修订版 | 53160ab98d745289b58114cd92ad5410be9c7b4f (tree) |
---|---|
时间 | 2007-11-10 23:36:39 |
作者 | ikemo <ikemo@56b1...> |
Commiter | ikemo |
move Thread -> DatInfo
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@2073 56b19765-1e22-0410-a548-a0f45d66c51a
@@ -897,3 +897,13 @@ bool DatInfo::parseDat( int num ) | ||
897 | 897 | |
898 | 898 | return TRUE; |
899 | 899 | } |
900 | + | |
901 | +bool DatInfo::isOpened() | |
902 | +{ | |
903 | + return m_isOpened; | |
904 | +} | |
905 | + | |
906 | +void DatInfo::setIsOpened( bool isOpened ) | |
907 | +{ | |
908 | + m_isOpened = isOpened; | |
909 | +} |
@@ -109,6 +109,7 @@ namespace Kita | ||
109 | 109 | KURL m_datURL; |
110 | 110 | bool m_broken; |
111 | 111 | ResDatVec m_resDatVec; |
112 | + bool m_isOpened; | |
112 | 113 | |
113 | 114 | /* for caching */ |
114 | 115 | Access* m_access; |
@@ -175,6 +176,8 @@ namespace Kita | ||
175 | 176 | bool isResBroken( int num ); |
176 | 177 | bool checkID( const QString& strid, int num ); |
177 | 178 | bool checkWord( QStringList& stlist, int num, bool checkOR ); |
179 | + bool isOpened(); | |
180 | + void setIsOpened( bool isOpened ); | |
178 | 181 | |
179 | 182 | /* abone check */ |
180 | 183 | bool checkAbone( int num ); |
@@ -564,18 +564,18 @@ void DatManager::resetAbone( const KURL& url ) | ||
564 | 564 | /* check if the thread is shown on the main thread tab. */ /* public */ |
565 | 565 | bool DatManager::isMainThreadOpened( const KURL& url ) |
566 | 566 | { |
567 | - KURL datURL = Kita::getDatURL( url ).prettyURL(); | |
568 | - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); | |
569 | - if ( thread == NULL ) return FALSE; | |
567 | + DatInfo * datInfo = getDatInfo( url ); | |
568 | + if ( datInfo == NULL ) return FALSE; | |
570 | 569 | |
571 | - return thread->isOpened(); | |
570 | + return datInfo->isOpened(); | |
572 | 571 | } |
573 | 572 | |
574 | 573 | void DatManager::setMainThreadOpened( const KURL& url, bool isOpened ) |
575 | 574 | { |
576 | - KURL datURL = Kita::getDatURL( url ).prettyURL(); | |
577 | - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); | |
578 | - if ( thread != NULL ) thread->setIsOpened( isOpened ); | |
575 | + DatInfo * datInfo = getDatInfo( url ); | |
576 | + if ( datInfo == NULL ) return; | |
577 | + | |
578 | + datInfo->setIsOpened( isOpened ); | |
579 | 579 | } |
580 | 580 | |
581 | 581 |
@@ -18,7 +18,7 @@ using namespace Kita; | ||
18 | 18 | QDict<Thread>* Thread::m_threadDict = 0; |
19 | 19 | |
20 | 20 | Thread::Thread( const KURL& datURL ) |
21 | - : m_datURL( datURL ), m_threadName( 0 ) , m_resNum( 0 ), m_readNum( 0 ), m_viewPos( 0 ), m_isOpened( 0 ) | |
21 | + : m_datURL( datURL ), m_threadName( 0 ) , m_resNum( 0 ), m_readNum( 0 ), m_viewPos( 0 ) | |
22 | 22 | {} |
23 | 23 | |
24 | 24 | Thread::~Thread() |
@@ -85,19 +85,6 @@ void Thread::setViewPos( int num ) | ||
85 | 85 | m_viewPos = num; |
86 | 86 | } |
87 | 87 | |
88 | - | |
89 | -/* public */ | |
90 | -bool Thread::isOpened() const | |
91 | -{ | |
92 | - return m_isOpened; | |
93 | -} | |
94 | - | |
95 | -/* public */ | |
96 | -void Thread::setIsOpened( bool isOpened ) | |
97 | -{ | |
98 | - m_isOpened = isOpened; | |
99 | -} | |
100 | - | |
101 | 88 | /* public */ |
102 | 89 | const QValueList< int >& Thread::markList() const |
103 | 90 | { |
@@ -29,7 +29,6 @@ namespace Kita | ||
29 | 29 | int m_resNum; |
30 | 30 | int m_readNum; |
31 | 31 | int m_viewPos; |
32 | - bool m_isOpened; | |
33 | 32 | QValueList< int > m_markList; |
34 | 33 | |
35 | 34 | public: |
@@ -50,9 +49,6 @@ namespace Kita | ||
50 | 49 | const int viewPos() const; |
51 | 50 | void setViewPos( int viewPos ); |
52 | 51 | |
53 | - bool isOpened() const; | |
54 | - void setIsOpened( bool isOpend ); | |
55 | - | |
56 | 52 | const QValueList< int >& markList() const; |
57 | 53 | void setMarkList( const QValueList< int >& markList ); |
58 | 54 | bool isMarked( int num ); |