OSDN Git Service

private constructor
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 2 Jan 2004 14:12:14 +0000 (14:12 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 2 Jan 2004 14:12:14 +0000 (14:12 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@769 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/kitasubjectview.cpp
kita/src/kitathreadtabwidget.cpp
kita/src/libkita/board.cpp
kita/src/libkita/favoritethreads.cpp
kita/src/libkita/thread.h
kita/src/part/kitathreadpart.cpp

index 9307b7f..4ccf512 100644 (file)
@@ -62,8 +62,8 @@ void KitaSubjectView::loadThread( QListViewItem* item )
     datURL.addPath( "/dat/" + datName );
 
     Kita::Board::setName( Kita::datToBoard( datURL.url() ), m_board->name() );
-    Kita::Thread* thread = new Kita::Thread( datURL.url(),
-                           item->text( Row_Subject ) );
+    Kita::Thread::setName( datURL.url(), item->text( Row_Subject ) );
+    Kita::Thread* thread = Kita::Thread::getByURL( datURL.url() );
 
     KitaThreadInfo::setResNum( datURL.url(), item->text( Row_Read ).toInt() );
     emit signalShowThread( thread );
index 8b3e5ba..1c4e664 100644 (file)
@@ -130,7 +130,7 @@ void KitaThreadTabWidget::slotOpenURLRequest( const KURL& url, const KParts::URL
     if ( regexp.search( url.url() ) == -1 ) {
         emit openURLRequest( url, args );
     } else {
-        Kita::Thread* thread = new Kita::Thread( url.url() );
+        Kita::Thread* thread = Kita::Thread::getByURL( url.url() );
         showThreadWithNewTab( thread );
     }
 }
index 241d711..91dd54e 100644 (file)
@@ -101,7 +101,8 @@ const QPtrList<Thread> Board::getThreadList() const
         KURL datURL = m_boardURL;
         datURL.addPath("/dat/" + fname);
         Kita::Board::setName( datToBoard( datURL.url() ), name() );
-        Kita::Thread* thread = new Kita::Thread( datURL.url(), subject );
+        Kita::Thread::setName( datURL.url(), subject );
+        Kita::Thread* thread = Kita::Thread::getByURL( datURL.url() );
         KitaThreadInfo::setResNum( datURL.url(), num.toInt() );
         threadList.append(thread);
       }
index 058c2b6..701d343 100644 (file)
@@ -160,7 +160,8 @@ bool FavoritesXmlParser::endElement( const QString& namespaceURI, const QString&
     m_inThread = false;
     m_threadParser->endElement( namespaceURI, localName, qName );
     Kita::Thread thread = m_threadParser->getThread();
-    m_threadList.append( new Kita::Thread( thread.datURL(), thread.name() ) );
+    Kita::Thread::setName( thread.datURL(), thread.name() );
+    m_threadList.append( Kita::Thread::getByURL( thread.datURL() ) );
     KitaThreadInfo::setResNum( thread.datURL(), thread.resNum() );
 
     delete m_threadParser;
index e8c87ce..aee6857 100644 (file)
@@ -32,9 +32,11 @@ namespace Kita
 
     class Thread
     {
-    public:
         Thread( const QString& datURL, const QString& threadName = QString::null );
         Thread();
+        friend class ThreadAccess;
+        friend class ThreadXmlParser;
+    public:
         ~Thread();
 
         const QString& datURL() const;
index 087a1d8..de1b5f1 100644 (file)
@@ -64,7 +64,7 @@ bool KitaThreadPart::openURL( const KURL& _url )
     connect( m_threadview, SIGNAL( showThreadCompleted( const KURL& ) ),
              this, SLOT( slotOpenURLResult() ) );
 
-    m_threadview->showThread( new Kita::Thread( m_url.url() ) );
+    m_threadview->showThread( Kita::Thread::getByURL( m_url.url() ) );
     emit started( 0 );
     return true;
 }