OSDN Git Service

rewrite method
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 1 Jun 2003 14:45:16 +0000 (14:45 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 1 Jun 2003 14:45:16 +0000 (14:45 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@297 56b19765-1e22-0410-a548-a0f45d66c51a

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

index f972797..0ca7876 100644 (file)
@@ -85,7 +85,7 @@ void KitaSubjectView::loadThread(QListViewItem* item)
   QString datName = item->text(Row_DatName);
   KURL datURL = m_board.url();
   datURL.addPath("/dat/" + datName);
-  emit signalShowThread(m_board, Kita::Thread(datURL));
+  emit signalShowThread(m_board, Kita::Thread(m_board, datURL));
 }
 
 void KitaSubjectView::loadBoard(const Kita::Board& board)
index c58c73d..4ebcbb9 100644 (file)
@@ -85,7 +85,7 @@ void Board::refreshChildList()
 
         KURL datURL = m_boardURL;
         datURL.addPath("/dat/" + fname);
-        Kita::Thread* thread = new Kita::Thread(datURL, subject, num.toInt());
+        Kita::Thread* thread = new Kita::Thread(*this, datURL, subject, num.toInt());
         m_threadList.append(thread);
       }
     }
index 59de81f..72ed264 100644 (file)
@@ -28,16 +28,18 @@ Thread::Thread(const Board& board, const KURL& datURL, const QString threadName,
   m_boardID = m_board->id();
 }
 
+/*
 Thread::Thread(const KURL& datURL, const QString threadName, int resNum)
   : m_datURL(datURL), m_threadName(threadName), m_resNum(resNum), m_board( 0 )
 {
   m_datID = m_datURL.filename().section(".", 0, 0);
   m_boardID = KURL(datURL, "..").fileName();
-}
+}*/
 
 Thread::~Thread()
 {
-  delete m_board;
+// crash!!!
+//  delete m_board;
 }
 
 const KURL& Thread::datURL() const
index 198f0e0..aff58c4 100644 (file)
@@ -32,7 +32,7 @@ namespace Kita {
   public:
     Thread();
     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(const KURL& datURL, const QString threadName = QString::null, int resNum = 0);
     ~Thread();
     const KURL& datURL() const;
     const KURL url() const;
index 0389b1f..4a30915 100644 (file)
@@ -97,8 +97,10 @@ bool KitaThreadPart::openURL( const KURL& _url )
     m_url = _url;
     emit setWindowCaption( m_url.url() );
     connect( m_threadview, SIGNAL( showThreadCompleted(const KURL&) ),
-            this, SLOT( slotOpenURLResult() ) );
-    m_threadview->slotShowThread( Kita::Board(m_url.upURL().upURL()) , Kita::Thread(m_url) );
+             this, SLOT( slotOpenURLResult() ) );
+
+    Kita::Board board( m_url.upURL().upURL() );
+    m_threadview->slotShowThread( board, Kita::Thread( board, m_url ) );
     emit started( 0 );
     return true;
 }
index 46d7ebe..aaed290 100644 (file)
@@ -162,7 +162,7 @@ void KitaThreadView::slotShowThread(const Kita::Board& board, const Kita::Thread
 void KitaThreadView::slotRedirection(KIO::Job *, const KURL & newURL)
 {
   printf("  Redirected to newURL: %s\n", newURL.url().latin1() );
-  m_thread = Kita::Thread(newURL);
+  m_thread = Kita::Thread(m_board, newURL);
   emit setLocationBarURL(newURL.url());
 }
 
@@ -435,7 +435,7 @@ void KitaThreadView::slotPopupMenu( KXMLGUIClient *client, const QPoint &global,
   KActionCollection * collection = client->actionCollection();
   KAction * action;
   action = new KAction( i18n("goback anchor"), SmallIcon("idea"), KShortcut(), m_threadPart, SLOT( gobackAnchor() ), collection, "goback_anchor" );
-  printf("  KitaThreadView::slotPopupMenu() %p\n", action);
+//  printf("  KitaThreadView::slotPopupMenu() %p\n", action);
   emit popupMenu(client, global, url, mimeType, mode);
 }