OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 7 Dec 2003 10:48:35 +0000 (10:48 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 7 Dec 2003 10:48:35 +0000 (10:48 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@649 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/favoritelistview.cpp
kita/src/kitasubjectview.cpp
kita/src/libkita/board.cpp
kita/src/libkita/tests/threadtest.cpp
kita/src/libkita/thread.cpp
kita/src/libkita/thread.h
kita/src/part/kitathreadpart.cpp

index 65982b7..eefb93c 100644 (file)
@@ -130,7 +130,7 @@ void FavoriteListView::slotContextMenuRequested( QListViewItem* item, const QPoi
   kdDebug() << "datURL = " << datURL.url() << endl;
   Kita::Board board = Kita::Board( KURL( datURL, ".." ) );
   kdDebug() << "board.url = " << board.url().url() << endl;
-  Kita::Thread thread( board, datURL );
+  Kita::Thread thread( board.name(), datURL );
   kdDebug() << "thread.url = %s" << thread.url() << endl;
   thread.setName( item->text( Row_Subject ) );
   thread.setResNum( item->text( Row_Read ).toInt() );
index c295464..3907b44 100644 (file)
@@ -92,7 +92,7 @@ void KitaSubjectView::loadThread( int, QListViewItem* item )
   KURL datURL = m_board.url();
   datURL.addPath("/dat/" + datName);
 
-  Kita::Thread* thread = new Kita::Thread( m_board, datURL,
+  Kita::Thread* thread = new Kita::Thread( m_board.name(), datURL,
                                            item->text( Row_Subject ),
                                            item->text( Row_Read ).toInt() );
 
@@ -268,7 +268,7 @@ void KitaSubjectView::slotContextMenuRequested( QListViewItem* item, const QPoin
   KURL datURL = m_board.url();
   datURL.addPath("/dat/" + datName);
 
-  Kita::Thread thread( m_board, datURL );
+  Kita::Thread thread( m_board.name(), datURL );
   thread.setName( item->text( Row_Subject ) );
   thread.setResNum( item->text( Row_Read ).toInt() );
 
index 4e6ca5e..80c8849 100644 (file)
@@ -97,7 +97,7 @@ const QPtrList<Thread> Board::getThreadList() const
 
         KURL datURL = m_boardURL;
         datURL.addPath("/dat/" + fname);
-        Kita::Thread* thread = new Kita::Thread(*this, datURL, subject, num.toInt());
+        Kita::Thread* thread = new Kita::Thread( name(), datURL, subject, num.toInt());
         threadList.append(thread);
       }
     }
index 7a40030..63f85e9 100644 (file)
@@ -14,7 +14,7 @@ using namespace Kita;
 
 void ThreadTest::setUp()
 {
-    m_normal = new Thread( Board( "http://pc.2ch.net/linux/", "Linux" ),
+    m_normal = new Thread( "Linux",
     KURL( "http://pc.2ch.net/linux/dat/1069738960.dat" ),
     "Kita - 2ch client for KDE",
     0 );
index e0feccb..59aa0dd 100644 (file)
@@ -37,9 +37,10 @@ Thread::Thread() : m_board( 0 )
 Thread::Thread( const QString& boardName, const KURL& datURL, const QString& threadName, int resNum )
   : m_datURL( datURL ), m_threadName( threadName ), m_resNum( resNum )
 {
+  m_datID = m_datURL.filename().section( ".", 0, 0 );
   m_board = new Board( datToBoard( datURL.url() ), boardName );
 }
-
+/*
 Thread::Thread(const Board& board, const KURL& datURL, const QString threadName, int resNum)
   : m_datURL(datURL), m_threadName(threadName), m_resNum(resNum)
 {
@@ -47,7 +48,7 @@ Thread::Thread(const Board& board, const KURL& datURL, const QString threadName,
 
   m_datID = m_datURL.filename().section(".", 0, 0);
   m_board = new Board( board.url(), board.name() );
-}
+}*/
 
 Thread::Thread( const KURL& datURL, const QString& threadName, int resNum )
   : m_datURL( datURL ), m_threadName( threadName ), m_resNum( resNum ), m_board( 0 )
@@ -206,7 +207,7 @@ bool ThreadXmlParser::endElement( const QString& namespaceURI, const QString& lo
     m_boardParser->endElement( namespaceURI, localName, qName );
   } else if( localName == "thread" ) {
     m_inThread = false;
-    m_thread = Kita::Thread( *m_board, KURL( m_datUrlStr ), m_threadName, m_resNum );
+    m_thread = Kita::Thread( m_board->name(), KURL( m_datUrlStr ), m_threadName, m_resNum );
     m_isValid = true;
     // create thread;
   } else if( localName == "daturl" ) {
index 4a7a6ac..0a9e8c8 100644 (file)
@@ -40,7 +40,7 @@ namespace Kita {
     Thread();
     Thread( const Thread& obj );
     Thread( const QString& boardName, const KURL& datURL, const QString& threadName = QString::null, int resNum = 0 );
-    Thread(const Board& board, const KURL& datURL, const QString threadName = QString::null, int resNum = 0);
+//    Thread(const Board& board, const KURL& datURL, const QString threadName = QString::null, int resNum = 0);
     Thread( const KURL& datURL, const QString& threadName = QString::null, int resNum = 0 );
     ~Thread();
     Thread& operator=( const Thread& obj );
index e8cd7f8..1c9890d 100644 (file)
@@ -65,7 +65,7 @@ bool KitaThreadPart::openURL( const KURL& _url )
              this, SLOT( slotOpenURLResult() ) );
 
     Kita::Board board( m_url.upURL().upURL() );
-    m_threadview->showThread( Kita::Thread( board, m_url ) );
+    m_threadview->showThread( Kita::Thread( board.name(), m_url ) );
     emit started( 0 );
     return true;
 }