OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sat, 9 Oct 2004 12:59:14 +0000 (12:59 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sat, 9 Oct 2004 12:59:14 +0000 (12:59 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1428 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/favoritelistview.cpp
kita/src/kitasubjectview.cpp
kita/src/libkita/datinfo.cpp
kita/src/libkita/thread.cpp
kita/src/libkita/thread.h

index 71c8a39..57da297 100644 (file)
@@ -118,8 +118,8 @@ void FavoriteListView::slotUpdateSubject( const KURL& url )
     Kita::Thread* updated_thread = Kita::Thread::getByURLNew( datURL );
     for ( QListViewItem * item = subjectList->firstChild(); item; item = item->nextSibling() ) {
         if ( item->text( Col_DatURL ) == datURL.prettyURL() ) {
-            int resNum = updated_thread->resNum();
-            int readNum = KitaThreadInfo::readNum( updated_thread->datURL() );
+            int resNum = KitaThreadInfo::resNum( datURL.prettyURL() );
+            int readNum = KitaThreadInfo::readNum( datURL.prettyURL() );
             item->setText( Col_ResNum, QString( "%1" ).arg( resNum, 4 ) );
             item->setText( Col_Read, QString( "%1" ).arg( readNum, 4 ) );
         }
index efb06a3..cfd6ca0 100644 (file)
@@ -161,8 +161,8 @@ void KitaSubjectView::loadBoard( const QString& boardURL )
         since.setTime_t( Kita::datToSince( datURL ) );
         QDateTime current = QDateTime::currentDateTime();
 
-        int readNum = cache->readNum( datURL );
-        int resNum = thread->resNum();
+        int readNum = KitaThreadInfo::readNum( datURL );
+        int resNum = KitaThreadInfo::resNum( datURL );
         double speed = resNum / ( since.secsTo( current ) / ( 60.0 * 60.0 * 24.0 ) );
 
         Kita::ThreadListViewItem* item = new Kita::ThreadListViewItem( subjectList );
@@ -262,7 +262,7 @@ void KitaSubjectView::slotUpdateSubject( const KURL& url )
             QDateTime since;
             since.setTime_t( Kita::datToSince( datURL.prettyURL() ) );
 
-            int resNum = updated_thread->resNum();
+            int resNum = KitaThreadInfo::resNum( datURL.prettyURL() );
             int readNum = KitaThreadInfo::readNum( datURL.prettyURL() );
             item->setText( Col_ResNum, QString( "%1" ).arg( resNum, 4 ) );
             item->setText( Col_Read, ( readNum > 0 ) ? QString( "%1" ).arg( readNum, 4 ) : QString( "" ) );
index 50e679f..5534b82 100644 (file)
@@ -215,7 +215,8 @@ void DatInfo::updateThreadInfo()
         m_thread = Kita::Thread::getByURL( m_datURL.prettyURL() );
     }
     if ( m_thread ) {
-        if ( m_thread->resNum() < m_readNum ) {
+        int resNum = KitaThreadInfo::resNum( m_datURL.prettyURL() );
+        if ( resNum < m_readNum ) {
             KitaThreadInfo::setResNum( m_datURL.prettyURL(), m_readNum );
         }
         KitaThreadInfo::setReadNum( m_datURL.prettyURL(), m_readNum );
index 537c352..2342686 100644 (file)
@@ -54,11 +54,6 @@ const QString& Thread::datURL() const
     return m_datURL;
 }
 
-int Thread::resNum() const
-{
-    return KitaThreadInfo::resNum( m_datURL );
-}
-
 const QString& Thread::name() const
 {
     if ( ! Kita::Thread::getByURL( m_datURL ) ->m_threadName.isEmpty() ) {
index 3b487d6..d02970a 100644 (file)
@@ -41,7 +41,6 @@ namespace Kita
 
         const QString& datURL() const;
         const QString& name() const;
-        int resNum() const;
 
         static Thread* getByURL( const QString& datURL );
         static Thread* getByURLNew( const KURL& datURL );