svnno****@sourc*****
svnno****@sourc*****
2009年 7月 12日 (日) 12:48:19 JST
Revision: 2402 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2402 Author: nogu Date: 2009-07-12 12:48:19 +0900 (Sun, 12 Jul 2009) Log Message: ----------- use QList instead of Q3PtrList Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-11 21:13:40 UTC (rev 2401) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-12 03:48:19 UTC (rev 2402) @@ -11,10 +11,10 @@ #include "boardview.h" #include <QtCore/QDateTime> +#include <QtCore/QList> #include <QtGui/QApplication> #include <QtGui/QClipboard> #include <QtGui/QMouseEvent> -#include <Qt3Support/Q3PtrList> #include <kaction.h> #include <kconfig.h> @@ -140,8 +140,8 @@ m_newNum = 0; /* get list of pointers of Thread classes */ - Q3PtrList<Kita::Thread> oldLogList; - Q3PtrList<Kita::Thread> threadList; + QList<Kita::Thread*> oldLogList; + QList<Kita::Thread*> threadList; Kita::BoardManager::getThreadList(m_boardURL, m_showOldLogs, online, threadList, oldLogList); // reset list Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-11 21:13:40 UTC (rev 2401) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-12 03:48:19 UTC (rev 2402) @@ -171,8 +171,8 @@ QList<QString>::const_iterator it; for (it = boardList.begin(); it != boardList.end(); ++it) { bool online = true; - Q3PtrList<Kita::Thread> threadList; - Q3PtrList<Kita::Thread> tmpList; + QList<Kita::Thread*> threadList; + QList<Kita::Thread*> tmpList; Kita::BoardManager::getThreadList((*it), false, online, threadList, tmpList); } } Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-11 21:13:40 UTC (rev 2401) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-12 03:48:19 UTC (rev 2402) @@ -429,8 +429,8 @@ bool online, /* output */ - Q3PtrList<Thread>& threadList, - Q3PtrList<Thread>& oldLogList) + QList<Thread*>& threadList, + QList<Thread*>& oldLogList) { threadList.clear(); oldLogList.clear(); @@ -475,20 +475,20 @@ /* get old logs */ if (oldLogs) { - Q3PtrList<Thread> tmpList; + QList<Thread*> tmpList; tmpList.clear(); getCachedThreadList(url, tmpList); - for (unsigned i = 0; i < tmpList.count(); i++) { - - if (threadList.contains(tmpList.at(i)) == 0) oldLogList.append(tmpList.at(i)); + for (int i = 0; i < tmpList.count(); i++) { + if (threadList.contains(tmpList.at(i)) == 0) + oldLogList.append(tmpList.at(i)); } } } /* read the cache dir & get the list of all threads. */ /* private */ /* static */ -void BoardManager::getCachedThreadList(const KUrl& url, Q3PtrList<Thread>& threadList) +void BoardManager::getCachedThreadList(const KUrl& url, QList<Thread*>& threadList) { QString cacheDir = Cache::baseDir() + Cache::serverDir(url) + Cache::boardDir(url); QDir d(cacheDir); @@ -522,7 +522,7 @@ /* open subject.txt and get list of Thread classes */ /* private */ /* static */ -bool BoardManager::readSubjectTxt(BoardData* bdata, const KUrl& url, Q3PtrList<Thread>& threadList) +bool BoardManager::readSubjectTxt(BoardData* bdata, const KUrl& url, QList<Thread*>& threadList) { /* get all names of cached files to read idx. */ QStringList cacheList; @@ -576,7 +576,7 @@ /* get pointer of Thread class */ QString datURL = boardURL(url) + "dat/" + fname; Kita::Thread* thread = Kita::Thread::getByURL(datURL); - if (threadList.find(thread) == -1) { + if (threadList.indexOf(thread) == -1) { threadList.append(thread); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-11 21:13:40 UTC (rev 2401) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-12 03:48:19 UTC (rev 2402) @@ -13,7 +13,6 @@ #include <QtCore/QList> #include <QtCore/QStringList> -#include <Qt3Support/Q3PtrList> #include <kurl.h> @@ -146,7 +145,7 @@ /* ThreadList */ static void getThreadList(const KUrl& url, bool oldLogs, bool online, - Q3PtrList<Thread>& threadList, Q3PtrList<Thread>& oldLogList); + QList<Thread*>& threadList, QList<Thread*>& oldLogList); /* BoardData */ static void clearBoardData(); @@ -168,8 +167,8 @@ /* ThreadList */ - static void getCachedThreadList(const KUrl& url, Q3PtrList<Thread>& threadList); - static bool readSubjectTxt(BoardData* bdata, const KUrl& url, Q3PtrList<Thread>& threadList); + static void getCachedThreadList(const KUrl& url, QList<Thread*>& threadList); + static bool readSubjectTxt(BoardData* bdata, const KUrl& url, QList<Thread*>& threadList); /* SETTING.TXT */