[Kita-svn] [2401] - use QList instead of Q3ValueList

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2009年 7月 12日 (日) 06:13:40 JST


Revision: 2401
          http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2401
Author:   nogu
Date:     2009-07-12 06:13:40 +0900 (Sun, 12 Jul 2009)

Log Message:
-----------
- use QList instead of Q3ValueList
- use QVector instead of Q3ValueVector
- use QByteArray instead of Q3CString
- use QMultiHash instead of Q3Dict

Modified Paths:
--------------
    kita/branches/KITA-KDE4/kita/src/bbsview.cpp
    kita/branches/KITA-KDE4/kita/src/bbsview.h
    kita/branches/KITA-KDE4/kita/src/domtree.cpp
    kita/branches/KITA-KDE4/kita/src/domtree.h
    kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/account.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/account.h
    kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h
    kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h
    kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h
    kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h
    kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h
    kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/thread.h
    kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h
    kita/branches/KITA-KDE4/kita/src/mainwindow.cpp
    kita/branches/KITA-KDE4/kita/src/threadlistview.h
    kita/branches/KITA-KDE4/kita/src/writeview.cpp
    kita/branches/KITA-KDE4/kita/src/writeview.h

Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/bbsview.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -21,7 +21,6 @@
 #include <QtGui/QSpacerItem>
 #include <QtGui/QVBoxLayout>
 #include <Qt3Support/Q3Header>
-#include <Qt3Support/Q3ValueList>
 
 #include <kaction.h>
 #include <kcombobox.h>
@@ -121,8 +120,8 @@
 bool KitaBBSView::downloadBoardList()
 {
     // moved urls.
-    Q3ValueList<QString> oldURLs;
-    Q3ValueList<QString> newURLs;
+    QList<QString> oldURLs;
+    QList<QString> newURLs;
 
     QString tmpFile;
     QString url = Kita::Config::boardListUrl();
@@ -142,19 +141,19 @@
 
     // parse
     QStringList list;
-    Q3ValueList<Kita::Category> categoryList = getCategoryList(html);
-    Q3ValueList<Kita::Category>::iterator it;
+    QList<Kita::Category> categoryList = getCategoryList(html);
+    QList<Kita::Category>::iterator it;
 
     /* Are there new boards or moved boards ? */
     QString newBoards;
     QString oldBoards;
     for (it = categoryList.begin(); it != categoryList.end(); ++it) {
         Kita::Category category = (*it);
-        Q3ValueList<QString> board_url_list = category.boardURLList;
+        QList<QString> board_url_list = category.boardURLList;
         if (board_url_list.isEmpty()) continue;
 
         int count = 0;
-        for (Q3ValueList<QString>::iterator it2 = board_url_list.begin();
+        for (QList<QString>::iterator it2 = board_url_list.begin();
                 it2 != board_url_list.end(); ++it2) {
 
             QString boardURL = *it2;
@@ -236,7 +235,7 @@
     KConfig config(configPath);
     for (it = categoryList.begin(); it != categoryList.end(); ++it) {
         Kita::Category category = (*it);
-        Q3ValueList<QString> board_url_list = category.boardURLList;
+        QList<QString> board_url_list = category.boardURLList;
 
         if (board_url_list.isEmpty()) {
             continue;
@@ -245,7 +244,7 @@
         list << category.category_name;
         KConfigGroup group = config.group(category.category_name);
 
-        Q3ValueList<QString>::iterator it2;
+        QList<QString>::iterator it2;
         int count = 0;
         for (it2 = board_url_list.begin(); it2 != board_url_list.end(); ++it2) {
             QString key = QString("item%1").arg(count);
@@ -398,9 +397,9 @@
     }
 }
 
-Q3ValueList<Kita::Category> KitaBBSView::getCategoryList(const QString& html) const
+QList<Kita::Category> KitaBBSView::getCategoryList(const QString& html) const
 {
-    Q3ValueList<Kita::Category> result;
+    QList<Kita::Category> result;
 
     QStringList lines = html.split('\n');
     QStringList::iterator it;
@@ -447,8 +446,8 @@
     } while (m_favorites->childCount() != 0);
 
     // insert items.
-    Q3ValueList<KUrl> boards = Kita::FavoriteBoards::boards();
-    Q3ValueList<KUrl>::iterator it;
+    QList<KUrl> boards = Kita::FavoriteBoards::boards();
+    QList<KUrl>::iterator it;
 
     for (it = boards.begin(); it != boards.end(); ++it) {
         QString boardURL = (*it).prettyUrl();

Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/bbsview.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/bbsview.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,8 +11,8 @@
 #ifndef KITABBSVIEW_H
 #define KITABBSVIEW_H
 
+#include <QtCore/QList>
 #include <QtGui/QWidget>
-#include <Qt3Support/Q3ValueList>
 
 class KComboBox;
 class KUrl;
@@ -45,7 +45,7 @@
     QColor m_backColor;
     QColor m_altColor;
 
-    Q3ValueList<Kita::Category> getCategoryList(const QString& html) const;
+    QList<Kita::Category> getCategoryList(const QString& html) const;
 
     void saveOpened();
     KComboBox* SearchCombo;

Modified: kita/branches/KITA-KDE4/kita/src/domtree.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/domtree.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/domtree.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -59,8 +59,16 @@
 
         m_titleElm.resize(m_bufSize);
         m_bodyElm.resize(m_bufSize);
-        m_resStatus.resize(m_bufSize, false);
-        m_coloredNum.resize(m_bufSize, false);
+        int statusSize = m_resStatus.count();
+        m_resStatus.resize(m_bufSize);
+        for (int i = statusSize; i < m_bufSize; i++) {
+            m_resStatus[i] = false;
+        }
+        int numSize = m_coloredNum.count();
+        m_coloredNum.resize(m_bufSize);
+        for (int i = numSize; i < m_bufSize; i++) {
+            m_coloredNum[i] = false;
+        }
     }
 
     /* cleate elements */

Modified: kita/branches/KITA-KDE4/kita/src/domtree.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/domtree.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/domtree.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,7 +11,7 @@
 #ifndef KITADOMTREE_H
 #define KITADOMTREE_H
 
-#include <Qt3Support/Q3ValueVector>
+#include <QtCore/QVector>
 
 #include <dom/html_block.h>
 #include <dom/html_document.h>
@@ -32,13 +32,13 @@
     /* bottom number of shown. probably m_bottomNum == m_datInfo->getReadNum */
     int m_bottomNum;
 
-    Q3ValueVector< int > m_resStatus; /* return val of DatInfo::getHTML(). See datinfo.h */
-    Q3ValueVector< bool > m_coloredNum; /* colored number */
+    QVector<int> m_resStatus; /* return val of DatInfo::getHTML(). See datinfo.h */
+    QVector<bool> m_coloredNum; /* colored number */
 
     /* DOM elements */
     DOM::HTMLDocument m_hdoc; /* root node of document*/
-    Q3ValueVector< DOM::HTMLDivElement > m_titleElm; /* the vector of the element of response */
-    Q3ValueVector< DOM::HTMLDivElement > m_bodyElm; /* the vector of the element of response */
+    QVector<DOM::HTMLDivElement> m_titleElm; /* the vector of the element of response */
+    QVector<DOM::HTMLDivElement> m_bodyElm; /* the vector of the element of response */
     DOM::Element m_header;
     DOM::Element m_footer;
     DOM::Element m_kokoyon;

Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -158,7 +158,7 @@
  */
 void FavoriteListView::reload()
 {
-    Q3ValueList<QString> boardList;
+    QList<QString> boardList;
 
     for (int i = 0; FavoriteThreads::count() > i; i++) {
         QString datURL = FavoriteThreads::getDatURL(i);
@@ -168,7 +168,7 @@
         }
     }
 
-    Q3ValueList<QString>::const_iterator it;
+    QList<QString>::const_iterator it;
     for (it = boardList.begin(); it != boardList.end(); ++it) {
         bool online = true;
         Q3PtrList<Kita::Thread> threadList;

Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -9,6 +9,7 @@
 ***************************************************************************/
 #include "access.h"
 
+#include <QtCore/QByteArray>
 #include <QtCore/QDateTime>
 #include <QtCore/QFile>
 #include <QtCore/QRegExp>
@@ -412,7 +413,7 @@
 
 void OfflawAccess::slotReceiveThreadData(KIO::Job*, const QByteArray& data)
 {
-    Q3CString cstr(data);
+    QByteArray cstr(data);
 
     if ((m_dataSize > 0 && responseCode() != 206)
             || (m_dataSize == 0 && responseCode() != 200)) {

Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -9,8 +9,8 @@
 ***************************************************************************/
 #include "account.h"
 
+#include <QtCore/QByteArray>
 #include <QtCore/QRegExp>
-#include <Qt3Support/Q3CString>
 
 #include <kurl.h>
 #include <kio/job.h>
@@ -43,7 +43,7 @@
 
 bool Account::loginInternal(const QString& userID, const QString& password)
 {
-    m_data.resize(0);
+    m_data.clear();
 
     KUrl url("https://2chv.tora3.net/futen.cgi");
     QString postData = QString("ID=") + userID + QString("&PW=") + password;
@@ -70,8 +70,7 @@
 
 void Account::slotReceiveData(KIO::Job*, const QByteArray& data)
 {
-    Q3CString str(data, data.size());
-    m_data += str;
+    m_data += data;
 }
 
 void Account::slotResult(KIO::Job* job)

Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/account.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/account.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -10,9 +10,9 @@
 #ifndef KITAACCOUNT_H
 #define KITAACCOUNT_H
 
+#include <QtCore/QByteArray>
 #include <QtCore/QEventLoop>
 #include <QtCore/QObject>
-#include <Qt3Support/Q3CString>
 
 #include <kdemacros.h>
 
@@ -33,7 +33,7 @@
         static Account* instance;
 
         KIO::Job* m_job;
-        Q3CString m_data;
+        QByteArray m_data;
         QString m_sessionID;
         bool m_isLogged;
         QEventLoop m_eventLoop;

Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -15,8 +15,7 @@
 #include <QtCore/QFile>
 #include <QtCore/QRegExp>
 #include <QtCore/QTextCodec>
-#include <Qt3Support/Q3PtrList>
-#include <Qt3Support/Q3TextStream>
+#include <QtCore/QTextStream>
 
 #include <kfilterdev.h>
 #include <kio/netaccess.h>
@@ -430,8 +429,8 @@
     bool online,
 
     /* output */
-    Q3PtrList< Thread >& threadList,
-    Q3PtrList< Thread >& oldLogList)
+    Q3PtrList<Thread>& threadList,
+    Q3PtrList<Thread>& oldLogList)
 {
     threadList.clear();
     oldLogList.clear();
@@ -476,7 +475,7 @@
     /* get old logs */
     if (oldLogs) {
 
-        Q3PtrList< Thread > tmpList;
+        Q3PtrList<Thread> tmpList;
         tmpList.clear();
         getCachedThreadList(url, tmpList);
 
@@ -489,7 +488,7 @@
 
 
 /* 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, Q3PtrList<Thread>& threadList)
 {
     QString cacheDir = Cache::baseDir() + Cache::serverDir(url) + Cache::boardDir(url);
     QDir d(cacheDir);
@@ -523,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, Q3PtrList<Thread>& threadList)
 {
     /* get all names of cached files to read idx.  */
     QStringList cacheList;
@@ -543,7 +542,7 @@
     QIODevice * device = KFilterDev::deviceForFile(subjectPath, "application/x-gzip");
     if (!device->open(QIODevice::ReadOnly)) return false;
 
-    Q3TextStream stream(device);
+    QTextStream stream(device);
 
     if (BoardManager::type(url) == Board_JBBS) {
         if (!m_eucJpCodec) m_eucJpCodec = QTextCodec::codecForName("eucJP");
@@ -829,10 +828,10 @@
     QFile file(Cache::getBBSHistoryPath(url));
     if (file.open(QIODevice::ReadOnly)) {
 
-        Q3TextStream ts(&file);
+        QTextStream ts(&file);
 
         QString line;
-        while (!ts.eof()) {
+        while (!ts.atEnd()) {
 
             line = ts.readLine();
             keyHosts += line;
@@ -941,7 +940,7 @@
         QString movedPath = oldCachePath + "/BBS_MOVED";
         QFile file(movedPath);
         if (file.open(QIODevice::WriteOnly)) {
-            Q3TextStream stream(&file);
+            QTextStream stream(&file);
             stream << newURL << endl;
         }
         file.close();
@@ -953,7 +952,7 @@
     QFile file(Cache::getBBSHistoryPath(bdata->basePath()));
     if (file.open(QIODevice::WriteOnly)) {
 
-        Q3TextStream ts(&file);
+        QTextStream ts(&file);
 
         keyHosts.removeOne(newhost);
         for (QStringList::iterator it = keyHosts.begin() ; it != keyHosts.end(); ++it) {

Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,9 +11,9 @@
 #ifndef KITABOARDMANAGER_H
 #define KITABOARDMANAGER_H
 
+#include <QtCore/QList>
 #include <QtCore/QStringList>
 #include <Qt3Support/Q3PtrList>
-#include <Qt3Support/Q3ValueList>
 
 #include <kurl.h>
 
@@ -117,7 +117,7 @@
 
     /*--------------------------------------*/
 
-    typedef Q3ValueList< BoardData* > BoardDataList;
+    typedef QList<BoardData*> BoardDataList;
 
     /**
     @author Hideki Ikemoto
@@ -146,7 +146,7 @@
 
         /* ThreadList */
         static void getThreadList(const KUrl& url, bool oldLogs, bool online,
-                                   Q3PtrList< Thread >& threadList, Q3PtrList< Thread >& oldLogList);
+                                   Q3PtrList<Thread>& threadList, Q3PtrList<Thread>& oldLogList);
 
         /* BoardData */
         static void clearBoardData();
@@ -168,8 +168,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, Q3PtrList<Thread>& threadList);
+        static bool readSubjectTxt(BoardData* bdata, const KUrl& url, Q3PtrList<Thread>& threadList);
 
 
         /* SETTING.TXT */

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -141,7 +141,9 @@
     int size = m_resDatVec.size();
     RESDAT resdat;
     resetResDat(resdat);
-    m_resDatVec.resize(size + delta, resdat);
+    m_resDatVec.resize(size + delta);
+    for (int i = size; i < size + delta; i++)
+        m_resDatVec[i] = resdat;
 }
 
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -12,9 +12,9 @@
 #define KITADATINFO_H
 
 #include <QtCore/QDateTime>
+#include <QtCore/QList>
 #include <QtCore/QObject>
-#include <Qt3Support/Q3ValueList>
-#include <Qt3Support/Q3ValueVector>
+#include <QtCore/QVector>
 
 #include <kurl.h>
 
@@ -56,7 +56,7 @@
     int to;
 };
 
-typedef Q3ValueList<ANCNUM> AncList;
+typedef QList<ANCNUM> AncList;
 
 
 /* Data Base of response */
@@ -87,7 +87,7 @@
     /* Is this res responsed by other one? */
     bool isResponsed;
 };
-typedef Q3ValueVector<RESDAT> ResDatVec;
+typedef QVector<RESDAT> ResDatVec;
 
 
 namespace Kita

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -102,7 +102,7 @@
 
             /* LRU */
             if (i) {
-                m_datInfoList.remove(it);
+                m_datInfoList.erase(it);
                 m_datInfoList.prepend(datInfo);
             }
 
@@ -137,11 +137,14 @@
     if (m_datInfoList.count() > DMANAGER_MAXQUEUE) {
 
         DatInfoList::Iterator it;
+        // TODO
+#if 0 
         for (it = m_datInfoList.at(DMANAGER_MAXQUEUE); it != m_datInfoList.end(); ++it) {
 
             if ((*it) == 0) continue;
             DatInfo* deleteInfo = (*it);
         }
+#endif
     }
 
     return datInfo;

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,7 +11,7 @@
 #ifndef KITADATMANAGER_H
 #define KITADATMANAGER_H
 
-#include <Qt3Support/Q3ValueList>
+#include <QtCore/QList>
 
 #include <kdemacros.h>
 
@@ -23,7 +23,7 @@
 {
 
     class DatInfo;
-    typedef Q3ValueList<DatInfo*> DatInfoList;
+    typedef QList<DatInfo*> DatInfoList;
 
     class KDE_EXPORT DatManager
     {

Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -10,7 +10,6 @@
 #include "favoriteboards.h"
 
 #include <QtXml/QDomDocument>
-#include <Qt3Support/Q3ValueList>
 
 #include "boardmanager.h"
 
@@ -43,12 +42,12 @@
 void FavoriteBoards::remove(KUrl& url)
 {
     if (getInstance() ->m_list.contains(url)) {
-        getInstance() ->m_list.remove(url);
+        getInstance() ->m_list.removeAll(url);
         getInstance() ->notifyChange();
     }
 }
 
-const Q3ValueList<KUrl>& FavoriteBoards::boards()
+const QList<KUrl>& FavoriteBoards::boards()
 {
     return getInstance() ->m_list;
 }
@@ -101,8 +100,8 @@
     QDomElement root = document.createElementNS("http://kita.sourceforge.jp/ns/boardlist", "boardlist");
     document.appendChild(root);
 
-    Q3ValueList<KUrl> boards = FavoriteBoards::boards();
-    Q3ValueList<KUrl>::iterator it;
+    QList<KUrl> boards = FavoriteBoards::boards();
+    QList<KUrl>::iterator it;
     for (it = boards.begin(); it != boards.end(); ++it) {
         QDomElement board = document.createElementNS("http://kita.sourceforge.jp/ns/board", "board");
         root.appendChild(board);
@@ -123,8 +122,8 @@
 void FavoriteBoards::replace(const QString& fromURL, const QString& toURL)
 {
     if (FavoriteBoards::getInstance() == 0) return ;
-    Q3ValueList<KUrl>& boardList = FavoriteBoards::getInstance() ->m_list;
-    for (Q3ValueList<KUrl>::iterator it = boardList.begin(); it != boardList.end(); ++it) {
+    QList<KUrl>& boardList = FavoriteBoards::getInstance() ->m_list;
+    for (QList<KUrl>::iterator it = boardList.begin(); it != boardList.end(); ++it) {
         QString url = (*it).url();
         if (url.startsWith(fromURL)) {
             url = url.replace(0, fromURL.length(), toURL);

Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -10,8 +10,8 @@
 #ifndef KITAFAVORITEBOARDS_H
 #define KITAFAVORITEBOARDS_H
 
+#include <QtCore/QList>
 #include <QtCore/QObject>
-#include <Qt3Support/Q3ValueList>
 
 #include <kurl.h>
 
@@ -28,7 +28,7 @@
         Q_OBJECT
 
         static FavoriteBoards* instance;
-        Q3ValueList<KUrl> m_list;
+        QList<KUrl> m_list;
         FavoriteBoards();
         ~FavoriteBoards();
 
@@ -39,7 +39,7 @@
         static FavoriteBoards* getInstance();
         static void append(KUrl& url);
         static void remove(KUrl& url);
-        static const Q3ValueList<KUrl>& boards();
+        static const QList<KUrl>& boards();
         static bool readFromXML(QString& xml);
         static QString toXML();
         static void replace(const QString& fromURL, const QString& toURL);

Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -10,8 +10,8 @@
 
 #include "favoritethreads.h"
 
+#include <QtCore/QList>
 #include <QtXml/QDomDocument>
-#include <Qt3Support/Q3ValueList>
 
 #include "boardmanager.h"
 #include "datmanager.h"
@@ -57,7 +57,7 @@
 
 void FavoriteThreads::remove(const QString& datURL)
 {
-    m_threadList.remove(datURL);
+    m_threadList.removeAll(datURL);
 }
 
 bool FavoriteThreads::contains(const QString& datURL)
@@ -69,7 +69,7 @@
     }
 }
 
-const Q3ValueList<FavoriteThreadItem> FavoriteThreads::threadList() const
+const QList<FavoriteThreadItem> FavoriteThreads::threadList() const
 {
     return m_threadList;
 }
@@ -126,7 +126,7 @@
     QDomElement root = document.createElementNS("http://kita.sourceforge.jp/ns/favorites", "favorites");
     document.appendChild(root);
 
-    Q3ValueList<FavoriteThreadItem>::const_iterator it;
+    QList<FavoriteThreadItem>::const_iterator it;
     for (it = threadList().begin(); it != threadList().end(); ++it) {
         QString datURL = (*it).m_datURL;
         QDomElement threadElement = document.createElementNS("http://kita.sourceforge.jp/ns/thread", "thread");
@@ -166,13 +166,13 @@
 void FavoriteThreads::replace(const QString& fromURL, const QString& toURL)
 {
     if (FavoriteThreads::getInstance() == 0) return ;
-    Q3ValueList<FavoriteThreadItem>& threadList = FavoriteThreads::getInstance() ->m_threadList;
-    Q3ValueList<FavoriteThreadItem>::iterator it;
+    QList<FavoriteThreadItem>& threadList = FavoriteThreads::getInstance() ->m_threadList;
+    QList<FavoriteThreadItem>::iterator it;
     for (it = threadList.begin(); it != threadList.end(); ++it) {
         QString url = (*it).m_datURL;
         if (url.indexOf(fromURL) == 0) {
             url = url.replace(0, fromURL.length(), toURL);
-            threadList.remove(it);
+            threadList.erase(it);
             threadList.prepend(url);
             it = threadList.begin();
         }

Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,7 +11,8 @@
 #ifndef FAVORITETHREADS_H
 #define FAVORITETHREADS_H
 
-#include <Qt3Support/Q3ValueList>
+#include <QtCore/QList>
+#include <QtCore/QString>
 
 #include <kdemacros.h>
 
@@ -34,12 +35,12 @@
 class KDE_EXPORT FavoriteThreads
 {
     static FavoriteThreads* instance;
-    Q3ValueList<FavoriteThreadItem> m_threadList;
+    QList<FavoriteThreadItem> m_threadList;
 
     FavoriteThreads();
     ~FavoriteThreads();
 
-    const Q3ValueList<FavoriteThreadItem> threadList() const;
+    const QList<FavoriteThreadItem> threadList() const;
     static void processThreadNode(QDomNode& node);
 
 public:

Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -10,10 +10,10 @@
 
 #include "kita_misc.h"
 
+#include <QtCore/QByteArray>
 #include <QtCore/QDir>
 #include <QtCore/QRegExp>
 #include <QtCore/QTextCodec>
-#include <Qt3Support/Q3CString>
 
 #include <kurl.h>
 
@@ -1432,7 +1432,7 @@
   const char *encode_string = "/@<>#\"&?={}|^~[]\'`\\:+%";
   encode_string += encoding_offset;
 
-  Q3CString local;
+  QByteArray local;
   if (encoding_hint==0)
     local = segment.toLocal8Bit();
   else

Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,11 +11,10 @@
 #include "thread.h"
 
 #include <QtCore/QRegExp>
-#include <Qt3Support/Q3ValueList>
 
 using namespace Kita;
 
-Q3Dict<Thread>* Thread::m_threadDict = 0;
+QMultiHash<QString, Thread*>* Thread::m_threadDict = 0;
 
 Thread::Thread(const KUrl& datURL)
         : m_datURL(datURL), m_threadName(0) , m_resNum(0), m_readNum(0), m_viewPos(0)
@@ -87,13 +86,13 @@
 }
 
 /* public */
-const Q3ValueList< int >& Thread::markList() const
+const QList<int>& Thread::markList() const
 {
     return m_markList;
 }
 
 /* public */
-void Thread::setMarkList(const Q3ValueList< int >& markList)
+void Thread::setMarkList(const QList<int>& markList)
 {
     m_markList = markList;
 }
@@ -101,7 +100,7 @@
 /* public */
 bool Thread::isMarked(int num)
 {
-    Q3ValueList< int >::iterator it;
+    QList<int>::iterator it;
     for (it = m_markList.begin(); it != m_markList.end(); ++it) {
         if ((*it) == num) return true;
     }
@@ -116,7 +115,7 @@
     if (status == newStatus) return false;
 
     if (newStatus) m_markList += num;
-    else m_markList.remove(num);
+    else m_markList.removeAll(num);
 
     return true;
 }
@@ -129,10 +128,10 @@
 Thread* Thread::getByURL(const KUrl& datURL)
 {
     if (m_threadDict == 0) {
-        m_threadDict = new Q3Dict<Thread>();
+        m_threadDict = new QMultiHash<QString, Thread*>();
     }
 
-    Thread* thread = m_threadDict->find(datURL.prettyUrl());
+    Thread* thread = m_threadDict->value(datURL.prettyUrl());
     if (thread) return thread;
 
     Thread* newThread = new Thread(datURL);
@@ -146,22 +145,23 @@
 {
     if (m_threadDict == 0) return 0;
 
-    return m_threadDict->find(datURL.prettyUrl());
+    return m_threadDict->value(datURL.prettyUrl());
 }
 
 void Thread::replace(const QString& fromURL, const QString& toURL)
 {
     if (m_threadDict == 0) return ;
-    Q3DictIterator<Kita::Thread> it(*m_threadDict);
-    for (; it.current(); ++it) {
-        QString url = it.currentKey();
-        Kita::Thread* thread = it.current();
+	QHashIterator<QString, Thread*> it(*m_threadDict);
+    while (it.hasNext()) {
+        it.next();
+        QString url = it.key();
+        Kita::Thread* thread = it.value();
         if (url.indexOf(fromURL) == 0) {
             m_threadDict->remove(url);
             url = url.replace(0, fromURL.length(), toURL);
             thread->m_datURL = url;
             m_threadDict->insert(url, thread);
-            it.toFirst();
+            it.toFront();
         }
     }
 }

Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/thread.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/thread.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,8 +11,8 @@
 #ifndef KITATHREAD_H
 #define KITATHREAD_H
 
-#include <Qt3Support/Q3Dict>
-#include <Qt3Support/Q3ValueList>
+#include <QtCore/QMultiHash>
+#include <QtCore/QList>
 
 #include <kurl.h>
 
@@ -23,14 +23,14 @@
     */
     class KDE_EXPORT Thread
     {
-        static Q3Dict<Thread>* m_threadDict;
+        static QMultiHash<QString, Thread*>* m_threadDict;
 
         KUrl m_datURL;
         QString m_threadName;
         int m_resNum;
         int m_readNum;
         int m_viewPos;
-        Q3ValueList< int > m_markList;
+        QList<int> m_markList;
 
     public:
         Thread(const KUrl& datURL);
@@ -50,8 +50,8 @@
         int viewPos() const;
         void setViewPos(int viewPos);
 
-        const Q3ValueList< int >& markList() const;
-        void setMarkList(const Q3ValueList< int >& markList);
+        const QList<int>& markList() const;
+        void setMarkList(const QList<int>& markList);
         bool isMarked(int num);
         bool setMark(int num, bool newStatus);
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,7 +11,6 @@
 #include "threadindex.h"
 
 #include <QtCore/QFile>
-#include <Qt3Support/Q3ValueList>
 
 #include <kconfig.h>
 #include <KConfigGroup>
@@ -80,7 +79,7 @@
     setViewPosPrivate(viewPos, config);
 }
 
-void ThreadIndex::setMarkList(const KUrl& url, const Q3ValueList< int >& markList)
+void ThreadIndex::setMarkList(const KUrl& url, const QList<int>& markList)
 {
     QString indexPath = Kita::Cache::getIndexPath(url);
     KConfig config(indexPath);
@@ -253,14 +252,14 @@
 /*-------*/
 
 /* private */ /* static */
-QList< int > ThreadIndex::getMarkListPrivate(KConfig& config)
+QList<int> ThreadIndex::getMarkListPrivate(KConfig& config)
 {
     QList<int> default_value;
     return config.group("").readEntry("Mark", default_value);
 }
 
 /* private */ /* static */
-void ThreadIndex::setMarkListPrivate(const QList< int >& markList, KConfig& config)
+void ThreadIndex::setMarkListPrivate(const QList<int>& markList, KConfig& config)
 {
     config.group("").writeEntry("Mark", markList);
 }

Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -12,8 +12,8 @@
 
 #define USE_INDEX
 
+#include <QtCore/QList>
 #include <QtCore/QString>
-#include <Qt3Support/Q3ValueList>
 
 #include <kdemacros.h>
 
@@ -42,7 +42,7 @@
         static int getViewPos(const KUrl& url);
         static void setViewPos(const KUrl& url, int viewPos);
 
-        static void setMarkList(const KUrl& url, const Q3ValueList< int >& markList);
+        static void setMarkList(const KUrl& url, const QList<int>& markList);
 
         /*---------------------------------*/
 
@@ -63,8 +63,8 @@
         static int getViewPosPrivate(KConfig& config);
         static void setViewPosPrivate(int viewPos, KConfig& config);
 
-        static QList< int > getMarkListPrivate(KConfig& config);
-        static void setMarkListPrivate(const QList< int >& markList, KConfig& config);
+        static QList<int> getMarkListPrivate(KConfig& config);
+        static void setMarkListPrivate(const QList<int>& markList, KConfig& config);
     };
 }
 

Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -347,8 +347,8 @@
     m_threadTab = new KitaThreadTabWidget(vsplit);
     ViewMediator::getInstance()->setThreadTabWidget(m_threadTab);
 
-    hsplit->setSizes(Q3ValueList<int>() << 100 << 500);
-    vsplit->setSizes(Q3ValueList<int>() << 200 << 300);
+    hsplit->setSizes(QList<int>() << 100 << 500);
+    vsplit->setSizes(QList<int>() << 200 << 300);
 
     setCentralWidget(mainWidget);
 

Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/threadlistview.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/threadlistview.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -10,7 +10,7 @@
 #ifndef KITATHREADLISTVIEW_H
 #define KITATHREADLISTVIEW_H
 
-#include <Qt3Support/Q3ValueList>
+#include <QtCore/QList>
 
 #include "ui_threadlistviewbase.h"
 
@@ -43,7 +43,7 @@
         static struct Col_Attr s_colAttr[];
         QStringList m_prevquery;
         unsigned m_nextHitIndex;
-        Q3ValueList<K3ListViewItem *> m_hitList;
+        QList<K3ListViewItem *> m_hitList;
 
         void insertSearchCombo();
         void searchNext(const QStringList& input);

Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/writeview.cpp	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/writeview.cpp	2009-07-11 21:13:40 UTC (rev 2401)
@@ -206,7 +206,7 @@
     /* referrer */
     QString refStr = Kita::BoardManager::boardURL(m_datURL);
 
-    m_array.resize(0);
+    m_array.clear();
 
     KIO::TransferJob* job = KIO::http_post(m_bbscgi, postStr.toUtf8());
     job->addMetaData("content-type", "Content-type: application/x-www-form-urlencoded");

Modified: kita/branches/KITA-KDE4/kita/src/writeview.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/writeview.h	2009-07-11 15:24:24 UTC (rev 2400)
+++ kita/branches/KITA-KDE4/kita/src/writeview.h	2009-07-11 21:13:40 UTC (rev 2401)
@@ -11,8 +11,8 @@
 #ifndef KITAWRITEVIEW_H
 #define KITAWRITEVIEW_H
 
+#include <QtCore/QByteArray>
 #include <QtGui/QWidget>
-#include <Qt3Support/Q3CString>
 
 #include <kio/job.h>
 
@@ -52,7 +52,7 @@
 
 protected:
 
-    Q3CString m_array;
+    QByteArray m_array;
     KUrl m_bbscgi;
     int m_bbstype;
     KUrl m_datURL;




Kita-svn メーリングリストの案内
アーカイブの一覧に戻る