From svnnotify ¡÷ sourceforge.jp Sun Jul 5 07:50:35 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 07:50:35 +0900 Subject: [Kita-svn] [2350] fix a bug related to cache Message-ID: <1246747835.286305.26305.nullmailer@users.sourceforge.jp> Revision: 2350 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2350 Author: nogu Date: 2009-07-05 07:50:35 +0900 (Sun, 05 Jul 2009) Log Message: ----------- fix a bug related to cache Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp kita/branches/KITA-KDE4/kita/src/libkita/access.h kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h -------------- next part -------------- Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-04 03:40:29 UTC (rev 2349) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-04 22:50:35 UTC (rev 2350) @@ -38,7 +38,7 @@ m_bbstype = BoardManager::type( m_datURL ); m_header = "HTTP/1.1 200 "; /* dummy header */ m_dataSize = 0; - m_threadData = QString::null; + m_threadData.clear(); } /* read data from cache, then emit data to DatInfo. */ /* public */ @@ -87,7 +87,7 @@ void Access::writeCacheData() { if ( m_invalidDataReceived ) return ; - if ( m_threadData.length() == 0 ) return ; + if ( m_threadData.isEmpty() ) return ; m_dataSize += m_threadData.length(); @@ -99,7 +99,7 @@ fwrite( m_threadData.data(), m_threadData.length(), 1, fs ); fclose( fs ); } - m_threadData = QString::null; /* clear baffer */ + m_threadData.clear(); /* clear baffer */ return ; } @@ -109,7 +109,7 @@ { /* init */ m_readNum = readNum; - m_threadData = QString::null; + m_threadData.clear(); m_firstReceive = FALSE; m_invalidDataReceived = FALSE; m_lastLine.clear(); @@ -251,6 +251,7 @@ if ( ! lineList[ i ].isEmpty() ) { QString line, line2; + QByteArray ba; int nextNum = m_readNum + 1; /* convert line */ @@ -259,34 +260,38 @@ case Board_MachiBBS: line = Kita::qcpToUnicode( lineList[i] ); line2 = Kita::ParseMachiBBSOneLine( line, nextNum ); + ba = Kita::unicodeToQcp( line2 ); break; case Board_JBBS: line = Kita::eucToUnicode( lineList[i] ); line2 = Kita::ParseJBBSOneLine( line, nextNum ); + ba = Kita::unicodeToEuc( line2 ); break; case Board_FlashCGI: line = Kita::qcpToUnicode( lineList[i] ); line2 = Kita::ParseFlashCGIOneLine( line ); + ba = Kita::unicodeToQcp( line2 ); break; default: line = line2 = Kita::qcpToUnicode( lineList[i] ); + ba = lineList[i]; } if ( line2 == QString::null ) continue; /* add abone lines */ - const QString aboneStr = "abone<><><>abone<>"; + const char aboneStr[] = "abone<><><>abone<>"; while ( nextNum > m_readNum + 1 ) { datLineList += aboneStr; - m_threadData += aboneStr + "\n"; + m_threadData += aboneStr + '\n'; ++m_readNum; } /* save line */ - if ( m_bbstype == Board_MachiBBS ) m_threadData += line2 + "\n"; + if ( m_bbstype == Board_MachiBBS ) m_threadData += ba + "\n"; else m_threadData += lineList[ i ] + "\n"; ++m_readNum; @@ -364,7 +369,7 @@ KUrl kgetURL( getURL ); kgetURL.addQueryItem( "sid", Account::getSessionID() ); - m_threadData = ""; + m_threadData.clear(); m_invalidDataReceived = FALSE; KIO::SlaveConfig::self() ->setConfigData( "http", @@ -394,7 +399,7 @@ m_header = job->queryMetaData( "HTTP-Headers" ); } - if ( !m_invalidDataReceived && m_threadData.length() ) { + if ( !m_invalidDataReceived && !m_threadData.isEmpty() ) { KUrl url = m_datURL; writeCacheData(); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-04 03:40:29 UTC (rev 2349) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-04 22:50:35 UTC (rev 2350) @@ -52,7 +52,7 @@ const KUrl m_datURL; KIO::Job* m_currentJob; - QString m_threadData; + QByteArray m_threadData; QString m_header; int m_dataSize; bool m_firstReceive; Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-04 03:40:29 UTC (rev 2349) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-04 22:50:35 UTC (rev 2350) @@ -82,8 +82,19 @@ return Kita::eucCodec->toUnicode( str ); } +QByteArray Kita::unicodeToQcp( const QString& str ) +{ + if ( !Kita::qcpCodec ) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); // TODO + return Kita::qcpCodec->fromUnicode( str ); +} +QByteArray Kita::unicodeToEuc( const QString& str ) +{ + if ( !Kita::eucCodec ) Kita::eucCodec = QTextCodec::codecForName( "eucJP" ); + return Kita::eucCodec->fromUnicode( str ); +} + /*------------------------------------------------------------*/ /*------------------------------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-04 03:40:29 UTC (rev 2349) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-04 22:50:35 UTC (rev 2350) @@ -38,6 +38,8 @@ QString qcpToUnicode( const QByteArray& str ); QString utf8ToUnicode( const QByteArray& str ); QString eucToUnicode( const QByteArray& str ); + QByteArray unicodeToQcp( const QString& str ); + QByteArray unicodeToEuc( const QString& str ); QString encode_string(const QString &str, int encoding_hint); From svnnotify ¡÷ sourceforge.jp Sun Jul 5 08:14:33 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 08:14:33 +0900 Subject: [Kita-svn] [2351] use shared libraries Message-ID: <1246749273.421022.23835.nullmailer@users.sourceforge.jp> Revision: 2351 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2351 Author: nogu Date: 2009-07-05 08:14:33 +0900 (Sun, 05 Jul 2009) Log Message: ----------- use shared libraries Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/kitaui/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/account.h kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h kita/branches/KITA-KDE4/kita/src/libkita/thread.h kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/prefs/prefs.h -------------- next part -------------- Modified: kita/branches/KITA-KDE4/kita/src/kitaui/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/CMakeLists.txt 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/kitaui/CMakeLists.txt 2009-07-04 23:14:33 UTC (rev 2351) @@ -6,7 +6,7 @@ set(kitaui_LIB_SRCS tabwidgetbase.cpp listviewitem.cpp htmlview.cpp) -kde4_add_library(kitaui STATIC ${kitaui_LIB_SRCS}) +kde4_add_library(kitaui SHARED ${kitaui_LIB_SRCS}) target_link_libraries(kitaui ${KDE4_KDECORE_LIBS} ${KDE4_KHTML_LIBS} ${QT_QT3SUPPORT_LIBRARY} ${KDE4_KDE3SUPPORT_LIBS}) Modified: kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -16,7 +16,7 @@ /** @author Hideki Ikemoto */ -class KitaHTMLView : public KHTMLView +class KDE_EXPORT KitaHTMLView : public KHTMLView { Q_OBJECT public: Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -15,7 +15,7 @@ namespace Kita { - class ListViewItem : public K3ListViewItem + class KDE_EXPORT ListViewItem : public K3ListViewItem { QBrush m_textPalette; /* text palette */ QBrush m_basePalette; /* background palette */ Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -45,7 +45,7 @@ /*-----------------------------------------------*/ -class KitaTabWidgetBase : public KTabWidget, public KXMLGUIClient +class KDE_EXPORT KitaTabWidgetBase : public KTabWidget, public KXMLGUIClient { Q_OBJECT Modified: kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt 2009-07-04 23:14:33 UTC (rev 2351) @@ -28,7 +28,7 @@ kde4_add_kcfg_files(kita_LIB_SRCS config_xt.kcfgc asciiart.kcfgc abone.kcfgc) -kde4_add_library(kitautil STATIC ${kita_LIB_SRCS}) +kde4_add_library(kitautil SHARED ${kita_LIB_SRCS}) target_link_libraries(kitautil ${KDE4_KDECORE_LIBS} ${QT_QT3SUPPORT_LIBRARY} ${KDE4_KIO_LIBS} ${KDE4_KDE3SUPPORT_LIBS}) Modified: kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfgc =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfgc 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfgc 2009-07-04 23:14:33 UTC (rev 2351) @@ -3,3 +3,4 @@ NameSpace=Kita Singleton=true Mutators=true +Visibility=KDE_EXPORT Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -10,6 +10,8 @@ #ifndef KITAACCOUNT_H #define KITAACCOUNT_H +#include + #include //Added by qt3to4: #include @@ -26,7 +28,7 @@ /** @author Hideki Ikemoto */ - class Account : public QObject + class KDE_EXPORT Account : public QObject { Q_OBJECT static Account* instance; Modified: kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfgc =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfgc 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfgc 2009-07-04 23:14:33 UTC (rev 2351) @@ -3,3 +3,4 @@ NameSpace=Kita Singleton=true Mutators=true +Visibility=KDE_EXPORT Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -123,7 +123,7 @@ /** @author Hideki Ikemoto */ - class BoardManager + class KDE_EXPORT BoardManager { static BoardDataList m_boardDataList; static BoardData* m_previousBoardData; /* used in getBoardData() */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc 2009-07-04 23:14:33 UTC (rev 2351) @@ -3,3 +3,4 @@ NameSpace=Kita Singleton=true Mutators=true +Visibility=KDE_EXPORT Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -100,7 +100,7 @@ /*-----------------------*/ - class DatInfo : public QObject + class KDE_EXPORT DatInfo : public QObject { Q_OBJECT Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -23,7 +23,7 @@ class DatInfo; typedef Q3ValueList DatInfoList; - class DatManager + class KDE_EXPORT DatManager { static DatInfoList m_datInfoList; Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -22,7 +22,7 @@ /** @author Hideki Ikemoto */ - class FavoriteBoards : public QObject + class KDE_EXPORT FavoriteBoards : public QObject { Q_OBJECT Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -36,7 +36,7 @@ bool operator==( const FavoriteThreadItem& item ) const; }; -class FavoriteThreads +class KDE_EXPORT FavoriteThreads { static FavoriteThreads* instance; Q3ValueList m_threadList; Modified: kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -10,12 +10,14 @@ #ifndef FLASHCGI_H #define FLASHCGI_H +#include + #include /** @author Hideki Ikemoto */ -class FlashCGI { +class KDE_EXPORT FlashCGI { public: static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -10,12 +10,14 @@ #ifndef JBBS_H #define JBBS_H +#include + #include /** @author Hideki Ikemoto */ -class JBBS { +class KDE_EXPORT JBBS { public: static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -10,11 +10,13 @@ #ifndef K2CH_H #define K2CH_H +#include + #include /** @author Hideki Ikemoto */ -class K2ch { +class KDE_EXPORT K2ch { public: static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime, const QString& sessionID ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -36,7 +36,7 @@ /*------------------------------*/ /* text codecs */ QString qcpToUnicode( const QByteArray& str ); - QString utf8ToUnicode( const QByteArray& str ); + KDE_EXPORT QString utf8ToUnicode( const QByteArray& str ); QString eucToUnicode( const QByteArray& str ); QByteArray unicodeToQcp( const QString& str ); QByteArray unicodeToEuc( const QString& str ); @@ -52,12 +52,12 @@ /*------------------------------*/ /* conversion of URL */ - KUrl getDatURL( const KUrl& url , QString& refstr ); - KUrl getDatURL( const KUrl& url ); + KDE_EXPORT KUrl getDatURL( const KUrl& url , QString& refstr ); + KDE_EXPORT KUrl getDatURL( const KUrl& url ); QString getThreadURL( const KUrl& url, QString& refstr ); - QString getThreadURL( const KUrl& url ); - QString getWriteURL( const KUrl& datURL ); + KDE_EXPORT QString getThreadURL( const KUrl& url ); + KDE_EXPORT QString getWriteURL( const KUrl& datURL ); QString getNewThreadWriteURL( const KUrl& datURL ); QString convertURL( int mode, const KUrl& url , QString& refstr ); @@ -69,16 +69,16 @@ /* utilities */ bool mkdir( const QString& path ); QString unescape( const QString& str ); - uint datToSince( const KUrl& datURL ); + KDE_EXPORT uint datToSince( const KUrl& datURL ); int isEqual( const QChar *cdat, const QString& str ); - int stringToPositiveNum( const QChar *cdat, const unsigned int length ); - QString getCategory( const QString& line ); - bool isBoardURL( const QString& url ); - QString fontToString( const QFont& font ); + KDE_EXPORT int stringToPositiveNum( const QChar *cdat, const unsigned int length ); + KDE_EXPORT QString getCategory( const QString& line ); + KDE_EXPORT bool isBoardURL( const QString& url ); + KDE_EXPORT QString fontToString( const QFont& font ); /*------------------------------*/ /* internal parsing funtions */ - QStringList parseSearchQuery( const QString& input ); + KDE_EXPORT QStringList parseSearchQuery( const QString& input ); /* for MACHI BBS */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -10,12 +10,14 @@ #ifndef MACHIBBS_H #define MACHIBBS_H +#include + #include /** @author Hideki Ikemoto */ -class MachiBBS { +class KDE_EXPORT MachiBBS { public: static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -20,7 +20,7 @@ /** @author Hideki Ikemoto */ - class Thread + class KDE_EXPORT Thread { static Q3Dict* m_threadDict; Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -12,6 +12,8 @@ #define USE_INDEX +#include + #include #include @@ -25,7 +27,7 @@ /** @author Hideki Ikemoto */ - class ThreadIndex + class KDE_EXPORT ThreadIndex { public: static QString getSubject( const KUrl& url ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -20,7 +20,7 @@ * Hideki Ikemoto **/ -class KitaThreadInfo +class KDE_EXPORT KitaThreadInfo { public: static KitaThreadInfo* getInstance(); @@ -28,8 +28,8 @@ static int readNum( const QString& url ); static void replace( const QString fromURL, const QString toURL ); static void removeThreadInfo( const QString& url ); - friend QDataStream& operator<<( QDataStream& s, KitaThreadInfo& c ); - friend QDataStream& operator>>( QDataStream& s, KitaThreadInfo& c ); + KDE_EXPORT friend QDataStream& operator<<( QDataStream& s, KitaThreadInfo& c ); + KDE_EXPORT friend QDataStream& operator>>( QDataStream& s, KitaThreadInfo& c ); private: KitaThreadInfo(); ~KitaThreadInfo(); Modified: kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-04 23:14:33 UTC (rev 2351) @@ -14,9 +14,9 @@ faceprefbase.ui write_page.ui) -kde4_add_library(kitapref STATIC ${kitapref_LIB_SRCS}) +kde4_add_library(kitapref SHARED ${kitapref_LIB_SRCS}) -target_link_libraries(kitapref ${KDE4_KDECORE_LIBS} ${QT_QT3SUPPORT_LIBRARY} ${KDE4_KDE3SUPPORT_LIBS}) +target_link_libraries(kitapref ${KDE4_KDECORE_LIBS} ${QT_QT3SUPPORT_LIBRARY} ${KDE4_KDE3SUPPORT_LIBS} kitautil) set_target_properties(kitapref PROPERTIES VERSION 1.0.0 SOVERSION 1) install(TARGETS kitapref ${INSTALL_TARGETS_DEFAULT_ARGS}) Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-04 22:50:35 UTC (rev 2350) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-04 23:14:33 UTC (rev 2351) @@ -38,7 +38,7 @@ } } -class KitaPreferences : public KConfigDialog +class KDE_EXPORT KitaPreferences : public KConfigDialog { Q_OBJECT From svnnotify ¡÷ sourceforge.jp Sun Jul 5 08:39:32 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 08:39:32 +0900 Subject: [Kita-svn] [2352] add support for out-of-source builds Message-ID: <1246750772.401572.26987.nullmailer@users.sourceforge.jp> Revision: 2352 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2352 Author: nogu Date: 2009-07-05 08:39:32 +0900 (Sun, 05 Jul 2009) Log Message: ----------- add support for out-of-source builds see also: http://techbase.kde.org/Development/Tutorials/Using_KConfig_XT#out-of-source_builds Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt -------------- next part -------------- Modified: kita/branches/KITA-KDE4/kita/src/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-04 23:14:33 UTC (rev 2351) +++ kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-04 23:39:32 UTC (rev 2352) @@ -1,5 +1,5 @@ -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/prefs) add_subdirectory(kitaui) add_subdirectory(libkita) Modified: kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-04 23:14:33 UTC (rev 2351) +++ kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-04 23:39:32 UTC (rev 2352) @@ -1,5 +1,5 @@ -include_directories(.. ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) +include_directories(.. ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/..) ########### next target ############### From svnnotify ¡÷ sourceforge.jp Sun Jul 5 09:09:00 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 09:09:00 +0900 Subject: [Kita-svn] [2353] don't call deprecated functions Message-ID: <1246752540.139814.15924.nullmailer@users.sourceforge.jp> Revision: 2353 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2353 Author: nogu Date: 2009-07-05 09:09:00 +0900 (Sun, 05 Jul 2009) Log Message: ----------- don't call deprecated functions Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp kita/branches/KITA-KDE4/kita/src/libkita/account.cpp kita/branches/KITA-KDE4/kita/src/writeview.cpp -------------- next part -------------- Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-04 23:39:32 UTC (rev 2352) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 00:09:00 UTC (rev 2353) @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -171,7 +172,8 @@ } m_currentJob = 0; if ( tjob->error() ) { - tjob->showErrorDialog(); + tjob->ui()->setWindow(0); + tjob->ui()->showErrorMessage(); } else { m_header = tjob->queryMetaData( "HTTP-Headers" ); } @@ -394,7 +396,8 @@ { m_currentJob = 0; if ( job->error() ) { - job->showErrorDialog(); + job->ui()->setWindow(0); + job->ui()->showErrorMessage(); } else { m_header = job->queryMetaData( "HTTP-Headers" ); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-04 23:39:32 UTC (rev 2352) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-05 00:09:00 UTC (rev 2353) @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -82,7 +83,8 @@ { m_job = 0; if ( job->error() ) { - job->showErrorDialog(); + job->ui()->setWindow(0); + job->ui()->showErrorMessage(); } QString str( m_data ); Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-04 23:39:32 UTC (rev 2352) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 00:09:00 UTC (rev 2353) @@ -388,7 +388,7 @@ /* login */ if ( Kita::DatManager::is2chThread( m_datURL ) && Kita::Account::isLogged() ) { - sessionID = KUrl::encode_string( Kita::Account::getSessionID() ); + sessionID = KUrl::toPercentEncoding( Kita::Account::getSessionID() ); } return K2ch::buildPostStr( name(), mail(), From svnnotify ¡÷ sourceforge.jp Sun Jul 5 09:13:11 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 09:13:11 +0900 Subject: [Kita-svn] [2354] remove pointless `const' Message-ID: <1246752791.573056.20639.nullmailer@users.sourceforge.jp> Revision: 2354 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2354 Author: nogu Date: 2009-07-05 09:13:11 +0900 (Sun, 05 Jul 2009) Log Message: ----------- remove pointless `const' Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/domtree.cpp kita/branches/KITA-KDE4/kita/src/domtree.h -------------- next part -------------- Modified: kita/branches/KITA-KDE4/kita/src/domtree.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-05 00:09:00 UTC (rev 2353) +++ kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-05 00:13:11 UTC (rev 2354) @@ -142,7 +142,7 @@ } } -const int KitaDomTree::getBottomResNumber() const +int KitaDomTree::getBottomResNumber() const { return m_bottomNum; } Modified: kita/branches/KITA-KDE4/kita/src/domtree.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-05 00:09:00 UTC (rev 2353) +++ kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-05 00:13:11 UTC (rev 2354) @@ -55,7 +55,7 @@ /* information */ - const int getBottomResNumber() const; + int getBottomResNumber() const; /* header Node, footer Node, kokomadeyonda Node, etc... */ From svnnotify ¡÷ sourceforge.jp Sun Jul 5 09:30:26 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 09:30:26 +0900 Subject: [Kita-svn] [2355] int -> unsigned Message-ID: <1246753826.677480.24828.nullmailer@users.sourceforge.jp> Revision: 2355 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2355 Author: nogu Date: 2009-07-05 09:30:26 +0900 (Sun, 05 Jul 2009) Log Message: ----------- int -> unsigned Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 00:13:11 UTC (rev 2354) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 00:30:26 UTC (rev 2355) @@ -108,14 +108,15 @@ void ThreadListView::searchNext( const QStringList &query ) { Q_ASSERT( query == m_prevquery ); - Q_ASSERT( m_nextHitIndex < m_hitList.size() ); + Q_ASSERT( m_nextHitIndex < static_cast( m_hitList.size() ) ); K3ListViewItem* item = m_hitList[ m_nextHitIndex ]; subjectList->ensureItemVisible( item ); subjectList->setSelected( item, TRUE ); m_nextHitIndex++; - if ( m_nextHitIndex >= m_hitList.size() ) m_nextHitIndex = 0; + if ( m_nextHitIndex >= static_cast( m_hitList.size() ) ) + m_nextHitIndex = 0; } void ThreadListView::searchNew( const QStringList &query ) From svnnotify ¡÷ sourceforge.jp Sun Jul 5 10:30:38 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 10:30:38 +0900 Subject: [Kita-svn] [2356] - remove a deprecated key "Encoding" Message-ID: <1246757438.238673.6682.nullmailer@users.sourceforge.jp> Revision: 2356 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2356 Author: nogu Date: 2009-07-05 10:30:38 +0900 (Sun, 05 Jul 2009) Log Message: ----------- - remove a deprecated key "Encoding" - remove a deprecated field code "%m" - use X-DocPath instead of DocPath - use "false" instead of a deprecated value "0" - remove a deprecated value "Application" Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/kita.desktop Modified: kita/branches/KITA-KDE4/kita/src/kita.desktop =================================================================== --- kita/branches/KITA-KDE4/kita/src/kita.desktop 2009-07-05 00:30:26 UTC (rev 2355) +++ kita/branches/KITA-KDE4/kita/src/kita.desktop 2009-07-05 01:30:38 UTC (rev 2356) @@ -1,11 +1,10 @@ [Desktop Entry] -Encoding=UTF-8 Name=Kita -Exec=kita %i %m -caption "%c" +Exec=kita %i -caption "%c" Icon=kita Type=Application -DocPath=kita/kita.html +X-DocPath=kita/kita.html Comment=Kita - 2ch client for KDE Comment[ja]=Kita - KDEÍÑ2¤Á¤ã¤ó¤Í¤ë¥Ö¥é¥¦¥¶ -Terminal=0 -Categories=Application;Network; +Terminal=false +Categories=Network; From svnnotify ¡÷ sourceforge.jp Sun Jul 5 11:07:04 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 11:07:04 +0900 Subject: [Kita-svn] [2358] fix typos Message-ID: <1246759624.670144.7245.nullmailer@users.sourceforge.jp> Revision: 2358 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2358 Author: nogu Date: 2009-07-05 11:07:04 +0900 (Sun, 05 Jul 2009) Log Message: ----------- fix typos Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h kita/branches/KITA-KDE4/kita/src/threadview.cpp Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 01:57:23 UTC (rev 2357) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 02:07:04 UTC (rev 2358) @@ -129,7 +129,7 @@ /* DatManager::getDatInfo(). */ Kita::DatManager::createDatInfo( m_datURL ); - /* tell Thread class that "thread is opend" */ + /* tell Thread class that "thread is opened" */ Kita::DatManager::setMainThreadOpened( m_datURL, true ); /* reset abone */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 01:57:23 UTC (rev 2357) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 02:07:04 UTC (rev 2358) @@ -171,7 +171,7 @@ int getNumByID( const QString& strid ); int getDatSize(); - /* several informations */ + /* several information */ bool isResponsed ( int num ) const; bool isResValid( int num ); bool isBroken(); @@ -209,7 +209,7 @@ bool checkAbonePrivate( int num ); bool checkAboneCore( const QString& str, QStringList strlist ); - /* parsing funtions */ + /* parsing functions */ bool parseDat( int num ); /*----------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 01:57:23 UTC (rev 2357) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 02:07:04 UTC (rev 2358) @@ -1147,7 +1147,7 @@ /* parsing function for anchor (>>digits) */ -/* This fuction parses res anchor. +/* This function parses res anchor. For example, if cdat = ">12-20", then Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-05 01:57:23 UTC (rev 2357) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-05 02:07:04 UTC (rev 2358) @@ -77,7 +77,7 @@ KDE_EXPORT QString fontToString( const QFont& font ); /*------------------------------*/ - /* internal parsing funtions */ + /* internal parsing functions */ KDE_EXPORT QStringList parseSearchQuery( const QString& input ); Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 01:57:23 UTC (rev 2357) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 02:07:04 UTC (rev 2358) @@ -434,7 +434,7 @@ m_rescode = Kita::DatManager::getResponseCode( m_datURL ); m_serverTime = Kita::DatManager::getServerTime( m_datURL ); - /* uptate informations */ + /* uptate information */ setSubjectLabel( Kita::BoardManager::boardName( m_datURL ), Kita::DatManager::threadName( m_datURL ) + QString( " (%1)" ) From svnnotify ¡÷ sourceforge.jp Sun Jul 5 11:30:13 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 11:30:13 +0900 Subject: [Kita-svn] [2359] add `explicit' Message-ID: <1246761013.595483.5386.nullmailer@users.sourceforge.jp> Revision: 2359 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2359 Author: nogu Date: 2009-07-05 11:30:13 +0900 (Sun, 05 Jul 2009) Log Message: ----------- add `explicit' Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbstabwidget.h kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/boardtabwidget.h kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h kita/branches/KITA-KDE4/kita/src/threadtabwidget.h kita/branches/KITA-KDE4/kita/src/writetabwidget.h Modified: kita/branches/KITA-KDE4/kita/src/bbstabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbstabwidget.h 2009-07-05 02:07:04 UTC (rev 2358) +++ kita/branches/KITA-KDE4/kita/src/bbstabwidget.h 2009-07-05 02:30:13 UTC (rev 2359) @@ -23,7 +23,7 @@ Q_OBJECT public: - KitaBBSTabWidget( QWidget* parent, Qt::WFlags fl = 0 ); + explicit KitaBBSTabWidget( QWidget* parent, Qt::WFlags fl = 0 ); ~KitaBBSTabWidget(); public slots: Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 02:07:04 UTC (rev 2358) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 02:30:13 UTC (rev 2359) @@ -67,7 +67,7 @@ void slotMenuOpenWithBrowser(); public: - KitaBBSView( QWidget *parent, const char *name = 0 ); + explicit KitaBBSView( QWidget *parent, const char *name = 0 ); ~KitaBBSView(); void loadOpened(); Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.h 2009-07-05 02:07:04 UTC (rev 2358) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.h 2009-07-05 02:30:13 UTC (rev 2359) @@ -24,7 +24,7 @@ Q_OBJECT public: - KitaBoardTabWidget( QWidget* parent = 0, Qt::WFlags f = 0 ); + explicit KitaBoardTabWidget( QWidget* parent = 0, Qt::WFlags f = 0 ); ~KitaBoardTabWidget(); void updateBoardView( const KUrl& datURL ); Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-05 02:07:04 UTC (rev 2358) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-05 02:30:13 UTC (rev 2359) @@ -34,9 +34,9 @@ QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null ); - ListViewItem( Q3ListView* parent, QString = QString::null, QString = QString::null ); + explicit ListViewItem( Q3ListView* parent, QString = QString::null, QString = QString::null ); - ListViewItem( Q3ListViewItem* parent, QString = QString::null, QString = QString::null ); + explicit ListViewItem( Q3ListViewItem* parent, QString = QString::null, QString = QString::null ); ~ListViewItem(); Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-05 02:07:04 UTC (rev 2358) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-05 02:30:13 UTC (rev 2359) @@ -54,7 +54,7 @@ public: - KitaTabWidgetBase( QWidget* parent = 0, Qt::WFlags f = 0 ); + explicit KitaTabWidgetBase( QWidget* parent = 0, Qt::WFlags f = 0 ); virtual ~KitaTabWidgetBase(); public slots: Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.h 2009-07-05 02:07:04 UTC (rev 2358) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.h 2009-07-05 02:30:13 UTC (rev 2359) @@ -23,7 +23,7 @@ Q_OBJECT public: - KitaThreadTabWidget( QWidget* parent = 0, Qt::WFlags f = 0 ); + explicit KitaThreadTabWidget( QWidget* parent = 0, Qt::WFlags f = 0 ); ~KitaThreadTabWidget(); public slots: Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.h 2009-07-05 02:07:04 UTC (rev 2358) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.h 2009-07-05 02:30:13 UTC (rev 2359) @@ -23,7 +23,7 @@ Q_OBJECT public: - KitaWriteTabWidget( QWidget* parent = 0, Qt::WFlags f = 0 ); + explicit KitaWriteTabWidget( QWidget* parent = 0, Qt::WFlags f = 0 ); ~KitaWriteTabWidget(); void slotShowWriteView( const KUrl& url, const QString& resStr ); From svnnotify ¡÷ sourceforge.jp Sun Jul 5 10:57:23 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 10:57:23 +0900 Subject: [Kita-svn] [2357] don't use TRUE and FALSE macros Message-ID: <1246759043.598923.5913.nullmailer@users.sourceforge.jp> Revision: 2357 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2357 Author: nogu Date: 2009-07-05 10:57:23 +0900 (Sun, 05 Jul 2009) Log Message: ----------- don't use TRUE and FALSE macros Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.h kita/branches/KITA-KDE4/kita/src/domtree.cpp kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.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/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/favoritethreads.cpp 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/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/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h kita/branches/KITA-KDE4/kita/src/respopup.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.cpp kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/viewmediator.cpp kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 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-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -74,7 +74,7 @@ sizePolicy.setVerticalStretch( 0 ); sizePolicy.setHeightForWidth( SearchCombo->sizePolicy().hasHeightForWidth() ); SearchCombo->setSizePolicy( sizePolicy ); - SearchCombo->setEditable( TRUE ); + SearchCombo->setEditable( true ); SearchCombo->setMaxCount( 10 ); layout10->addWidget( SearchCombo ); spacer2 = new QSpacerItem( 467, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); @@ -82,9 +82,9 @@ KitaBBSViewBaseLayout->addLayout( layout10 ); m_boardList = new K3ListView( this ); - m_boardList->setRootIsDecorated( TRUE ); + m_boardList->setRootIsDecorated( true ); m_boardList->setTreeStepSize( 10 ); - m_boardList->setFullWidth( TRUE ); + m_boardList->setFullWidth( true ); KitaBBSViewBaseLayout->addWidget( m_boardList ); resize( QSize(600, 482).expandedTo(minimumSizeHint()) ); setAttribute( Qt::WA_WState_Polished ); @@ -92,7 +92,7 @@ m_boardList->setSorting( -1 ); m_boardList->addColumn( i18n( "board name" ) ); - m_boardList->header() ->setClickEnabled( FALSE ); + m_boardList->header() ->setClickEnabled( false ); /* default colors */ QPalette palette = m_boardList->viewport() ->palette(); @@ -131,12 +131,12 @@ QString tmpFile; QString url = Kita::Config::boardListUrl(); if ( ! KIO::NetAccess::download( url, tmpFile, NULL ) ) { - return FALSE; + return false; } QFile file( tmpFile ); if ( ! file.open( QIODevice::ReadOnly ) ) { - return FALSE; + return false; } QTextStream stream( &file ); @@ -165,7 +165,7 @@ QString boardName = category.boardNameList[ count ]; QString oldURL; int ret = Kita::BoardManager::enrollBoard( boardURL, boardName, oldURL, Kita::Board_Unknown, - TRUE /* test only */ + true /* test only */ ); if ( ret == Kita::Board_enrollNew ) { newBoards += boardName + " ( " + category.category_name + " ) " + boardURL + "\n"; @@ -219,11 +219,11 @@ QApplication::clipboard() ->setText( str , QClipboard::Selection ); } - if ( ret == QMessageBox::Cancel ) return FALSE; + if ( ret == QMessageBox::Cancel ) return false; } else if ( newBoards == QString::null && oldBoards == QString::null ) { QMessageBox::information( this, "Kita", i18n( "no new boards" ) ); - return FALSE; + return false; } // if moved URL exists. move files. @@ -280,7 +280,7 @@ logfile.close(); } - return TRUE; + return true; } void KitaBBSView::updateBoardList() @@ -577,7 +577,7 @@ for ( item = m_boardList->firstChild(); item; item = item->nextSibling() ) { QString categoryName = item->text( 0 ); if ( openedList.indexOf( categoryName ) != -1 ) { - item->setOpen( TRUE ); + item->setOpen( true ); } } } @@ -611,15 +611,15 @@ Q3ListViewItem* boardItem; for ( categoryItem = m_boardList->firstChild(); categoryItem; categoryItem = categoryItem->nextSibling() ) { - bool matched = FALSE; + bool matched = false; for ( boardItem = categoryItem->firstChild(); boardItem; boardItem = boardItem->nextSibling() ) { QString boardName = boardItem->text( 0 ); if ( boardName.contains( str ) ) { - boardItem->setVisible( TRUE ); - matched = TRUE; + boardItem->setVisible( true ); + matched = true; } else { - boardItem->setVisible( FALSE ); + boardItem->setVisible( false ); } } Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -61,7 +61,7 @@ { init(); m_parent = parent; - closeButton->setEnabled( TRUE ); + closeButton->setEnabled( true ); connect( subjectList, SIGNAL( contextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ), SLOT( slotContextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ) ); @@ -91,8 +91,8 @@ m_unreadNum = 0; m_readNum = 0; m_newNum = 0; - m_showOldLogs = FALSE; - m_enableSizeChange = FALSE; + m_showOldLogs = false; + m_enableSizeChange = false; } @@ -119,7 +119,7 @@ void KitaBoardView::toggleShowOldLogs() { m_showOldLogs = !m_showOldLogs; - loadBoard( m_boardURL, FALSE ); + loadBoard( m_boardURL, false ); } void KitaBoardView::loadThread( Q3ListViewItem* item ) @@ -144,7 +144,7 @@ { activateWindow(); topLevelWidget() ->raise(); - m_enableSizeChange = FALSE; + m_enableSizeChange = false; // reset member variables. // FIXME: FavoriteListView::update() @@ -197,14 +197,14 @@ break; } - subjectList->setSelected( subjectList->firstChild(), TRUE ); + subjectList->setSelected( subjectList->firstChild(), true ); subjectList->setFocus(); UpdateKindLabel(); /* restore column size */ loadLayout(); loadHeaderOnOff(); - m_enableSizeChange = TRUE; + m_enableSizeChange = true; } /* public slot */ /* virtual */ @@ -451,20 +451,20 @@ for ( int i = Col_Begin; i <= Col_End; i++ ) { if ( i != Col_Subject && i != Col_MarkOrder && i != Col_IDOrder ) { KAction* action = new KAction( s_colAttr[ i ].itemName, this ); - action->setCheckable( TRUE ); + action->setCheckable( true ); action->setChecked( subjectList->columnWidth( i ) != 0 ); action->setData( QVariant( i ) ); popup.addAction( action ); } } KAction* autoResizeAct = new KAction( i18n( "Auto Resize" ), this ); - autoResizeAct->setCheckable( TRUE ); + autoResizeAct->setCheckable( true ); autoResizeAct->setChecked( autoResize() ); popup.addAction( autoResizeAct ); QAction* action = popup.exec( mouseEvent->globalPos() ); if ( !action ) { - return TRUE; + return true; } if ( action == autoResizeAct ) { setAutoResize( !action->isChecked() ); @@ -474,9 +474,9 @@ showColumn( action->data().toInt() ); } saveHeaderOnOff(); - return TRUE; + return true; } else { - return FALSE; + return false; } } else { return subjectList->header() ->eventFilter( watched, e ); @@ -491,9 +491,9 @@ KConfigGroup group = config.group( "Column" ); for ( int i = Col_Begin; i <= Col_End; i++ ) { if ( subjectList->columnWidth( i ) != 0 ) { - group.writeEntry( s_colAttr[ i ].keyName, TRUE ); + group.writeEntry( s_colAttr[ i ].keyName, true ); } else { - group.writeEntry( s_colAttr[ i ].keyName, FALSE ); + group.writeEntry( s_colAttr[ i ].keyName, false ); } } } @@ -520,7 +520,7 @@ QString configPath = KStandardDirs::locateLocal( "appdata", "subjectview.conf" ); KConfig config( configPath ); - return config.group( "Column" ).readEntry( "AutoResize", TRUE ); + return config.group( "Column" ).readEntry( "AutoResize", true ); } void KitaBoardView::setAutoResize( bool flag ) Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -39,7 +39,7 @@ virtual void setFocus(); void slotFocusSearchCombo(); void reloadSubject(); - void loadBoard( const KUrl& url, bool online = TRUE ); + void loadBoard( const KUrl& url, bool online = true ); void setFont( const QFont& font ); void slotUpdateSubject( const KUrl& url ); Modified: kita/branches/KITA-KDE4/kita/src/domtree.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -50,7 +50,7 @@ if ( num < m_bufSize && m_resStatus[ num ] != KITA_HTML_NOTPARSED ) { /* already parsed */ - return TRUE; + return true; } if ( num >= m_bufSize ) { @@ -60,16 +60,16 @@ m_titleElm.resize( m_bufSize ); m_bodyElm.resize( m_bufSize ); - m_resStatus.resize( m_bufSize, FALSE ); - m_coloredNum.resize( m_bufSize, FALSE ); + m_resStatus.resize( m_bufSize, false ); + m_coloredNum.resize( m_bufSize, false ); } /* cleate elements */ QString titleHTML, bodyHTML; - m_resStatus[ num ] = m_datInfo->getHTML( num, TRUE, titleHTML, bodyHTML ); + m_resStatus[ num ] = m_datInfo->getHTML( num, true, titleHTML, bodyHTML ); if ( m_resStatus[ num ] == KITA_HTML_NOTPARSED ) { - return FALSE; + return false; } m_titleElm[ num ] = m_hdoc.createElement( "DIV" ); @@ -82,7 +82,7 @@ m_bodyElm[ num ].setAttribute( "id", QString().setNum( num ) ); m_bodyElm[ num ].setInnerHTML( bodyHTML ); - return TRUE; + return true; } /* @@ -90,14 +90,14 @@ */ bool KitaDomTree::appendRes( int num ) { - if ( !createResElement( num ) ) return FALSE; + if ( !createResElement( num ) ) return false; m_hdoc.body().appendChild( m_titleElm[ num ] ); m_hdoc.body().appendChild( m_bodyElm[ num ] ); if ( num > m_bottomNum ) m_bottomNum = num; - return TRUE; + return true; } /* @@ -116,7 +116,7 @@ QString titleHTML, bodyHTML; int oldStatus = m_resStatus[ i ]; - m_resStatus[ i ] = m_datInfo->getHTML( i , TRUE, titleHTML, bodyHTML ); + m_resStatus[ i ] = m_datInfo->getHTML( i , true, titleHTML, bodyHTML ); if ( force || oldStatus != m_resStatus[ i ] ) { m_titleElm[ i ].setInnerHTML( titleHTML ); @@ -367,7 +367,7 @@ { if ( m_coloredNum[ num ] ) return ; - m_coloredNum[ num ] = TRUE; + m_coloredNum[ num ] = true; DOM::Node node = m_titleElm[ num ]; node = node.firstChild(); Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -152,7 +152,7 @@ clipboard->setText( clipText , QClipboard::Clipboard ); clipboard->setText( clipText , QClipboard::Selection ); } else if ( action == removeFromFavoritesAct ) { - ViewMediator::getInstance()->bookmark( datURL, FALSE ); + ViewMediator::getInstance()->bookmark( datURL, false ); } } @@ -173,9 +173,9 @@ Q3ValueList::const_iterator it; for ( it = boardList.begin(); it != boardList.end(); ++it ) { - bool online = TRUE; + bool online = true; Q3PtrList threadList; Q3PtrList tmpList; - Kita::BoardManager::getThreadList( ( *it ), FALSE, online, threadList, tmpList ); + Kita::BoardManager::getThreadList( ( *it ), false, online, threadList, tmpList ); } } Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -52,7 +52,7 @@ m_popup = NULL; m_domtree = NULL; m_datURL = QString::null; - m_updatedKokoyon = FALSE; + m_updatedKokoyon = false; clearPart(); createHTMLDocument(); @@ -82,7 +82,7 @@ Kita::DatManager::setViewPos( m_datURL, readNum ); } } - m_updatedKokoyon = FALSE; + m_updatedKokoyon = false; /* clear variables */ m_anchorStack.clear(); @@ -95,7 +95,7 @@ if ( m_mode == HTMLPART_MODE_MAINPART ) { /* This part is on the main thread view. */ /* tell Thread class that "thread is closed" */ - Kita::DatManager::setMainThreadOpened( m_datURL, FALSE ); + Kita::DatManager::setMainThreadOpened( m_datURL, false ); /* emit "deactivated all thread view" SIGNAL */ KUrl nullUrl(""); @@ -130,7 +130,7 @@ Kita::DatManager::createDatInfo( m_datURL ); /* tell Thread class that "thread is opend" */ - Kita::DatManager::setMainThreadOpened( m_datURL, TRUE ); + Kita::DatManager::setMainThreadOpened( m_datURL, true ); /* reset abone */ Kita::DatManager::resetAbone( m_datURL ); @@ -144,7 +144,7 @@ m_domtree = new KitaDomTree( htmlDocument(), m_datURL ); } - return TRUE; + return true; } @@ -176,8 +176,8 @@ text += style; text += ""; - setJScriptEnabled( FALSE ); - setJavaEnabled( FALSE ); + setJScriptEnabled( false ); + setJavaEnabled( false ); /* Use dummy URL here, and protocol should be "file:". If protocol is "http:", local image files are not shown @@ -232,7 +232,7 @@ QApplication::setOverrideCursor( qc ); showResponses( 1, readNum ); - updateScreen( TRUE, FALSE ); + updateScreen( true, false ); QApplication::restoreOverrideCursor(); } @@ -331,17 +331,17 @@ m_centerNum = centerNum; m_jumpNumAfterLoading = 0; - if ( m_mode != HTMLPART_MODE_MAINPART ) return FALSE; - if ( !m_domtree ) return FALSE; - if ( Kita::DatManager::getReadNum( m_datURL ) == 0 ) return FALSE; + if ( m_mode != HTMLPART_MODE_MAINPART ) return false; + if ( !m_domtree ) return false; + if ( Kita::DatManager::getReadNum( m_datURL ) == 0 ) return false; int endNum = Kita::DatManager::getReadNum( m_datURL ); showResponses( 1, endNum ); - updateScreen( TRUE , FALSE ); - gotoAnchor( QString().setNum( m_centerNum ), FALSE ); + updateScreen( true , false ); + gotoAnchor( QString().setNum( m_centerNum ), false ); view() ->setFocus(); - return TRUE; + return true; } @@ -353,14 +353,14 @@ and slotFinishLoad(). */ /* public */ bool KitaHTMLPart::reload( int jumpNum ) { - if ( !m_domtree ) return FALSE; + if ( !m_domtree ) return false; if ( m_mode != HTMLPART_MODE_MAINPART ) { /* If this is not MainPart, then open MainPart. */ ViewMediator::getInstance()->openURL( m_datURL ); - return FALSE; + return false; } - m_firstReceive = TRUE; + m_firstReceive = true; if ( m_centerNum == 0 ) m_centerNum = m_domtree->getBottomResNumber(); m_jumpNumAfterLoading = jumpNum; @@ -368,7 +368,7 @@ Kita::DatManager::updateCache( m_datURL , this ); view() ->setFocus(); - return TRUE; + return true; } @@ -392,12 +392,12 @@ /* rendering */ if ( m_firstReceive || bottom + delta < readNum ) { showResponses( bottom + 1, readNum ); - updateScreen( TRUE, FALSE ); + updateScreen( true, false ); } if ( m_firstReceive && m_centerNum < readNum ) { - gotoAnchor( QString().setNum( m_centerNum ), FALSE ); - m_firstReceive = FALSE; + gotoAnchor( QString().setNum( m_centerNum ), false ); + m_firstReceive = false; } emit receiveData(); @@ -417,11 +417,11 @@ int shownNum = m_centerNum + 5000; showResponses( bottom + 1, shownNum ); - updateScreen( TRUE, FALSE ); + updateScreen( true, false ); // m_domtree->parseAllRes(); m_centerNum = 0; - if ( m_jumpNumAfterLoading ) gotoAnchor( QString().setNum( m_jumpNumAfterLoading ), FALSE ); + if ( m_jumpNumAfterLoading ) gotoAnchor( QString().setNum( m_jumpNumAfterLoading ), false ); m_jumpNumAfterLoading = 0; emit finishReload(); @@ -438,7 +438,7 @@ /* public */ bool KitaHTMLPart::gotoAnchor( const QString& anc, bool pushPosition ) { - if ( anc == QString::null ) return FALSE; + if ( anc == QString::null ) return false; if ( !m_domtree || m_mode == HTMLPART_MODE_POPUP ) return KHTMLPart::gotoAnchor( anc ); @@ -450,7 +450,7 @@ if ( res > 1 ) { /* is target valid ? */ - if ( !Kita::DatManager::isResValid( m_datURL, res ) ) return FALSE; + if ( !Kita::DatManager::isResValid( m_datURL, res ) ) return false; ancstr = QString().setNum( res ); } @@ -464,7 +464,7 @@ GotoAnchorEvent * e = new GotoAnchorEvent( ancstr ); QApplication::postEvent( this, e ); // Qt will delete it when done - return TRUE; + return true; } @@ -476,7 +476,7 @@ if ( m_mode != HTMLPART_MODE_MAINPART ) return ; int kokoyon = Kita::DatManager::getViewPos( m_datURL ); - gotoAnchor( QString().setNum( kokoyon ), FALSE ); + gotoAnchor( QString().setNum( kokoyon ), false ); } @@ -488,7 +488,7 @@ QString anc = m_anchorStack.last(); m_anchorStack.pop_back(); - gotoAnchor( anc , FALSE ); + gotoAnchor( anc , false ); } @@ -516,7 +516,7 @@ void KitaHTMLPart::slotClickGotoFooter() { if ( !m_domtree || m_mode != HTMLPART_MODE_MAINPART ) { - gotoAnchor( "footer", FALSE ); + gotoAnchor( "footer", false ); return ; } @@ -525,10 +525,10 @@ if ( readNum != bottom ) { showResponses( bottom + 1, readNum ); - updateScreen( TRUE, TRUE ); + updateScreen( true, true ); } - gotoAnchor( "footer", FALSE ); + gotoAnchor( "footer", false ); } @@ -550,7 +550,7 @@ /* public */ bool KitaHTMLPart::findText( const QString &query, bool reverse ) { - if ( m_mode != HTMLPART_MODE_MAINPART ) return FALSE; + if ( m_mode != HTMLPART_MODE_MAINPART ) return false; QRegExp regexp( query ); regexp.setCaseSensitivity( Qt::CaseInsensitive ); @@ -590,7 +590,7 @@ DOM::Range rg( m_findNode, m_findPos, m_findNode, m_findPos + matchLen ); setSelection( rg ); - return TRUE; + return true; } } else if ( m_findNode.nodeName().string() == "table" ) { @@ -656,11 +656,11 @@ m_findNode = next; if ( m_findNode.isNull() ) { m_findNode = NULL; - return FALSE; + return false; } } - return FALSE; + return false; } @@ -677,7 +677,7 @@ void KitaHTMLPart::showPopupMenu( const KUrl& kurl ) { QString url = kurl.prettyUrl(); - bool showppm = FALSE; + bool showppm = false; QString str; @@ -699,7 +699,7 @@ if ( m_domtree && ( m_mode == HTMLPART_MODE_MAINPART ) ) { - showppm = TRUE; + showppm = true; // back if ( !m_anchorStack.empty() ) { @@ -756,7 +756,7 @@ KAction* aboneWordAct = 0; if ( hasSelection() ) { if ( showppm ) popupMenu.addSeparator(); - showppm = TRUE; + showppm = true; copyStrAct = new KAction( i18n( "Copy" ), this ); popupMenu.addAction(copyStrAct); @@ -778,7 +778,7 @@ KAction* copyLinkAct = 0; if ( url != QString::null ) { if ( showppm ) popupMenu.addSeparator(); - showppm = TRUE; + showppm = true; openBrowserAct = new KAction( i18n( "Open with Web Browser" ), this ); popupMenu.addAction( openBrowserAct ); @@ -806,7 +806,7 @@ } else if ( action == openBrowserAct ) { KRun::runUrl( kurl, "text/html", view() ); } else if ( action == homeLinkAct ) { - gotoAnchor( "header", FALSE ); + gotoAnchor( "header", false ); } else if ( action == kokoLinkAct ) { slotGotoKokoyon(); } else if ( action == endLinkAct ) { @@ -820,7 +820,7 @@ == QMessageBox::Ok ) { Kita::AboneConfig::aboneWordList().append( selectedText() ); - redrawHTMLPart( m_datURL, FALSE ); + redrawHTMLPart( m_datURL, false ); } } else { QMenu* menu = action->menu(); @@ -830,7 +830,7 @@ return; } if ( menu == markSubMenu ) { - gotoAnchor( QString().setNum( menu->actions().indexOf( action ) ), FALSE ); + gotoAnchor( QString().setNum( menu->actions().indexOf( action ) ), false ); } else if ( menu == backSubMenu ) { for ( int i = 0; i < menu->actions().indexOf( action ); i++ ) m_anchorStack.pop_back(); @@ -873,10 +873,10 @@ if ( e->url().string() != QString::null ) kurl = KUrl( Kita::BoardManager::boardURL( m_datURL ), e->url().string() ); - m_pushctrl = m_pushmidbt = m_pushrightbt = FALSE; - if ( e->qmouseEvent() ->button() & Qt::RightButton ) m_pushrightbt = TRUE; - if ( e->qmouseEvent() ->modifiers() & Qt::ControlModifier ) m_pushctrl = TRUE; - if ( e->qmouseEvent() ->button() & Qt::MidButton ) m_pushmidbt = TRUE; + m_pushctrl = m_pushmidbt = m_pushrightbt = false; + if ( e->qmouseEvent() ->button() & Qt::RightButton ) m_pushrightbt = true; + if ( e->qmouseEvent() ->modifiers() & Qt::ControlModifier ) m_pushctrl = true; + if ( e->qmouseEvent() ->button() & Qt::MidButton ) m_pushmidbt = true; if ( e->url() != NULL ) { @@ -886,14 +886,14 @@ } clickAnchor( kurl ); - m_pushctrl = m_pushmidbt = m_pushrightbt = FALSE; + m_pushctrl = m_pushmidbt = m_pushrightbt = false; return ; } /* popup menu */ if ( m_pushrightbt ) { showPopupMenu( kurl ); - m_pushctrl = m_pushmidbt = m_pushrightbt = FALSE; + m_pushctrl = m_pushmidbt = m_pushrightbt = false; return ; } @@ -1012,7 +1012,7 @@ if ( m_mode == HTMLPART_MODE_POPUP ) { ViewMediator::getInstance()->openURL( urlin ); } else { - gotoAnchor( QString().setNum( refNum ), TRUE ); + gotoAnchor( QString().setNum( refNum ), true ); } } @@ -1060,7 +1060,7 @@ // mark KAction* markAct = new KAction( i18n( "Mark" ), this ); - markAct->setCheckable( TRUE ); + markAct->setCheckable( true ); markAct->setChecked( Kita::DatManager::isMarked( m_datURL, resNum ) ); popupMenu.addAction( markAct ); @@ -1151,9 +1151,9 @@ } else if ( action == setKokoYonAct ) { Kita::DatManager::setViewPos( m_datURL, resNum ); ViewMediator::getInstance()->updateBoardView( m_datURL ); - m_updatedKokoyon = TRUE; - updateScreen( TRUE, TRUE ); - gotoAnchor( QString().setNum( resNum ), FALSE ); + m_updatedKokoyon = true; + updateScreen( true, true ); + gotoAnchor( QString().setNum( resNum ), false ); } else if ( action == showBrowserAct ) { str = Kita::DatManager::threadURL( m_datURL ) + "/" + QString().setNum( resNum ); @@ -1166,7 +1166,7 @@ == QMessageBox::Ok ) { Kita::AboneConfig::aboneNameList().append( namestr ); - redrawHTMLPart( m_datURL, FALSE ); + redrawHTMLPart( m_datURL, false ); } } } @@ -1212,7 +1212,7 @@ == QMessageBox::Ok ) { Kita::AboneConfig::aboneIDList().append( strid ); - redrawHTMLPart( m_datURL, FALSE ); + redrawHTMLPart( m_datURL, false ); } } } @@ -1264,7 +1264,7 @@ /* public */ bool KitaHTMLPart::isPopupVisible() { - if ( !m_popup ) return FALSE; + if ( !m_popup ) return false; return m_popup->isVisible(); } @@ -1274,7 +1274,7 @@ { if ( m_popup ) delete m_popup; m_popup = NULL; - m_multiPopup = FALSE; + m_multiPopup = false; } @@ -1299,7 +1299,7 @@ void KitaHTMLPart::showPopupCore( const KUrl& url, const QString& innerHTML, QPoint point ) { slotDeletePopup(); - m_multiPopup = FALSE; + m_multiPopup = false; m_popup = new Kita::ResPopup( view() , url ); @@ -1318,10 +1318,10 @@ { if ( m_popup && m_popup->isVisible() ) { - m_multiPopup = TRUE; + m_multiPopup = true; m_popup->moveMouseAbove(); } else { - m_multiPopup = FALSE; + m_multiPopup = false; } return m_multiPopup; @@ -1332,9 +1332,9 @@ bool KitaHTMLPart::isMultiPopupMode() { if ( !m_popup ) { - m_multiPopup = FALSE; + m_multiPopup = false; } else if ( m_popup->isHidden() ) { - m_multiPopup = FALSE; + m_multiPopup = false; } return m_multiPopup; @@ -1346,10 +1346,10 @@ if ( m_popup ) { m_popup->hide(); } - m_multiPopup = FALSE; + m_multiPopup = false; } -/* return TRUE if this view is under mouse. */ /* private */ +/* return true if this view is under mouse. */ /* private */ bool KitaHTMLPart::isUnderMouse( int mrgwd, int mrght ) { QPoint pos = QCursor::pos(); @@ -1361,10 +1361,10 @@ if ( ( px < cx && cx < px + wd + mrgwd ) && ( py < cy && cy < py + ht + mrght ) ) { - return TRUE; + return true; } - return FALSE; + return false; } /* private slot */ @@ -1445,7 +1445,7 @@ if ( url.left( 7 ) == "mailto:" ) return ; /* Is Kita active now ? */ - if( ViewMediator::getInstance()->isKitaActive() == FALSE ) return; + if( ViewMediator::getInstance()->isKitaActive() == false ) return; /* get reference */ QString refstr; @@ -1495,7 +1495,7 @@ if ( url.left( 6 ) == "#abone" ) { int no = url.mid( 6 ).toInt(); - QString tmpstr = Kita::DatManager::getHtml( m_datURL, no, no, FALSE ); + QString tmpstr = Kita::DatManager::getHtml( m_datURL, no, no, false ); showPopup( m_datURL, tmpstr ); return ; } @@ -1554,7 +1554,7 @@ then show res popup. */ /* private */ bool KitaHTMLPart::showSelectedDigitPopup() { - if ( !hasSelection() ) return FALSE; + if ( !hasSelection() ) return false; QString linkstr; int refNum; @@ -1567,9 +1567,9 @@ if ( innerHTML != QString::null ) { showPopup( m_datURL, innerHTML ); startMultiPopup(); - return TRUE; + return true; } } - return FALSE; + return false; } Modified: kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -55,8 +55,8 @@ if ( y >= contentsHeight() - visibleHeight() ) { emit pushDown(); /* to KitaHTMLPart in order to call slotClickTugi100 */ - return TRUE; + return true; } - return FALSE; + return false; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -111,8 +111,8 @@ /* init */ m_readNum = readNum; m_threadData.clear(); - m_firstReceive = FALSE; - m_invalidDataReceived = FALSE; + m_firstReceive = false; + m_invalidDataReceived = false; m_lastLine.clear(); /* set URL of data */ @@ -156,12 +156,12 @@ if ( m_bbstype != Board_MachiBBS && m_bbstype != Board_JBBS && m_dataSize > 0 ) { - m_firstReceive = TRUE; /* remove first char (i.e. \n). see also slotReceiveThreadData() */ + m_firstReceive = true; /* remove first char (i.e. \n). see also slotReceiveThreadData() */ job->addMetaData( "resume", QString::number( m_dataSize - 1 ) ); job->addMetaData( "AllowCompressedPage", "false" ); } - return TRUE; + return true; } void Access::slotThreadResult( KJob* job ) @@ -202,7 +202,7 @@ if ( ( m_dataSize > 0 && responseCode() != 206 ) || ( m_firstReceive && data_tmp[ 0 ] != '\n' ) || ( m_dataSize == 0 && responseCode() != 200 ) - ) m_invalidDataReceived = TRUE; + ) m_invalidDataReceived = true; if ( m_invalidDataReceived ) return ; @@ -210,7 +210,7 @@ if ( m_firstReceive ) { data_tmp = data_tmp.mid( 1 ); } - m_firstReceive = FALSE; + m_firstReceive = false; emitDatLineList( data_tmp ); } @@ -224,8 +224,8 @@ QStringList datLineList; if ( dataStream.isEmpty() ) return ; - bool endIsLF = FALSE; - if ( dataStream.at( dataStream.length() - 1 ) == '\n' ) endIsLF = TRUE; + bool endIsLF = false; + if ( dataStream.at( dataStream.length() - 1 ) == '\n' ) endIsLF = true; /* split the stream */ m_lastLine += dataStream; @@ -372,7 +372,7 @@ kgetURL.addQueryItem( "sid", Account::getSessionID() ); m_threadData.clear(); - m_invalidDataReceived = FALSE; + m_invalidDataReceived = false; KIO::SlaveConfig::self() ->setConfigData( "http", KUrl( getURL ).host(), @@ -415,7 +415,7 @@ if ( ( m_dataSize > 0 && responseCode() != 206 ) || ( m_dataSize == 0 && responseCode() != 200 ) ) { - m_invalidDataReceived = TRUE; + m_invalidDataReceived = true; } if ( m_invalidDataReceived ) return ; Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -35,7 +35,7 @@ } Account::Account() - : m_isLogged( FALSE ) + : m_isLogged( false ) {} Account::~Account() @@ -57,7 +57,7 @@ url.host(), "UserAgent", "DOLIB/1.00" ); - m_job = KIO::http_post( url, postData.toUtf8(), FALSE ); + m_job = KIO::http_post( url, postData.toUtf8(), false ); connect( m_job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), SLOT( slotReceiveData( KIO::Job*, const QByteArray& ) ) ); @@ -91,16 +91,16 @@ QRegExp regexp( "SESSION-ID=(.*)" ); if ( regexp.indexIn( str ) == -1 ) { m_sessionID = QString::null; - m_isLogged = FALSE; + m_isLogged = false; } else { QString value = regexp.cap( 1 ); QRegExp error( "^ERROR:p+$" ); if ( error.indexIn( value ) == -1 ) { - m_isLogged = TRUE; + m_isLogged = true; m_sessionID = value; } else { - m_isLogged = FALSE; + m_isLogged = false; m_sessionID = QString::null; } } Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -47,7 +47,7 @@ const QString& ext, int boardtype ) { - m_readIdx = FALSE; + m_readIdx = false; m_boardName = boardName; m_rootPath = rootPath; m_delimiter = delimiter; @@ -63,7 +63,7 @@ createKeys( keyHosts ); /* reset SETTING.TXT */ - setSettingLoaded( FALSE ); + setSettingLoaded( false ); } BoardData::~BoardData() @@ -415,7 +415,7 @@ Input: url: URL of board. - oldLogs: If TRUE, search cache and get list of pointer of old threads. + oldLogs: If true, search cache and get list of pointer of old threads. online: online or offline mode. Output: @@ -514,7 +514,7 @@ thread = Kita::Thread::getByURL( datURL ); if ( thread == NULL ) continue; - ThreadIndex::loadIndex( thread, datURL, FALSE ); + ThreadIndex::loadIndex( thread, datURL, false ); } if ( thread != NULL ) threadList.append( thread ); @@ -543,7 +543,7 @@ /* open subject.txt */ QString subjectPath = Cache::getSubjectPath( url ); QIODevice * device = KFilterDev::deviceForFile( subjectPath, "application/x-gzip" ); - if ( !device->open( QIODevice::ReadOnly ) ) return FALSE; + if ( !device->open( QIODevice::ReadOnly ) ) return false; Q3TextStream stream( device ); @@ -589,7 +589,7 @@ /* load index file */ if ( !bdata->readIdx() ) { - if ( cacheList.contains( fname ) ) ThreadIndex::loadIndex( thread, datURL, FALSE ); + if ( cacheList.contains( fname ) ) ThreadIndex::loadIndex( thread, datURL, false ); } /* update res num */ @@ -606,9 +606,9 @@ } device->close(); - bdata->setReadIdx( TRUE ); /* never read idx files again */ + bdata->setReadIdx( true ); /* never read idx files again */ - return TRUE; + return true; } /*---------------------------*/ @@ -643,7 +643,7 @@ * * "int type" is type of board. It could be "Kita::Board_Unknown". See also parseBoardURL(). * - * If "bool test" is TRUE, this function just checks if the board is enrolled (never enroll board). + * If "bool test" is true, this function just checks if the board is enrolled (never enroll board). * */ /* public */ /* static */ @@ -768,8 +768,8 @@ /* public */ /* static */ bool BoardManager::isEnrolled( const KUrl& url ) { - if ( getBoardData( url ) == NULL ) return FALSE; - return TRUE; + if ( getBoardData( url ) == NULL ) return false; + return true; } @@ -824,7 +824,7 @@ bool BoardManager::loadBBSHistory( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return FALSE; + if ( bdata == NULL ) return false; QStringList keyHosts(bdata->hostName()); @@ -843,10 +843,10 @@ bdata->createKeys( keyHosts ); file.close(); - return TRUE; + return true; } - return FALSE; + return false; } @@ -864,7 +864,7 @@ oldURL += "/"; newURL += "/"; - if ( oldURL == newURL ) return FALSE; + if ( oldURL == newURL ) return false; /* Is oldURL enrolled? */ BoardData* bdata = getBoardData( oldURL ); @@ -872,7 +872,7 @@ /* Is newURL enrolled? */ bdata = getBoardData( newURL ); - if ( bdata == NULL ) return FALSE; + if ( bdata == NULL ) return false; } @@ -908,15 +908,15 @@ bdata->createKeys( keyHosts ); /* reset BoardData */ - bdata->setReadIdx( FALSE ); - bdata->setSettingLoaded( FALSE ); + bdata->setReadIdx( false ); + bdata->setSettingLoaded( false ); /*---------------------------*/ /* move cache dir */ QDir qdir; - if ( ! qdir.exists( oldCachePath ) ) return TRUE; + if ( ! qdir.exists( oldCachePath ) ) return true; /* mkdir new server dir */ QString newCachePath = Cache::baseDir() + Cache::serverDir( bdata->basePath() ); @@ -973,5 +973,5 @@ KitaThreadInfo::replace( oldURL, newURL ); Kita::FavoriteBoards::replace( oldURL, newURL ); - return TRUE; + return true; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -49,7 +49,7 @@ class BoardData { QString m_boardName; - bool m_readIdx; /* If TRUE, idx file has been read. */ + bool m_readIdx; /* If true, idx file has been read. */ QString m_hostname; /* latest host name */ QString m_rootPath; @@ -152,7 +152,7 @@ /* BoardData */ static void clearBoardData(); static int enrollBoard( const KUrl& url, const QString& boardName, QString& oldURL, - int type = Board_Unknown, bool test = FALSE ); + int type = Board_Unknown, bool test = false ); static bool isEnrolled( const KUrl& url ); static BoardData* getBoardData( const KUrl& url ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -68,13 +68,13 @@ if ( !Kita::mkdir( cacheDir ) ) return ; initPrivate( - TRUE /* load cache */ + true /* load cache */ ); } DatInfo::~DatInfo() { - initPrivate( FALSE ); + initPrivate( false ); } @@ -82,18 +82,18 @@ /* Usually, don't call this. */ /* public */ void DatInfo::init() { - return initPrivate( TRUE ); + return initPrivate( true ); } -/* Init. If loadCache = TRUE, load data from cache. */ /* private */ +/* Init. If loadCache = true, load data from cache. */ /* private */ void DatInfo::initPrivate( bool loadCache ) { /* stop & delete dat loader */ deleteAccessJob(); /* init variables */ - m_broken = FALSE; - m_nowLoading = FALSE; + m_broken = false; + m_nowLoading = false; m_lastLine = QString::null; /* clear ResDatVec */ @@ -129,12 +129,12 @@ void DatInfo::resetResDat( RESDAT& resdat ) { resdat.num = 0; - resdat.parsed = FALSE; - resdat.broken = FALSE; + resdat.parsed = false; + resdat.broken = false; resdat.anclist.clear(); - resdat.checkAbone = FALSE; - resdat.abone = FALSE; - resdat.isResponsed = FALSE; + resdat.checkAbone = false; + resdat.abone = false; + resdat.isResponsed = false; } @@ -184,10 +184,10 @@ DatInfo emits the finishLoad signal to the parent object */ /* public */ bool DatInfo::updateCache( const QObject* parent ) { - if ( m_access == NULL ) return FALSE; - if ( m_nowLoading ) return FALSE; + if ( m_access == NULL ) return false; + if ( m_nowLoading ) return false; - m_nowLoading = TRUE; + m_nowLoading = true; connect( this, SIGNAL( receiveData() ), parent, SLOT( slotReceiveData() ) ); @@ -197,7 +197,7 @@ m_access->getupdate( m_thread->readNum() ); - return TRUE; + return true; } @@ -224,7 +224,7 @@ See also DatInfo::slotReceiveData() */ /* private */ bool DatInfo::copyOneLineToResDat( const QString& line ) { - if ( line == QString::null ) return FALSE; + if ( line == QString::null ) return false; /* update ReadNum */ const int num = m_thread->readNum() + 1; @@ -259,13 +259,13 @@ for ( int i = fromNum; i <= toNum; ++i ) { - if ( !checkAbonePrivate( i ) ) m_resDatVec[ i ].isResponsed = TRUE; + if ( !checkAbonePrivate( i ) ) m_resDatVec[ i ].isResponsed = true; } } } } - return TRUE; + return true; } @@ -279,7 +279,7 @@ /* re-try by offlaw.cgi */ if ( m_thread->readNum() == 0 && m_access2 == NULL && DatManager::is2chThread( m_datURL ) ) { if ( Account::isLogged() ) { - initPrivate( TRUE ); + initPrivate( true ); m_access2 = new OfflawAccess( m_datURL ); connect( m_access2, SIGNAL( receiveData( const QStringList& ) ), SLOT( slotReceiveData( const QStringList& ) ) ); @@ -289,7 +289,7 @@ } } /* finish loading session & emit signal to the parent object */ - m_nowLoading = FALSE; + m_nowLoading = false; emit finishLoad(); /* disconnect signals */ @@ -319,11 +319,11 @@ /* public */ bool DatInfo::deleteCache() { - if ( m_nowLoading ) return FALSE; + if ( m_nowLoading ) return false; - initPrivate( FALSE ); + initPrivate( false ); - return TRUE; + return true; } @@ -488,7 +488,7 @@ count ++; QString html; - getHTMLofOneRes( i, TRUE, html ); + getHTMLofOneRes( i, true, html ); retHTML += html; } } @@ -532,7 +532,7 @@ /* Note that this function checks Abone internally. */ /* public */ QString DatInfo::getTreeByRes( const int rootnum, int& count ) { - return getTreeByResPrivate( rootnum, FALSE, count ); + return getTreeByResPrivate( rootnum, false, count ); } /*---------------------------------------*/ @@ -548,7 +548,7 @@ /* Note that this function checks Abone internally. */ /* public */ QString DatInfo::getTreeByResReverse( const int rootnum, int& count ) { - return getTreeByResPrivate( rootnum, TRUE, count ); + return getTreeByResPrivate( rootnum, true, count ); } @@ -632,20 +632,20 @@ /* Check if No.num has anchors to No.target */ /* For exsample, if target = 4, and No.num have an anchor >>4, or >>2-6, etc., - then return TRUE. */ /* private */ + then return true. */ /* private */ bool DatInfo::checkRes( const int num, const int target ) { const int range = 20; - if ( !parseDat( num ) ) return FALSE; + if ( !parseDat( num ) ) return false; AncList& anclist = m_resDatVec[ num ].anclist; for ( AncList::iterator it = anclist.begin(); it != anclist.end(); ++it ) { if ( ( *it ).to - ( *it ).from > range ) continue; - if ( target >= ( *it ).from && target <= ( *it ).to ) return TRUE; + if ( target >= ( *it ).from && target <= ( *it ).to ) return true; } - return FALSE; + return false; } @@ -716,22 +716,22 @@ { if ( m_broken ) return m_broken; - if ( m_access == NULL ) return FALSE; + if ( m_access == NULL ) return false; int rescode = m_access->responseCode(); bool invalid = m_access->invalidDataReceived(); /* see also Access::slotReceiveThreadData() */ - if ( invalid && ( rescode == 200 || rescode == 206 ) ) return TRUE; + if ( invalid && ( rescode == 200 || rescode == 206 ) ) return true; /* maybe "Dat Ochi" */ - return FALSE; + return false; } /* public */ bool DatInfo::isResBroken( int num ) { - if ( !parseDat( num ) ) return FALSE; + if ( !parseDat( num ) ) return false; return m_resDatVec[ num ].broken; } @@ -739,11 +739,11 @@ /* ID = strid ? */ /* public */ bool DatInfo::checkID( const QString& strid, int num ) { - if ( !parseDat( num ) ) return FALSE; + if ( !parseDat( num ) ) return false; - if ( m_resDatVec[ num ].id == strid ) return TRUE; + if ( m_resDatVec[ num ].id == strid ) return true; - return FALSE; + return false; } @@ -753,27 +753,27 @@ bool checkOR /* AND or OR search */ ) { - if ( !parseDat( num ) ) return FALSE; + if ( !parseDat( num ) ) return false; QString str_text = m_resDatVec[ num ].bodyHTML; for ( QStringList::iterator it = stlist.begin(); it != stlist.end(); ++it ) { QRegExp regexp( ( *it ) ); -// regexp.setCaseSensitive( FALSE ); // TODO +// regexp.setCaseSensitive( false ); // TODO if ( checkOR ) { /* OR */ if ( str_text.indexOf( regexp, 0 ) != -1 ) { - return TRUE; + return true; } } else { /* AND */ - if ( str_text.indexOf( regexp, 0 ) == -1 ) return FALSE; + if ( str_text.indexOf( regexp, 0 ) == -1 ) return false; } } - if ( checkOR ) return FALSE; + if ( checkOR ) return false; - return TRUE; + return true; } @@ -796,7 +796,7 @@ /* private */ void DatInfo::resetAbonePrivate() { - for ( int i = 1; i < ( int ) m_resDatVec.size(); i++ ) m_resDatVec[ i ].checkAbone = FALSE; + for ( int i = 1; i < ( int ) m_resDatVec.size(); i++ ) m_resDatVec[ i ].checkAbone = false; m_aboneByID = ( ! Kita::AboneConfig::aboneIDList().empty() ); m_aboneByName = ( ! Kita::AboneConfig::aboneNameList().empty() ); @@ -817,12 +817,12 @@ /* private */ bool DatInfo::checkAbonePrivate( int num ) { - if ( !parseDat( num ) ) return FALSE; + if ( !parseDat( num ) ) return false; if ( m_resDatVec[ num ].checkAbone ) return m_resDatVec[ num ].abone; - m_resDatVec[ num ].checkAbone = TRUE; - bool checktmp = FALSE; + m_resDatVec[ num ].checkAbone = true; + bool checktmp = false; if ( m_aboneByID ) checktmp = checkAboneCore( m_resDatVec[ num ].id, Kita::AboneConfig::aboneIDList() ); @@ -848,7 +848,7 @@ for ( int i = refNum; i <= refNum2; i++ ) { if ( checkAbonePrivate( i ) ) { - checktmp = TRUE; + checktmp = true; break; } } @@ -870,12 +870,12 @@ it != strlist.end(); ++it ) { i = str.indexOf( ( *it ) ); if ( i != -1 ) { - return TRUE; + return true; } } } - return FALSE; + return false; } @@ -884,17 +884,17 @@ /* This function parses the raw data by Kita::parseResDat() */ /* private */ bool DatInfo::parseDat( int num ) { - if ( num <= 0 || m_thread->readNum() < num ) return FALSE; - if ( m_resDatVec[ num ].parsed ) return TRUE; + if ( num <= 0 || m_thread->readNum() < num ) return false; + if ( m_resDatVec[ num ].parsed ) return true; // qDebug("parseDat %d",num); QString subject = QString::null; Kita::parseResDat( m_resDatVec[ num ], subject ); if ( num == 1 && subject != QString::null ) m_thread->setThreadName( subject ); - if ( m_resDatVec[ num ].broken ) m_broken = TRUE; + if ( m_resDatVec[ num ].broken ) m_broken = true; - return TRUE; + return true; } bool DatInfo::isOpened() Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -159,7 +159,7 @@ /* HTML data */ int getHTML( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML ); - QString getHTMLString( int startnum, int endnum, bool checkAbone = TRUE ); + QString getHTMLString( int startnum, int endnum, bool checkAbone = true ); QString getHtmlByID( const QString& strid, int &count ); QString getTreeByRes( const int rootnum, int& count ); QString getTreeByResReverse( const int rootnum, int& count ); @@ -189,7 +189,7 @@ private: - void initPrivate( bool loadCache = TRUE ); + void initPrivate( bool loadCache = true ); void resetResDat( RESDAT& resdat ); void increaseResDatVec( int delta ); void deleteAccessJob(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -43,9 +43,9 @@ bool DatManager::createDatInfo( const KUrl& url ) { if ( getDatInfo( url, - FALSE /* don't check the existence of cache */ - ) == NULL ) return FALSE; - return TRUE; + false /* don't check the existence of cache */ + ) == NULL ) return false; + return true; } @@ -67,9 +67,9 @@ If cache exists, create DatInfo and return its pointer. - If checkCached == TRUE and cache does not exist, return NULL. + If checkCached == true and cache does not exist, return NULL. - If checkCached == FALSE and cache does not exist, + If checkCached == false and cache does not exist, create DatInfo and return its pointer anyway. see also DatManager::searchDatInfo() and DatManager::createDatInfo() */ /* private */ @@ -172,7 +172,7 @@ bool DatManager::updateCache( const KUrl& url , const QObject* parent ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->updateCache( parent ); } @@ -202,13 +202,13 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == NULL ) return FALSE; - if ( thread->readNum() == 0 ) return FALSE; + if ( thread == NULL ) return false; + if ( thread->readNum() == 0 ) return false; /* init DatInfo */ DatInfo * datInfo = searchDatInfo( datURL ); if ( datInfo ) { - if ( !datInfo->deleteCache() ) return FALSE; + if ( !datInfo->deleteCache() ) return false; } /* reset readNum & veiwPos */ @@ -223,7 +223,7 @@ /* delete log from "cache" */ KitaThreadInfo::removeThreadInfo( datURL.prettyUrl() ); - return TRUE; + return true; } @@ -231,7 +231,7 @@ bool DatManager::isLoadingNow( const KUrl& url ) { DatInfo * datInfo = searchDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->isLoadingNow(); } @@ -444,25 +444,25 @@ /* public */ bool DatManager::isThreadEnrolled( const KUrl& url ) { - if ( Kita::getDatURL( url ).isEmpty() ) return FALSE; + if ( Kita::getDatURL( url ).isEmpty() ) return false; - return TRUE; + return true; } /* public */ bool DatManager::is2chThread( const KUrl& url ) { - if ( BoardManager::type( url ) != Board_2ch ) return FALSE; - if ( Kita::getDatURL( url ).isEmpty() ) return FALSE; + if ( BoardManager::type( url ) != Board_2ch ) return false; + if ( Kita::getDatURL( url ).isEmpty() ) return false; QRegExp url_2ch( ".*\\.2ch\\.net" ); QRegExp url_bbspink( ".*\\.bbspink\\.com" ); if ( url_2ch.indexIn( url.host() ) != -1 - || url_bbspink.indexIn( url.host() ) != -1 ) return TRUE; + || url_bbspink.indexIn( url.host() ) != -1 ) return true; - return FALSE; + return false; } @@ -470,7 +470,7 @@ bool DatManager::isResValid( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->isResValid( num ); } @@ -480,7 +480,7 @@ bool DatManager::isBroken( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->isBroken(); } @@ -489,7 +489,7 @@ bool DatManager::isResBroken( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->isResBroken( num ); } @@ -500,7 +500,7 @@ bool DatManager::checkID( const KUrl& url, const QString& strid, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->checkID( strid, num ); } @@ -513,7 +513,7 @@ ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->checkWord( strlist, num, checkOR ); } @@ -524,7 +524,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == NULL ) return FALSE; + if ( thread == NULL ) return false; return thread->isMarked( num ); } @@ -545,7 +545,7 @@ bool DatManager::checkAbone( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->checkAbone( num ); } @@ -565,7 +565,7 @@ bool DatManager::isMainThreadOpened( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return FALSE; + if ( datInfo == NULL ) return false; return datInfo->isOpened(); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -55,7 +55,7 @@ static const QString getCacheIndexPath( const KUrl& url ); /* HTML data */ - static QString getHtml( const KUrl& url, int startnum, int endnum, bool checkAbone = TRUE ); + static QString getHtml( const KUrl& url, int startnum, int endnum, bool checkAbone = true ); static QString getHtmlByID( const KUrl& url, const QString& strid, int &count ); static QString getTreeByRes( const KUrl& url, const int rootnum, int &count ); static QString getTreeByResReverse( const KUrl& url, const int rootnum, int &count ); @@ -95,7 +95,7 @@ private: - static DatInfo* getDatInfo( const KUrl& url, bool checkCached = TRUE ); + static DatInfo* getDatInfo( const KUrl& url, bool checkCached = true ); static DatInfo* searchDatInfo( const KUrl& url ); static DatInfo* enrollDatInfo( const KUrl& url, bool checkCached ); }; Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -59,8 +59,8 @@ instance->m_list.clear(); QDomDocument document; - if ( ! document.setContent( xml, TRUE ) ) { - return FALSE; + if ( ! document.setContent( xml, true ) ) { + return false; } QDomElement root = document.documentElement(); @@ -73,7 +73,7 @@ } node = node.nextSibling(); } - return TRUE; + return true; } void FavoriteBoards::processChildNode( QDomNode& node ) Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -66,9 +66,9 @@ bool FavoriteThreads::contains( const QString& datURL ) { if ( m_threadList.contains( datURL ) ) { - return TRUE; + return true; } else { - return FALSE; + return false; } } @@ -83,8 +83,8 @@ instance->m_threadList.clear(); QDomDocument document; - if ( ! document.setContent( xml, TRUE ) ) { - return FALSE; + if ( ! document.setContent( xml, true ) ) { + return false; } QDomElement root = document.documentElement(); @@ -98,7 +98,7 @@ } node = node.nextSibling(); } - return TRUE; + return true; } void FavoriteThreads::processThreadNode( QDomNode& node ) Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -109,7 +109,7 @@ resdat.num = num; resdat.linestr = rawData; - resdat.parsed = FALSE; + resdat.parsed = false; parseResDat( resdat, subject ); createTitleHTML( resdat, titleHTML ); @@ -502,12 +502,12 @@ qdir = path; if ( !qdir.exists() ) { - if ( !qdir.mkdir( path ) ) return FALSE; + if ( !qdir.mkdir( path ) ) return false; } } } - return TRUE; + return true; } @@ -780,10 +780,10 @@ */ bool Kita::parseResDat( RESDAT& resdat, QString& subject ) { - if ( resdat.parsed ) return TRUE; + if ( resdat.parsed ) return true; - resdat.parsed = TRUE; - resdat.broken = FALSE; + resdat.parsed = true; + resdat.broken = false; resdat.anclist.clear(); /* search the staring positions of each section to split raw data. */ @@ -799,8 +799,8 @@ if ( section >= 5 ) { - resdat.broken = TRUE; - return TRUE; + resdat.broken = true; + return true; } sectionPos[ section ] = i + 2; @@ -810,8 +810,8 @@ /* broken data */ if ( section != 4 ) { - resdat.broken = TRUE; - return TRUE; + resdat.broken = true; + return true; } // qDebug("[%d] %d %d %d %d",section, sectionPos[1],sectionPos[2],sectionPos[3],sectionPos[4] ); @@ -835,7 +835,7 @@ /* subject */ subject = resdat.linestr.mid( sectionPos[ 4 ] ); - return TRUE; + return true; } @@ -976,10 +976,10 @@ const QChar *chpt = rawStr.unicode(); unsigned int length = rawStr.length(); - bool ancChain = FALSE; + bool ancChain = false; /* ancChain is chain for anchor. For examle, if anchor ">2" - appeared, ancChain is set to TRUE. Moreover, if next strings + appeared, ancChain is set to true. Moreover, if next strings are "=5", anchor for 5 is also set. Thus, we can obtain anchors for strings ">2=5" as follows: @@ -998,7 +998,7 @@ if ( chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>' ) { /* reset anchor chain */ - ancChain = FALSE; + ancChain = false; unsigned int i2 = i - startPos; if ( i > 0 && chpt[ i - 1 ] == ' ' ) i2--; /* remove space before
*/ @@ -1084,7 +1084,7 @@ linkurl = "http://foo.com", pos (= length of cdat) = 13, - and return TRUE. + and return true. */ bool Kita::parseLink( @@ -1124,7 +1124,7 @@ prefix = "tps://"; scheme = "https://"; } else { - return FALSE; + return false; } pos = prefix.length(); @@ -1133,14 +1133,14 @@ && pos < length ) { retlinkstr += cdat[ pos++ ]; } - if ( pos > length ) return FALSE; + if ( pos > length ) return false; if ( retlinkstr != QString::null ) DatToText( retlinkstr, linkstr ); linkurl = scheme + linkstr; linkstr = prefix + linkstr; - return TRUE; + return true; } @@ -1155,7 +1155,7 @@ refNum[0] = 12, refNum[1] = 20, pos (= length of cdat ) = 9, - ret = TRUE; + ret = true; */ bool Kita::parseResAnchor( @@ -1177,17 +1177,17 @@ || ( c == 0x2212 ) || ( c == 0xFF0D ) /* UTF8: 0xEFBC8D */ ) { - return TRUE; + return true; } - return FALSE; + return false; } }; - bool ret = FALSE; + bool ret = false; int i; - if ( length == 0 ) return FALSE; + if ( length == 0 ) return false; linkstr = QString::null; refNum[ 0 ] = 0; @@ -1249,7 +1249,7 @@ refNum[ hyphen ] += c - '0'; } - ret = TRUE; + ret = true; } return ret; @@ -1272,7 +1272,7 @@ if ( !parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) { i += pos - 1; - return FALSE; + return false; } /* create anchor */ @@ -1294,7 +1294,7 @@ startPos = i + pos; i = startPos - 1; - return TRUE; + return true; } @@ -1407,13 +1407,13 @@ QRegExp url_www_2ch( "http://www\\.2ch\\.net/.*" ); QRegExp url_machibbs( "http://.*\\.machi\\.to/.*" ); - if ( url.isEmpty() ) return FALSE; + if ( url.isEmpty() ) return false; if ( url_2ch.indexIn( url ) == -1 && url_bbspink.indexIn( url ) == -1 - && url_machibbs.indexIn( url ) == -1 ) return FALSE; - if ( url_www_2ch.indexIn( url ) != -1 ) return FALSE; + && url_machibbs.indexIn( url ) == -1 ) return false; + if ( url_www_2ch.indexIn( url ) != -1 ) return false; - return TRUE; + return true; } QString Kita::fontToString( const QFont& font ) Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -104,22 +104,22 @@ { Q3ValueList< int >::iterator it; for ( it = m_markList.begin(); it != m_markList.end(); ++it ) { - if ( ( *it ) == num ) return TRUE; + if ( ( *it ) == num ) return true; } - return FALSE; + return false; } /* public */ bool Thread::setMark( int num, bool newStatus ) { bool status = isMarked( num ); - if ( status == newStatus ) return FALSE; + if ( status == newStatus ) return false; if ( newStatus ) m_markList += num; else m_markList.remove( num ); - return TRUE; + return true; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -56,7 +56,7 @@ { QString indexPath = Kita::Cache::getIndexPath( url ); KConfig config( indexPath ); - return getReadNumPrivate( url, config, TRUE ); + return getReadNumPrivate( url, config, true ); } void ThreadIndex::setReadNum( const KUrl& url, int readNum ) Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -46,7 +46,7 @@ /*---------------------------------*/ - static void loadIndex( Kita::Thread* thread, const KUrl& url, bool checkCached = TRUE ); + static void loadIndex( Kita::Thread* thread, const KUrl& url, bool checkCached = true ); static void saveIndex( const Kita::Thread* thread, const KUrl& url ); private: Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -78,7 +78,7 @@ KGlobal::locale() ->insertCatalog( "kitapart" ); // accept dnd - setAcceptDrops( TRUE ); + setAcceptDrops( true ); // setup view, dock setupView(); Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -28,7 +28,7 @@ connect( nameAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) ); connect( wordAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) ); - m_changed = FALSE; + m_changed = false; } AbonePrefPage::~AbonePrefPage() @@ -36,7 +36,7 @@ void AbonePrefPage::slotTextChanged() { - m_changed = TRUE; + m_changed = true; emit changed(); } @@ -56,7 +56,7 @@ Kita::AboneConfig::setAboneWordList( wordList ); } - m_changed = FALSE; + m_changed = false; } #include "aboneprefpage.moc" Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -45,8 +45,8 @@ KitaPreferences::KitaPreferences( QWidget* parent ) : KConfigDialog( parent, "Kita Preferences", Kita::Config::self() ) { - enableButtonApply( FALSE ); - enableButton( Help, FALSE ); + enableButtonApply( false ); + enableButton( Help, false ); // this is the base class for your preferences dialog. it is now // a Treelist dialog.. but there are a number of other // possibilities (including Tab, Swallow, and just Plain) @@ -104,7 +104,7 @@ // login // write } - enableButtonApply( FALSE ); + enableButtonApply( false ); } void KitaPreferences::slotDefault() @@ -124,12 +124,12 @@ // write // debug } - enableButtonApply( TRUE ); + enableButtonApply( true ); } void KitaPreferences::slotChanged() { - enableButtonApply( TRUE ); + enableButtonApply( true ); } void KitaPreferences::slotOk() @@ -190,13 +190,13 @@ void Ui::UIPrefPage::reset() { - kcfg_AlwaysUseTab->setChecked( TRUE ); + kcfg_AlwaysUseTab->setChecked( true ); kcfg_MarkTime->setValue( 24 ); - kcfg_ShowMailAddress->setChecked( FALSE ); + kcfg_ShowMailAddress->setChecked( false ); kcfg_ShowNum->setValue( 100 ); kcfg_ListSortOrder->setButton( Kita::Config::EnumListSortOrder::Mark ); kcfg_PartMimeList->setText( "image/gif,image/jpeg,image/png,image/x-bmp" ); - kcfg_UsePart->setChecked( TRUE ); + kcfg_UsePart->setChecked( true ); } void Ui::UIPrefPage::slotEditFileAssociation() @@ -219,8 +219,8 @@ updateButtons(); - m_threadFontchanged = FALSE; - m_threadColorChanged = FALSE; + m_threadFontchanged = false; + m_threadColorChanged = false; // color threadColorButton->setColor( Kita::Config::threadColor() ); @@ -247,7 +247,7 @@ QFont threadFont = threadFontButton->font(); Kita::Config::setThreadFont( threadFont ); } - m_threadFontchanged = FALSE; + m_threadFontchanged = false; QFont popupFont = popupFontButton->font(); Kita::Config::setPopupFont( popupFont ); @@ -257,7 +257,7 @@ Kita::Config::setThreadColor( threadColorButton->color() ); Kita::Config::setThreadBackground( threadBackgroundColorButton->color() ); } - m_threadColorChanged = FALSE; + m_threadColorChanged = false; Kita::Config::setPopupColor( popupColorButton->color() ); Kita::Config::setPopupBackground( popupBackgroundColorButton->color() ); } @@ -271,7 +271,7 @@ threadFontButton->setText( Kita::fontToString( font ) ); threadFontButton->setFont( font ); - m_threadFontchanged = TRUE; + m_threadFontchanged = true; popupFontButton->setText( Kita::fontToString( font ) ); popupFontButton->setFont( font ); @@ -281,7 +281,7 @@ threadBackgroundColorButton->setColor( Qt::white ); popupColorButton->setColor( Qt::black ); popupBackgroundColorButton->setColor( Qt::yellow ); - m_threadColorChanged = TRUE; + m_threadColorChanged = true; } void Ui::FacePrefPage::updateButtons() @@ -303,11 +303,11 @@ { QFont threadFont = threadFontButton->font(); - if ( KFontDialog::getFont( threadFont, FALSE, this ) == QDialog::Accepted ) { + if ( KFontDialog::getFont( threadFont, false, this ) == QDialog::Accepted ) { threadFontButton->setText( Kita::fontToString( threadFont ) ); threadFontButton->setFont( threadFont ); emit changed(); - m_threadFontchanged = TRUE; + m_threadFontchanged = true; } } @@ -315,7 +315,7 @@ { QFont font = listFontButton->font(); - if ( KFontDialog::getFont( font, FALSE, this ) == QDialog::Accepted ) { + if ( KFontDialog::getFont( font, false, this ) == QDialog::Accepted ) { listFontButton->setText( Kita::fontToString( font ) ); listFontButton->setFont( font ); emit changed(); @@ -326,7 +326,7 @@ { QFont font = popupFontButton->font(); - if ( KFontDialog::getFont( font, FALSE, this ) == QDialog::Accepted ) { + if ( KFontDialog::getFont( font, false, this ) == QDialog::Accepted ) { popupFontButton->setText( Kita::fontToString( font ) ); popupFontButton->setFont( font ); emit changed(); @@ -335,5 +335,5 @@ void Ui::FacePrefPage::slotColorChanged() { - m_threadColorChanged = TRUE; + m_threadColorChanged = true; } Modified: kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -11,8 +11,8 @@ void Kita::WritePrefPage::DefaultSageCheckBoxToggled( bool on ) { if ( on ) { - kcfg_DefaultMail->setReadOnly( TRUE ); + kcfg_DefaultMail->setReadOnly( true ); } else { - kcfg_DefaultMail->setReadOnly( FALSE ); + kcfg_DefaultMail->setReadOnly( false ); } } Modified: kita/branches/KITA-KDE4/kita/src/respopup.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -76,8 +76,8 @@ if ( m_htmlPart ) { m_htmlPart->view() ->resize( maxwd, maxht ); - m_htmlPart->setJScriptEnabled( FALSE ); - m_htmlPart->setJavaEnabled( FALSE ); + m_htmlPart->setJScriptEnabled( false ); + m_htmlPart->setJavaEnabled( false ); m_htmlPart->begin( KUrl("file:/dummy.htm") ); m_htmlPart->write( text ); m_htmlPart->end(); Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -33,20 +33,20 @@ struct Col_Attr ThreadListView::s_colAttr[] = { // labelName, itemName, keyName, showDefault - { " ", I18N_NOOP( "Mark" ), "Col_Mark", TRUE }, - { "No.", I18N_NOOP( "ID" ), "Col_ID", TRUE }, - { " ", I18N_NOOP( "Icon" ), "Col_Icon", TRUE }, - { "Title", I18N_NOOP( "Subject" ), "Col_Subject", TRUE }, - { "ResNum", I18N_NOOP( "ResNum" ), "Col_ResNum", TRUE }, - { "ReadNum", I18N_NOOP( "ReadNum" ), "Col_ReadNum", TRUE }, - { "ViewPos", I18N_NOOP( "ViewPos" ), "Col_ViewPos", FALSE }, - { "Unread", I18N_NOOP( "Unread" ), "Col_Unread", TRUE }, - { "Since", I18N_NOOP( "Since" ), "Col_Since", TRUE }, - { "Thread's speed", I18N_NOOP( "Speed" ), "Col_Speed", TRUE }, - { "Board", I18N_NOOP( "Board" ), "Col_Board", FALSE }, - { "Dat URL", I18N_NOOP( "DatURL" ), "Col_DatURL", FALSE }, - { "Mark Order", I18N_NOOP( "MarkOrder" ), "Col_MarkOrder", FALSE }, - { "ID Order", I18N_NOOP( "IDOrder" ), "Col_IDOrder", FALSE } + { " ", I18N_NOOP( "Mark" ), "Col_Mark", true }, + { "No.", I18N_NOOP( "ID" ), "Col_ID", true }, + { " ", I18N_NOOP( "Icon" ), "Col_Icon", true }, + { "Title", I18N_NOOP( "Subject" ), "Col_Subject", true }, + { "ResNum", I18N_NOOP( "ResNum" ), "Col_ResNum", true }, + { "ReadNum", I18N_NOOP( "ReadNum" ), "Col_ReadNum", true }, + { "ViewPos", I18N_NOOP( "ViewPos" ), "Col_ViewPos", false }, + { "Unread", I18N_NOOP( "Unread" ), "Col_Unread", true }, + { "Since", I18N_NOOP( "Since" ), "Col_Since", true }, + { "Thread's speed", I18N_NOOP( "Speed" ), "Col_Speed", true }, + { "Board", I18N_NOOP( "Board" ), "Col_Board", false }, + { "Dat URL", I18N_NOOP( "DatURL" ), "Col_DatURL", false }, + { "Mark Order", I18N_NOOP( "MarkOrder" ), "Col_MarkOrder", false }, + { "ID Order", I18N_NOOP( "IDOrder" ), "Col_IDOrder", false } }; ThreadListView::ThreadListView( QWidget* parent ) @@ -61,11 +61,11 @@ for ( int i = Col_Begin; i <= Col_End; i++ ) { subjectList->addColumn( i18n( s_colAttr[ i ].labelName ) ); - if ( s_colAttr[ i ].showDefault != TRUE ) { + if ( s_colAttr[ i ].showDefault != true ) { hideColumn( i ); } } - header->setStretchEnabled( TRUE, Col_Subject ); + header->setStretchEnabled( true, Col_Subject ); connect( SearchCombo, SIGNAL( activated( int ) ), SLOT( slotSearchButton() ) ); @@ -89,7 +89,7 @@ clearSearch(); } else if ( list != m_prevquery ) { searchNew( list ); - HideButton->setDown( TRUE ); + HideButton->setDown( true ); } else { searchNext( list ); } @@ -112,7 +112,7 @@ K3ListViewItem* item = m_hitList[ m_nextHitIndex ]; subjectList->ensureItemVisible( item ); - subjectList->setSelected( item, TRUE ); + subjectList->setSelected( item, true ); m_nextHitIndex++; if ( m_nextHitIndex >= static_cast( m_hitList.size() ) ) @@ -148,7 +148,7 @@ while ( listIt.current() != 0 ) { K3ListViewItem * item = static_cast( listIt.current() ); item->setPixmap( Col_Icon, 0 ); - item->setVisible( TRUE ); + item->setVisible( true ); ++listIt; } } @@ -159,9 +159,9 @@ while ( listIt.current() != 0 ) { K3ListViewItem * item = static_cast( listIt.current() ); if ( on && ! item->pixmap( Col_Icon ) ) { - item->setVisible( FALSE ); + item->setVisible( false ); } else { - item->setVisible( TRUE ); + item->setVisible( true ); } ++listIt; } @@ -182,7 +182,7 @@ { Q3Header* header = subjectList->header(); subjectList->setColumnWidthMode( col, Q3ListView::Manual ); - header->setResizeEnabled( FALSE, col ); + header->setResizeEnabled( false, col ); subjectList->setColumnWidth( col, 0 ); } @@ -190,7 +190,7 @@ { Q3Header* header = subjectList->header(); subjectList->setColumnWidthMode( col, Q3ListView::Maximum ); - header->setResizeEnabled( TRUE, col ); + header->setResizeEnabled( true, col ); subjectList->adjustColumn( col ); } Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -65,29 +65,29 @@ layout2->setSpacing( 6 ); writeButton = new QToolButton( this ); - writeButton->setEnabled( FALSE ); + writeButton->setEnabled( false ); layout2->addWidget( writeButton ); SearchCombo = new QComboBox( this ); SearchCombo->setMinimumSize( QSize( 200, 0 ) ); - SearchCombo->setEditable( TRUE ); + SearchCombo->setEditable( true ); SearchCombo->setMaxVisibleItems( 10 ); SearchCombo->setMaxCount( 15 ); SearchCombo->setInsertPolicy( QComboBox::InsertAtTop ); - SearchCombo->setDuplicatesEnabled( FALSE ); + SearchCombo->setDuplicatesEnabled( false ); layout2->addWidget( SearchCombo ); HighLightButton = new QToolButton( this ); - HighLightButton->setCheckable( TRUE ); + HighLightButton->setCheckable( true ); layout2->addWidget( HighLightButton ); BookmarkButton = new QToolButton( this ); - BookmarkButton->setEnabled( FALSE ); - BookmarkButton->setCheckable( TRUE ); + BookmarkButton->setEnabled( false ); + BookmarkButton->setCheckable( true ); layout2->addWidget( BookmarkButton ); ReloadButton = new QToolButton( this ); - ReloadButton->setEnabled( FALSE ); + ReloadButton->setEnabled( false ); layout2->addWidget( ReloadButton ); gotoCombo = new QComboBox( this ); @@ -95,13 +95,13 @@ layout2->addWidget( gotoCombo ); deleteButton = new QToolButton( this ); - deleteButton->setEnabled( FALSE ); + deleteButton->setEnabled( false ); layout2->addWidget( deleteButton ); spacer2 = new QSpacerItem( 30, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout2->addItem( spacer2 ); closeButton = new QToolButton( this ); - closeButton->setEnabled( FALSE ); + closeButton->setEnabled( false ); layout2->addWidget( closeButton ); KitaThreadViewBaseLayout->addLayout( layout2 ); @@ -126,11 +126,11 @@ closeButton->setIcon( SmallIcon( "tab-close" ) ); } - setAcceptDrops( TRUE ); // DND Drop eneble: 2nd stage. - enable on "KitaThreadView" widget and disable on the others(child widgets of "KitaThreadView"). - threadFrame->setAcceptDrops( FALSE ); // don't treat Drop event on child. - m_threadPart->view() ->setAcceptDrops( FALSE ); // don't treat Drop event on child. + setAcceptDrops( true ); // DND Drop eneble: 2nd stage. - enable on "KitaThreadView" widget and disable on the others(child widgets of "KitaThreadView"). + threadFrame->setAcceptDrops( false ); // don't treat Drop event on child. + m_threadPart->view() ->setAcceptDrops( false ); // don't treat Drop event on child. -// m_threadPart->enableMetaRefresh( FALSE ); //disable // TODO +// m_threadPart->enableMetaRefresh( false ); //disable // TODO connect( deleteButton, SIGNAL( clicked() ), SLOT( slotDeleteButtonClicked() ) ); @@ -205,11 +205,11 @@ void KitaThreadView::updateButton() { - writeButton->setEnabled( TRUE ); - BookmarkButton->setEnabled( TRUE ); - ReloadButton->setEnabled( TRUE ); - deleteButton->setEnabled( TRUE ); - closeButton->setEnabled( TRUE ); + writeButton->setEnabled( true ); + BookmarkButton->setEnabled( true ); + ReloadButton->setEnabled( true ); + deleteButton->setEnabled( true ); + closeButton->setEnabled( true ); if ( HighLightButton->isChecked() ) { HighLightButton->toggle(); @@ -218,9 +218,9 @@ // don't emit SIGNAL( toggled() ) disconnect( BookmarkButton, SIGNAL( toggled( bool ) ), this, SLOT( slotBookmarkButtonClicked( bool ) ) ); if ( FavoriteThreads::getInstance() ->contains( m_datURL.prettyUrl() ) ) { - BookmarkButton->setChecked( TRUE ); + BookmarkButton->setChecked( true ); } else { - BookmarkButton->setChecked( FALSE ); + BookmarkButton->setChecked( false ); } connect( BookmarkButton, SIGNAL( toggled( bool ) ), SLOT( slotBookmarkButtonClicked( bool ) ) ); } @@ -314,7 +314,7 @@ m_viewmode = mode; /* reset search direction */ - m_revsearch = FALSE; + m_revsearch = false; } @@ -489,17 +489,17 @@ /* jump */ QString anc = str.mid( 1 ); - m_threadPart->gotoAnchor( anc, FALSE ); + m_threadPart->gotoAnchor( anc, false ); SearchCombo->setFocus(); return ; } - slotSearchPrivate( FALSE ); + slotSearchPrivate( false ); } /* public slot */ -void KitaThreadView::slotSearchNext() { slotSearchPrivate( FALSE ); } -void KitaThreadView::slotSearchPrev() { slotSearchPrivate( TRUE ); } +void KitaThreadView::slotSearchNext() { slotSearchPrivate( false ); } +void KitaThreadView::slotSearchPrev() { slotSearchPrivate( true ); } /* private */ void KitaThreadView::slotSearchPrivate( bool rev ) @@ -518,7 +518,7 @@ int ResNum = Kita::DatManager::getResNum( m_datURL ); for ( int i = 1; i <= ResNum; i++ ) { - if ( Kita::DatManager::checkWord( m_datURL, query, i, FALSE ) ) { + if ( Kita::DatManager::checkWord( m_datURL, query, i, false ) ) { /* if this is parent, then show all responses, and search */ if ( m_viewmode == VIEWMODE_MAINVIEW ) m_threadPart->showAll(); @@ -537,7 +537,7 @@ /* public slot */ void KitaThreadView::slotGobackAnchor() { m_threadPart->slotGobackAnchor(); } -void KitaThreadView::slotGotoHeader() { m_threadPart->gotoAnchor( "header", FALSE );} +void KitaThreadView::slotGotoHeader() { m_threadPart->gotoAnchor( "header", false );} void KitaThreadView::slotGotoFooter() { m_threadPart->slotClickGotoFooter(); } // vim:sw=2: @@ -546,14 +546,14 @@ { if ( index == gotoCombo->count() - 1 ) { // last - m_threadPart->gotoAnchor( "footer", FALSE ); + m_threadPart->gotoAnchor( "footer", false ); } else if ( index == 1 ) { // kokomade yonda - m_threadPart->gotoAnchor( "kokomade_yonda", FALSE ); + m_threadPart->gotoAnchor( "kokomade_yonda", false ); } else if ( index != 0 ) { QString numText = gotoCombo->itemText( index ); numText.truncate( numText.length() - 1 ); - m_threadPart->gotoAnchor( numText, FALSE ); + m_threadPart->gotoAnchor( numText, false ); } } Modified: kita/branches/KITA-KDE4/kita/src/viewmediator.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/viewmediator.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/viewmediator.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -94,9 +94,9 @@ { Q_ASSERT( m_mainWindow ); - if( m_mainWindow->isActiveWindow() ) return TRUE; + if( m_mainWindow->isActiveWindow() ) return true; - return FALSE; + return false; } void ViewMediator::updateBoardView( const KUrl& datURL ) Modified: kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -13,9 +13,9 @@ if ( on ) { m_mailswap = mailLine->text(); mailLine->setText( "sage" ); - mailLine->setReadOnly( TRUE ); + mailLine->setReadOnly( true ); } else { - mailLine->setReadOnly( FALSE ); + mailLine->setReadOnly( false ); mailLine->setText( m_mailswap ); } } Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -133,14 +133,14 @@ /* disable all ok buttons. */ for( int i=0; i < max ; i++ ) { view = isWriteView( widget( i ) ); - if ( view ) view->slotEnableWriting( FALSE ); + if ( view ) view->slotEnableWriting( false ); } /* show current url page. */ view = findWriteView( url ); if ( view ) { if ( currentWidget() != view ) setCurrentWidget( view ); - view->slotEnableWriting( TRUE ); + view->slotEnableWriting( true ); } } Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 01:57:23 UTC (rev 2357) @@ -94,7 +94,7 @@ /* setup labels and edit lines */ QFont font = Kita::Config::threadFont(); bodyText->setFont( font ); - bodyText->setTabChangesFocus( TRUE ); + bodyText->setTabChangesFocus( true ); boardNameLabel->setText( Kita::BoardManager::boardName( m_datURL ) ); @@ -106,7 +106,7 @@ // setup mail field & 'sage' checkbox if ( Kita::Config::defaultSage() ) { mailLine->setText( "sage" ); - sageBox->setChecked( TRUE ); + sageBox->setChecked( true ); } else { mailLine->setText( Kita::Config::defaultMail() ); } @@ -117,7 +117,7 @@ if ( host_2ch.indexIn( m_bbscgi.host() ) != -1 && Kita::Config::beMailAddress().length() > 0 && Kita::Config::beAuthCode().length() > 0 ) { - beBox->setChecked( TRUE ); + beBox->setChecked( true ); } /* setup AA */ @@ -132,8 +132,8 @@ // init thread name field. threadNameLine->setText( Kita::DatManager::threadName( m_datURL ) ); - threadNameLine->setReadOnly( TRUE ); - threadNameLine->setFrame( FALSE ); + threadNameLine->setReadOnly( true ); + threadNameLine->setFrame( false ); threadNameLine->setFocusPolicy( Qt::NoFocus ); } @@ -187,9 +187,9 @@ bool KitaWriteView::checkFields() { if ( body().length() == 0 ) { - return FALSE; + return false; } else { - return TRUE; + return true; } } @@ -376,7 +376,7 @@ str += " | " + QString().setNum( length ); lengthLabel->setText( str ); - return TRUE; + return true; } /* create posting message for 2ch */ /* private */ Modified: kita/branches/KITA-KDE4/kita/src/writeview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-05 01:30:38 UTC (rev 2356) +++ kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-05 01:57:23 UTC (rev 2357) @@ -103,9 +103,9 @@ if ( on ) { m_mailswap = mailLine->text(); mailLine->setText( "sage" ); - mailLine->setReadOnly( TRUE ); + mailLine->setReadOnly( true ); } else { - mailLine->setReadOnly( FALSE ); + mailLine->setReadOnly( false ); mailLine->setText( m_mailswap ); } } From svnnotify ¡÷ sourceforge.jp Sun Jul 5 12:19:28 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 12:19:28 +0900 Subject: [Kita-svn] [2360] change include directives Message-ID: <1246763968.537781.28557.nullmailer@users.sourceforge.jp> Revision: 2360 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2360 Author: nogu Date: 2009-07-05 12:19:28 +0900 (Sun, 05 Jul 2009) Log Message: ----------- change include directives Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/boardview.h kita/branches/KITA-KDE4/kita/src/const.h kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 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/downloadmanager.h kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.h kita/branches/KITA-KDE4/kita/src/prefs/prefs.h kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h kita/branches/KITA-KDE4/kita/src/threadview.h kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h kita/branches/KITA-KDE4/kita/src/writetabwidget.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-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,6 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ +#include "bbsview.h" + #include #include #include @@ -34,8 +36,6 @@ #include #include -#include "bbsview.h" - #include "viewmediator.h" #include "kitaui/listviewitem.h" Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITABBSVIEW_H_ -#define _KITABBSVIEW_H_ +#ifndef KITABBSVIEW_H +#define KITABBSVIEW_H #include Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITABOARDVIEW_H_ -#define _KITABOARDVIEW_H_ +#ifndef KITABOARDVIEW_H +#define KITABOARDVIEW_H #include #include "threadlistview.h" Modified: kita/branches/KITA-KDE4/kita/src/const.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/const.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/const.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -1,3 +1,6 @@ +#ifndef KITACONST_H +#define KITACONST_H + #define DEFAULT_STYLESHEET \ "body,\n" \ "body.pop {\n" \ @@ -24,3 +27,4 @@ " text-align: center;\n" \ "}\n" \ "\n" +#endif Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,6 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ +#include "htmlpart.h" + #include #include #include @@ -24,7 +26,6 @@ #include #include -#include "htmlpart.h" #include "domtree.h" #include "respopup.h" #include "viewmediator.h" Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITALISTVIEWITEM_H_ -#define _KITALISTVIEWITEM_H_ +#ifndef KITALISTVIEWITEM_H +#define KITALISTVIEWITEM_H #include Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,11 +8,12 @@ * (at your option) any later version. * ***************************************************************************/ +#include "datinfo.h" + #include #include #include -#include "datinfo.h" #include "datmanager.h" #include "access.h" #include "thread.h" Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 03:19:28 UTC (rev 2360) @@ -9,6 +9,7 @@ ***************************************************************************/ /* DatManager manages all information about thread */ +#include "datmanager.h" #include #include @@ -18,7 +19,6 @@ #include "thread.h" #include "threadinfo.h" -#include "datmanager.h" #include "datinfo.h" #include "cache.h" #include "kita_misc.h" Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,9 +8,11 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef KITADATMG_H -#define KITADATMG_H +#ifndef KITADATMANAGER_H +#define KITADATMANAGER_H +#include + #include class KUrl; Modified: kita/branches/KITA-KDE4/kita/src/libkita/downloadmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/downloadmanager.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/downloadmanager.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,7 +8,7 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef KITAFILELOADER_H -#define KITAFILELOADER_H +#ifndef KITADOWNLOADMANAGER_H +#define KITADOWNLOADMANAGER_H #endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,9 +8,14 @@ * (at your option) any later version. * **************************************************************************/ +#ifndef KITAUTF16_H +#define KITAUTF16_H + /* UTF-16 */ #define UTF16_BRACKET 0xFF1E /* > */ #define UTF16_0 0xFF10 /* 0 */ #define UTF16_9 0xFF19 /* 9 */ #define UTF16_EQ 0xFF1D /* = */ #define UTF16_COMMA 0xFF0C /* , */ + +#endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,6 +8,8 @@ * (at your option) any later version. * **************************************************************************/ +#ifndef KITAUTF8_H +#define KITAUTF8_H /* UTF-8 japanese strings */ #define KITAUTF8_ZENSPACE "¡¡" @@ -41,3 +43,4 @@ #define KITAUTF8_WRITECOOKIE "½ñ¤­¹þ¤ß³Îǧ" #define KITAUTF8_WRITECOOKIEMSG "Åê¹Æ³Îǧ\n¡¦Åê¹Æ¼Ô¤Ï¡¢Åê¹Æ¤Ë´Ø¤·¤ÆȯÀ¸¤¹¤ëÀÕǤ¤¬Á´¤ÆÅê¹Æ¼Ô¤Ëµ¢¤¹¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n¡¦Åê¹Æ¼Ô¤Ï¡¢ÏÃÂê¤È̵´Ø·¸¤Ê¹­¹ð¤ÎÅê¹Æ¤Ë´Ø¤·¤Æ¡¢Áê±þ¤ÎÈñÍѤò»Ùʧ¤¦¤³¤È¤ò¾µÂú¤·¤Þ¤¹\n¡¦Åê¹Æ¼Ô¤Ï¡¢Åê¹Æ¤µ¤ì¤¿ÆâÍƵڤӤ³¤ì¤Ë´Þ¤Þ¤ì¤ëÃÎŪºâ»º¸¢¡¢¡ÊÃøºî¸¢Ë¡Âè21¾ò¤Ê¤¤¤·Âè28¾ò¤Ëµ¬Äꤵ¤ì¤ë¸¢Íø¤â´Þ¤à¡Ë¤½¤Î¾¤Î¸¢Íø¤Ë¤Ä¤­¡ÊÂè»°¼Ô¤ËÂФ·¤ÆºÆµöÂú¤¹¤ë¸¢Íø¤ò´Þ¤ß¤Þ¤¹¡£¡Ë¡¢·Ç¼¨Èı¿±Ä¼Ô¤ËÂФ·¡¢Ìµ½þ¤Ç¾ùÅϤ¹¤ë¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£¤¿¤À¤·¡¢·Ç¼¨Èı¿±Ä¼Ô¤Ï¡¢Åê¹Æ¼Ô¤ËÂФ·¤ÆÆüËܹñÆâ³°¤Ë¤ª¤¤¤Æ̵½þ¤ÇÈóÆÈÀêŪ¤ËÊ£À½¡¢¸ø½°Á÷¿®¡¢ÈÒÉÛµÚ¤ÓËÝÌõ¤¹¤ë¸¢Íø¤òÅê¹Æ¼Ô¤ËµöÂú¤·¤Þ¤¹¡£¤Þ¤¿¡¢Åê¹Æ¼Ô¤Ï·Ç¼¨Èı¿±Ä¼Ô¤¬»ØÄꤹ¤ëÂè»°¼Ô¤ËÂФ·¤Æ¡¢°ìÀڤθ¢Íø¡ÊÂè»°¼Ô¤ËÂФ·¤ÆºÆµöÂú¤¹¤ë¸¢Íø¤ò´Þ¤ß¤Þ¤¹¡Ë¤òµöÂú¤·¤Ê¤¤¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n¡¦Åê¹Æ¼Ô¤Ï¡¢·Ç¼¨Èı¿±Ä¼Ô¤¢¤ë¤¤¤Ï¤½¤Î»ØÄꤹ¤ë¼Ô¤ËÂФ·¤Æ¡¢Ãøºî¼Ô¿Í³Ê¸¢¤ò°ìÀڹԻȤ·¤Ê¤¤¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n\nÁ´ÀÕǤ¤òÉ餦¤³¤È¤ò¾µÂú¤·¤Æ½ñ¤­¹þ¤ß¤Þ¤¹¤«\n" #define KITAUTF8_WRITENEWTHREAD "½ñ¤­¹þ¤ß¤Ë´Ø¤·¤ÆÍÍ¡¹¤Ê¥í¥°¾ðÊ󤬵­Ï¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n¸ø½øÎɯ¤ËÈ¿¤·¤¿¤ê¡¢Â¾¿Í¤ËÌÂÏǤò¤«¤±¤ë½ñ¤­¹þ¤ß¤Ï¹µ¤¨¤Æ²¼¤µ¤¤" +#endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -10,8 +10,8 @@ /* obsolete */ -#ifndef KITAPARMISC_H -#define KITAPARMISC_H +#ifndef KITAPARSEMISC_H +#define KITAPARSEMISC_H #include "kita_misc.h" Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITATHREADINFO_H_ -#define _KITATHREADINFO_H_ +#ifndef KITATHREADINFO_H +#define KITATHREADINFO_H #include Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 03:19:28 UTC (rev 2360) @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITA_H_ -#define _KITA_H_ +#ifndef KITAMAINWINDOW_H +#define KITAMAINWINDOW_H #ifdef HAVE_CONFIG_H #include @@ -95,4 +95,4 @@ void loadAboneWordList(); }; -#endif // _KITA_H_ +#endif // KITAMAINWINDOW_H Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITAPREF_H_ -#define _KITAPREF_H_ +#ifndef KITAPREFS_H +#define KITAPREFS_H #include #include @@ -143,4 +143,4 @@ }; } -#endif // _KITAPREF_H_ +#endif // KITAPREFS_H Modified: kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -7,6 +7,8 @@ ** place of a destructor. *****************************************************************************/ +#ifndef KITAWRITEPAGEUI_H +#define KITAWRITEPAGEUI_H void Kita::WritePrefPage::DefaultSageCheckBoxToggled( bool on ) { @@ -16,3 +18,5 @@ kcfg_DefaultMail->setReadOnly( false ); } } + +#endif Modified: kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITATHREADLISTVIEWITEM_H_ -#define _KITATHREADLISTVIEWITEM_H_ +#ifndef KITATHREADLISTVIEWITEM_H +#define KITATHREADLISTVIEWITEM_H #include "kitaui/listviewitem.h" Modified: kita/branches/KITA-KDE4/kita/src/threadview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITATHREADVIEW_H_ -#define _KITATHREADVIEW_H_ +#ifndef KITATHREADVIEW_H +#define KITATHREADVIEW_H #include #include Modified: kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -7,6 +7,8 @@ ** place of a destructor. *****************************************************************************/ +#ifndef KITAWRITEDIALOGBASEUI_H +#define KITAWRITEDIALOGBASEUI_H void KitaWriteDialogBase::sageBoxToggled( bool on ) { @@ -34,3 +36,4 @@ { return bodyText->text(); } +#endif Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,10 +8,11 @@ * (at your option) any later version. * ***************************************************************************/ +#include "writetabwidget.h" + #include "libkita/kita_misc.h" #include "libkita/datmanager.h" #include "libkita/boardmanager.h" -#include "writetabwidget.h" #include "writeview.h" #include Modified: kita/branches/KITA-KDE4/kita/src/writeview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-05 02:30:13 UTC (rev 2359) +++ kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-05 03:19:28 UTC (rev 2360) @@ -8,8 +8,8 @@ * (at your option) any later version. * ***************************************************************************/ -#ifndef _KITAWRITEDIALOG_H_ -#define _KITAWRITEDIALOG_H_ +#ifndef KITAWRITEVIEW_H +#define KITAWRITEVIEW_H #include #include From svnnotify ¡÷ sourceforge.jp Sun Jul 5 12:36:25 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 12:36:25 +0900 Subject: [Kita-svn] [2361] QComboBox -> KComboBox Message-ID: <1246764985.446673.17662.nullmailer@users.sourceforge.jp> Revision: 2361 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2361 Author: nogu Date: 2009-07-05 12:36:25 +0900 (Sun, 05 Jul 2009) Log Message: ----------- QComboBox -> KComboBox Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/threadview.h Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 03:19:28 UTC (rev 2360) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 03:36:25 UTC (rev 2361) @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include #include "viewmediator.h" @@ -68,7 +68,7 @@ layout10 = new QHBoxLayout( 0 ); - SearchCombo = new QComboBox( this ); + SearchCombo = new KComboBox( this ); QSizePolicy sizePolicy( static_cast(1), static_cast(4) ); sizePolicy.setHorizontalStretch( 0 ); sizePolicy.setVerticalStretch( 0 ); Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 03:19:28 UTC (rev 2360) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 03:36:25 UTC (rev 2361) @@ -16,12 +16,12 @@ #include #include +class KComboBox; class KUrl; class K3ListView; class QCp932Codec; class Q3ListViewItem; class QSpacerItem; -class QComboBox; class QVBoxLayout; class QHBoxLayout; @@ -50,7 +50,7 @@ Q3ValueList getCategoryList( const QString& html ) const; void saveOpened(); - QComboBox* SearchCombo; + KComboBox* SearchCombo; K3ListView* m_boardList; protected: Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 03:19:28 UTC (rev 2360) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 03:36:25 UTC (rev 2361) @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -68,12 +67,12 @@ writeButton->setEnabled( false ); layout2->addWidget( writeButton ); - SearchCombo = new QComboBox( this ); + SearchCombo = new KComboBox( this ); SearchCombo->setMinimumSize( QSize( 200, 0 ) ); SearchCombo->setEditable( true ); SearchCombo->setMaxVisibleItems( 10 ); SearchCombo->setMaxCount( 15 ); - SearchCombo->setInsertPolicy( QComboBox::InsertAtTop ); + SearchCombo->setInsertPolicy( KComboBox::InsertAtTop ); SearchCombo->setDuplicatesEnabled( false ); layout2->addWidget( SearchCombo ); @@ -90,7 +89,7 @@ ReloadButton->setEnabled( false ); layout2->addWidget( ReloadButton ); - gotoCombo = new QComboBox( this ); + gotoCombo = new KComboBox( this ); gotoCombo->setMinimumSize( QSize( 200, 0 ) ); layout2->addWidget( gotoCombo ); Modified: kita/branches/KITA-KDE4/kita/src/threadview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 03:19:28 UTC (rev 2360) +++ kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 03:36:25 UTC (rev 2361) @@ -18,9 +18,9 @@ class KUrl; class KitaHTMLPart; +class KComboBox; class QToolButton; class QSpacerItem; -class QComboBox; class QVBoxLayout; class QHBoxLayout; class KitaThreadTabWidget; @@ -97,11 +97,11 @@ void setSubjectLabel( const QString& boardName, const QString& threadName, const QString boardURL ); void updateButton(); QToolButton* writeButton; - QComboBox* SearchCombo; + KComboBox* SearchCombo; QToolButton* HighLightButton; QToolButton* BookmarkButton; QToolButton* ReloadButton; - QComboBox* gotoCombo; + KComboBox* gotoCombo; QToolButton* deleteButton; QToolButton* closeButton; QFrame* threadFrame; From svnnotify ¡÷ sourceforge.jp Sun Jul 5 12:51:51 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 12:51:51 +0900 Subject: [Kita-svn] [2362] install kita.desktop in ${XDG_APPS_INSTALL_DIR} Message-ID: <1246765911.525627.11400.nullmailer@users.sourceforge.jp> Revision: 2362 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2362 Author: nogu Date: 2009-07-05 12:51:51 +0900 (Sun, 05 Jul 2009) Log Message: ----------- install kita.desktop in ${XDG_APPS_INSTALL_DIR} Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt Modified: kita/branches/KITA-KDE4/kita/src/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-05 03:36:25 UTC (rev 2361) +++ kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-05 03:51:51 UTC (rev 2362) @@ -40,7 +40,7 @@ install(FILES kitaui.rc writetabwidgetui.rc boardtabwidgetui.rc threadtabwidgetui.rc DESTINATION ${DATA_INSTALL_DIR}/kita) install(FILES DESTINATION ${DATA_INSTALL_DIR}/kita/icons) -install(FILES kita.desktop DESTINATION ${APPLNK_INSTALL_DIR}/Internet) +install(FILES kita.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) kde4_install_icons(${ICON_INSTALL_DIR}) From svnnotify ¡÷ sourceforge.jp Sun Jul 5 13:37:30 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 13:37:30 +0900 Subject: [Kita-svn] [2363] replace double quotes with single quotes for efficiency Message-ID: <1246768650.869526.2439.nullmailer@users.sourceforge.jp> Revision: 2363 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2363 Author: nogu Date: 2009-07-05 13:37:30 +0900 (Sun, 05 Jul 2009) Log Message: ----------- replace double quotes with single quotes for efficiency Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/libkita/access.cpp kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp 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/threadview.cpp kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -168,10 +168,10 @@ true /* test only */ ); if ( ret == Kita::Board_enrollNew ) { - newBoards += boardName + " ( " + category.category_name + " ) " + boardURL + "\n"; + newBoards += boardName + " ( " + category.category_name + " ) " + boardURL + '\n'; } if ( ret == Kita::Board_enrollMoved ) { - oldBoards += boardName + " ( " + category.category_name + " ) " + oldURL + " -> " + boardURL + "\n"; + oldBoards += boardName + " ( " + category.category_name + " ) " + oldURL + " -> " + boardURL + '\n'; } count++; oldURLs += oldURL; @@ -184,7 +184,7 @@ /* show new board names */ if ( newBoards != QString::null && newBoards.count( "\n" ) < maxNewBoard ) { - QStringList boardList = newBoards.split( "\n" ); + QStringList boardList = newBoards.split( '\n' ); KMessageBox::informationList( this, i18n( "New boards:\n\n" ), boardList, "Kita" ); @@ -193,7 +193,7 @@ /* show moved board names */ if ( oldBoards != QString::null ) { - QStringList boardList = oldBoards.split( "\n" ); + QStringList boardList = oldBoards.split( '\n' ); KMessageBox::informationList( this, i18n( "These boards were moved:\n\n" ) + i18n( "\nPlease create the backup of those caches.\n" ), @@ -213,7 +213,7 @@ int ret; while ( ( ret = mb.exec() ) == QMessageBox::No ) { - QString str = i18n( "New boards:\n\n" ) + newBoards + "\n" + QString str = i18n( "New boards:\n\n" ) + newBoards + '\n' + i18n( "These boards were moved:\n\n" ) + oldBoards; QApplication::clipboard() ->setText( str , QClipboard::Clipboard ); QApplication::clipboard() ->setText( str , QClipboard::Selection ); @@ -274,7 +274,7 @@ stream.setCodec( "UTF-8" ); stream << "Date: " << now.toString( "yyyy/MM/dd hh:mm:ss" ) << endl; - stream << i18n( "New boards:\n\n" ) + newBoards + "\n"; + stream << i18n( "New boards:\n\n" ) + newBoards + '\n'; stream << i18n( "These boards were moved:\n\n" ) + oldBoards; stream << "----------------------------------------" << endl; logfile.close(); @@ -403,7 +403,7 @@ { Q3ValueList result; - QStringList lines = html.split( "\n" ); + QStringList lines = html.split( '\n' ); QStringList::iterator it; Kita::Category current_category; @@ -536,8 +536,8 @@ clipboard->setText( boardURL_upToDate.prettyUrl(), QClipboard::Clipboard ); clipboard->setText( boardURL_upToDate.prettyUrl(), QClipboard::Selection ); } else if ( action == copyTitleAndURLAct ) { - clipboard->setText( boardName + "\n" + boardURL_upToDate.prettyUrl(), QClipboard::Clipboard ); - clipboard->setText( boardName + "\n" + boardURL_upToDate.prettyUrl(), QClipboard::Selection ); + clipboard->setText( boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Clipboard ); + clipboard->setText( boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Selection ); } else if ( action == addToFavoritesAct ) { Kita::FavoriteBoards::append( boardURL_upToDate ); } else if ( action == removeFromFavoritesAct ) { Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -239,7 +239,7 @@ } else if ( action == openBrowserAct ) { KRun::runUrl( subjectView->boardURL(), "text/html", this ); } else if ( action == copyTitleAct ) { - QString cliptxt = Kita::BoardManager::boardName( subjectView->boardURL() ) + "\n" + subjectView->boardURL().prettyUrl(); + QString cliptxt = Kita::BoardManager::boardName( subjectView->boardURL() ) + '\n' + subjectView->boardURL().prettyUrl(); clipboard->setText( cliptxt , QClipboard::Clipboard ); clipboard->setText( cliptxt , QClipboard::Selection ); } Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -381,7 +381,7 @@ clipboard->setText( threadURL, QClipboard::Clipboard ); clipboard->setText( threadURL, QClipboard::Selection ); } else if ( action == copyTitleAndURLAct ) { - cliptxt = Kita::DatManager::threadName( datURL ) + "\n" + threadURL; + cliptxt = Kita::DatManager::threadName( datURL ) + '\n' + threadURL; clipboard->setText( cliptxt , QClipboard::Clipboard ); clipboard->setText( cliptxt , QClipboard::Selection ); } else if ( action == favoritesAct ) { Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -148,7 +148,7 @@ } else if ( action == copyURLAct ) { clipboard->setText( threadURL ); } else if ( action == copyTitleAndURLAct ) { - clipText = Kita::DatManager::threadName( datURL ) + "\n" + threadURL; + clipText = Kita::DatManager::threadName( datURL ) + '\n' + threadURL; clipboard->setText( clipText , QClipboard::Clipboard ); clipboard->setText( clipText , QClipboard::Selection ); } else if ( action == removeFromFavoritesAct ) { Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -1117,12 +1117,12 @@ return; } if ( action == resAct ) { - resstr = ">>" + QString().setNum( resNum ) + "\n"; + resstr = ">>" + QString().setNum( resNum ) + '\n'; ViewMediator::getInstance()->showWriteView( m_datURL, resstr ); } else if ( action == quoteAct ) { - resstr = ">>" + QString().setNum( resNum ) + "\n" - + "> " + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + "\n" - + "> " + Kita::DatManager::getPlainBody( m_datURL, resNum ).replace( "\n", "\n> " ) + "\n"; + resstr = ">>" + QString().setNum( resNum ) + '\n' + + "> " + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + '\n' + + "> " + Kita::DatManager::getPlainBody( m_datURL, resNum ).replace( '\n', "\n> " ) + '\n'; ViewMediator::getInstance()->showWriteView( m_datURL, resstr ); } else if ( action == markAct ) { Kita::DatManager::setMark( m_datURL, resNum, ! Kita::DatManager::isMarked( m_datURL, resNum ) ); @@ -1135,14 +1135,14 @@ } // url - if ( str != QString::null ) str += "\n"; - str += Kita::DatManager::threadURL( m_datURL ) + "/" + QString().setNum( resNum ) + "\n"; + if ( str != QString::null ) str += '\n'; + str += Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ) + '\n'; // body if ( action == copyAct ) { - str += "\n" - + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + "\n" - + Kita::DatManager::getPlainBody( m_datURL, resNum ) + "\n"; + str += '\n' + + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + '\n' + + Kita::DatManager::getPlainBody( m_datURL, resNum ) + '\n'; } // copy @@ -1157,7 +1157,7 @@ gotoAnchor( QString().setNum( resNum ), false ); } else if ( action == showBrowserAct ) { - str = Kita::DatManager::threadURL( m_datURL ) + "/" + QString().setNum( resNum ); + str = Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ); KRun::runUrl( str, "text/html", view() ); } else if ( action == aboneNameAct ) { @@ -1529,7 +1529,7 @@ /* get board name */ QString boardName = Kita::BoardManager::boardName( datURL ); - if ( boardName != QString::null ) innerHTML += "[" + boardName + "] "; + if ( boardName != QString::null ) innerHTML += '[' + boardName + "] "; /* If idx file of datURL is not read, thread name cannot be obtained. so, create DatInfo if cache exists, and read idx file in DatInfo::DatInfo(). */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -71,7 +71,7 @@ { QString tmpData = Kita::qcpToUnicode( orgData ); - QStringList tmpList = tmpData.split( "\n" ); + QStringList tmpList = tmpData.split( '\n' ); emit receiveData( tmpList ); } break; @@ -128,7 +128,7 @@ case Board_JBBS: getURL = Kita::getThreadURL( m_datURL ); getURL.replace( "read.cgi", "rawmode.cgi" ); /* adhoc... */ - if ( m_readNum > 0 ) getURL += "/" + QString().setNum( m_readNum + 1 ) + "-"; + if ( m_readNum > 0 ) getURL += '/' + QString().setNum( m_readNum + 1 ) + '-'; break; default: @@ -293,8 +293,8 @@ } /* save line */ - if ( m_bbstype == Board_MachiBBS ) m_threadData += ba + "\n"; - else m_threadData += lineList[ i ] + "\n"; + if ( m_bbstype == Board_MachiBBS ) m_threadData += ba + '\n'; + else m_threadData += lineList[ i ] + '\n'; ++m_readNum; datLineList += line2; @@ -322,7 +322,7 @@ if ( m_currentJob ) m_header = m_currentJob->queryMetaData( "HTTP-Headers" ); //if ( m_header.isEmpty() ) return QDateTime::currentDateTime().toTime_t(); // parse HTTP headers - QStringList headerList = m_header.split( "\n" ); + QStringList headerList = m_header.split( '\n' ); QRegExp regexp( "Date: (.*)" ); QStringList dateStrList = headerList.filter( regexp ); if ( dateStrList.isEmpty() || regexp.indexIn( dateStrList[0] ) == -1 ) { @@ -338,7 +338,7 @@ if ( m_currentJob ) m_header = m_currentJob->queryMetaData( "HTTP-Headers" ); //if ( m_header.isEmpty() ) return 200; // parse HTTP headers - QStringList headerList = m_header.split( "\n" ); + QStringList headerList = m_header.split( '\n' ); QRegExp regexp( "HTTP/1\\.[01] ([0-9]+) .*" ); QStringList dateStrList = headerList.filter( regexp ); if ( dateStrList.isEmpty() || regexp.indexIn( dateStrList[0] ) == -1 ) { Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -76,7 +76,7 @@ m_hostname = hostName; /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */ - m_basePath = m_hostname + m_rootPath + m_bbsPath + "/"; + m_basePath = m_hostname + m_rootPath + m_bbsPath + '/'; switch ( m_type ) { @@ -86,7 +86,7 @@ /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */ default: - m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + m_bbsPath + "/"; + m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + m_bbsPath + '/'; break; } } @@ -254,7 +254,7 @@ /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */ for ( int i = 0; i < m_keyHostList.count(); ++i ) { if ( m_keyHostList[ i ].length() > 0 ) - m_keyBasePathList += m_keyHostList[ i ] + m_rootPath + m_bbsPath + "/"; + m_keyBasePathList += m_keyHostList[ i ] + m_rootPath + m_bbsPath + '/'; } switch ( m_type ) { @@ -268,7 +268,7 @@ /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */ default: for ( int i = 0; i < m_keyHostList.count(); ++i ) - m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter + m_bbsPath + "/"; + m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter + m_bbsPath + '/'; break; } } @@ -500,7 +500,7 @@ /* get all file names */ QString ext = BoardManager::getBoardData( url ) ->ext(); QString boardURL = BoardManager::getBoardData( url ) ->basePath(); - QStringList filter("*" + ext); + QStringList filter('*' + ext); QStringList flist = d.entryList(filter); for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) { @@ -535,7 +535,7 @@ QDir d( cacheDir ); if ( d.exists() ) { QString ext = BoardManager::getBoardData( url ) ->ext(); - QStringList filter("*" + ext); + QStringList filter('*' + ext); cacheList = d.entryList( filter ); } } @@ -738,7 +738,7 @@ delimiter = "/test/read.cgi"; bbsPath = url.fileName(); - rootPath = url.prettyUrl().remove( hostname + "/" ).remove( bbsPath + "/" ); + rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' ); if ( rootPath.length() == 0 ) rootPath = QString::null; ext = ".dat"; break; @@ -747,7 +747,7 @@ delimiter = "/test/read.cgi"; bbsPath = url.fileName(); - rootPath = url.prettyUrl().remove( hostname + "/" ).remove( bbsPath + "/" ); + rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' ); if ( rootPath.length() == 0 ) rootPath = QString::null; ext = ".dat"; type = Board_2ch; @@ -758,8 +758,8 @@ const QRegExp exp( "/$" ); rootPath.remove( exp ); bbsPath.remove( exp ); - if ( rootPath != QString::null && rootPath.at( 0 ) != '/' ) rootPath = "/" + rootPath; - if ( bbsPath != QString::null && bbsPath.at( 0 ) != '/' ) bbsPath = "/" + bbsPath; + if ( rootPath != QString::null && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath; + if ( bbsPath != QString::null && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath; return type; } @@ -861,8 +861,8 @@ QString newURL = toURL.prettyUrl(); oldURL.remove( exp ); newURL.remove( exp ); - oldURL += "/"; - newURL += "/"; + oldURL += '/'; + newURL += '/'; if ( oldURL == newURL ) return false; @@ -927,7 +927,7 @@ if ( qdir.exists ( newCachePath ) ) { QString bkupPath = newCachePath; bkupPath.truncate( bkupPath.length() - 1 ); /* remove '/' */ - bkupPath += "." + QString().setNum( QDateTime::currentDateTime().toTime_t() ); + bkupPath += '.' + QString().setNum( QDateTime::currentDateTime().toTime_t() ); qdir.rename( newCachePath, bkupPath ); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -21,7 +21,7 @@ { QString dir = KGlobal::dirs() ->saveLocation( "cache", "kita" ); if ( dir[ dir.length() - 1 ] != '/' ) - dir += "/"; + dir += '/'; return dir; } @@ -35,7 +35,7 @@ QString root = bdata->hostName() + bdata->rootPath(); - return root.remove( "http://" ).replace( "/", "_" ) + "/"; + return root.remove( "http://" ).replace( '/', '_' ) + '/'; } @@ -47,7 +47,7 @@ QString bbs = bdata->bbsPath(); - return bbs.mid( 1 ).replace( "/", "_" ) + "/"; + return bbs.mid( 1 ).replace( '/', '_' ) + '/'; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -439,13 +439,13 @@ RESDAT& resdat = m_resDatVec[ num ]; if ( abone ) { - titleHTML = QString().setNum( num ) + " " + i18n( "Abone" ); + titleHTML = QString().setNum( num ) + ' ' + i18n( "Abone" ); bodyHTML = ""; bodyHTML += i18n( "Abone" ) + ""; return KITA_HTML_ABONE; } else if ( resdat.broken ) { - titleHTML = QString().setNum( num ) + " " + i18n( "Broken" ); + titleHTML = QString().setNum( num ) + ' ' + i18n( "Broken" ); bodyHTML = i18n( "Broken" ); return KITA_HTML_BROKEN; Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -316,7 +316,7 @@ const QString DatManager::threadID( const KUrl& url ) { KUrl datURL = Kita::getDatURL( url ); - return datURL.fileName().section( ".", 0, 0 ); + return datURL.fileName().section( '.', 0, 0 ); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -32,9 +32,9 @@ ( ret += "submit=" ) += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ ( ret += "&NAME=" ) += Kita::encode_string( name, mib ); ( ret += "&MAIL=" ) += Kita::encode_string( mail, mib ); - ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ).replace( ";", "%3B" ); - ( ret += "&BBS=" ) += boardID.section( "/", 1, 1 ); - ( ret += "&DIR=" ) += boardID.section( "/", 0, 0 ); + ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ).replace( ';', "%3B" ); + ( ret += "&BBS=" ) += boardID.section( '/', 1, 1 ); + ( ret += "&DIR=" ) += boardID.section( '/', 0, 0 ); ( ret += "&KEY=" ) += threadID; ( ret += "&TIME=" ) += QString::number( serverTime ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -210,11 +210,11 @@ { QString retstr = QString::null; - if ( ( pos = isEqual( cdat , ">" ) ) ) retstr = ">"; - else if ( ( pos = isEqual( cdat , "<" ) ) ) retstr = "<"; - else if ( ( pos = isEqual( cdat , " " ) ) ) retstr = " "; - else if ( ( pos = isEqual( cdat , "&" ) ) ) retstr = "&"; - else if ( ( pos = isEqual( cdat , """ ) ) ) retstr = "\""; + if ( ( pos = isEqual( cdat , ">" ) ) ) retstr = '>'; + else if ( ( pos = isEqual( cdat , "<" ) ) ) retstr = '<'; + else if ( ( pos = isEqual( cdat , " " ) ) ) retstr = ' '; + else if ( ( pos = isEqual( cdat , "&" ) ) ) retstr = '&'; + else if ( ( pos = isEqual( cdat , """ ) ) ) retstr = '"'; else if ( ( pos = isEqual( cdat , "♥" ) ) ) retstr = utf8ToUnicode( KITAUTF8_HEART ); @@ -269,7 +269,7 @@ case Kita::Board_JBBS: { QString cgipath = Kita::BoardManager::boardRoot( m_datURL ) - + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + "/"; + + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + '/'; cgipath += "new/"; @@ -304,9 +304,9 @@ case Kita::Board_JBBS: { QString cgipath = Kita::BoardManager::boardRoot( m_datURL ) - + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + "/"; + + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + '/'; - cgipath += Kita::DatManager::threadID( m_datURL ) + "/"; + cgipath += Kita::DatManager::threadID( m_datURL ) + '/'; m_bbscgi = cgipath; } @@ -421,7 +421,7 @@ if ( refBase != QString::null ) { - if ( refBase.at( 0 ) == '-' ) refstr = "1" + refBase; + if ( refBase.at( 0 ) == '-' ) refstr = '1' + refBase; else refstr = refBase; } @@ -464,7 +464,7 @@ KUrl url( datURL ); QString root = url.host(); - QStringList list = url.fileName().split( "." ); + QStringList list = url.fileName().split( '.' ); if ( list.size() != 2 ) { return QString::null; } @@ -493,12 +493,12 @@ QDir qdir( targetPath ); if ( !qdir.exists() ) { - QStringList pathList = targetPath.split( "/" ); + QStringList pathList = targetPath.split( '/' ); QString path = QString::null; for ( int i = 0; i < pathList.count(); ++i ) { - path += "/" + pathList[ i ]; + path += '/' + pathList[ i ]; qdir = path; if ( !qdir.exists() ) { @@ -575,7 +575,7 @@ QRegExp truncSpace( "\\s*$" ); QStringList::iterator it = tmp.begin(); for ( ; it != tmp.end(); ++it ) - ret_list += ( *it ).replace( truncSpace, "" ); + ret_list += ( *it ).remove( truncSpace ); return ret_list; } @@ -677,7 +677,7 @@ if ( num >= nextNum ) { if ( num != 1 ) m_machiSubject = QString::null; - ret += name + "<><>" + date + " " + time + " ID:" + id; + ret += name + "<><>" + date + ' ' + time + " ID:" + id; if ( host != QString::null ) ret += " HOST:" + host; ret += "<>" + message + "<>" + m_machiSubject; nextNum = num; @@ -1202,7 +1202,7 @@ pos++; } else if ( cdat[ pos ] == '&' && cdat[ pos + 1 ] == 'g' /* > */ && cdat[ pos + 2 ] == 't' && cdat[ pos + 3 ] == ';' ) { - linkstr += ">"; + linkstr += '>'; pos += 4; } @@ -1211,7 +1211,7 @@ /* check ',' */ if ( !pos ) { if ( cdat[ pos ] == ',' || cdat[ pos ].unicode() == UTF16_COMMA ) { - linkstr += ","; + linkstr += ','; pos ++; } } @@ -1219,7 +1219,7 @@ /* check '=' */ if ( !pos ) { if ( cdat[ pos ] == '=' || cdat[ pos ].unicode() == UTF16_EQ ) { - linkstr += "="; + linkstr += '='; pos ++; } } @@ -1335,7 +1335,7 @@ if ( showMailAddress ) { titleHTML += resdat.nameHTML; - if ( resdat.address != QString::null ) titleHTML += " [" + resdat.address + "]"; + if ( resdat.address != QString::null ) titleHTML += " [" + resdat.address + ']'; } else { /* don't show mail address */ @@ -1418,7 +1418,7 @@ QString Kita::fontToString( const QFont& font ) { - return font.family() + " " + QString::number( font.pointSize() ); + return font.family() + ' ' + QString::number( font.pointSize() ); } // copied from kurl.cpp Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -42,7 +42,7 @@ { /* remove space */ QRegExp qrx( " +$" ); - threadName.replace( qrx, "" ); + threadName.remove( qrx ); /* unescape */ threadName.replace( "<", "<" ).replace( ">", ">" ).replace( "&", "&" ); Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -406,7 +406,7 @@ /* show status bar,caption, url */ infostr = Kita::DatManager::threadName( m_datURL ) + QString( " [Total: %1 New: %2] %3 k" ).arg( resNum ).arg( resNum - viewPos ).arg( datSize / 1024 ) - + info + " " + errstr; + + info + ' ' + errstr; captionStr = Kita::DatManager::threadName( m_datURL ) + QString( " (%1)" ).arg( viewPos ); @@ -445,7 +445,7 @@ gotoCombo->addItem( Kita::utf8ToUnicode( KITAUTF8_GOTO ) ); gotoCombo->addItem( Kita::utf8ToUnicode( KITAUTF8_KOKOYON ) ); for ( int i = 1; i < Kita::DatManager::getReadNum( m_datURL ); i += 100 ) { - gotoCombo->addItem( QString().setNum( i ) + "-" ); + gotoCombo->addItem( QString().setNum( i ) + '-' ); } gotoCombo->addItem( Kita::utf8ToUnicode( KITAUTF8_SAIGO ) ); gotoCombo->adjustSize(); Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 03:51:51 UTC (rev 2362) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 04:37:30 UTC (rev 2363) @@ -189,7 +189,7 @@ if ( str == QString::null ) str = clipboard->text( QClipboard::Clipboard ); if ( str != QString::null ) { - QString msg = "\n> " + str.replace( "\n", "\n> " ) + "\n"; + QString msg = "\n> " + str.replace( '\n', "\n> " ) + '\n'; view->insertMessage( msg ); } } From svnnotify ¡÷ sourceforge.jp Sun Jul 5 13:53:11 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 13:53:11 +0900 Subject: [Kita-svn] [2364] use edit-find.png instead of find.png because KDE4 packages don' t contain find.png Message-ID: <1246769591.762849.29410.nullmailer@users.sourceforge.jp> Revision: 2364 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2364 Author: nogu Date: 2009-07-05 13:53:11 +0900 (Sun, 05 Jul 2009) Log Message: ----------- use edit-find.png instead of find.png because KDE4 packages don't contain find.png Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 04:37:30 UTC (rev 2363) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 04:53:11 UTC (rev 2364) @@ -133,7 +133,7 @@ QStringList::const_iterator queryIt = query.begin(); for ( ; queryIt != query.end(); ++queryIt ) { if ( item->text( Col_Subject ).contains( *queryIt, Qt::CaseInsensitive ) ) { - item->setPixmap( Col_Icon, SmallIcon( "find" ) ); + item->setPixmap( Col_Icon, SmallIcon( "edit-find" ) ); m_hitList.append( item ); break; } From svnnotify ¡÷ sourceforge.jp Sun Jul 5 14:22:43 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 14:22:43 +0900 Subject: [Kita-svn] [2365] use isNull() and isEmpty() instead of comparing a QString to QString::null or QString() Message-ID: <1246771363.228204.16850.nullmailer@users.sourceforge.jp> Revision: 2365 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2365 Author: nogu Date: 2009-07-05 14:22:43 +0900 (Sun, 05 Jul 2009) Log Message: ----------- use isNull() and isEmpty() instead of comparing a QString to QString::null or QString() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/libkita/access.cpp kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp kita/branches/KITA-KDE4/kita/src/writeview.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -182,7 +182,7 @@ const int maxNewBoard = 64; /* show new board names */ - if ( newBoards != QString::null && newBoards.count( "\n" ) < maxNewBoard ) { + if ( !newBoards.isNull() && newBoards.count( "\n" ) < maxNewBoard ) { QStringList boardList = newBoards.split( '\n' ); KMessageBox::informationList( this, @@ -191,7 +191,7 @@ } /* show moved board names */ - if ( oldBoards != QString::null ) { + if ( !oldBoards.isNull() ) { QStringList boardList = oldBoards.split( '\n' ); KMessageBox::informationList( this, @@ -200,8 +200,8 @@ boardList, "Kita" ); } - if ( ( newBoards != QString::null && newBoards.count( "\n" ) < maxNewBoard ) - || oldBoards != QString::null ) { + if ( ( !newBoards.isNull() && newBoards.count( "\n" ) < maxNewBoard ) + || !oldBoards.isNull() ) { QMessageBox mb( "kita", i18n( "Do you really want to update board list?" ), QMessageBox::Information, @@ -220,7 +220,7 @@ } if ( ret == QMessageBox::Cancel ) return false; - } else if ( newBoards == QString::null && oldBoards == QString::null ) { + } else if ( newBoards.isNull() && oldBoards.isNull() ) { QMessageBox::information( this, "Kita", i18n( "no new boards" ) ); return false; @@ -377,7 +377,7 @@ Kita::ListViewItem* categoryItem = new Kita::ListViewItem( m_boardList, "extboard" ); // categoryItem->setColor( m_textColor, m_baseColor ); // TODO - while ( ( str = stream.readLine() ) != QString::null ) { + while ( !( str = stream.readLine() ).isNull() ) { if ( ! str.isEmpty() ) { QStringList list = str.split( "<>" ); @@ -412,8 +412,8 @@ current_category.boardURLList.clear(); for ( it = lines.begin(); it != lines.end(); ++it ) { QString category_name = Kita::getCategory( *it ); - if ( category_name != QString::null ) { - if ( current_category.category_name != QString::null ) { + if ( !category_name.isNull() ) { + if ( !current_category.category_name.isNull() ) { result.append( current_category ); } current_category.category_name = category_name; @@ -424,7 +424,7 @@ if ( regexp.indexIn( ( *it ) ) != -1 ) { QString url = regexp.cap( 1 ); QString title = regexp.cap( 2 ); - if ( Kita::isBoardURL( url ) && current_category.category_name != QString::null ) { + if ( Kita::isBoardURL( url ) && !current_category.category_name.isNull() ) { current_category.boardNameList.append( title ); current_category.boardURLList.append( url ); } Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -439,7 +439,7 @@ /* public */ bool KitaHTMLPart::gotoAnchor( const QString& anc, bool pushPosition ) { - if ( anc == QString::null ) return false; + if ( anc.isNull() ) return false; if ( !m_domtree || m_mode == HTMLPART_MODE_POPUP ) return KHTMLPart::gotoAnchor( anc ); @@ -777,7 +777,7 @@ // copy link KAction* openBrowserAct = 0; KAction* copyLinkAct = 0; - if ( url != QString::null ) { + if ( !url.isNull() ) { if ( showppm ) popupMenu.addSeparator(); showppm = true; @@ -871,7 +871,7 @@ emit mousePressed(); /* to KitaThreadView to focus this view. */ KUrl kurl; - if ( e->url().string() != QString::null ) + if ( !e->url().string().isNull() ) kurl = KUrl( Kita::BoardManager::boardURL( m_datURL ), e->url().string() ); m_pushctrl = m_pushmidbt = m_pushrightbt = false; @@ -952,7 +952,7 @@ return ; } - if ( refstr == QString::null ) return ; + if ( refstr.isNull() ) return ; /*---------------------------*/ /* show popupmenu for #write */ @@ -1135,7 +1135,7 @@ } // url - if ( str != QString::null ) str += '\n'; + if ( !str.isNull() ) str += '\n'; str += Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ) + '\n'; // body @@ -1283,7 +1283,7 @@ void KitaHTMLPart::slotShowResPopup( QPoint point, int refNum, int refNum2 ) { QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum2 ); - if ( innerHTML == QString::null ) return ; + if ( innerHTML.isNull() ) return ; showPopupCore( m_datURL, innerHTML, point ); } @@ -1529,7 +1529,7 @@ /* get board name */ QString boardName = Kita::BoardManager::boardName( datURL ); - if ( boardName != QString::null ) innerHTML += '[' + boardName + "] "; + if ( !boardName.isNull() ) innerHTML += '[' + boardName + "] "; /* If idx file of datURL is not read, thread name cannot be obtained. so, create DatInfo if cache exists, and read idx file in DatInfo::DatInfo(). */ @@ -1537,7 +1537,7 @@ /* get thread Name */ QString subName = Kita::DatManager::threadName( datURL ); - if ( subName != QString::null ) innerHTML += subName + "

"; + if ( !subName.isNull() ) innerHTML += subName + "

"; if ( !refNum ) refNum = refNum2 = 1; } @@ -1546,7 +1546,7 @@ if ( !refNum ) return ; innerHTML += Kita::DatManager::getHtml( datURL, refNum, refNum2 ); - if ( innerHTML != QString::null ) showPopup( datURL, innerHTML ); + if ( !innerHTML.isNull() ) showPopup( datURL, innerHTML ); } @@ -1565,7 +1565,7 @@ if ( ( refNum = Kita::stringToPositiveNum( chpt, length ) ) != -1 ) { QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum ); - if ( innerHTML != QString::null ) { + if ( !innerHTML.isNull() ) { showPopup( m_datURL, innerHTML ); startMultiPopup(); return true; Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -49,7 +49,7 @@ // get cache path. QString cachePath = Kita::Cache::getPath( m_datURL ); - if ( cachePath == QString::null ) { + if ( cachePath.isNull() ) { return; } @@ -93,7 +93,7 @@ m_dataSize += m_threadData.length(); QString cachePath = Kita::Cache::getPath( m_datURL ); - if ( cachePath != QString::null ) { + if ( !cachePath.isNull() ) { FILE * fs = fopen( QFile::encodeName( cachePath ), "a" ); if ( !fs ) return ; @@ -282,7 +282,7 @@ ba = lineList[i]; } - if ( line2 == QString::null ) continue; + if ( line2.isNull() ) continue; /* add abone lines */ const char aboneStr[] = "abone<><><>abone<>"; Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -504,7 +504,7 @@ QStringList flist = d.entryList(filter); for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) { - if ( ( *it ) == QString::null ) continue; + if ( ( *it ).isNull() ) continue; QString datURL = boardURL + "dat/" + ( *it ); @@ -569,7 +569,7 @@ } QString line; - while ( ( line = stream.readLine() ) != QString::null ) { + while ( !( line = stream.readLine() ).isNull() ) { int pos = regexp.indexIn( line ); if ( pos != -1 ) { QString fname = regexp.cap( 1 ); @@ -758,8 +758,8 @@ const QRegExp exp( "/$" ); rootPath.remove( exp ); bbsPath.remove( exp ); - if ( rootPath != QString::null && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath; - if ( bbsPath != QString::null && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath; + if ( !rootPath.isNull() && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath; + if ( !bbsPath.isNull() && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath; return type; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -54,7 +54,7 @@ QString Cache::getPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path == QString::null ) return QString::null; + if ( path.isNull() ) return QString::null; // qDebug( "%s -> %s",url.prettyUrl().ascii(),path.ascii()); @@ -64,7 +64,7 @@ QString Cache::getIndexPath( const KUrl& url ) { QString path = getPath( url ); - if ( path == QString::null ) { + if ( path.isNull() ) { return QString::null; } else { return path + ".idx"; @@ -80,7 +80,7 @@ QString Cache::getSettingPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path == QString::null ) return QString::null; + if ( path.isNull() ) return QString::null; return path + "SETTING.TXT"; } @@ -89,7 +89,7 @@ QString Cache::getBBSHistoryPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path == QString::null ) return QString::null; + if ( path.isNull() ) return QString::null; return path + "BBSHISTORY"; } @@ -98,7 +98,7 @@ QString Cache::getSubjectPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path == QString::null ) return QString::null; + if ( path.isNull() ) return QString::null; return path + "subject.txt"; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -225,7 +225,7 @@ See also DatInfo::slotReceiveData() */ /* private */ bool DatInfo::copyOneLineToResDat( const QString& line ) { - if ( line == QString::null ) return false; + if ( line.isNull() ) return false; /* update ReadNum */ const int num = m_thread->readNum() + 1; @@ -892,7 +892,7 @@ QString subject = QString::null; Kita::parseResDat( m_resDatVec[ num ], subject ); - if ( num == 1 && subject != QString::null ) m_thread->setThreadName( subject ); + if ( num == 1 && !subject.isNull() ) m_thread->setThreadName( subject ); if ( m_resDatVec[ num ].broken ) m_broken = true; return true; Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -179,7 +179,7 @@ QString tmpstr; tmpstr = parseSpecialChar( chpt + i, pos ); - if ( tmpstr != QString::null ) { + if ( !tmpstr.isNull() ) { text += rawData.mid( startPos, i - startPos ) + tmpstr; startPos = i + pos; i = startPos - 1; @@ -417,9 +417,9 @@ } } - if ( thread == QString::null ) return QString::null; + if ( thread.isNull() ) return QString::null; - if ( refBase != QString::null ) { + if ( !refBase.isNull() ) { if ( refBase.at( 0 ) == '-' ) refstr = '1' + refBase; else refstr = refBase; @@ -678,7 +678,7 @@ if ( num != 1 ) m_machiSubject = QString::null; ret += name + "<><>" + date + ' ' + time + " ID:" + id; - if ( host != QString::null ) ret += " HOST:" + host; + if ( !host.isNull() ) ret += " HOST:" + host; ret += "<>" + message + "<>" + m_machiSubject; nextNum = num; } @@ -746,7 +746,7 @@ name.remove( rex ); ret += name + "<>" + mail + "<>" + date + " ID:" + id; - if ( host != QString::null ) ret += " HOST:" + host; + if ( !host.isNull() ) ret += " HOST:" + host; ret += "<>" + body + "<>" + subject; return ret; @@ -1135,7 +1135,7 @@ } if ( pos > length ) return false; - if ( retlinkstr != QString::null ) DatToText( retlinkstr, linkstr ); + if ( !retlinkstr.isNull() ) DatToText( retlinkstr, linkstr ); linkurl = scheme + linkstr; linkstr = prefix + linkstr; @@ -1313,7 +1313,7 @@ bool showMailAddress = Kita::Config::showMailAddress(); bool useTableTag = Kita::Config::useStyleSheet(); - if ( m_colonstr == QString::null ) { + if ( m_colonstr.isNull() ) { m_colonstr = utf8ToUnicode( KITAUTF8_COLON ); m_colonnamestr = utf8ToUnicode( KITAUTF8_NAME ); } @@ -1335,11 +1335,11 @@ if ( showMailAddress ) { titleHTML += resdat.nameHTML; - if ( resdat.address != QString::null ) titleHTML += " [" + resdat.address + ']'; + if ( !resdat.address.isNull() ) titleHTML += " [" + resdat.address + ']'; } else { /* don't show mail address */ - if ( resdat.address == QString::null ) { + if ( resdat.address.isNull() ) { titleHTML += ""; titleHTML += resdat.name; @@ -1362,7 +1362,7 @@ if ( useTableTag ) titleHTML += ""; /* ID */ - if ( resdat.id != QString::null ) { + if ( !resdat.id.isNull() ) { if ( useTableTag ) titleHTML += ""; if ( resdat.id.count( "???" ) >= 1 ) titleHTML += " ID:" + resdat.id; @@ -1371,7 +1371,7 @@ } /* BE */ - if ( resdat.be != QString::null ) { + if ( !resdat.be.isNull() ) { if ( useTableTag ) titleHTML += ""; titleHTML += " ?" + resdat.bepointmark + ""; @@ -1379,7 +1379,7 @@ } /* host */ - if ( resdat.host != QString::null ) { + if ( !resdat.host.isNull() ) { if ( useTableTag ) titleHTML += ""; titleHTML += " HOST:" + resdat.host; Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -104,12 +104,12 @@ /* load thread name */ QString subject = getSubjectPrivate( config ); - if ( subject == QString::null && thread->threadName() != QString::null ) { + if ( subject.isNull() && !thread->threadName().isNull() ) { subject = thread->threadName(); KConfigGroup group = config.group(""); group.writeEntry( "Subject", subject ); } - if ( subject == QString::null ) thread->setThreadName( "?" ); + if ( subject.isNull() ) thread->setThreadName( "?" ); else thread->setThreadName( subject ); /* load res number */ Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -469,7 +469,7 @@ QStringList list; QString str; - while ( ( str = stream.readLine() ) != QString::null ) { + while ( !( str = stream.readLine() ).isNull() ) { if ( ! str.isEmpty() ) { list << str; } @@ -489,7 +489,7 @@ QStringList list; QString str; - while ( ( str = stream.readLine() ) != QString::null ) { + while ( !( str = stream.readLine() ).isNull() ) { if ( ! str.isEmpty() ) { list << str; } @@ -509,7 +509,7 @@ QStringList list; QString str; - while ( ( str = stream.readLine() ) != QString::null ) { + while ( !( str = stream.readLine() ).isNull() ) { if ( ! str.isEmpty() ) { list << str; } @@ -529,7 +529,7 @@ QStringList list; QString str; - while ( ( str = stream.readLine() ) != QString::null ) { + while ( !( str = stream.readLine() ).isNull() ) { if ( ! str.isEmpty() ) { list << str; } Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -63,7 +63,7 @@ KitaThreadView* currentView = isThreadView( currentWidget() ); if ( currentView ) viewMode = currentView->getViewMode(); - if ( refstr != QString::null ) { + if ( !refstr.isNull() ) { int i = refstr.indexOf( "-" ); if ( i != -1 ) jumpNum = refstr.left( i ).toInt(); else jumpNum = refstr.toInt(); Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -507,8 +507,8 @@ /* jump */ QString str = SearchCombo->currentText(); - if ( str == QString::null ) return ; - if ( str == "" ) return ; + if ( str.isNull() ) return ; + if ( str.isEmpty() ) return ; if ( str.at( 0 ) == ':' ) return ; if ( str.at( 0 ) == '?' ) return ; Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -186,8 +186,8 @@ if ( view ) { QClipboard * clipboard = QApplication::clipboard(); QString str = clipboard->text( QClipboard::Selection ); - if ( str == QString::null ) str = clipboard->text( QClipboard::Clipboard ); - if ( str != QString::null ) { + if ( str.isNull() ) str = clipboard->text( QClipboard::Clipboard ); + if ( !str.isNull() ) { QString msg = "\n> " + str.replace( '\n', "\n> " ) + '\n'; view->insertMessage( msg ); Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 04:53:11 UTC (rev 2364) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 05:22:43 UTC (rev 2365) @@ -485,7 +485,7 @@ } else { /* get code from title */ QString title = resultTitle( response ); - if ( title == QString::null ) return K2ch_Unknown; + if ( title.isNull() ) return K2ch_Unknown; if ( title.contains( errstr ) ) return K2ch_Error; if ( title.contains( truestr ) ) return K2ch_True; From svnnotify ¡÷ sourceforge.jp Sun Jul 5 16:05:20 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 16:05:20 +0900 Subject: [Kita-svn] [2366] - use QString::isEmpty() instead of QString::isNull() Message-ID: <1246777520.640978.1076.nullmailer@users.sourceforge.jp> Revision: 2366 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2366 Author: nogu Date: 2009-07-05 16:05:20 +0900 (Sun, 05 Jul 2009) Log Message: ----------- - use QString::isEmpty() instead of QString::isNull() - use QString() instead of QString::null - don't return reference to temporary Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 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/boardmanager.cpp kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 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/favoritethreads.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/threadview.h kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp kita/branches/KITA-KDE4/kita/src/writetabwidget.h kita/branches/KITA-KDE4/kita/src/writeview.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -150,8 +150,8 @@ Q3ValueList::iterator it; /* Are there new boards or moved boards ? */ - QString newBoards = QString::null; - QString oldBoards = QString::null; + QString newBoards; + QString oldBoards; for ( it = categoryList.begin(); it != categoryList.end(); ++it ) { Kita::Category category = ( *it ); Q3ValueList board_url_list = category.boardURLList; @@ -182,7 +182,7 @@ const int maxNewBoard = 64; /* show new board names */ - if ( !newBoards.isNull() && newBoards.count( "\n" ) < maxNewBoard ) { + if ( !newBoards.isEmpty() && newBoards.count( "\n" ) < maxNewBoard ) { QStringList boardList = newBoards.split( '\n' ); KMessageBox::informationList( this, @@ -191,7 +191,7 @@ } /* show moved board names */ - if ( !oldBoards.isNull() ) { + if ( !oldBoards.isEmpty() ) { QStringList boardList = oldBoards.split( '\n' ); KMessageBox::informationList( this, @@ -200,8 +200,8 @@ boardList, "Kita" ); } - if ( ( !newBoards.isNull() && newBoards.count( "\n" ) < maxNewBoard ) - || !oldBoards.isNull() ) { + if ( ( !newBoards.isEmpty() && newBoards.count( "\n" ) < maxNewBoard ) + || !oldBoards.isEmpty() ) { QMessageBox mb( "kita", i18n( "Do you really want to update board list?" ), QMessageBox::Information, @@ -220,7 +220,7 @@ } if ( ret == QMessageBox::Cancel ) return false; - } else if ( newBoards.isNull() && oldBoards.isNull() ) { + } else if ( newBoards.isEmpty() && oldBoards.isEmpty() ) { QMessageBox::information( this, "Kita", i18n( "no new boards" ) ); return false; @@ -377,7 +377,7 @@ Kita::ListViewItem* categoryItem = new Kita::ListViewItem( m_boardList, "extboard" ); // categoryItem->setColor( m_textColor, m_baseColor ); // TODO - while ( !( str = stream.readLine() ).isNull() ) { + while ( !( str = stream.readLine() ).isEmpty() ) { if ( ! str.isEmpty() ) { QStringList list = str.split( "<>" ); @@ -407,13 +407,13 @@ QStringList::iterator it; Kita::Category current_category; - current_category.category_name = QString::null; + current_category.category_name.clear(); current_category.boardNameList.clear(); current_category.boardURLList.clear(); for ( it = lines.begin(); it != lines.end(); ++it ) { QString category_name = Kita::getCategory( *it ); - if ( !category_name.isNull() ) { - if ( !current_category.category_name.isNull() ) { + if ( !category_name.isEmpty() ) { + if ( !current_category.category_name.isEmpty() ) { result.append( current_category ); } current_category.category_name = category_name; @@ -424,7 +424,7 @@ if ( regexp.indexIn( ( *it ) ) != -1 ) { QString url = regexp.cap( 1 ); QString title = regexp.cap( 2 ); - if ( Kita::isBoardURL( url ) && !current_category.category_name.isNull() ) { + if ( Kita::isBoardURL( url ) && !current_category.category_name.isEmpty() ) { current_category.boardNameList.append( title ); current_category.boardURLList.append( url ); } Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -52,7 +52,7 @@ m_mode = HTMLPART_MODE_MAINPART; m_popup = NULL; m_domtree = NULL; - m_datURL = QString::null; + m_datURL.clear(); m_updatedKokoyon = false; clearPart(); @@ -106,7 +106,7 @@ } } - m_datURL = QString::null; + m_datURL.clear(); m_mode = HTMLPART_MODE_MAINPART; } @@ -439,7 +439,7 @@ /* public */ bool KitaHTMLPart::gotoAnchor( const QString& anc, bool pushPosition ) { - if ( anc.isNull() ) return false; + if ( anc.isEmpty() ) return false; if ( !m_domtree || m_mode == HTMLPART_MODE_POPUP ) return KHTMLPart::gotoAnchor( anc ); @@ -508,7 +508,7 @@ DOM::Node node; node = nodeUnderMouse(); while ( node != NULL && node.nodeName().string() != "div" ) node = node.parentNode(); - if ( node == NULL ) return QString::null; + if ( node == NULL ) return QString(); return static_cast( node ).getAttribute( "id" ).string(); } @@ -777,7 +777,7 @@ // copy link KAction* openBrowserAct = 0; KAction* copyLinkAct = 0; - if ( !url.isNull() ) { + if ( !url.isEmpty() ) { if ( showppm ) popupMenu.addSeparator(); showppm = true; @@ -871,7 +871,7 @@ emit mousePressed(); /* to KitaThreadView to focus this view. */ KUrl kurl; - if ( !e->url().string().isNull() ) + if ( !e->url().string().isEmpty() ) kurl = KUrl( Kita::BoardManager::boardURL( m_datURL ), e->url().string() ); m_pushctrl = m_pushmidbt = m_pushrightbt = false; @@ -952,7 +952,7 @@ return ; } - if ( refstr.isNull() ) return ; + if ( refstr.isEmpty() ) return ; /*---------------------------*/ /* show popupmenu for #write */ @@ -1127,7 +1127,7 @@ } else if ( action == markAct ) { Kita::DatManager::setMark( m_datURL, resNum, ! Kita::DatManager::isMarked( m_datURL, resNum ) ); } else if ( action == copyAct || action == copyUrlAct || action == copyThreadNameAct ) { - str = QString::null; + str.clear(); // title if ( action == copyThreadNameAct || action == copyAct ) { @@ -1135,7 +1135,7 @@ } // url - if ( !str.isNull() ) str += '\n'; + if ( !str.isEmpty() ) str += '\n'; str += Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ) + '\n'; // body @@ -1283,7 +1283,7 @@ void KitaHTMLPart::slotShowResPopup( QPoint point, int refNum, int refNum2 ) { QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum2 ); - if ( innerHTML.isNull() ) return ; + if ( innerHTML.isEmpty() ) return ; showPopupCore( m_datURL, innerHTML, point ); } @@ -1504,7 +1504,7 @@ /*-------------------------*/ /* popup for anchor */ - QString innerHTML = QString::null; + QString innerHTML; int refNum; int refNum2; @@ -1529,7 +1529,7 @@ /* get board name */ QString boardName = Kita::BoardManager::boardName( datURL ); - if ( !boardName.isNull() ) innerHTML += '[' + boardName + "] "; + if ( !boardName.isEmpty() ) innerHTML += '[' + boardName + "] "; /* If idx file of datURL is not read, thread name cannot be obtained. so, create DatInfo if cache exists, and read idx file in DatInfo::DatInfo(). */ @@ -1537,7 +1537,7 @@ /* get thread Name */ QString subName = Kita::DatManager::threadName( datURL ); - if ( !subName.isNull() ) innerHTML += subName + "

"; + if ( !subName.isEmpty() ) innerHTML += subName + "

"; if ( !refNum ) refNum = refNum2 = 1; } @@ -1546,7 +1546,7 @@ if ( !refNum ) return ; innerHTML += Kita::DatManager::getHtml( datURL, refNum, refNum2 ); - if ( !innerHTML.isNull() ) showPopup( datURL, innerHTML ); + if ( !innerHTML.isEmpty() ) showPopup( datURL, innerHTML ); } @@ -1565,7 +1565,7 @@ if ( ( refNum = Kita::stringToPositiveNum( chpt, length ) ) != -1 ) { QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum ); - if ( !innerHTML.isNull() ) { + if ( !innerHTML.isEmpty() ) { showPopup( m_datURL, innerHTML ); startMultiPopup(); return true; Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-05 07:05:20 UTC (rev 2366) @@ -23,20 +23,20 @@ public: ListViewItem( Q3ListView *parent, Q3ListViewItem *after, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null ); + QString, QString = QString(), + QString = QString(), QString = QString(), + QString = QString(), QString = QString(), + QString = QString(), QString = QString() ); ListViewItem( Q3ListViewItem *parent, Q3ListViewItem *after, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null ); + QString, QString = QString(), + QString = QString(), QString = QString(), + QString = QString(), QString = QString(), + QString = QString(), QString = QString() ); - explicit ListViewItem( Q3ListView* parent, QString = QString::null, QString = QString::null ); + explicit ListViewItem( Q3ListView* parent, QString = QString(), QString = QString() ); - explicit ListViewItem( Q3ListViewItem* parent, QString = QString::null, QString = QString::null ); + explicit ListViewItem( Q3ListViewItem* parent, QString = QString(), QString = QString() ); ~ListViewItem(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -49,7 +49,7 @@ // get cache path. QString cachePath = Kita::Cache::getPath( m_datURL ); - if ( cachePath.isNull() ) { + if ( cachePath.isEmpty() ) { return; } @@ -93,7 +93,7 @@ m_dataSize += m_threadData.length(); QString cachePath = Kita::Cache::getPath( m_datURL ); - if ( !cachePath.isNull() ) { + if ( !cachePath.isEmpty() ) { FILE * fs = fopen( QFile::encodeName( cachePath ), "a" ); if ( !fs ) return ; @@ -282,7 +282,7 @@ ba = lineList[i]; } - if ( line2.isNull() ) continue; + if ( line2.isEmpty() ) continue; /* add abone lines */ const char aboneStr[] = "abone<><><>abone<>"; @@ -389,7 +389,7 @@ // use 'HTTP-Headers' metadata. job->addMetaData( "PropagateHttpHeader", "true" ); - return QString::null; /* dummy */ + return QString(); /* dummy */ } void OfflawAccess::slotThreadResult( KIO::Job* job ) Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -90,7 +90,7 @@ QString str( m_data ); QRegExp regexp( "SESSION-ID=(.*)" ); if ( regexp.indexIn( str ) == -1 ) { - m_sessionID = QString::null; + m_sessionID.clear(); m_isLogged = false; } else { QString value = regexp.cap( 1 ); @@ -101,7 +101,7 @@ m_sessionID = value; } else { m_isLogged = false; - m_sessionID = QString::null; + m_sessionID.clear(); } } m_eventLoop.exit(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -206,10 +206,10 @@ { m_settingLoaded = set; if ( ! set ) { - m_defaultName = QString::null; + m_defaultName.clear(); m_linenum = 0; m_msgCount = 0; - m_titleImgURL = QString::null; + m_titleImgURL.clear(); } } @@ -322,7 +322,7 @@ const QString BoardManager::boardURL( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); return bdata->basePath(); } @@ -343,7 +343,7 @@ const QString BoardManager::boardRoot( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); return bdata->hostName() + bdata->rootPath(); } @@ -352,7 +352,7 @@ const QString BoardManager::boardPath( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); return bdata->bbsPath(); } @@ -361,7 +361,7 @@ const QString BoardManager::ext( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); return bdata->ext(); } @@ -370,7 +370,7 @@ const QString BoardManager::boardID( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); return bdata->bbsPath().mid( 1 ); /* remove "/" */ } @@ -380,7 +380,7 @@ const QString BoardManager::subjectURL( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); return bdata->basePath() + "subject.txt"; } @@ -390,7 +390,7 @@ const QString BoardManager::boardName( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); return bdata->boardName(); } @@ -504,7 +504,7 @@ QStringList flist = d.entryList(filter); for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) { - if ( ( *it ).isNull() ) continue; + if ( ( *it ).isEmpty() ) continue; QString datURL = boardURL + "dat/" + ( *it ); @@ -569,7 +569,7 @@ } QString line; - while ( !( line = stream.readLine() ).isNull() ) { + while ( !( line = stream.readLine() ).isEmpty() ) { int pos = regexp.indexIn( line ); if ( pos != -1 ) { QString fname = regexp.cap( 1 ); @@ -622,7 +622,7 @@ m_boardDataList.clear(); m_previousBoardData = NULL; - m_previousBoardURL = QString::null; + m_previousBoardURL.clear(); } /** @@ -634,8 +634,8 @@ * * @param[out] oldURL * - * @retval Board_enrollEnrolled if board is already enrolled. oldURL is QString::null. - * @retval Board_enrollNew if board is new board. oldURL is QString::null. + * @retval Board_enrollEnrolled if board is already enrolled. oldURL is QString(). + * @retval Board_enrollNew if board is new board. oldURL is QString(). * @retval Board_enrollMoved if board is moved. oldURL is old URL. * * @note board is NOT enrolled when board is moved. @@ -655,7 +655,7 @@ QString bbsPath; QString ext; type = parseBoardURL( url, type, hostname, rootPath, delimiter, bbsPath, ext ); - oldURL = QString::null; + oldURL.clear(); if ( type == Board_Unknown ) return Board_enrollFailed; @@ -703,10 +703,10 @@ QString& ext ) { hostname = url.protocol() + "://" + url.host(); - rootPath = QString::null; - delimiter = QString::null; - bbsPath = QString::null; - ext = QString::null; + rootPath.clear(); + delimiter.clear(); + bbsPath.clear(); + ext.clear(); /* decide type */ if ( type == Board_Unknown ) { @@ -739,7 +739,7 @@ delimiter = "/test/read.cgi"; bbsPath = url.fileName(); rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' ); - if ( rootPath.length() == 0 ) rootPath = QString::null; + if ( rootPath.length() == 0 ) rootPath.clear(); ext = ".dat"; break; @@ -748,7 +748,7 @@ delimiter = "/test/read.cgi"; bbsPath = url.fileName(); rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' ); - if ( rootPath.length() == 0 ) rootPath = QString::null; + if ( rootPath.length() == 0 ) rootPath.clear(); ext = ".dat"; type = Board_2ch; break; @@ -758,8 +758,8 @@ const QRegExp exp( "/$" ); rootPath.remove( exp ); bbsPath.remove( exp ); - if ( !rootPath.isNull() && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath; - if ( !bbsPath.isNull() && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath; + if ( !rootPath.isEmpty() && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath; + if ( !bbsPath.isEmpty() && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath; return type; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -31,7 +31,7 @@ { /* Is board enrolled ? */ BoardData * bdata = BoardManager::getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); QString root = bdata->hostName() + bdata->rootPath(); @@ -43,7 +43,7 @@ { /* Is board enrolled ? */ BoardData * bdata = BoardManager::getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); QString bbs = bdata->bbsPath(); @@ -54,7 +54,7 @@ QString Cache::getPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isNull() ) return QString::null; + if ( path.isEmpty() ) return QString(); // qDebug( "%s -> %s",url.prettyUrl().ascii(),path.ascii()); @@ -64,8 +64,8 @@ QString Cache::getIndexPath( const KUrl& url ) { QString path = getPath( url ); - if ( path.isNull() ) { - return QString::null; + if ( path.isEmpty() ) { + return QString(); } else { return path + ".idx"; } @@ -80,7 +80,7 @@ QString Cache::getSettingPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isNull() ) return QString::null; + if ( path.isEmpty() ) return QString(); return path + "SETTING.TXT"; } @@ -89,7 +89,7 @@ QString Cache::getBBSHistoryPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isNull() ) return QString::null; + if ( path.isEmpty() ) return QString(); return path + "BBSHISTORY"; } @@ -98,7 +98,7 @@ QString Cache::getSubjectPath( const KUrl& url ) { QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isNull() ) return QString::null; + if ( path.isEmpty() ) return QString(); return path + "subject.txt"; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -95,7 +95,7 @@ /* init variables */ m_broken = false; m_nowLoading = false; - m_lastLine = QString::null; + m_lastLine.clear(); /* clear ResDatVec */ m_resDatVec.clear(); @@ -225,7 +225,7 @@ See also DatInfo::slotReceiveData() */ /* private */ bool DatInfo::copyOneLineToResDat( const QString& line ) { - if ( line.isNull() ) return false; + if ( line.isEmpty() ) return false; /* update ReadNum */ const int num = m_thread->readNum() + 1; @@ -355,16 +355,16 @@ /* They are public */ -const QString& DatInfo::getDat( int num ) +QString DatInfo::getDat( int num ) { - if ( !parseDat( num ) ) return QString::null; + if ( !parseDat( num ) ) return QString(); return m_resDatVec[ num ].linestr; } -const QString& DatInfo::getId( int num ) +QString DatInfo::getId( int num ) { - if ( !parseDat( num ) ) return QString::null; + if ( !parseDat( num ) ) return QString(); return m_resDatVec[ num ].id; } @@ -372,7 +372,7 @@ /* plain strings of name */ QString DatInfo::getPlainName( int num ) { - if ( !parseDat( num ) ) return QString::null; + if ( !parseDat( num ) ) return QString(); return m_resDatVec[ num ].name; } @@ -381,7 +381,7 @@ /* plain strings of title */ QString DatInfo::getPlainTitle( int num ) { - if ( !parseDat( num ) ) return QString::null; + if ( !parseDat( num ) ) return QString(); QString titleHTML; Kita::createTitleHTML( m_resDatVec[ num ], titleHTML ); @@ -396,7 +396,7 @@ /* plain strings of body */ QString DatInfo::getPlainBody( int num ) { - if ( !parseDat( num ) ) return QString::null; + if ( !parseDat( num ) ) return QString(); QString retStr; Kita::DatToText( m_resDatVec[ num ].bodyHTML, retStr ); @@ -462,7 +462,7 @@ return value is HTML strings */ /* public */ QString DatInfo::getHTMLString( int startnum, int endnum, bool checkAbone ) { - QString retHTML = QString::null; + QString retHTML; for ( int num = startnum; num <= endnum; num++ ) { @@ -478,7 +478,7 @@ /* return HTML strings that have ID = strid. */ /* public */ QString DatInfo::getHtmlByID( const QString& strid, int &count ) { - QString retHTML = QString::null; + QString retHTML; count = 0; for ( int i = 1; i <= m_thread->readNum(); i++ ) { @@ -509,7 +509,7 @@ */ void DatInfo::getHTMLofOneRes( int num, bool checkAbone, QString& html ) { - html = QString::null; + html.clear(); QString titleHTML, bodyHTML; if ( getHTMLPrivate( num, checkAbone, titleHTML, bodyHTML ) == KITA_HTML_NOTPARSED ) return ; @@ -574,10 +574,10 @@ bool reverse, /* reverse search */ int& count, QString prestr ) { - if ( !parseDat( rootnum ) ) return QString::null; - if ( checkAbonePrivate( rootnum ) ) return QString::null; + if ( !parseDat( rootnum ) ) return QString(); + if ( checkAbonePrivate( rootnum ) ) return QString(); - QString retstr = QString::null ; + QString retstr; count = 0; QStringList strlists; @@ -890,9 +890,9 @@ // qDebug("parseDat %d",num); - QString subject = QString::null; + QString subject; Kita::parseResDat( m_resDatVec[ num ], subject ); - if ( num == 1 && !subject.isNull() ) m_thread->setThreadName( subject ); + if ( num == 1 && !subject.isEmpty() ) m_thread->setThreadName( subject ); if ( m_resDatVec[ num ].broken ) m_broken = true; return true; Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 07:05:20 UTC (rev 2366) @@ -151,8 +151,8 @@ void stopLoading(); /* string data */ - const QString& getDat( int num ); - const QString& getId( int num ); + QString getDat( int num ); + QString getId( int num ); QString getPlainName( int num ); QString getPlainTitle( int num ); QString getPlainBody( int num ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -251,10 +251,10 @@ /* public */ -const QString& DatManager::getDat( const KUrl& url, int num ) +QString DatManager::getDat( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getDat( num ); } @@ -262,10 +262,10 @@ /* public */ -const QString& DatManager::getId( const KUrl& url, int num ) +QString DatManager::getId( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getId( num ); } @@ -275,7 +275,7 @@ QString DatManager::getPlainName( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getPlainName( num ); } @@ -285,7 +285,7 @@ QString DatManager::getPlainBody( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getPlainBody( num ); } @@ -295,7 +295,7 @@ QString DatManager::getPlainTitle( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getPlainTitle( num ); } @@ -308,7 +308,7 @@ Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); if ( thread != NULL ) return thread->threadName(); - return QString::null; + return QString(); } @@ -337,7 +337,7 @@ QString DatManager::getHtml( const KUrl& url, int startnum, int endnum, bool checkAbone ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getHTMLString( startnum, endnum, checkAbone ); } @@ -348,7 +348,7 @@ QString DatManager::getHtmlByID( const KUrl& url, const QString& strid, int &count ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getHtmlByID( strid, count ); } @@ -359,7 +359,7 @@ QString DatManager::getTreeByRes( const KUrl& url, const int rootnum, int &count ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getTreeByRes( rootnum, count ); } @@ -368,7 +368,7 @@ QString DatManager::getTreeByResReverse( const KUrl& url, const int rootnum, int &count ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString::null; + if ( datInfo == NULL ) return QString(); return datInfo->getTreeByResReverse( rootnum, count ); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 07:05:20 UTC (rev 2366) @@ -44,8 +44,8 @@ static void stopLoading( const KUrl& url ); /* string data */ - static const QString& getDat( const KUrl& url, int num ); - static const QString& getId( const KUrl& url, int num ); + static QString getDat( const KUrl& url, int num ); + static QString getId( const KUrl& url, int num ); static QString getPlainName( const KUrl& url, int num ); static QString getPlainBody( const KUrl& url, int num ); static QString getPlainTitle( const KUrl& url, int num ); Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -187,6 +187,6 @@ if ( getInstance() ->m_threadList.count() > i ) { return getInstance() ->m_threadList[ i ].m_datURL; } else { - return QString::null; + return QString(); } } Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -134,7 +134,7 @@ QString& text ) { - text = QString::null; + text.clear(); unsigned int startPos, pos; const QChar *chpt = rawData.unicode(); @@ -179,7 +179,7 @@ QString tmpstr; tmpstr = parseSpecialChar( chpt + i, pos ); - if ( !tmpstr.isNull() ) { + if ( !tmpstr.isEmpty() ) { text += rawData.mid( startPos, i - startPos ) + tmpstr; startPos = i + pos; i = startPos - 1; @@ -208,7 +208,7 @@ /* output */ unsigned int& pos ) { - QString retstr = QString::null; + QString retstr; if ( ( pos = isEqual( cdat , ">" ) ) ) retstr = '>'; else if ( ( pos = isEqual( cdat , "<" ) ) ) retstr = '<'; @@ -333,7 +333,7 @@ If mode = URLMODE_DAT, output is URL of dat file. If mode = URLMODE_THREAD, output is URL of read.cgi . - If url is NOT enrolled, return QString::null. + If url is NOT enrolled, return QString(). (ex.1) @@ -369,9 +369,9 @@ /* output */ QString& refstr ) { - refstr = QString::null; + refstr.clear(); - if ( url.isEmpty() ) return QString::null; + if ( url.isEmpty() ) return QString(); /* cache */ if ( m_prevConvMode == mode && m_prevConvURL == url.prettyUrl() ) { @@ -382,13 +382,13 @@ /* Is board enrolled ? */ BoardData* bdata = Kita::BoardManager::getBoardData( url ); - if ( bdata == NULL ) return QString::null; + if ( bdata == NULL ) return QString(); QString urlstr = url.prettyUrl(); /* get thread & reference */ - QString thread = QString::null; - QString refBase = QString::null;; + QString thread; + QString refBase; if ( urlstr.contains( "/dat/" ) ) { @@ -405,7 +405,7 @@ then, thread = 1096716679 */ case Board_MachiBBS: thread = url.queryItem( "KEY" ); - refBase = QString::null; + refBase.clear(); break; /* url = (hostname)/(rootPath)/(delimiter)/(bbsPath)/(thread_ID)/(refBase) */ @@ -417,9 +417,9 @@ } } - if ( thread.isNull() ) return QString::null; + if ( thread.isEmpty() ) return QString(); - if ( !refBase.isNull() ) { + if ( !refBase.isEmpty() ) { if ( refBase.at( 0 ) == '-' ) refstr = '1' + refBase; else refstr = refBase; @@ -466,13 +466,13 @@ QStringList list = url.fileName().split( '.' ); if ( list.size() != 2 ) { - return QString::null; + return QString(); } QString datName = list[ 0 ]; url.cd( ".." ); if ( url.fileName() != "dat" ) { - return QString::null; + return QString(); } url.cd( ".." ); @@ -494,7 +494,7 @@ if ( !qdir.exists() ) { QStringList pathList = targetPath.split( '/' ); - QString path = QString::null; + QString path; for ( int i = 0; i < pathList.count(); ++i ) { @@ -586,23 +586,23 @@ /* init parser. Don't forget to call this before parsing. */ void Kita::InitParseMachiBBS() { - m_machiSubject = QString::null; - m_machiLine = QString::null; + m_machiSubject.clear(); + m_machiLine.clear(); } QString Kita::ParseMachiBBSOneLine( const QString& inputLine, int& nextNum ) { - QString ret = QString::null; + QString ret; m_machiLine += inputLine; int num = 0; - QString name = QString::null; - QString mail = QString::null; - QString date = QString::null; - QString time = QString::null; - QString id = QString::null; - QString host = QString::null; - QString message = QString::null; + QString name; + QString mail; + QString date; + QString time; + QString id; + QString host; + QString message; // Subject QRegExp title_regexp( "(.*)" ); @@ -662,28 +662,28 @@ } else if ( regexp5.indexIn( m_machiLine ) != -1 ) { /* abone */ num = regexp5.cap( 1 ).toInt(); - m_machiLine = QString::null; + m_machiLine.clear(); if ( num == nextNum ) return "abone<><><>abone<>"; - else return QString::null; + else return QString(); } else if ( title_regexp.indexIn( m_machiLine ) != -1 ) { /* get title */ m_machiSubject = title_regexp.cap( 1 ); - m_machiLine = QString::null; - return QString::null; + m_machiLine.clear(); + return QString(); } - else return QString::null; + else return QString(); if ( num >= nextNum ) { - if ( num != 1 ) m_machiSubject = QString::null; + if ( num != 1 ) m_machiSubject.clear(); ret += name + "<><>" + date + ' ' + time + " ID:" + id; - if ( !host.isNull() ) ret += " HOST:" + host; + if ( !host.isEmpty() ) ret += " HOST:" + host; ret += "<>" + message + "<>" + m_machiSubject; nextNum = num; } - m_machiLine = QString::null; + m_machiLine.clear(); return ret; } @@ -694,9 +694,9 @@ QString Kita::ParseJBBSOneLine( const QString& line, int& nextNum ) { - QString ret = QString::null; + QString ret; QStringList list = line.split( "<>" ); - if ( list.size() != 7 ) return QString::null; + if ( list.size() != 7 ) return QString(); int num = list[ 0 ].toInt(); QString name = list[ 1 ]; @@ -706,7 +706,7 @@ QString subject = list[ 5 ]; QString id = list[ 6 ]; - if ( num < nextNum ) return QString::null; + if ( num < nextNum ) return QString(); /* remove tag */ QRegExp rex( "<[^<]*>" ); @@ -729,9 +729,9 @@ QString Kita::ParseFlashCGIOneLine( const QString& line ) { - QString ret = QString::null; + QString ret; QStringList list = line.split( "<>" ); - if ( list.size() != 13 ) return QString::null; + if ( list.size() != 13 ) return QString(); QString name = list[ 0 ]; QString mail = list[ 1 ]; @@ -746,7 +746,7 @@ name.remove( rex ); ret += name + "<>" + mail + "<>" + date + " ID:" + id; - if ( !host.isNull() ) ret += " HOST:" + host; + if ( !host.isEmpty() ) ret += " HOST:" + host; ret += "<>" + body + "<>" + subject; return ret; @@ -857,7 +857,7 @@ const QChar * chpt = resdat.name.unicode(); unsigned int length = resdat.name.length(); - resdat.nameHTML = QString::null; + resdat.nameHTML.clear(); /* anchor */ while ( parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) { @@ -902,10 +902,10 @@ void Kita::parseDateId( const QString& rawStr, RESDAT& resdat ) { resdat.date = rawStr; - resdat.id = QString::null; - resdat.host = QString::null; - resdat.be = QString::null; - resdat.bepointmark = QString::null; + resdat.id.clear(); + resdat.host.clear(); + resdat.be.clear(); + resdat.bepointmark.clear(); const QChar *chpt = rawStr.unicode(); unsigned int pos = 0, startpos = 0; @@ -969,7 +969,7 @@ */ void Kita::parseBody( const QString &rawStr, RESDAT& resdat ) { - resdat.bodyHTML = QString::null; + resdat.bodyHTML.clear(); unsigned int startPos, pos; QString linkstr, linkurl; @@ -1098,12 +1098,12 @@ /*-----------------------------*/ - linkstr = QString::null; - linkurl = QString::null; + linkstr.clear(); + linkurl.clear(); - QString retlinkstr = QString::null; - QString prefix = QString::null; - QString scheme = QString::null; + QString retlinkstr; + QString prefix; + QString scheme; if ( isEqual( cdat , "http://" ) ) { prefix = "http://"; @@ -1135,7 +1135,7 @@ } if ( pos > length ) return false; - if ( !retlinkstr.isNull() ) DatToText( retlinkstr, linkstr ); + if ( !retlinkstr.isEmpty() ) DatToText( retlinkstr, linkstr ); linkurl = scheme + linkstr; linkstr = prefix + linkstr; @@ -1189,7 +1189,7 @@ if ( length == 0 ) return false; - linkstr = QString::null; + linkstr.clear(); refNum[ 0 ] = 0; refNum[ 1 ] = 0; pos = 0; @@ -1307,13 +1307,13 @@ */ void Kita::createTitleHTML( RESDAT& resdat, QString& titleHTML ) { - titleHTML = QString::null; + titleHTML.clear(); if ( !resdat.parsed ) return ; bool showMailAddress = Kita::Config::showMailAddress(); bool useTableTag = Kita::Config::useStyleSheet(); - if ( m_colonstr.isNull() ) { + if ( m_colonstr.isEmpty() ) { m_colonstr = utf8ToUnicode( KITAUTF8_COLON ); m_colonnamestr = utf8ToUnicode( KITAUTF8_NAME ); } @@ -1335,11 +1335,11 @@ if ( showMailAddress ) { titleHTML += resdat.nameHTML; - if ( !resdat.address.isNull() ) titleHTML += " [" + resdat.address + ']'; + if ( !resdat.address.isEmpty() ) titleHTML += " [" + resdat.address + ']'; } else { /* don't show mail address */ - if ( resdat.address.isNull() ) { + if ( resdat.address.isEmpty() ) { titleHTML += ""; titleHTML += resdat.name; @@ -1362,7 +1362,7 @@ if ( useTableTag ) titleHTML += ""; /* ID */ - if ( !resdat.id.isNull() ) { + if ( !resdat.id.isEmpty() ) { if ( useTableTag ) titleHTML += ""; if ( resdat.id.count( "???" ) >= 1 ) titleHTML += " ID:" + resdat.id; @@ -1371,7 +1371,7 @@ } /* BE */ - if ( !resdat.be.isNull() ) { + if ( !resdat.be.isEmpty() ) { if ( useTableTag ) titleHTML += ""; titleHTML += " ?" + resdat.bepointmark + ""; @@ -1379,7 +1379,7 @@ } /* host */ - if ( !resdat.host.isNull() ) { + if ( !resdat.host.isEmpty() ) { if ( useTableTag ) titleHTML += ""; titleHTML += " HOST:" + resdat.host; @@ -1396,7 +1396,7 @@ if ( regexp.indexIn( line ) != -1 ) { return regexp.cap( 1 ); } else { - return QString::null; + return QString(); } } @@ -1451,7 +1451,7 @@ int old_length = isRawURI ? local.size() - 1 : local.length(); if ( !old_length ) - return segment.isNull() ? QString::null : QString(""); // differentiate null and empty + return segment.isEmpty() ? QString() : QString(""); // differentiate null and empty // a worst case approximation QChar *new_segment = new QChar[ old_length * 3 + 1 ]; Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -104,12 +104,12 @@ /* load thread name */ QString subject = getSubjectPrivate( config ); - if ( subject.isNull() && !thread->threadName().isNull() ) { + if ( subject.isEmpty() && !thread->threadName().isEmpty() ) { subject = thread->threadName(); KConfigGroup group = config.group(""); group.writeEntry( "Subject", subject ); } - if ( subject.isNull() ) thread->setThreadName( "?" ); + if ( subject.isEmpty() ) thread->setThreadName( "?" ); else thread->setThreadName( subject ); /* load res number */ Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -469,7 +469,7 @@ QStringList list; QString str; - while ( !( str = stream.readLine() ).isNull() ) { + while ( !( str = stream.readLine() ).isEmpty() ) { if ( ! str.isEmpty() ) { list << str; } @@ -489,7 +489,7 @@ QStringList list; QString str; - while ( !( str = stream.readLine() ).isNull() ) { + while ( !( str = stream.readLine() ).isEmpty() ) { if ( ! str.isEmpty() ) { list << str; } @@ -509,7 +509,7 @@ QStringList list; QString str; - while ( !( str = stream.readLine() ).isNull() ) { + while ( !( str = stream.readLine() ).isEmpty() ) { if ( ! str.isEmpty() ) { list << str; } @@ -529,7 +529,7 @@ QStringList list; QString str; - while ( !( str = stream.readLine() ).isNull() ) { + while ( !( str = stream.readLine() ).isEmpty() ) { if ( ! str.isEmpty() ) { list << str; } Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -63,7 +63,7 @@ KitaThreadView* currentView = isThreadView( currentWidget() ); if ( currentView ) viewMode = currentView->getViewMode(); - if ( !refstr.isNull() ) { + if ( !refstr.isEmpty() ) { int i = refstr.indexOf( "-" ); if ( i != -1 ) jumpNum = refstr.left( i ).toInt(); else jumpNum = refstr.toInt(); @@ -195,8 +195,8 @@ KitaTabWidgetBase::deleteWidget( w ); if ( count() == 0 ) { - ViewMediator::getInstance()->setMainCaption( QString::null ); - ViewMediator::getInstance()->setMainStatus( QString::null ); + ViewMediator::getInstance()->setMainCaption( QString() ); + ViewMediator::getInstance()->setMainStatus( QString() ); ViewMediator::getInstance()->setMainURLLine( KUrl() ); /* default view */ Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -156,7 +156,7 @@ m_viewmode = VIEWMODE_MAINVIEW; m_rescode = 200; m_serverTime = 0; - m_datURL = QString::null; + m_datURL.clear(); } @@ -284,7 +284,7 @@ void KitaThreadView::setFocus() { ViewMediator::getInstance()->changeWriteTab( m_datURL ); - showStatusBar( QString::null ); + showStatusBar( QString() ); m_threadPart->view() ->setFocus(); } @@ -386,9 +386,9 @@ void KitaThreadView::showStatusBar( QString info ) { if ( m_datURL.isEmpty() ) return ; - QString captionStr = QString::null; - QString infostr = QString::null; - QString errstr = QString::null; + QString captionStr; + QString infostr; + QString errstr; int viewPos = Kita::DatManager::getViewPos( m_datURL ); int resNum = Kita::DatManager::getResNum( m_datURL ); bool broken = Kita::DatManager::isBroken( m_datURL ); @@ -398,7 +398,7 @@ case VIEWMODE_MAINVIEW: - errstr = QString::null; + errstr.clear(); if ( m_rescode != 200 && m_rescode != 206 && m_rescode != 0 ) errstr = QString( "Error %1" ).arg( m_rescode ); if ( broken ) info += " This thread is broken."; @@ -507,8 +507,8 @@ /* jump */ QString str = SearchCombo->currentText(); - if ( str.isNull() ) return ; if ( str.isEmpty() ) return ; + if ( str.isEmpty() ) return ; if ( str.at( 0 ) == ':' ) return ; if ( str.at( 0 ) == '?' ) return ; Modified: kita/branches/KITA-KDE4/kita/src/threadview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 07:05:20 UTC (rev 2366) @@ -112,7 +112,7 @@ private slots: void slotSearchButton(); void slotBookmarkButtonClicked( bool on ); - void slotWriteButtonClicked( QString resstr = QString::null ); + void slotWriteButtonClicked( QString resstr = QString() ); void slotComboActivated( int index ); void slotUpdateInfo(); void slotSearchPrivate( bool rev ); Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -44,7 +44,7 @@ void KitaWriteTabWidget::slotShowWriteView( const KUrl& url, const QString& resStr ) { - openWriteView( url, resStr, QString::null ); + openWriteView( url, resStr, QString() ); } @@ -186,8 +186,8 @@ if ( view ) { QClipboard * clipboard = QApplication::clipboard(); QString str = clipboard->text( QClipboard::Selection ); - if ( str.isNull() ) str = clipboard->text( QClipboard::Clipboard ); - if ( !str.isNull() ) { + if ( str.isEmpty() ) str = clipboard->text( QClipboard::Clipboard ); + if ( !str.isEmpty() ) { QString msg = "\n> " + str.replace( '\n', "\n> " ) + '\n'; view->insertMessage( msg ); Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.h 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.h 2009-07-05 07:05:20 UTC (rev 2366) @@ -28,7 +28,7 @@ void slotShowWriteView( const KUrl& url, const QString& resStr ); private: - void openWriteView( const KUrl& url, const QString& resStr = QString::null, const QString& subject = QString::null ); + void openWriteView( const KUrl& url, const QString& resStr = QString(), const QString& subject = QString() ); KitaWriteView* findWriteView( const KUrl& url ); KitaWriteView* isWriteView( QWidget* w ); Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 05:22:43 UTC (rev 2365) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 07:05:20 UTC (rev 2366) @@ -267,7 +267,7 @@ "Do you want to close?" ), QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default ) ) { case QMessageBox::Ok: - setMessage( QString::null ); + setMessage( QString() ); m_parent->slotCloseCurrentTab(); break; case QMessageBox::Cancel: @@ -311,7 +311,7 @@ logPostMessage(); /* clear message */ - setMessage( QString::null ); + setMessage( QString() ); /* reload thread */ ViewMediator::getInstance()->openThread( m_datURL ); @@ -485,7 +485,7 @@ } else { /* get code from title */ QString title = resultTitle( response ); - if ( title.isNull() ) return K2ch_Unknown; + if ( title.isEmpty() ) return K2ch_Unknown; if ( title.contains( errstr ) ) return K2ch_Error; if ( title.contains( truestr ) ) return K2ch_True; @@ -529,7 +529,7 @@ return regexp.cap( 1 ).replace( "
", "\n" ); } - return QString::null; + return QString(); } { @@ -552,7 +552,7 @@ return body_regexp.cap( 1 ); } - return QString::null; + return QString(); } @@ -564,6 +564,6 @@ if ( pos != -1 ) { return regexp.cap( 1 ); } else { - return QString::null; + return QString(); } } From svnnotify ¡÷ sourceforge.jp Sun Jul 5 20:57:35 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 20:57:35 +0900 Subject: [Kita-svn] [2367] initialize m_manager even when parent is 0 in order to avoid a crash Message-ID: <1246795055.894942.22825.nullmailer@users.sourceforge.jp> Revision: 2367 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2367 Author: nogu Date: 2009-07-05 20:57:35 +0900 (Sun, 05 Jul 2009) Log Message: ----------- initialize m_manager even when parent is 0 in order to avoid a crash Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-05 07:05:20 UTC (rev 2366) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-05 11:57:35 UTC (rev 2367) @@ -52,6 +52,8 @@ /* setup part manager */ m_manager = new KParts::PartManager( parent, this ); m_manager->addManagedTopLevelWidget( parent ); + } else { + m_manager = 0; } } From svnnotify ¡÷ sourceforge.jp Sun Jul 5 21:21:14 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 05 Jul 2009 21:21:14 +0900 Subject: [Kita-svn] [2368] use isEmpty() Message-ID: <1246796474.785812.18903.nullmailer@users.sourceforge.jp> Revision: 2368 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2368 Author: nogu Date: 2009-07-05 21:21:14 +0900 (Sun, 05 Jul 2009) Log Message: ----------- use isEmpty() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 11:57:35 UTC (rev 2367) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 12:21:14 UTC (rev 2368) @@ -91,7 +91,7 @@ { KUrl datURL = Kita::getDatURL( url ); if ( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */ - if ( m_datInfoList.count() == 0 ) return NULL; + if ( m_datInfoList.isEmpty() ) return NULL; int i = 0; DatInfoList::Iterator it; From svnnotify ¡÷ sourceforge.jp Mon Jul 6 06:22:06 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 06 Jul 2009 06:22:06 +0900 Subject: [Kita-svn] [2369] change include directives Message-ID: <1246828926.308949.29588.nullmailer@users.sourceforge.jp> Revision: 2369 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2369 Author: nogu Date: 2009-07-06 06:22:06 +0900 (Mon, 06 Jul 2009) Log Message: ----------- change include directives see also: http://techbase.kde.org/Policies/Library_Code_Policy#Getting_.23includes_right Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp kita/branches/KITA-KDE4/kita/src/boardtabwidget.h kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.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/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.h kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h kita/branches/KITA-KDE4/kita/src/libkita/access.cpp kita/branches/KITA-KDE4/kita/src/libkita/access.h 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/cache.cpp kita/branches/KITA-KDE4/kita/src/libkita/cache.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/flashcgi.cpp kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h 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/libkita/threadinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h kita/branches/KITA-KDE4/kita/src/main.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.h kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.h kita/branches/KITA-KDE4/kita/src/respopup.cpp kita/branches/KITA-KDE4/kita/src/respopup.h kita/branches/KITA-KDE4/kita/src/threadlistview.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.h kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/threadview.h kita/branches/KITA-KDE4/kita/src/viewmediator.cpp kita/branches/KITA-KDE4/kita/src/viewmediator.h kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp kita/branches/KITA-KDE4/kita/src/writeview.cpp kita/branches/KITA-KDE4/kita/src/writeview.h Modified: kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,10 +9,11 @@ ***************************************************************************/ #include "bbstabwidget.h" -#include "bbsview.h" #include +#include "bbsview.h" + /*--------------------------------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,39 +10,36 @@ #include "bbsview.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include -#include -#include -#include -#include -#include -#include #include -#include +#include #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "viewmediator.h" - #include "kitaui/listviewitem.h" - -#include "libkita/favoriteboards.h" #include "libkita/boardmanager.h" #include "libkita/config_xt.h" +#include "libkita/favoriteboards.h" #include "libkita/kita_misc.h" namespace Kita Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,11 +11,11 @@ #ifndef KITABBSVIEW_H #define KITABBSVIEW_H +#include +#include + #include -#include -#include - class KComboBox; class KUrl; class K3ListView; Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,22 +10,20 @@ #include "boardtabwidget.h" -#include "viewmediator.h" +#include +#include -#include "libkita/boardmanager.h" - +#include +#include #include #include #include #include #include -#include -#include -#include -#include +#include "viewmediator.h" +#include "libkita/boardmanager.h" - KitaBoardTabWidget::KitaBoardTabWidget( QWidget* parent, Qt::WFlags f ) : KitaTabWidgetBase( parent, f ) { Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,11 +11,10 @@ #ifndef KITABOARDTABWIDGET_H #define KITABOARDTABWIDGET_H +#include "boardview.h" +#include "favoritelistview.h" #include "kitaui/tabwidgetbase.h" -#include "favoritelistview.h" -#include "boardview.h" - /** @author Hideki Ikemoto */ Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,52 +10,46 @@ #include "boardview.h" -// include files for Qt -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -// kdelibs/kio -#include -#include - -// include files for KDE #include -#include -#include +#include +#include #include -#include #include #include +#include #include -#include -#include #include +#include +#include +#include +#include -#include "libkita/thread.h" -#include "libkita/kita_misc.h" -#include "libkita/favoritethreads.h" +#include "boardtabwidget.h" +#include "threadlistviewitem.h" +#include "ui_threadproperty.h" +#include "viewmediator.h" +#include "libkita/boardmanager.h" +#include "libkita/config_xt.h" #include "libkita/datmanager.h" +#include "libkita/favoritethreads.h" +#include "libkita/kita_misc.h" +#include "libkita/thread.h" #include "libkita/threadindex.h" -#include "libkita/boardmanager.h" #include "libkita/threadinfo.h" -#include "libkita/config_xt.h" -#include "ui_threadproperty.h" -#include "threadlistviewitem.h" -#include "viewmediator.h" -#include "boardtabwidget.h" - KitaBoardView::KitaBoardView( KitaBoardTabWidget* parent ) : Kita::ThreadListView( parent ) { Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -12,6 +12,7 @@ #define KITABOARDVIEW_H #include + #include "threadlistview.h" class QWidget; Modified: kita/branches/KITA-KDE4/kita/src/domtree.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -13,13 +13,12 @@ #include "domtree.h" #include - #include -#include "libkita/datmanager.h" #include "libkita/datinfo.h" -#include "libkita/kita-utf8.h" +#include "libkita/datmanager.h" #include "libkita/kita_misc.h" +#include "libkita/kita-utf8.h" KitaDomTree::KitaDomTree( const DOM::HTMLDocument& hdoc, const KUrl& datURL ) { Modified: kita/branches/KITA-KDE4/kita/src/domtree.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,10 +11,9 @@ #ifndef KITADOMTREE_H #define KITADOMTREE_H -#include +#include #include - #include #include Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,26 +10,25 @@ #include "favoritelistview.h" -#include "viewmediator.h" +#include +#include +#include +#include +#include -#include "libkita/favoritethreads.h" -#include "libkita/kita_misc.h" -#include "libkita/datmanager.h" -#include "libkita/boardmanager.h" -#include "libkita/thread.h" - -#include -#include -#include -#include -#include - #include #include #include #include #include +#include "viewmediator.h" +#include "libkita/boardmanager.h" +#include "libkita/datmanager.h" +#include "libkita/favoritethreads.h" +#include "libkita/kita_misc.h" +#include "libkita/thread.h" + /** * */ Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,35 +10,32 @@ #include "htmlpart.h" +#include +#include +#include +#include +#include + #include -#include -#include -#include #include +#include +#include +#include #include - #include #include -#include -#include -#include -#include -#include - +#include "const.h" #include "domtree.h" #include "respopup.h" #include "viewmediator.h" -#include "const.h" - #include "kitaui/htmlview.h" - -#include "libkita/datmanager.h" +#include "libkita/abone.h" #include "libkita/boardmanager.h" +#include "libkita/config_xt.h" #include "libkita/datinfo.h" +#include "libkita/datmanager.h" #include "libkita/kita_misc.h" -#include "libkita/config_xt.h" -#include "libkita/abone.h" /*-------------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,9 +11,10 @@ #ifndef KITAHTMLPART_H #define KITAHTMLPART_H +#include +#include + #include -#include -#include /* mode */ enum { Modified: kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,11 +10,11 @@ #include "htmlview.h" +#include +#include + #include -#include -#include - KitaHTMLView::KitaHTMLView( KHTMLPart* part, QWidget *parent ) : KHTMLView( part, parent ) {} Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -12,30 +12,29 @@ #include "tabwidgetbase.h" -#include "kita_misc.h" -#include "parsemisc.h" -#include "datmanager.h" +#include +#include +#include +#include +#include -#include -#include -#include -#include #include -#include -#include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include #include +#include +#include +#include -#include -#include -#include -#include -//Added by qt3to4: -#include +#include "datmanager.h" +#include "kita_misc.h" +#include "parsemisc.h" /*--------------------------------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,20 +11,17 @@ #ifndef KITATABWIDGETBASE_H #define KITATABWIDGETBASE_H +#include +#include +#include + +#include #include #include -#include +#include #include +#include -#include - -#include - -#include -#include -//Added by qt3to4: -#include - class KUrl; class QIcon; class KMenu; Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -8,20 +8,21 @@ * (at your option) any later version. * ***************************************************************************/ #include "access.h" -#include "cache.h" -#include "kita_misc.h" -#include "account.h" -#include "boardmanager.h" +#include +#include +#include + #include -#include +#include #include #include -#include +#include -#include -#include -#include +#include "account.h" +#include "boardmanager.h" +#include "cache.h" +#include "kita_misc.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,10 +10,10 @@ #ifndef KITAACCESS_H #define KITAACCESS_H +#include + #include -#include - class KJob; namespace KIO { Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,19 +9,17 @@ ***************************************************************************/ #include "account.h" -#include +#include +#include +#include -#include -#include -#include +#include #include +#include #include +#include +#include -#include -#include -//Added by qt3to4: -#include - using namespace Kita; Account* Account::instance = 0; Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,13 +10,12 @@ #ifndef KITAACCOUNT_H #define KITAACCOUNT_H +#include +#include +#include + #include -#include -//Added by qt3to4: -#include -#include - namespace KIO { class Job; Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,28 +9,29 @@ ***************************************************************************/ #include "boardmanager.h" -#include -#include -#include "downloadmanager.h" -#include "cache.h" -#include "favoritethreads.h" -#include "thread.h" -#include "threadinfo.h" -#include "favoriteboards.h" -#include "kita_misc.h" -#include "threadindex.h" +#include +#include +#include +#include +#include +#include +#include + #include +#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include +#include "cache.h" +#include "downloadmanager.h" +#include "favoriteboards.h" +#include "favoritethreads.h" +#include "kita_misc.h" +#include "thread.h" +#include "threadindex.h" +#include "threadinfo.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,12 +11,12 @@ #ifndef KITABOARDMANAGER_H #define KITABOARDMANAGER_H +#include +#include +#include + #include #include -//Added by qt3to4: -#include -#include -#include class QSjisCodec; class QEucJpCodec; Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -8,13 +8,14 @@ * (at your option) any later version. * ***************************************************************************/ #include "cache.h" -#include "boardmanager.h" -#include #include #include #include +#include +#include "boardmanager.h" + using namespace Kita; QString Cache::baseDir() Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,7 +10,7 @@ #ifndef KITACACHE_H #define KITACACHE_H -#include +#include class KUrl; Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,21 +10,22 @@ #include "datinfo.h" -#include -#include +#include +#include + #include -#include "datmanager.h" +#include "abone.h" #include "access.h" -#include "thread.h" -#include "kita-utf8.h" -#include "kita-utf16.h" -#include "kita_misc.h" #include "account.h" -#include "threadindex.h" #include "cache.h" #include "config_xt.h" -#include "abone.h" +#include "datmanager.h" +#include "kita_misc.h" +#include "kita-utf16.h" +#include "kita-utf8.h" +#include "thread.h" +#include "threadindex.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,13 +11,13 @@ #ifndef KITADATINFO_H #define KITADATINFO_H -#include -//Added by qt3to4: -#include +#include +#include +#include +#include +#include + #include -#include -#include -#include class QStringList; Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,21 +11,21 @@ /* DatManager manages all information about thread */ #include "datmanager.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include "thread.h" -#include "threadinfo.h" +#include "boardmanager.h" +#include "cache.h" #include "datinfo.h" -#include "cache.h" #include "kita_misc.h" +#include "kita-utf16.h" #include "kita-utf8.h" -#include "kita-utf16.h" +#include "thread.h" #include "threadindex.h" -#include "boardmanager.h" +#include "threadinfo.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,10 +11,10 @@ #ifndef KITADATMANAGER_H #define KITADATMANAGER_H +#include + #include -#include - class KUrl; class QObject; class QStringList; Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -8,12 +8,12 @@ * (at your option) any later version. * ***************************************************************************/ #include "favoriteboards.h" + +#include +#include + #include "boardmanager.h" -#include -//Added by qt3to4: -#include - using namespace Kita; FavoriteBoards* FavoriteBoards::instance = 0; Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,9 +10,9 @@ #ifndef KITAFAVORITEBOARDS_H #define KITAFAVORITEBOARDS_H -#include -//Added by qt3to4: -#include +#include +#include + #include class QDomNode; Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,19 +9,19 @@ ***************************************************************************/ #include "favoritethreads.h" -#include "thread.h" -#include "threadindex.h" + +#include +#include +#include + +#include + #include "boardmanager.h" #include "datmanager.h" #include "kita_misc.h" +#include "thread.h" +#include "threadindex.h" -#include - -#include -#include -//Added by qt3to4: -#include - // FavoriteThreadItem FavoriteThreadItem::FavoriteThreadItem() {} Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,15 +11,13 @@ #ifndef FAVORITETHREADS_H #define FAVORITETHREADS_H +#include +#include +#include +#include + #include -#include -#include -#include -#include -//Added by qt3to4: -#include - class QDomNode; /** Modified: kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,11 +9,11 @@ ***************************************************************************/ #include "flashcgi.h" -#include "kita_misc.h" +#include #include -#include +#include "kita_misc.h" FlashCGI::FlashCGI() { Modified: kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,10 +10,10 @@ #ifndef FLASHCGI_H #define FLASHCGI_H +#include + #include -#include - /** @author Hideki Ikemoto */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,11 +9,12 @@ ***************************************************************************/ #include "jbbs.h" -#include // FIXME -#include "kita_misc.h" +#include #include +#include "kita_misc.h" + JBBS::JBBS() { } Modified: kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,10 +10,10 @@ #ifndef JBBS_H #define JBBS_H +#include + #include -#include - /** @author Hideki Ikemoto */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,11 +9,12 @@ ***************************************************************************/ #include "k2ch.h" -#include "qsjiscodec.h" -#include "kita_misc.h" +#include #include +#include "kita_misc.h" + K2ch::K2ch() { } Modified: kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,9 +10,10 @@ #ifndef K2CH_H #define K2CH_H +#include + #include -#include /** @author Hideki Ikemoto */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,23 +9,24 @@ ***************************************************************************/ #include "kita_misc.h" -#include "datinfo.h" /* struct RESDAT is defined. */ -#include "kita-utf8.h" -#include "kita-utf16.h" -#include "config_xt.h" -#include "datmanager.h" -#include -#include +#include +#include +#include +#include +#include +#include + #include #include +#include +#include -#include -#include -#include -#include -#include -#include +#include "config_xt.h" +#include "datinfo.h" /* struct RESDAT is defined. */ +#include "datmanager.h" +#include "kita-utf8.h" +#include "kita-utf16.h" #define KITA_RESDIGIT 4 Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,10 +11,10 @@ #ifndef KITAKITA_MISC_H #define KITAKITA_MISC_H +#include + #include "boardmanager.h" -#include - class KUrl; class QDateTime; Modified: kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,11 +9,12 @@ ***************************************************************************/ #include "machibbs.h" -#include // FIXME -#include "kita_misc.h" +#include #include +#include "kita_misc.h" + MachiBBS::MachiBBS() { } Modified: kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,10 +10,10 @@ #ifndef MACHIBBS_H #define MACHIBBS_H +#include + #include -#include - /** @author Hideki Ikemoto */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,11 +10,9 @@ #include "thread.h" -#include -//Added by qt3to4: -#include +#include +#include - using namespace Kita; Q3Dict* Thread::m_threadDict = 0; Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,9 +11,10 @@ #ifndef KITATHREAD_H #define KITATHREAD_H +#include +#include + #include -#include -#include namespace Kita { Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -7,20 +7,20 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ + #include "threadindex.h" +#include +#include + #include #include -#include -//Added by qt3to4: -#include - #include "cache.h" +#include "datmanager.h" +#include "kita_misc.h" #include "thread.h" #include "threadinfo.h" -#include "kita_misc.h" -#include "datmanager.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -12,11 +12,11 @@ #define USE_INDEX +#include +#include + #include -#include -#include - class KUrl; class KConfig; Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,11 +10,11 @@ #include "threadinfo.h" +#include +#include + #include -#include -#include - KitaThreadInfo* KitaThreadInfo::instance = 0; KitaThreadInfo::KitaThreadInfo() : m_readDict() Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,10 +11,10 @@ #ifndef KITATHREADINFO_H #define KITATHREADINFO_H +#include + #include -#include - /** * * Hideki Ikemoto Modified: kita/branches/KITA-KDE4/kita/src/main.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,10 +10,10 @@ #include "mainwindow.h" -#include #include #include #include +#include #include "libkita/config_xt.h" Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,66 +10,64 @@ #include "mainwindow.h" -#include "prefs/prefs.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "threadview.h" -#include "threadtabwidget.h" -#include "boardview.h" -#include "boardtabwidget.h" -#include "bbsview.h" -#include "bbstabwidget.h" -#include "writetabwidget.h" -#include "viewmediator.h" - -#include "libkita/threadinfo.h" -#include "libkita/favoriteboards.h" -#include "libkita/favoritethreads.h" -#include "libkita/kita_misc.h" -#include "libkita/account.h" -#include "libkita/datmanager.h" -#include "libkita/boardmanager.h" -#include "libkita/config_xt.h" -#include "libkita/asciiart.h" -#include "libkita/abone.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include #include +#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include +#include #include -#include +#include +#include #include -#include #include -#include -#include -#include -#include -#include #include #include -#include +#include +#include +#include +#include +#include "bbstabwidget.h" +#include "bbsview.h" +#include "boardtabwidget.h" +#include "boardview.h" +#include "threadtabwidget.h" +#include "threadview.h" +#include "viewmediator.h" +#include "writetabwidget.h" +#include "libkita/abone.h" +#include "libkita/account.h" +#include "libkita/asciiart.h" +#include "libkita/boardmanager.h" +#include "libkita/config_xt.h" +#include "libkita/datmanager.h" +#include "libkita/favoriteboards.h" +#include "libkita/favoritethreads.h" +#include "libkita/kita_misc.h" +#include "libkita/threadinfo.h" +#include "prefs/prefs.h" + KitaMainWindow::KitaMainWindow() : KXmlGuiWindow( 0 ) { Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -16,8 +16,8 @@ #endif #include +#include #include -#include class KPrinter; class KToggleAction; Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -7,6 +7,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ + #include "aboneprefpage.h" #include Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,35 +10,35 @@ #include "prefs.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include -#include -#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "libkita/kita_misc.h" -#include "libkita/boardmanager.h" -#include "libkita/config_xt.h" -#include "libkita/asciiart.h" #include "aboneprefpage.h" #include "ui_login_page.h" #include "ui_write_page.h" +#include "libkita/asciiart.h" +#include "libkita/boardmanager.h" +#include "libkita/config_xt.h" +#include "libkita/kita_misc.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,16 +11,16 @@ #ifndef KITAPREFS_H #define KITAPREFS_H +#include + #include -#include #include "ui_asciiartprefbase.h" +#include "ui_faceprefbase.h" #include "ui_uiprefbase.h" -#include "ui_faceprefbase.h" - +#include "libkita/favoriteboards.h" #include "libkita/favoritethreads.h" #include "libkita/threadinfo.h" -#include "libkita/favoriteboards.h" class DebugPrefPage; Modified: kita/branches/KITA-KDE4/kita/src/respopup.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,19 +10,17 @@ #include "respopup.h" -#include -#include -#include +#include +#include +#include -#include #include +#include +#include "const.h" #include "kitaui/htmlview.h" - #include "libkita/config_xt.h" -#include "const.h" - namespace Kita { ResPopup::ResPopup( KHTMLView* view, const KUrl& url ) Modified: kita/branches/KITA-KDE4/kita/src/respopup.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/respopup.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,7 +11,7 @@ #ifndef RESPOPUP_H #define RESPOPUP_H -#include +#include #include "htmlpart.h" Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,24 +10,21 @@ #include "threadlistview.h" -#include "viewmediator.h" +#include +#include +#include #include -#include #include #include +#include -#include -#include -#include -#include - -#include "libkita/thread.h" +#include "threadlistviewitem.h" +#include "viewmediator.h" #include "libkita/config_xt.h" #include "libkita/kita_misc.h" +#include "libkita/thread.h" -#include "threadlistviewitem.h" - using namespace Kita; struct Col_Attr ThreadListView::s_colAttr[] = Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,12 +10,13 @@ #ifndef KITATHREADLISTVIEW_H #define KITATHREADLISTVIEW_H -#include "ui_threadlistviewbase.h" +#include #include #include -#include +#include "ui_threadlistviewbase.h" + struct Col_Attr { const char* labelName; /// for header's label Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,31 +9,30 @@ ***************************************************************************/ #include "threadtabwidget.h" -#include "threadview.h" -#include "htmlpart.h" -#include "viewmediator.h" -#include "libkita/kita_misc.h" -#include "libkita/parsemisc.h" -#include "libkita/datmanager.h" -#include "libkita/boardmanager.h" -#include "libkita/kita-utf8.h" -#include "libkita/config_xt.h" +#include +#include +#include +#include -#include -#include #include +#include +#include #include #include #include -#include +#include -#include -#include -#include -#include +#include "htmlpart.h" +#include "threadview.h" +#include "viewmediator.h" +#include "libkita/boardmanager.h" +#include "libkita/config_xt.h" +#include "libkita/datmanager.h" +#include "libkita/kita_misc.h" +#include "libkita/kita-utf8.h" +#include "libkita/parsemisc.h" - /*--------------------------------------------------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,43 +11,41 @@ #include "threadview.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include #include #include -#include #include -#include -#include +#include #include -#include - -#include +#include #include -#include #include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "htmlpart.h" #include "viewmediator.h" - -#include "libkita/kita-utf8.h" -#include "libkita/favoritethreads.h" -#include "libkita/favoriteboards.h" -#include "libkita/datmanager.h" #include "libkita/boardmanager.h" -#include "libkita/kita_misc.h" #include "libkita/config_xt.h" +#include "libkita/datmanager.h" +#include "libkita/favoriteboards.h" +#include "libkita/favoritethreads.h" +#include "libkita/kita_misc.h" +#include "libkita/kita-utf8.h" #define MAX_LABEL_LENGTH 60 Modified: kita/branches/KITA-KDE4/kita/src/threadview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,11 +11,10 @@ #ifndef KITATHREADVIEW_H #define KITATHREADVIEW_H -#include +#include #include +#include -#include - class KUrl; class KitaHTMLPart; class KComboBox; Modified: kita/branches/KITA-KDE4/kita/src/viewmediator.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/viewmediator.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/viewmediator.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -9,11 +9,11 @@ ***************************************************************************/ #include "viewmediator.h" +#include +#include + #include "libkita/datmanager.h" -#include -#include - ViewMediator* ViewMediator::instance = 0; ViewMediator::ViewMediator() Modified: kita/branches/KITA-KDE4/kita/src/viewmediator.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/viewmediator.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/viewmediator.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,11 +10,11 @@ #ifndef VIEWMEDIATOR_H #define VIEWMEDIATOR_H +#include "bbstabwidget.h" +#include "boardtabwidget.h" +#include "mainwindow.h" #include "threadtabwidget.h" #include "writetabwidget.h" -#include "boardtabwidget.h" -#include "bbstabwidget.h" -#include "mainwindow.h" /** * @author Hideki Ikemoto Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,20 +10,20 @@ #include "writetabwidget.h" -#include "libkita/kita_misc.h" -#include "libkita/datmanager.h" -#include "libkita/boardmanager.h" -#include "writeview.h" +#include +#include +#include +#include +#include #include +#include #include -#include -#include -#include -#include -#include -#include +#include "writeview.h" +#include "libkita/boardmanager.h" +#include "libkita/datmanager.h" +#include "libkita/kita_misc.h" /*--------------------------------------------------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-05 21:22:06 UTC (rev 2369) @@ -10,45 +10,41 @@ #include "writeview.h" -#include "viewmediator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "libkita/datmanager.h" -#include "libkita/boardmanager.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include "htmlpart.h" +#include "viewmediator.h" #include "libkita/account.h" -#include "libkita/kita-utf8.h" -#include "libkita/kita_misc.h" -#include "libkita/config_xt.h" #include "libkita/asciiart.h" +#include "libkita/boardmanager.h" +#include "libkita/config_xt.h" +#include "libkita/datmanager.h" +#include "libkita/flashcgi.h" +#include "libkita/jbbs.h" +#include "libkita/kita_misc.h" +#include "libkita/kita-utf8.h" #include "libkita/k2ch.h" #include "libkita/machibbs.h" -#include "libkita/jbbs.h" -#include "libkita/flashcgi.h" - -#include "htmlpart.h" - #include "kitaui/htmlview.h" -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - /*--------------------------------------------------------------------*/ QCp932Codec* KitaWriteView::m_cp932Codec = NULL; Modified: kita/branches/KITA-KDE4/kita/src/writeview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-05 12:21:14 UTC (rev 2368) +++ kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-05 21:22:06 UTC (rev 2369) @@ -11,10 +11,11 @@ #ifndef KITAWRITEVIEW_H #define KITAWRITEVIEW_H -#include +#include +#include + #include #include -#include #include "ui_writedialogbase.h" #include "writetabwidget.h" From svnnotify ¡÷ sourceforge.jp Mon Jul 6 06:49:31 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 06 Jul 2009 06:49:31 +0900 Subject: [Kita-svn] [2370] add support for code page 932 Message-ID: <1246830571.950086.25363.nullmailer@users.sourceforge.jp> Revision: 2370 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2370 Author: nogu Date: 2009-07-06 06:49:31 +0900 (Mon, 06 Jul 2009) Log Message: ----------- add support for code page 932 Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/main.cpp Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 21:22:06 UTC (rev 2369) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-05 21:49:31 UTC (rev 2370) @@ -62,7 +62,7 @@ QString Kita::qcpToUnicode( const QByteArray& str ) { - if ( !Kita::qcpCodec ) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); // TODO + if ( !Kita::qcpCodec ) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); return Kita::qcpCodec->toUnicode( str ); } @@ -85,7 +85,7 @@ QByteArray Kita::unicodeToQcp( const QString& str ) { - if ( !Kita::qcpCodec ) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); // TODO + if ( !Kita::qcpCodec ) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); return Kita::qcpCodec->fromUnicode( str ); } Modified: kita/branches/KITA-KDE4/kita/src/main.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-05 21:22:06 UTC (rev 2369) +++ kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-05 21:49:31 UTC (rev 2370) @@ -10,6 +10,8 @@ #include "mainwindow.h" +#include // setenv() + #include #include #include @@ -24,6 +26,8 @@ int main( int argc, char **argv ) { + // for code page 932 with NEC special characters + setenv("UNICODEMAP_JP", "cp932,nec-vdc", 1); KAboutData about( "kita", "Kita", ki18n( "Kita" ), version, ki18n( description ), KAboutData::License_GPL, ki18n( "(C) 2003-2009 Kita Developers" ), KLocalizedString(), QByteArray(), "ikemo ¡÷ users.sourceforge.jp" ); about.addAuthor( ki18n( "Hideki Ikemoto" ), ki18n( "maintainer, initial code" ), "ikemo ¡÷ users.sourceforge.jp" ); From svnnotify ¡÷ sourceforge.jp Mon Jul 6 22:54:56 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 06 Jul 2009 22:54:56 +0900 Subject: [Kita-svn] [2371] - remove reduntant NULL checks Message-ID: <1246888496.965523.16139.nullmailer@users.sourceforge.jp> Revision: 2371 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2371 Author: nogu Date: 2009-07-06 22:54:56 +0900 (Mon, 06 Jul 2009) Log Message: ----------- - remove reduntant NULL checks - use isEmpty() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp kita/branches/KITA-KDE4/kita/src/libkita/access.cpp kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp kita/branches/KITA-KDE4/kita/src/respopup.cpp Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-05 21:49:31 UTC (rev 2370) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-06 13:54:56 UTC (rev 2371) @@ -70,7 +70,7 @@ slotDeletePopup(); /* delete KitaDomTree */ - if ( m_domtree ) delete m_domtree; + delete m_domtree; m_domtree = NULL; /* update ViewPos */ @@ -1270,7 +1270,7 @@ /* public slot */ void KitaHTMLPart::slotDeletePopup() { - if ( m_popup ) delete m_popup; + delete m_popup; m_popup = NULL; m_multiPopup = false; } Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-05 21:49:31 UTC (rev 2370) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-06 13:54:56 UTC (rev 2371) @@ -68,7 +68,7 @@ delete part; } } - if ( m_manager ) delete m_manager; + delete m_manager; m_manager = NULL; /* remove widgets which don't belong to parts */ Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-05 21:49:31 UTC (rev 2370) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-06 13:54:56 UTC (rev 2371) @@ -62,7 +62,7 @@ } // set data size. - if ( orgData.size() == 0 ) return ; + if ( orgData.isEmpty() ) return ; m_dataSize = orgData.length(); switch ( m_bbstype ) { Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-05 21:49:31 UTC (rev 2370) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-06 13:54:56 UTC (rev 2371) @@ -157,7 +157,6 @@ DatInfoList::Iterator it; for ( it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it ) { - if ( ( *it ) == NULL ) continue; delete ( *it ); } } Modified: kita/branches/KITA-KDE4/kita/src/respopup.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-05 21:49:31 UTC (rev 2370) +++ kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-06 13:54:56 UTC (rev 2371) @@ -42,7 +42,7 @@ ResPopup::~ResPopup() { - if ( m_htmlPart ) delete m_htmlPart; + delete m_htmlPart; } From svnnotify ¡÷ sourceforge.jp Mon Jul 6 22:59:57 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 06 Jul 2009 22:59:57 +0900 Subject: [Kita-svn] [2372] remove files which are no longer used Message-ID: <1246888797.996118.21723.nullmailer@users.sourceforge.jp> Revision: 2372 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2372 Author: nogu Date: 2009-07-06 22:59:57 +0900 (Mon, 06 Jul 2009) Log Message: ----------- remove files which are no longer used Removed Paths: ------------- kita/branches/KITA-KDE4/admin/ kita/branches/KITA-KDE4/configure.in.in Deleted: kita/branches/KITA-KDE4/configure.in.in =================================================================== --- kita/branches/KITA-KDE4/configure.in.in 2009-07-06 13:54:56 UTC (rev 2371) +++ kita/branches/KITA-KDE4/configure.in.in 2009-07-06 13:59:57 UTC (rev 2372) @@ -1,23 +0,0 @@ -#MIN_CONFIG - -AM_INIT_AUTOMAKE(kita, 0.200.0) -AC_C_BIGENDIAN -AC_CHECK_KDEMAXPATHLEN - -AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local}) - -AC_ARG_ENABLE( - xdg-menu, - [ --enable-xdg-menu enables freedeskop.org's menu spec], - [use_xdg_menu=$enableval], - [use_xdg_menu=no] -) - -AM_CONDITIONAL(KITA_USE_XDG_MENU, test "$use_xdg_menu" = yes) - -AC_CHECK_LIB(art_lgpl_2, libart_preinit, - [], - [AC_MSG_ERROR([libart_lgpl_2 was not found! -Please check whether you installed libart_lgpl(-devel) correctly.])] -) - From svnnotify ¡÷ sourceforge.jp Mon Jul 6 23:03:21 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 06 Jul 2009 23:03:21 +0900 Subject: [Kita-svn] [2373] remove unused stuff Message-ID: <1246889001.099627.26045.nullmailer@users.sourceforge.jp> Revision: 2373 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2373 Author: nogu Date: 2009-07-06 23:03:21 +0900 (Mon, 06 Jul 2009) Log Message: ----------- remove unused stuff Removed Paths: ------------- kita/branches/KITA-KDE4/ConfigureChecks.cmake kita/branches/KITA-KDE4/ConvenienceLibs.cmake kita/branches/KITA-KDE4/ManualStuff.cmake From svnnotify ¡÷ sourceforge.jp Mon Jul 6 23:04:08 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 06 Jul 2009 23:04:08 +0900 Subject: [Kita-svn] [2374] don't include removed files Message-ID: <1246889048.409035.27330.nullmailer@users.sourceforge.jp> Revision: 2374 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2374 Author: nogu Date: 2009-07-06 23:04:08 +0900 (Mon, 06 Jul 2009) Log Message: ----------- don't include removed files Modified Paths: -------------- kita/branches/KITA-KDE4/CMakeLists.txt Modified: kita/branches/KITA-KDE4/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/CMakeLists.txt 2009-07-06 14:03:21 UTC (rev 2373) +++ kita/branches/KITA-KDE4/CMakeLists.txt 2009-07-06 14:04:08 UTC (rev 2374) @@ -7,12 +7,6 @@ include(MacroLibrary) -include(ConvenienceLibs.cmake) - -include(ManualStuff.cmake) - -include(ConfigureChecks.cmake) - include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) add_subdirectory(kita) From svnnotify ¡÷ sourceforge.jp Tue Jul 7 00:07:43 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 07 Jul 2009 00:07:43 +0900 Subject: [Kita-svn] [2375] replace NULL with 0 Message-ID: <1246892863.503682.4115.nullmailer@users.sourceforge.jp> Revision: 2375 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2375 Author: nogu Date: 2009-07-07 00:07:43 +0900 (Tue, 07 Jul 2009) Log Message: ----------- replace NULL with 0 Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/domtree.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 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/threadinfo.cpp kita/branches/KITA-KDE4/kita/src/respopup.cpp kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp kita/branches/KITA-KDE4/kita/src/writeview.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -127,7 +127,7 @@ QString tmpFile; QString url = Kita::Config::boardListUrl(); - if ( ! KIO::NetAccess::download( url, tmpFile, NULL ) ) { + if ( ! KIO::NetAccess::download( url, tmpFile, 0 ) ) { return false; } @@ -308,7 +308,7 @@ // clear list m_boardList->clear(); - m_favorites = NULL; + m_favorites = 0; QString configPath = KStandardDirs::locateLocal( "appdata", "board_list" ); KConfig config( configPath ); @@ -350,7 +350,7 @@ QString boardURL = "http://jbbs.livedoor.jp/computer/18420/" ; QString boardName = i18n( "Kita Board" ); QString oldURL; - new Kita::ListViewItem( m_boardList, NULL, boardName, boardURL ); + new Kita::ListViewItem( m_boardList, 0, boardName, boardURL ); Kita::BoardManager::enrollBoard( boardURL, boardName, oldURL ); loadExtBoard(); Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -82,7 +82,7 @@ KitaBoardView* KitaBoardTabWidget::findView( const KUrl& boardURL ) { int max = count() - 1; - if ( max <= 0 ) return NULL; + if ( max <= 0 ) return 0; int i = 0; while ( i < max ) { @@ -91,7 +91,7 @@ i++; } - return NULL; + return 0; } @@ -108,7 +108,7 @@ /* private */ KitaBoardView* KitaBoardTabWidget::isSubjectView( QWidget* w ) { - KitaBoardView * view = NULL; + KitaBoardView * view = 0; if ( w ) { if ( w->inherits( "KitaBoardView" ) ) view = static_cast< KitaBoardView* >( w ); } Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -248,7 +248,7 @@ } Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == NULL ) return ; + if ( thread == 0 ) return ; int id = item->text( Col_ID ).toInt(); int order = item->text( Col_IDOrder ).toInt(); updateListViewItem( item, datURL, current, id, order ); @@ -310,7 +310,7 @@ } else { /* normal */ item->setText( Col_MarkOrder, QString::number( Thread_Normal ) ); - item->setPixmap( Col_Mark, NULL ); + item->setPixmap( Col_Mark, 0 ); } // no effect: m_unreadNum, m_readNum, m_newNum, markOrder Modified: kita/branches/KITA-KDE4/kita/src/domtree.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -45,7 +45,7 @@ bool KitaDomTree::createResElement( int num ) { Q_ASSERT( num > 0 ); - Q_ASSERT( m_datInfo != NULL ); + Q_ASSERT( m_datInfo != 0 ); if ( num < m_bufSize && m_resStatus[ num ] != KITA_HTML_NOTPARSED ) { /* already parsed */ @@ -104,7 +104,7 @@ */ void KitaDomTree::redraw( bool force ) { - Q_ASSERT( m_datInfo != NULL ); + Q_ASSERT( m_datInfo != 0 ); int readNum = m_datInfo->getReadNum(); @@ -151,7 +151,7 @@ */ void KitaDomTree::appendFooterAndHeader() { - Q_ASSERT( m_datInfo != NULL ); + Q_ASSERT( m_datInfo != 0 ); int readNum = m_datInfo->getReadNum(); if ( !readNum ) return ; @@ -168,7 +168,7 @@ */ void KitaDomTree::appendKokoyon() { - Q_ASSERT( m_datInfo != NULL ); + Q_ASSERT( m_datInfo != 0 ); int readNum = m_datInfo->getReadNum(); if ( !readNum ) return ; @@ -226,7 +226,7 @@ /* '1-', '101-' ¤Ê¤É¤Î¥ê¥ó¥¯¤òºîÀ® */ for ( int num = 1; num < readNum ; num += 100 ) { - if ( node == NULL ) { + if ( node == 0 ) { QString href = QString( "#%1" ).arg( num ); QString linkStr = QString( "%1-" ).arg( num ); @@ -236,7 +236,7 @@ } else { // ´û¤Ë¥ê¥ó¥¯¤¬ºî¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤ÏÈô¤Ð¤¹ node = node.nextSibling(); - if ( node != NULL ) node = node.nextSibling(); + if ( node != 0 ) node = node.nextSibling(); } } @@ -255,7 +255,7 @@ */ void KitaDomTree::updateFooter( DOM::Element& footerElement ) { - Q_ASSERT( m_datInfo != NULL ); + Q_ASSERT( m_datInfo != 0 ); DOM::Element backupElement; int readNum = m_datInfo->getReadNum(); @@ -268,7 +268,7 @@ /* '1-', '101-' ¤Ê¤É¤Î¥ê¥ó¥¯¤òºîÀ® */ for ( int num = 1; num < readNum ; num += 100 ) { - if ( node == NULL ) { + if ( node == 0 ) { QString href = QString( "#%1" ).arg( num ); QString linkStr = QString( "%1-" ).arg( num ); @@ -278,7 +278,7 @@ } else { // ´û¤Ë¥ê¥ó¥¯¤¬ºî¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤ÏÈô¤Ð¤¹ node = node.nextSibling(); - if ( node != NULL ) node = node.nextSibling(); + if ( node != 0 ) node = node.nextSibling(); } } Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -47,8 +47,8 @@ : KHTMLPart( new KitaHTMLView( this, parent ) ) { m_mode = HTMLPART_MODE_MAINPART; - m_popup = NULL; - m_domtree = NULL; + m_popup = 0; + m_domtree = 0; m_datURL.clear(); m_updatedKokoyon = false; @@ -71,7 +71,7 @@ /* delete KitaDomTree */ delete m_domtree; - m_domtree = NULL; + m_domtree = 0; /* update ViewPos */ if ( m_mode == HTMLPART_MODE_MAINPART && !m_updatedKokoyon && !m_datURL.isEmpty() ) { @@ -291,7 +291,7 @@ /* redraw screen */ void KitaHTMLPart::redrawHTMLPart( const KUrl& datURL, bool force ) { - if ( m_domtree == NULL ) return ; + if ( m_domtree == 0 ) return ; if ( m_datURL != datURL ) return ; m_domtree->redraw( force ); @@ -504,8 +504,8 @@ { DOM::Node node; node = nodeUnderMouse(); - while ( node != NULL && node.nodeName().string() != "div" ) node = node.parentNode(); - if ( node == NULL ) return QString(); + while ( node != 0 && node.nodeName().string() != "div" ) node = node.parentNode(); + if ( node == 0 ) return QString(); return static_cast( node ).getAttribute( "id" ).string(); } @@ -538,7 +538,7 @@ /* private */ void KitaHTMLPart::findTextInit() { - m_findNode = NULL; + m_findNode = 0; m_findPos = -1; m_find_y = 0; } @@ -611,7 +611,7 @@ DOM::Node tmpnode = m_findNode.previousSibling(); - if ( tmpnode != NULL ) { + if ( tmpnode != 0 ) { QRect qr = tmpnode.getRect(); if ( reverse ) m_find_y -= qr.bottom() - qr.top(); @@ -653,7 +653,7 @@ m_findNode = next; if ( m_findNode.isNull() ) { - m_findNode = NULL; + m_findNode = 0; return false; } } @@ -876,7 +876,7 @@ if ( e->qmouseEvent() ->modifiers() & Qt::ControlModifier ) m_pushctrl = true; if ( e->qmouseEvent() ->button() & Qt::MidButton ) m_pushmidbt = true; - if ( e->url() != NULL ) { + if ( e->url() != 0 ) { if ( e->url().string().at( 0 ) == '#' ) { /* anchor */ kurl = m_datURL; @@ -1271,7 +1271,7 @@ void KitaHTMLPart::slotDeletePopup() { delete m_popup; - m_popup = NULL; + m_popup = 0; m_multiPopup = false; } Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -62,14 +62,14 @@ /* romove parts */ if ( m_manager && !( m_manager->parts().isEmpty() ) ) { KParts::Part * part; - while ( ( part = m_manager->parts().first() ) != NULL ) { + while ( ( part = m_manager->parts().first() ) != 0 ) { m_manager->removePart( part ); removePage( part->widget() ); delete part; } } delete m_manager; - m_manager = NULL; + m_manager = 0; /* remove widgets which don't belong to parts */ QWidget* view = currentWidget(); @@ -83,8 +83,8 @@ /* public slot */ void KitaTabWidgetBase::slotCurrentChanged( QWidget * w ) { - if ( m_manager == NULL ) return ; - if ( w == NULL ) return ; + if ( m_manager == 0 ) return ; + if ( w == 0 ) return ; w->activateWindow(); w->setFocus(); @@ -118,7 +118,7 @@ /* protected */ /* virtual */ void KitaTabWidgetBase::deleteWidget( QWidget* w ) { - if ( w == NULL ) return ; + if ( w == 0 ) return ; removePage( w ); KParts::Part* part = findPartFromWidget( w ); @@ -130,18 +130,18 @@ /* protected */ KParts::Part* KitaTabWidgetBase::findPartFromWidget( QWidget* w ) { - if ( w == NULL ) return NULL; - if ( m_manager == NULL ) return NULL; - if ( m_manager->parts().isEmpty() ) return NULL; + if ( w == 0 ) return 0; + if ( m_manager == 0 ) return 0; + if ( m_manager->parts().isEmpty() ) return 0; KParts::Part *part; QList::const_iterator it = m_manager->parts().begin(); - while ( ( part = ( *it ) ) != NULL ) { + while ( ( part = ( *it ) ) != 0 ) { if ( part->widget() == w ) return part; ++it; } - return NULL; + return 0; } /*------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -301,10 +301,10 @@ /* BoardManager */ -QTextCodec* Kita::BoardManager::m_cp932Codec = NULL; // FIXME -QTextCodec* Kita::BoardManager::m_eucJpCodec = NULL; +QTextCodec* Kita::BoardManager::m_cp932Codec = 0; +QTextCodec* Kita::BoardManager::m_eucJpCodec = 0; BoardDataList Kita::BoardManager::m_boardDataList; -BoardData* Kita::BoardManager::m_previousBoardData = NULL; +BoardData* Kita::BoardManager::m_previousBoardData = 0; QString Kita::BoardManager::m_previousBoardURL; @@ -323,7 +323,7 @@ const QString BoardManager::boardURL( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); return bdata->basePath(); } @@ -344,7 +344,7 @@ const QString BoardManager::boardRoot( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); return bdata->hostName() + bdata->rootPath(); } @@ -353,7 +353,7 @@ const QString BoardManager::boardPath( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); return bdata->bbsPath(); } @@ -362,7 +362,7 @@ const QString BoardManager::ext( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); return bdata->ext(); } @@ -371,7 +371,7 @@ const QString BoardManager::boardID( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); return bdata->bbsPath().mid( 1 ); /* remove "/" */ } @@ -381,7 +381,7 @@ const QString BoardManager::subjectURL( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); return bdata->basePath() + "subject.txt"; } @@ -391,7 +391,7 @@ const QString BoardManager::boardName( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); return bdata->boardName(); } @@ -401,7 +401,7 @@ int BoardManager::type( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return Board_Unknown; + if ( bdata == 0 ) return Board_Unknown; return bdata->type(); } @@ -456,7 +456,7 @@ /*-------------------------*/ BoardData* bdata = getBoardData( url ); - if ( bdata == NULL ) return ; + if ( bdata == 0 ) return ; /* download subject.txt */ if ( online ) { @@ -470,7 +470,7 @@ "UserAgent", QString( "Monazilla/1.00 (Kita/%1)" ).arg( "0.200.0" ) ); QString subjectPath = Cache::getSubjectPath( url ); - KIO::NetAccess::download( subjectURL( url ), subjectPath, NULL ); + KIO::NetAccess::download( subjectURL( url ), subjectPath, 0 ); } /* open and read subject.txt */ @@ -511,14 +511,14 @@ /* read idx file */ Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == NULL ) { + if ( thread == 0 ) { thread = Kita::Thread::getByURL( datURL ); - if ( thread == NULL ) continue; + if ( thread == 0 ) continue; ThreadIndex::loadIndex( thread, datURL, false ); } - if ( thread != NULL ) threadList.append( thread ); + if ( thread != 0 ) threadList.append( thread ); } } } @@ -622,7 +622,7 @@ delete( *it ); m_boardDataList.clear(); - m_previousBoardData = NULL; + m_previousBoardData = 0; m_previousBoardURL.clear(); } @@ -769,7 +769,7 @@ /* public */ /* static */ bool BoardManager::isEnrolled( const KUrl& url ) { - if ( getBoardData( url ) == NULL ) return false; + if ( getBoardData( url ) == 0 ) return false; return true; } @@ -777,11 +777,11 @@ /* public */ /* static */ BoardData* BoardManager::getBoardData( const KUrl& url ) { - if ( url.isEmpty() ) return NULL; + if ( url.isEmpty() ) return 0; QString urlstr = url.prettyUrl(); /* cache */ - if ( m_previousBoardData != NULL && m_previousBoardURL == urlstr ) return m_previousBoardData; + if ( m_previousBoardData != 0 && m_previousBoardURL == urlstr ) return m_previousBoardData; for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ) { @@ -799,7 +799,7 @@ } } - return NULL; + return 0; } @@ -825,7 +825,7 @@ bool BoardManager::loadBBSHistory( const KUrl& url ) { BoardData * bdata = getBoardData( url ); - if ( bdata == NULL ) return false; + if ( bdata == 0 ) return false; QStringList keyHosts(bdata->hostName()); @@ -869,11 +869,11 @@ /* Is oldURL enrolled? */ BoardData* bdata = getBoardData( oldURL ); - if ( bdata == NULL ) { + if ( bdata == 0 ) { /* Is newURL enrolled? */ bdata = getBoardData( newURL ); - if ( bdata == NULL ) return false; + if ( bdata == 0 ) return false; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -32,7 +32,7 @@ { /* Is board enrolled ? */ BoardData * bdata = BoardManager::getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); QString root = bdata->hostName() + bdata->rootPath(); @@ -44,7 +44,7 @@ { /* Is board enrolled ? */ BoardData * bdata = BoardManager::getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); QString bbs = bdata->bbsPath(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -43,11 +43,11 @@ /* get the pointer of Thread class */ m_thread = Kita::Thread::getByURLNew( m_datURL ); - if ( m_thread == NULL ) { + if ( m_thread == 0 ) { /* create Thread */ m_thread = Kita::Thread::getByURL( m_datURL ); - if ( m_thread == NULL ) return ; + if ( m_thread == 0 ) return ; /* read idx file */ ThreadIndex::loadIndex( m_thread, m_datURL ); @@ -156,12 +156,12 @@ if ( m_access ) { m_access->killJob(); delete m_access; - m_access = NULL; + m_access = 0; } if ( m_access2 ) { m_access2->killJob(); delete m_access2; - m_access2 = NULL; + m_access2 = 0; } } @@ -186,7 +186,7 @@ DatInfo emits the finishLoad signal to the parent object */ /* public */ bool DatInfo::updateCache( const QObject* parent ) { - if ( m_access == NULL ) return false; + if ( m_access == 0 ) return false; if ( m_nowLoading ) return false; m_nowLoading = true; @@ -279,7 +279,7 @@ ThreadIndex::saveIndex( m_thread, m_datURL ); /* re-try by offlaw.cgi */ - if ( m_thread->readNum() == 0 && m_access2 == NULL && DatManager::is2chThread( m_datURL ) ) { + if ( m_thread->readNum() == 0 && m_access2 == 0 && DatManager::is2chThread( m_datURL ) ) { if ( Account::isLogged() ) { initPrivate( true ); m_access2 = new OfflawAccess( m_datURL ); @@ -303,7 +303,7 @@ /* public */ int DatInfo::getResponseCode() { - if ( m_access == NULL ) return 0; + if ( m_access == 0 ) return 0; return m_access->responseCode(); } @@ -312,7 +312,7 @@ /* public */ int DatInfo::getServerTime() { - if ( m_access == NULL ) return 0; + if ( m_access == 0 ) return 0; return m_access->serverTime(); } @@ -345,7 +345,7 @@ It will cause deadlock , because Kita::Access::stopJob() calls KitaHTMLPart::slotFinishLoad() back, then KitaHTMLPart::slotFinishLoad() calls another functions in DatInfo. */ - if ( m_access == NULL ) return ; + if ( m_access == 0 ) return ; if ( ! m_nowLoading ) return ; m_access->stopJob(); @@ -694,7 +694,7 @@ /* public */ int DatInfo::getDatSize() { - if ( m_access == NULL ) return 0; + if ( m_access == 0 ) return 0; return m_access->dataSize(); } @@ -718,7 +718,7 @@ { if ( m_broken ) return m_broken; - if ( m_access == NULL ) return false; + if ( m_access == 0 ) return false; int rescode = m_access->responseCode(); bool invalid = m_access->invalidDataReceived(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -44,7 +44,7 @@ { if ( getDatInfo( url, false /* don't check the existence of cache */ - ) == NULL ) return false; + ) == 0 ) return false; return true; } @@ -67,7 +67,7 @@ If cache exists, create DatInfo and return its pointer. - If checkCached == true and cache does not exist, return NULL. + If checkCached == true and cache does not exist, return 0. If checkCached == false and cache does not exist, create DatInfo and return its pointer anyway. @@ -78,7 +78,7 @@ { /* search */ DatInfo * datInfo = searchDatInfo( url ); - if ( datInfo != NULL ) return datInfo; + if ( datInfo != 0 ) return datInfo; /* create and enroll instance */ return enrollDatInfo( url, checkCached ); @@ -90,8 +90,8 @@ DatInfo* DatManager::searchDatInfo( const KUrl& url ) { KUrl datURL = Kita::getDatURL( url ); - if ( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */ - if ( m_datInfoList.isEmpty() ) return NULL; + if ( datURL.isEmpty() ) return 0; /* This url is not enrolled in BoardManager. */ + if ( m_datInfoList.isEmpty() ) return 0; int i = 0; DatInfoList::Iterator it; @@ -113,7 +113,7 @@ } } - return NULL; + return 0; } @@ -122,7 +122,7 @@ DatInfo* DatManager::enrollDatInfo( const KUrl& url, bool checkCached ) { KUrl datURL = Kita::getDatURL( url ); - if ( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */ + if ( datURL.isEmpty() ) return 0; /* This url is not enrolled in BoardManager. */ /* create DatInfo & read cached data */ DatInfo* datInfo = new DatInfo( datURL ); @@ -131,7 +131,7 @@ /* If cache does not exist, delete DatInfo here. */ if ( checkCached && datInfo->getReadNum() == 0 ) { delete datInfo; - return NULL; + return 0; } m_datInfoList.prepend( datInfo ); @@ -142,7 +142,7 @@ DatInfoList::Iterator it; for ( it = m_datInfoList.at( DMANAGER_MAXQUEUE ); it != m_datInfoList.end(); ++it ) { - if ( ( *it ) == NULL ) continue; + if ( ( *it ) == 0 ) continue; DatInfo* deleteInfo = ( *it ); } } @@ -171,7 +171,7 @@ bool DatManager::updateCache( const KUrl& url , const QObject* parent ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->updateCache( parent ); } @@ -181,7 +181,7 @@ int DatManager::getResponseCode( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return 0; + if ( datInfo == 0 ) return 0; return datInfo->getResponseCode(); } @@ -190,7 +190,7 @@ int DatManager::getServerTime( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return 0; + if ( datInfo == 0 ) return 0; return datInfo->getServerTime(); } @@ -201,7 +201,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == NULL ) return false; + if ( thread == 0 ) return false; if ( thread->readNum() == 0 ) return false; /* init DatInfo */ @@ -230,7 +230,7 @@ bool DatManager::isLoadingNow( const KUrl& url ) { DatInfo * datInfo = searchDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->isLoadingNow(); } @@ -240,7 +240,7 @@ void DatManager::stopLoading( const KUrl& url ) { DatInfo * datInfo = searchDatInfo( url ); - if ( datInfo == NULL ) return ; + if ( datInfo == 0 ) return ; return datInfo->stopLoading(); } @@ -253,7 +253,7 @@ QString DatManager::getDat( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getDat( num ); } @@ -264,7 +264,7 @@ QString DatManager::getId( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getId( num ); } @@ -274,7 +274,7 @@ QString DatManager::getPlainName( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getPlainName( num ); } @@ -284,7 +284,7 @@ QString DatManager::getPlainBody( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getPlainBody( num ); } @@ -294,7 +294,7 @@ QString DatManager::getPlainTitle( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getPlainTitle( num ); } @@ -305,7 +305,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != NULL ) return thread->threadName(); + if ( thread != 0 ) return thread->threadName(); return QString(); } @@ -336,7 +336,7 @@ QString DatManager::getHtml( const KUrl& url, int startnum, int endnum, bool checkAbone ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getHTMLString( startnum, endnum, checkAbone ); } @@ -347,7 +347,7 @@ QString DatManager::getHtmlByID( const KUrl& url, const QString& strid, int &count ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getHtmlByID( strid, count ); } @@ -358,7 +358,7 @@ QString DatManager::getTreeByRes( const KUrl& url, const int rootnum, int &count ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getTreeByRes( rootnum, count ); } @@ -367,7 +367,7 @@ QString DatManager::getTreeByResReverse( const KUrl& url, const int rootnum, int &count ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return QString(); + if ( datInfo == 0 ) return QString(); return datInfo->getTreeByResReverse( rootnum, count ); } @@ -378,7 +378,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != NULL ) return thread->resNum(); + if ( thread != 0 ) return thread->resNum(); return 0; } @@ -389,7 +389,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != NULL ) return thread->readNum(); + if ( thread != 0 ) return thread->readNum(); return 0; } @@ -400,7 +400,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != NULL ) return thread->viewPos(); + if ( thread != 0 ) return thread->viewPos(); return 0; } @@ -411,7 +411,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != NULL ) thread->setViewPos( num ); + if ( thread != 0 ) thread->setViewPos( num ); /* save idx */ Kita::ThreadIndex::setViewPos( url, num ); @@ -425,7 +425,7 @@ int DatManager::getDatSize( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return 0; + if ( datInfo == 0 ) return 0; return datInfo->getDatSize(); } @@ -434,7 +434,7 @@ int DatManager::getNumByID( const KUrl& url, const QString& strid ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return 0; + if ( datInfo == 0 ) return 0; return datInfo->getNumByID( strid ); } @@ -469,7 +469,7 @@ bool DatManager::isResValid( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->isResValid( num ); } @@ -479,7 +479,7 @@ bool DatManager::isBroken( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->isBroken(); } @@ -488,7 +488,7 @@ bool DatManager::isResBroken( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->isResBroken( num ); } @@ -499,7 +499,7 @@ bool DatManager::checkID( const KUrl& url, const QString& strid, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->checkID( strid, num ); } @@ -512,7 +512,7 @@ ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->checkWord( strlist, num, checkOR ); } @@ -523,7 +523,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == NULL ) return false; + if ( thread == 0 ) return false; return thread->isMarked( num ); } @@ -534,7 +534,7 @@ { KUrl datURL = Kita::getDatURL( url ); Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == NULL ) return ; + if ( thread == 0 ) return ; if ( thread->setMark( num, mark ) ) Kita::ThreadIndex::setMarkList( url, thread->markList() ); } @@ -544,7 +544,7 @@ bool DatManager::checkAbone( const KUrl& url, int num ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->checkAbone( num ); } @@ -554,7 +554,7 @@ void DatManager::resetAbone( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return ; + if ( datInfo == 0 ) return ; datInfo->resetAbone(); } @@ -564,7 +564,7 @@ bool DatManager::isMainThreadOpened( const KUrl& url ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return false; + if ( datInfo == 0 ) return false; return datInfo->isOpened(); } @@ -572,7 +572,7 @@ void DatManager::setMainThreadOpened( const KUrl& url, bool isOpened ) { DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == NULL ) return; + if ( datInfo == 0 ) return; datInfo->setIsOpened( isOpened ); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -122,7 +122,7 @@ void FavoriteBoards::replace( QString fromURL, QString toURL ) { - if ( FavoriteBoards::getInstance() == NULL ) return ; + if ( FavoriteBoards::getInstance() == 0 ) return ; Q3ValueList& boardList = FavoriteBoards::getInstance() ->m_list; for ( Q3ValueList::iterator it = boardList.begin(); it != boardList.end(); ++it ) { QString url = ( *it ).url(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -168,7 +168,7 @@ void FavoriteThreads::replace( QString fromURL, QString toURL ) { - if ( FavoriteThreads::getInstance() == NULL ) return ; + if ( FavoriteThreads::getInstance() == 0 ) return ; Q3ValueList& threadList = FavoriteThreads::getInstance() ->m_threadList; Q3ValueList::iterator it; for ( it = threadList.begin(); it != threadList.end(); ++it ) { Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -32,9 +32,9 @@ namespace Kita { - static QTextCodec* qcpCodec = NULL; - static QTextCodec* utf8Codec = NULL; - static QTextCodec* eucCodec = NULL; + static QTextCodec* qcpCodec = 0; + static QTextCodec* utf8Codec = 0; + static QTextCodec* eucCodec = 0; static QString m_weekstr[ 7 ]; static QString m_colonstr; @@ -383,7 +383,7 @@ /* Is board enrolled ? */ BoardData* bdata = Kita::BoardManager::getBoardData( url ); - if ( bdata == NULL ) return QString(); + if ( bdata == 0 ) return QString(); QString urlstr = url.prettyUrl(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -143,14 +143,14 @@ /* static & public */ Thread* Thread::getByURLNew( const KUrl& datURL ) { - if ( m_threadDict == NULL ) return NULL; + if ( m_threadDict == 0 ) return 0; return m_threadDict->find( datURL.prettyUrl() ); } void Thread::replace( const QString& fromURL, const QString& toURL ) { - if ( m_threadDict == NULL ) return ; + if ( m_threadDict == 0 ) return ; Q3DictIterator it( *m_threadDict ); for ( ; it.current(); ++it ) { QString url = it.currentKey(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -51,7 +51,7 @@ { QMap::Iterator it; KitaThreadInfo* instance = KitaThreadInfo::getInstance(); - if ( instance == NULL ) return ; + if ( instance == 0 ) return ; for ( it = instance->m_readDict.begin(); it != instance->m_readDict.end(); ++it ) { QString url = it.key(); Modified: kita/branches/KITA-KDE4/kita/src/respopup.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -32,7 +32,7 @@ ) { m_url = url; - m_htmlPart = NULL; + m_htmlPart = 0; m_htmlPart = new KitaHTMLPart( this ); m_htmlPart->setup( HTMLPART_MODE_POPUP , url ); Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -136,7 +136,7 @@ KUrl datURL = Kita::ParseMisc::parseURLonly( url ); int max = count(); - if ( max == 0 ) return NULL; + if ( max == 0 ) return 0; int i = 0; while ( i < max ) { @@ -152,14 +152,14 @@ i++; } - return NULL; + return 0; } /* private */ KitaThreadView* KitaThreadTabWidget::isThreadView( QWidget* w ) { - KitaThreadView * view = NULL; + KitaThreadView * view = 0; if ( w ) { if ( w->inherits( "KitaThreadView" ) ) view = static_cast< KitaThreadView* >( w ); } Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -163,7 +163,7 @@ if ( m_threadPart ) { delete m_threadPart; - m_threadPart = NULL; + m_threadPart = 0; } } Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -94,10 +94,10 @@ KitaWriteView* KitaWriteTabWidget::findWriteView( const KUrl& url ) { KUrl datURL = Kita::getDatURL( url ); - if ( datURL.isEmpty() ) return NULL; + if ( datURL.isEmpty() ) return 0; int max = count(); - if ( max == 0 ) return NULL; + if ( max == 0 ) return 0; for( int i=0; i < max; i++ ) { KitaWriteView * view = isWriteView( widget ( i ) ); @@ -106,14 +106,14 @@ } } - return NULL; + return 0; } /* private */ KitaWriteView* KitaWriteTabWidget::isWriteView( QWidget* w ) { - KitaWriteView * view = NULL; + KitaWriteView * view = 0; if ( w ) { if ( w->inherits( "KitaWriteView" ) ) view = static_cast< KitaWriteView* >( w ); } @@ -151,7 +151,7 @@ { KitaWriteView * view = isWriteView( w ); - if ( view == NULL ) return ; + if ( view == 0 ) return ; if ( view->body().length() ) { if ( QMessageBox::warning( this, "Kita", Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-06 14:04:08 UTC (rev 2374) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-06 15:07:43 UTC (rev 2375) @@ -47,7 +47,7 @@ /*--------------------------------------------------------------------*/ -QCp932Codec* KitaWriteView::m_cp932Codec = NULL; +QCp932Codec* KitaWriteView::m_cp932Codec = 0; /* From svnnotify ¡÷ sourceforge.jp Tue Jul 7 00:16:44 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 07 Jul 2009 00:16:44 +0900 Subject: [Kita-svn] [2376] remove unused files Message-ID: <1246893404.679182.15342.nullmailer@users.sourceforge.jp> Revision: 2376 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2376 Author: nogu Date: 2009-07-07 00:16:44 +0900 (Tue, 07 Jul 2009) Log Message: ----------- remove unused files Removed Paths: ------------- kita/branches/KITA-KDE4/kita/src/libkita/qjpunicode.h kita/branches/KITA-KDE4/kita/src/libkita/qsjiscodec.h Deleted: kita/branches/KITA-KDE4/kita/src/libkita/qjpunicode.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/qjpunicode.h 2009-07-06 15:07:43 UTC (rev 2375) +++ kita/branches/KITA-KDE4/kita/src/libkita/qjpunicode.h 2009-07-06 15:16:44 UTC (rev 2376) @@ -1,170 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info ¡÷ nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information -** to ensure GNU General Public Licensing requirements will be met: -** http://www.fsf.org/licensing/licenses/info/GPLv2.html and -** http://www.gnu.org/copyleft/gpl.html. In addition, as a special -** exception, Nokia gives you certain additional rights. These rights -** are described in the Nokia Qt GPL Exception version 1.3, included in -** the file GPL_EXCEPTION.txt in this package. -** -** Qt for Windows(R) Licensees -** As a special exception, Nokia, as the sole copyright holder for Qt -** Designer, grants users of the Qt/Eclipse Integration plug-in the -** right for the Qt/Eclipse Integration to link to functionality -** provided by Qt Designer and its related libraries. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales ¡÷ nokia.com. -** -****************************************************************************/ - -// Most of the code here was originally written by Serika Kurusugawa -// a.k.a. Junji Takagi, and is included in Qt with the author's permission, -// and the grateful thanks of the Trolltech team. - -/* - * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef QJPUNICODE_H -#define QJPUNICODE_H - -#include - -QT_BEGIN_NAMESPACE - -class QJpUnicodeConv { -public: - virtual ~QJpUnicodeConv() {} - enum Rules { - // "ASCII" is ANSI X.3.4-1986, a.k.a. US-ASCII here. - Default = 0x0000, - - Unicode = 0x0001, - Unicode_JISX0201 = 0x0001, - Unicode_ASCII = 0x0002, - JISX0221_JISX0201 = 0x0003, - JISX0221_ASCII = 0x0004, - Sun_JDK117 = 0x0005, - Microsoft_CP932 = 0x0006, - - NEC_VDC = 0x0100, // NEC Vender Defined Char - UDC = 0x0200, // User Defined Char - IBM_VDC = 0x0400 // IBM Vender Defined Char - }; - static QJpUnicodeConv *newConverter(int rule); - - virtual uint asciiToUnicode(uint h, uint l) const; - /*virtual*/ uint jisx0201ToUnicode(uint h, uint l) const; - virtual uint jisx0201LatinToUnicode(uint h, uint l) const; - /*virtual*/ uint jisx0201KanaToUnicode(uint h, uint l) const; - virtual uint jisx0208ToUnicode(uint h, uint l) const; - virtual uint jisx0212ToUnicode(uint h, uint l) const; - - uint asciiToUnicode(uint ascii) const { - return asciiToUnicode((ascii & 0xff00) >> 8, (ascii & 0x00ff)); - } - uint jisx0201ToUnicode(uint jis) const { - return jisx0201ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0201LatinToUnicode(uint jis) const { - return jisx0201LatinToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0201KanaToUnicode(uint jis) const { - return jisx0201KanaToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0208ToUnicode(uint jis) const { - return jisx0208ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0212ToUnicode(uint jis) const { - return jisx0212ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - - virtual uint unicodeToAscii(uint h, uint l) const; - /*virtual*/ uint unicodeToJisx0201(uint h, uint l) const; - virtual uint unicodeToJisx0201Latin(uint h, uint l) const; - /*virtual*/ uint unicodeToJisx0201Kana(uint h, uint l) const; - virtual uint unicodeToJisx0208(uint h, uint l) const; - virtual uint unicodeToJisx0212(uint h, uint l) const; - - uint unicodeToAscii(uint unicode) const { - return unicodeToAscii((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0201(uint unicode) const { - return unicodeToJisx0201((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0201Latin(uint unicode) const { - return unicodeToJisx0201Latin((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0201Kana(uint unicode) const { - return unicodeToJisx0201Kana((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0208(uint unicode) const { - return unicodeToJisx0208((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0212(uint unicode) const { - return unicodeToJisx0212((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - - uint sjisToUnicode(uint h, uint l) const; - uint unicodeToSjis(uint h, uint l) const; - uint sjisibmvdcToUnicode(uint h, uint l) const; - uint unicodeToSjisibmvdc(uint h, uint l) const; - uint cp932ToUnicode(uint h, uint l) const; - uint unicodeToCp932(uint h, uint l) const; - - uint sjisToUnicode(uint sjis) const { - return sjisToUnicode((sjis & 0xff00) >> 8, (sjis & 0x00ff)); - } - uint unicodeToSjis(uint unicode) const { - return unicodeToSjis((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - -protected: - explicit QJpUnicodeConv(int r) : rule(r) {} - -private: - int rule; -}; - -QT_END_NAMESPACE - -#endif // QJPUNICODE_H Deleted: kita/branches/KITA-KDE4/kita/src/libkita/qsjiscodec.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/qsjiscodec.h 2009-07-06 15:07:43 UTC (rev 2375) +++ kita/branches/KITA-KDE4/kita/src/libkita/qsjiscodec.h 2009-07-06 15:16:44 UTC (rev 2376) @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info ¡÷ nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information -** to ensure GNU General Public Licensing requirements will be met: -** http://www.fsf.org/licensing/licenses/info/GPLv2.html and -** http://www.gnu.org/copyleft/gpl.html. In addition, as a special -** exception, Nokia gives you certain additional rights. These rights -** are described in the Nokia Qt GPL Exception version 1.3, included in -** the file GPL_EXCEPTION.txt in this package. -** -** Qt for Windows(R) Licensees -** As a special exception, Nokia, as the sole copyright holder for Qt -** Designer, grants users of the Qt/Eclipse Integration plug-in the -** right for the Qt/Eclipse Integration to link to functionality -** provided by Qt Designer and its related libraries. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales ¡÷ nokia.com. -** -****************************************************************************/ - -// Most of the code here was originally written by Serika Kurusugawa -// a.k.a. Junji Takagi, and is included in Qt with the author's permission, -// and the grateful thanks of the Trolltech team. - -/* - * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef QSJISCODEC_H -#define QSJISCODEC_H - -#include "qjpunicode.h" -#include -#include - -QT_BEGIN_NAMESPACE - -#ifndef QT_NO_TEXTCODEC - -class QSjisCodec : public QTextCodec { -public: - static QByteArray _name(); - static QList _aliases(); - static int _mibEnum(); - - QByteArray name() const { return _name(); } - QList aliases() const { return _aliases(); } - int mibEnum() const { return _mibEnum(); } - - QString convertToUnicode(const char *, int, ConverterState *) const; - QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const; - - QSjisCodec(); - ~QSjisCodec(); - -protected: - const QJpUnicodeConv *conv; -}; - -#endif // QT_NO_TEXTCODEC - -QT_END_NAMESPACE - -#endif // QSJISCODEC_H From svnnotify ¡÷ sourceforge.jp Tue Jul 7 06:02:29 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 07 Jul 2009 06:02:29 +0900 Subject: [Kita-svn] [2377] avoid a crash on exit Message-ID: <1246914149.751001.21238.nullmailer@users.sourceforge.jp> Revision: 2377 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2377 Author: nogu Date: 2009-07-07 06:02:29 +0900 (Tue, 07 Jul 2009) Log Message: ----------- avoid a crash on exit Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-06 15:16:44 UTC (rev 2376) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-06 21:02:29 UTC (rev 2377) @@ -154,11 +154,8 @@ /* public */ void DatManager::deleteAllDatInfo() { - DatInfoList::Iterator it; - for ( it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it ) { - - delete ( *it ); - } + while (!m_datInfoList.isEmpty()) + delete m_datInfoList.takeFirst(); } From svnnotify ¡÷ sourceforge.jp Wed Jul 8 22:01:42 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 08 Jul 2009 22:01:42 +0900 Subject: [Kita-svn] [2378] make all the classes that have pointer data members uncopyable Message-ID: <1247058102.782190.13340.nullmailer@users.sourceforge.jp> Revision: 2378 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2378 Author: nogu Date: 2009-07-08 22:01:42 +0900 (Wed, 08 Jul 2009) Log Message: ----------- make all the classes that have pointer data members uncopyable Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/boardview.h kita/branches/KITA-KDE4/kita/src/domtree.h kita/branches/KITA-KDE4/kita/src/htmlpart.h kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h kita/branches/KITA-KDE4/kita/src/libkita/access.h kita/branches/KITA-KDE4/kita/src/libkita/account.h kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h kita/branches/KITA-KDE4/kita/src/mainwindow.h kita/branches/KITA-KDE4/kita/src/prefs/prefs.h kita/branches/KITA-KDE4/kita/src/respopup.h kita/branches/KITA-KDE4/kita/src/threadview.h kita/branches/KITA-KDE4/kita/src/viewmediator.h kita/branches/KITA-KDE4/kita/src/writeview.h Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -81,6 +81,8 @@ private: void loadExtBoard(); bool downloadBoardList(); + KitaBBSView(const KitaBBSView&); + KitaBBSView& operator=(const KitaBBSView&); }; #endif Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -59,6 +59,8 @@ void loadHeaderOnOff(); bool autoResize(); void setAutoResize( bool flag ); + KitaBoardView(const KitaBoardView&); + KitaBoardView& operator=(const KitaBoardView&); private slots: void loadThread( Q3ListViewItem* item ); Modified: kita/branches/KITA-KDE4/kita/src/domtree.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -24,6 +24,9 @@ class KitaDomTree { + KitaDomTree(const KitaDomTree&); + KitaDomTree& operator=(const KitaDomTree&); + Kita::DatInfo* m_datInfo; int m_bufSize; Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -158,6 +158,9 @@ bool isUnderMouse( int mrgwd, int mrght ); bool showSelectedDigitPopup(); + KitaHTMLPart(const KitaHTMLPart&); + KitaHTMLPart& operator=(const KitaHTMLPart&); + protected: /* user event */ Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -69,6 +69,8 @@ private: void setupActions(); + KitaTabWidgetBase(const KitaTabWidgetBase&); + KitaTabWidgetBase& operator=(const KitaTabWidgetBase&); public slots: void slotConfigureKeys(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -69,6 +69,9 @@ void redirection( const QString& ); void receiveData( const QStringList& ); void finishLoad(); + private: + Access(const Access&); + Access& operator=(const Access&); }; class OfflawAccess : public Access Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -46,6 +46,9 @@ private slots: void slotReceiveData( KIO::Job* job, const QByteArray& data ); void slotResult( KIO::Job* job ); + private: + Account(const Account&); + Account& operator=(const Account&); public: static const QString& getSessionID() { return getInstance() ->m_sessionID; } static bool isLogged() { return getInstance() ->m_isLogged; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -212,6 +212,8 @@ /* parsing functions */ bool parseDat( int num ); + DatInfo(const DatInfo&); + DatInfo& operator=(const DatInfo&); /*----------------------------*/ private slots: Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -93,6 +93,9 @@ void loadAboneIDList(); void loadAboneNameList(); void loadAboneWordList(); + + KitaMainWindow(const KitaMainWindow&); + KitaMainWindow& operator=(const KitaMainWindow&); }; #endif // KITAMAINWINDOW_H Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -49,6 +49,8 @@ virtual void slotApply(); private: + KitaPreferences(const KitaPreferences&); + KitaPreferences& operator=(const KitaPreferences&); Kita::Ui::FacePrefPage* m_facePage; Kita::Ui::AsciiArtPrefPage* m_asciiArtPage; Kita::Ui::UIPrefPage* m_uiPage; Modified: kita/branches/KITA-KDE4/kita/src/respopup.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/respopup.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -35,6 +35,8 @@ private: void showImage( const KUrl& url ); + ResPopup(const ResPopup&); + ResPopup& operator=(const ResPopup&); signals: void hideChildPopup(); Modified: kita/branches/KITA-KDE4/kita/src/threadview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -84,6 +84,13 @@ void slotPopupMenu( KXMLGUIClient*, const QPoint&, const KUrl&, const QString&, mode_t ); private: + void insertSearchCombo(); + void setSubjectLabel( const QString& boardName, const QString& threadName, const QString boardURL ); + void updateButton(); + + KitaThreadView(const KitaThreadView&); + KitaThreadView& operator=(const KitaThreadView&); + int m_serverTime; KUrl m_datURL; KitaHTMLPart* m_threadPart; @@ -92,9 +99,6 @@ int m_viewmode; int m_rescode; - void insertSearchCombo(); - void setSubjectLabel( const QString& boardName, const QString& threadName, const QString boardURL ); - void updateButton(); QToolButton* writeButton; KComboBox* SearchCombo; QToolButton* HighLightButton; Modified: kita/branches/KITA-KDE4/kita/src/viewmediator.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/viewmediator.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/viewmediator.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -53,6 +53,10 @@ void changeWriteTab( const KUrl& datURL ); void updateFavoriteListView(); void openURL( const KUrl& url ); + +private: + ViewMediator(const ViewMediator&); + ViewMediator& operator=(const ViewMediator&); }; #endif Modified: kita/branches/KITA-KDE4/kita/src/writeview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-06 21:02:29 UTC (rev 2377) +++ kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-08 13:01:42 UTC (rev 2378) @@ -49,6 +49,9 @@ QString getJBBSPostStr(); QString getFlashCGIPostStr(); + KitaWriteView(const KitaWriteView&); + KitaWriteView& operator=(const KitaWriteView&); + protected: Q3CString m_array; From svnnotify ¡÷ sourceforge.jp Wed Jul 8 22:23:35 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 08 Jul 2009 22:23:35 +0900 Subject: [Kita-svn] [2379] remove files related to CVS Message-ID: <1247059415.753926.9320.nullmailer@users.sourceforge.jp> Revision: 2379 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2379 Author: nogu Date: 2009-07-08 22:23:35 +0900 (Wed, 08 Jul 2009) Log Message: ----------- remove files related to CVS Removed Paths: ------------- kita/branches/KITA-KDE4/.cvsignore kita/branches/KITA-KDE4/Makefile.cvs kita/branches/KITA-KDE4/kita/.cvsignore kita/branches/KITA-KDE4/kita/doc/.cvsignore kita/branches/KITA-KDE4/kita/doc/en/.cvsignore kita/branches/KITA-KDE4/kita/po/.cvsignore kita/branches/KITA-KDE4/kita/src/.cvsignore kita/branches/KITA-KDE4/kita/src/kitaui/.cvsignore kita/branches/KITA-KDE4/kita/src/libkita/.cvsignore kita/branches/KITA-KDE4/kita/src/prefs/.cvsignore Deleted: kita/branches/KITA-KDE4/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,22 +0,0 @@ -Makefile -Makefile.in -acinclude.m4 -aclocal.m4 -autom4te.cache -config.h -config.h.in -config.log -config.status -configure -configure.files -configure.in -libtool -stamp-h.in -stamp-h1 -subdirs -kita.kdevelop.pcs -kita.kdevses -html -latex -xml -kita.tag Deleted: kita/branches/KITA-KDE4/Makefile.cvs =================================================================== --- kita/branches/KITA-KDE4/Makefile.cvs 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/Makefile.cvs 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,10 +0,0 @@ -all: - @echo "This Makefile is only for the CVS repository" - @echo "This will be deleted before making the distribution" - @echo "" - $(MAKE) -f admin/Makefile.common cvs - -dist: - $(MAKE) -f admin/Makefile.common dist - -.SILENT: Deleted: kita/branches/KITA-KDE4/kita/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,3 +0,0 @@ -Makefile -Makefile.in -kita.kdevses Deleted: kita/branches/KITA-KDE4/kita/doc/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/doc/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/doc/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,2 +0,0 @@ -Makefile -Makefile.in Deleted: kita/branches/KITA-KDE4/kita/doc/en/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/doc/en/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/doc/en/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,3 +0,0 @@ -Makefile -Makefile.in -index.cache.bz2 Deleted: kita/branches/KITA-KDE4/kita/po/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/po/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/po/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,3 +0,0 @@ -*.gmo -Makefile -Makefile.in Deleted: kita/branches/KITA-KDE4/kita/src/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/src/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/src/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,18 +0,0 @@ -kita -kita_client -kitaiface.kidl -kitaiface_skel.cpp -threadproperty.cpp -threadproperty.h -dummy.cpp -Makefile -Makefile.in -*base.cpp -*base.h -*.la -*.lo -*.moc -*.moc.cpp -*.all_cpp.cpp -.deps -.libs Deleted: kita/branches/KITA-KDE4/kita/src/kitaui/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/src/kitaui/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,9 +0,0 @@ -Makefile -Makefile.in -*.la -*.lo -*.moc -*.moc.cpp -*.all_cpp.cpp -.deps -.libs Deleted: kita/branches/KITA-KDE4/kita/src/libkita/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/src/libkita/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,15 +0,0 @@ -Makefile -Makefile.in -*.la -*.lo -*.moc -*.moc.cpp -*.all_cpp.cpp -.deps -.libs -config_xt.cpp -config_xt.h -asciiart.cpp -asciiart.h -abone.cpp -abone.h Deleted: kita/branches/KITA-KDE4/kita/src/prefs/.cvsignore =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/.cvsignore 2009-07-08 13:01:42 UTC (rev 2378) +++ kita/branches/KITA-KDE4/kita/src/prefs/.cvsignore 2009-07-08 13:23:35 UTC (rev 2379) @@ -1,14 +0,0 @@ -Makefile -Makefile.in -*base.cpp -*base.h -write_page.cpp -write_page.h -login_page.cpp -login_page.h -*.la -*.lo -*.moc -*.moc.cpp -.deps -.libs From svnnotify ¡÷ sourceforge.jp Wed Jul 8 22:52:53 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 08 Jul 2009 22:52:53 +0900 Subject: [Kita-svn] [2380] convert files to UTF-8 Message-ID: <1247061173.565237.17283.nullmailer@users.sourceforge.jp> Revision: 2380 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2380 Author: nogu Date: 2009-07-08 22:52:53 +0900 (Wed, 08 Jul 2009) Log Message: ----------- convert files to UTF-8 Modified Paths: -------------- kita/branches/KITA-KDE4/README kita/branches/KITA-KDE4/README.2ch kita/branches/KITA-KDE4/README.machibbs kita/branches/KITA-KDE4/TODO kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp Modified: kita/branches/KITA-KDE4/README =================================================================== --- kita/branches/KITA-KDE4/README 2009-07-08 13:23:35 UTC (rev 2379) +++ kita/branches/KITA-KDE4/README 2009-07-08 13:52:53 UTC (rev 2380) @@ -1,15 +1,15 @@ Kita - 2ch client for KDE -KDEÍÑ2¤Á¤ã¤ó¤Í¤ë¥Ö¥é¥¦¥¶¤Ç¤¹¡£ +KDE???¡ã???????????¶ã???? -¥é¥¤¥»¥ó¥¹¤ÏGPL version 2¤Þ¤¿¤Ï¤½¤ì°Ê¹ß¤Ç¤¹¡£ -(qcp932codec.{cpp,h}¤Î¤ßBSD¥é¥¤¥»¥ó¥¹¤È¤·¤Æ°·¤Ã¤Æ¤¯¤À¤µ¤¤¡£) +????»ã??¹ã?GPL version 2?¾ã??????»¥?????? +(qcp932codec.{cpp,h}???BSD????»ã??¹ã?????±ã??????????) -* Á°Äó¾ò·ï +* ????ä»? -Qt 3.2°Ê¹ß¡¢KDE 3.2°Ê¹ß¤Ê¤éÌäÂê̵¤¯Æ°¤¯¤Ï¤º¤Ç¤¹¡£ +Qt 3.2以é???DE 3.2以é?????é¡??????????§ã??? -* ¥¤¥ó¥¹¥È¡¼¥ë +* ?¤ã??¹ã??¼ã? tar xvfz kita-x.y.z.tar.gz cd kita-x.y.z @@ -17,48 +17,48 @@ make make install -CVS¤«¤é¤È¤Ã¤ÆÍ褿¾ì¹ç¤Ë¤Ï¡¢ +CVS?????????????????? make -f Makefile.cvs ./configure make make install -* ¥³¥ó¥Ñ¥¤¥ë»þ¤ÎÃí°Õ +* ?³ã?????????³¨?? -configure¤Ç¥¨¥é¡¼¤¬½Ð¤ë¾ì¹ç¤Ï¤ª¤½¤é¤¯¥é¥¤¥Ö¥é¥ê¤¬Â­¤ê¤Þ¤»¤ó¡£ +configure?§ã????????????????????????????足ã??¾ã???? kdelibs-devel kdebase-devel arts-devel libart_lgpl-devel -¤¢¤¿¤ê¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¯¤À¤µ¤¤¡£ -¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥¨¥é¡¼¤¬½Ð¤ë¾ì¹ç¤â¥é¥¤¥Ö¥é¥ê¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£ +???????¤ã??¹ã??¼ã??????????? +?³ã???????????????????????????????å­??????§ã????????????? -x86-64(AMD64, EM64T)¤Î¾ì¹ç¤Ï¡¢°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ +x86-64(AMD64, EM64T)????????»¥ä¸??????·ã??³ã?????????????? --enable-libsuffix=64 --with-qt-libraries=/usr/lib64/qt-3.3/lib -(--with-qt-libraries¤Ç»ØÄꤹ¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÏOS¤Ë¤è¤Ã¤Æ°Û¤Ê¤ê¤Þ¤¹) +(--with-qt-libraries?§æ?å®??????£ã???????OS????£ã??°ã?????? -* ¼Â¹Ô»þ¤ÎÃí°Õ +* å®?????æ³?? -KDE¤È°Û¤Ê¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¾ì¹ç¤Ï¡¢ -´Ä¶­ÊÑ¿ôKDEDIRS¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ -¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï /usr °Ê²¼¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¤¿¤á¡¢ -SuSE Linux¤Î¤è¤¦¤Ë¡¢KDE¤¬ /usr °Ê²¼¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤Ê¤¤¾ì¹ç¤Ï¡¢ +KDE???????????????????³ã???????????????+?°å?å¤??KDEDIRS??¨­å®?????è¦??????¾ã???+???????????/usr 以ä?????³ã???????????????+SuSE Linux????????DE??/usr 以ä?????³ã??????????????´å???? export KDEDIRS=/usr:$KDEDIR -¤ÈÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£configure¤Î¥ª¥×¥·¥ç¥ó¤Ç--prefix¤ò»ØÄꤷ¤Æ¡¢ -Ê̤Υǥ£¥ì¥¯¥È¥ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¾ì¹ç¤Ï¡¢ -/usr ¤ÎÂå¤ï¤ê¤Ë¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òKDEDIRS¤ÇÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ +??¨­å®???????????configure???????§ã???-prefix???å®????? +?¥ã??????????????³ã???????????????+/usr ??»£??????????????????DEDIRS?§è¨­å®??????????? -ÀßÄê¤ò˺¤ì¤ë¤È¡¢¥á¥Ë¥å¡¼¤Ê¤É¤Îʸ»úÎ󤬱Ѹì¤Î¤Þ¤Þ¤Ë¤Ê¤ê¤Þ¤¹¡£ +è¨????????????¡ã??¥ã???????å­?????èª???¾ã?????????? -SuSE 9.3¤Ï¥À¥¤¥¢¥í¥°¤Î"OK"¤È"Cancel"¥Ü¥¿¥ó¤ÎµóÆ°¤¬ -µÕ¤Ë¤Ê¤ë¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ÎÌäÂê¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¡¢ -°Ê²¼¤Î¤è¤¦¤Ë´Ä¶­ÊÑ¿ôQT_NO_KDE_INTEGRATION¤ò1¤Ë¥»¥Ã¥È¤·¤Æ¤¯¤À¤µ¤¤¡£ +SuSE 9.3????¤ã??????OK"??Cancel"????³ã??????+?????????????°ã?????¾ã???????é¡?????????????? +以ä????????°å?å¤??QT_NO_KDE_INTEGRATION?????????????????? export QT_NO_KDE_INTEGRATION=1 -* ³«È¯´Ä¶­ +* ????°å? SuSE 9.3 + Qt 3.3.4 @@ -67,13 +67,13 @@ Hideki Ikemoto -ÄÉ¿­¡§ °ìÈ̥桼¥¶/root°Ê³°¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¾ì¹ç +追伸ï¼?ä¸???????root以å??§ã??³ã???????????? ./configure --prefix=$HOME/.kde -¤È¤¹¤ë¤È¹¬¤»¤Ë¤Ê¤ì¤Þ¤¹¡£ -´Ä¶­ÊÑ¿ô $KDEHOME ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ +??????幸ã?????????? +?°å?å¤?? $KDEHOME ??¨­å®?????????´å???? ./configure --prefix=$KDEHOME -¤Ø¤È½ñ¤­´¹¤¨¤Æ¤Í¡£ +?¸ã??¸ã????????? Modified: kita/branches/KITA-KDE4/README.2ch =================================================================== --- kita/branches/KITA-KDE4/README.2ch 2009-07-08 13:23:35 UTC (rev 2379) +++ kita/branches/KITA-KDE4/README.2ch 2009-07-08 13:52:53 UTC (rev 2380) @@ -1,125 +1,125 @@ AA -Ž·ŽÀ¨¬¨¬¨¬(Žß¢ÏŽß)¨¬¨¬¨¬!!!! -Ž·ŽÀ¨¬¨¬¨¬(¡¬¢Ï¡¬)¨¬( ¡¬¢Ï)¨¬( ¡¬)¨¬( )¨¬( )¨¬(¡¬ )¨¬(¢Ï¡¬ )¨¬(¡¬¢Ï¡¬)¨¬¨¬¨¬!! -¦²(Žß§ÕŽßlll)Ž¶ŽÞŽ°ŽÝ -( Žß§ÕŽß)ŽÎŽßŽ¶Ž°ŽÝ -¡²|¡±|¡û -¡û|¡±|¡² -(#Žß§¥Žß) ŽºŽÞŽÙŽ§ -Ž¡Ž¥ŽßŽ¥(ŽÉ§¥`)Ž¥ŽßŽ¥Ž¡Ž³Ž´Ž´ŽªŽªŽÝ -(¡­Ž¥¦ØŽ¥`)Ž¼Ž®ŽÎŽÞŽ°ŽÝ -(Žß§ÕŽß)Ž³ŽÏŽ° -(¡¦¢Ï¡¦)Ž²Ž²!! -(¡­-`).Ž¡£ï£Ï( ) -(;¡­§¥¡®) +??????????????????!!! +??????????????? ???)?? ???? )?? )????)????? )????????????! +Σ(??´ã?lll)?????+( ??´ã?)????¼ã? +ï¼?????+????ï¼?+(#????) ?´ã???+??????(?ŽÐ?)?»ã??»ã????????§ã? +(´?»Ï??`)?·ã??????+(??´ã?)?????+(?»â????¤ã?!! +(´-`).???ï¼? ) +(;´?ï½? ('A`) -(¤Ä§¥¡®) -( ¡­,_¡µ¡®)ŽÌŽßŽ¯ -( Žß,_¡µŽß)ŽÊŽÞŽ¶Ž¼ŽÞŽ¬ŽÈŽ°ŽÉ -(¡­?¡®) -¤ó¡©(Žß§ÕŽß¢áŽß§ÕŽß)¤ó¡© -(¦ÒŽß¢ÏŽß)¦Ò gets!! -(¡¡¡¦¦Ø¡¦)¡© -( Žß§ÕŽß¡Ë¥Î¡¡ŽÊŽ°Ž² -(¤Ä§Õ¢¾)ŽºŽÞŽ¼ŽºŽÞŽ¼ -(¡¦¢Ï¡¦)¤Äö -( ¡­¢Ï¡®)ŽÖŽ¶ŽÀŽ°ŽÈ -¡È¥Ø(¡±¢à¡± )¥«¥â¥©¡¼¥ó¢ö -(-¢Ï-) -Ž³ŽÜŽ§Ž§Ž§Ž§Ž§Ž§¡³(`§¥¡­)ŽÉŽ§Ž§Ž§Ž§Ž§Ž§ŽÝ! -(¡®Ž¥¦ØŽ¥¡­) Ž¼Ž¬Ž·Ž°ŽÝ -( ¡­¢Ï¡®)¦Ò)§¥¡®) -(£Ô§¥£Ô) +(?¤Ð??) +( ´,_???)??? +( ??_???)????¸ã??????+(´?ï½? +???(??´ã??¡ã?д????? +(??????? gets!! +(??????ï¼?+( ??´ã?ï¼??????¼ã? +(?¤Ð´â?)?´ã??´ã? +(?»â????¤æ? +( ´???)????¿ã???+???(?¾â???)???????³â? +(-??) +????¡ã??¡ã??¡ã???`?´)????¡ã??¡ã??¡ã?! +(ï½????»Â? ?·ã??????+( ´???)?)?ï½? +(ï¼´Ð?¼´) _, ._ -(¡¨Žß §¥Žß) ¡Ä¡©! -(¡¦¢Ï¡¦)¿Í(¡¦¢Ï¡¦) -(¡­Ž¥¢ÏŽ¥`) -(ŽÉA`) +(ï¼?? ??? ???! +(?»â???äº??»â??? +(´?»â???) +(??`) -¤³¤ì¤Ï2ch¤Î»ÅÍͤˤĤ¤¤Æ¤Î¥á¥â¤Ç¤¹¡£ +?????ch???æ§???¤ã?????¡ã??§ã??? -¡¦ÈÄ°ìÍ÷¤Î¼èÆÀ +?»æ?ä¸?¦§???? http://www.ff.iij4u.or.jp/~ch2/bbsmenu.html -¤ò¼è¤Ã¤ÆÍè¤Æ²òÀϤ·¤Æ¤¤¤ë¡£ -¤³¤Î¥Ú¡¼¥¸¤Ïhttp://www.2ch.net/2ch.html¤Îº¸¤Ë¤¢¤ë¥Õ¥ì¡¼¥à¡£ +?????????§£????????? +???????¸ã?http://www.2ch.net/2ch.html??·¦???????????? -¡¦½ñ¤­¹þ¤ß¥¨¥é¡¼¤Î²ò¼á - ¢ª ¥¨¥é¡¼ - ¢ª ½ñ¤­¹þ¤ß³Îǧ(¤Þ¤À̤Âбþ) -2ch_X¤¬¤Ê¤¤ ¢ª Àµ¾ï? -¤½¤Î¾ ¢ª ¤É¤¦¤ä¤Ã¤¿¤é½Ð¤ë¤Î? +?»æ???¾¼?¿ã??????§£??+ ???????+ ???¸ã?è¾¼ã?確è?(?¾ã????å¿? +2ch_X???????正常? +???ä»?????????????ºã??? -¡ÖÆó½Å¥«¥­¥³¤Ç¤¹¤«?¡×¤Ï³ÎǧºÑ¡£ +??????????§ã??????確è?æ¸?? -¡¦URL¤Î´Ö¤Î´Ø·¸ -ÈÄURL(Îã: http://pc.2ch.net/linux/)¤Ë./subject.txt¤òÉÕ¤±¤ë¤³¤È¤Ç -¥¹¥ì°ìÍ÷¤¬¼è¤ì¤ë¡£ -¤½¤ÎÃæ¤ò²òÀϤ·¤ÆXXXXXX.dat¤ò¼è¤Ã¤ÆÍè¤Æ¡¢ÈÄURL¤Ë -./dat/XXXXXX.dat¤òÉÕ¤±¤ë¤³¤È¤Ç¥¹¥ì¤Îdat¤¬¼è¤ì¤ë¡£ +??RL??????ä¿?+??RL(ä¾? http://pc.2ch.net/linux/)??/subject.txt???????????+?¹ã?ä¸?¦§??????? +???ä¸??解æ????XXXXXX.dat????????????RL??+./dat/XXXXXX.dat??????????§ã????dat??????? -¥¹¥ì¤ÎURL¤ÏÈÄURL¤ÎID(linux)¤ò¼è¤Ã¤Æ¤­¤Æ¤«¤é¡¢ÈÄURL¤Ë -/test/read.cgi/ÈÄID/dat¤«¤é'.dat'¤ò¤È¤Ã¤¿Éôʬ/ -¤òÉÕ¤±¤ì¤ÐÆÀ¤é¤ì¤ë¡£ +?¹ã???RL???URL??D(linux)???????????????RL??+/test/read.cgi/??D/dat???'.dat'????£ã????/ +???????°å??????? -µÕ¤Ë¡¢¥¹¥ì¤ÎURL¤¬Í¿¤¨¤é¤ì¤¿¾ì¹ç¡¢ -/test/read.cgi¤ò½ü¤¤¤Æ¡¢ºÇ¸å¤Ë.dat¤ò¤Ä¤±¤ì¤ÐÎɤ¤¡£ -(l50¤È¤«ºÇ¸å¤Ë¤Ä¤¤¤Æ¤¤¤ë¾ì¹ç¤Ï¤½¤ì¤ò½ü¤¯É¬Íפ¬¤¢¤ë) +?????????URL??????????´å???+/test/read.cgi?????????å¾??.dat???????°è???? +(l50????????????????´å????????¤ã?å¿??????? -¤¹¤Ê¤ï¤Á¡¢ÈÄURL¤Èsubject.txt¤ÎURL¡¢ -¥¹¥ì¤ÎURL¤Èdat¥Õ¥¡¥¤¥ë¤ÎURL¤Ï¤½¤ì¤¾¤ì°ìÂаì¤ËÂбþ¤¹¤ë¡£ +?????¡ã???RL??ubject.txt??RL??+?¹ã???RL??at????¤ã???RL?????????対ä????å¿????? -Îã: -ÈÄURL: http://pc.2ch.net/linux/ +ä¾? +??RL: http://pc.2ch.net/linux/ dat: 1022744633.dat -¤Î¾ì¹ç¡¢ +?????? datURL: http//pc.2ch.net/linux/dat/1022744633.dat threadURL: http://pc.2ch.net/test/read.cgi/linux/1022744633/ -¡¦KDE¤Î¥­¥ã¥Ã¥·¥å¤Î»ÅÁȤß(HTTP) -¥­¥ã¥Ã¥·¥å¥Ç¥£¥ì¥¯¥È¥ê: ~/.kde/share/cache/http -¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê: ¥Û¥¹¥È̾¤ò¸¡º÷¤·¤Æ¡¢'w'°Ê³°¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤¬Í褿¤é -¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¡£¸«ÉÕ¤«¤é¤Ê¤¤¤È¤­¤Ï'0'¤Ë¤Ê¤ë¡£ +??DE????£ã??·ã????çµ??(HTTP) +???????¥ã??£ã?????? ~/.kde/share/cache/http +?µã??????????: ?????????ç´¢ã????'w'以å????????¡ã?????????? +??????????????????è¦?????????????0'?????? -Îã: +ä¾? www.wakaba.jp -> 'a' www.2ch.net -> 'c' -¥Õ¥¡¥¤¥ë̾: <¥Û¥¹¥È̾> + <¥Ñ¥¹('/'¤ò'_'¤ËÃÖ´¹)> + '_' + +????¤ã??? + + '_' + -¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È: +????¤ã?????¼ã????: (HTTPProtocol:::createCacheEntry) -1¹ÔÌÜ: ¥­¥ã¥Ã¥·¥å¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥Ð¡¼¥¸¥ç¥ó "7" -2¹ÔÌÜ: URL -3¹ÔÌÜ: Creation Date -4¹ÔÌÜ: Expiration Date -5¹ÔÌÜ: ETag -6¹ÔÌÜ: Last-Modified -7¹ÔÌÜ: MimeType -8¹ÔÌÜ: Charset -9¹ÔÌܰʹß: ÆâÍÆ +1è¡??: ???????¥ã??????????????¸ã???"7" +2è¡??: URL +3è¡??: Creation Date +4è¡??: Expiration Date +5è¡??: ETag +6è¡??: Last-Modified +7è¡??: MimeType +8è¡??: Charset +9è¡??以é?: ??? ---- -2channel.brd¤Î½ñ¼° +2channel.brd???å¼? -¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ï¤¿¤Ö¤óShift_JIS(CP932) -1¹ÔÌÜ: '2' +????³ã?????³ã?????¶ã?Shift_JIS(CP932) +1è¡??: '2' -¤½¤ì°Ê¹ß: -¡¦¥«¥Æ¥´¥ê -ÈÄ̾n -n¤Ï0 or 1¤Ç¡¢0¤¬ÊĤ¸¤Æ¤¤¤ë¡¢1¤¬³«¤¤¤Æ¤¤¤ë +???以é?: +?»ã??????+?¿å?n +n?? or 1?§ã?0???????????????????? -¡¦ÈÄ -¥Û¥¹¥È̾ÈÄIDÈĤÎÀâÌÀ +?»æ? +????????D?¿ã?èª?? ---- Samba24 -¢­¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤ë¡£ +?????????????????? -- -£Å£Ò£Ò£Ï£Ò¡ª +ERRORï? -£Å£Ò£Ò£Ï£Ò - 593 120 sec ¤¿¤¿¤Ê¤¤¤È½ñ¤±¤Þ¤»¤ó¡£(3²óÌÜ¡¢52 sec ¤·¤«¤¿¤Ã¤Æ¤Ê¤¤) 3 +ERROï¼?- 593 120 sec ?????????????????3?????2 sec ??????????? 3

(Samba24-2.13) -- Modified: kita/branches/KITA-KDE4/README.machibbs =================================================================== --- kita/branches/KITA-KDE4/README.machibbs 2009-07-08 13:23:35 UTC (rev 2379) +++ kita/branches/KITA-KDE4/README.machibbs 2009-07-08 13:52:53 UTC (rev 2380) @@ -1,21 +1,21 @@ -¤Þ¤ÁBBS¤Ë¤Ä¤¤¤Æ +?¾ã?BBS?????? -¸½ºß¤Ï¦ÁÈÇÄøÅ٤Ǥ¹¡£Æɤ߹þ¤ß¤ÏÂбþ¤·¤Æ¤Þ¤¹¤¬¡¢½ñ¤­¹þ¤ß¤ÏÂбþ¤·¤Æ¤¤¤Þ¤»¤ó¡£ +?¾å???±ç?ç¨?º¦?§ã?????¿è¾¼?¿ã?対å?????¾ã?????¸ã?è¾¼ã????å¿??????¾ã???? -¡¦DAT¥Õ¥¡¥¤¥ë¤ÏľÀܼèÆÀ¤Ç¤­¤Ê¤¤ -(DAT¤ÎURL¤é¤·¤­¤â¤Î¤Ï403 Forbidden¤Ë¤Ê¤ë) --> ¼±Ê̻ҤȤ·¤Æ¤ÎDAT¤ÎURL¤Ï¤½¤Î¤Þ¤Þ¤Ç¡¢¼èÆÀ¤¹¤ëºÝ¤ËURL¤òÃÖ¤­´¹¤¨¤Æ¤¤¤ë¡£ -(¥­¥ã¥Ã¥·¥å¤Î´Ø·¸¾å¤³¤ÎÊý¤¬³Ú¡¢¤Þ¤¿¡¢¡üÂбþ¤â¤³¤ì¤Ç¤¤¤±¤½¤¦) +??AT????¤ã?????¥å???§ã???? +(DAT??RL?????????403 Forbidden????? +-> è­??å­???????AT??RL???????¾ã???????????URL??½®?????????? +(???????¥ã??¢ä?ä¸???????¥½???????対å?????????????) -¡¦HTML¤ò²òÀϤ¹¤ëɬÍפ¬¤¢¤ë¡£ -¥Ñ¥¿¡¼¥ó¤Ï¥á¡¼¥ë¥¢¥É¥ì¥¹¤¢¤ê¤Ê¤·¤Ç2¤Ä³ÎǧºÑ¤ß¡£ -2¹Ô¤Ë¤ï¤¿¤ë¥Ñ¥¿¡¼¥ó¤â¤¢¤ë¡£¹ç·×4¼ïÎà? +??TML??§£??????è¦???????+????¼ã?????¼ã??¢ã?????????????¤ç¢ºèª???¿ã? +2è¡??????????¼ã??????????4ç¨??? -¡¦¤¢¤Ü¡¼¤ó¤Ï¤½¤Î¤Þ¤ÞÆ©ÌÀºï½ü¤µ¤ì¤ë¤é¤·¤¤¡£ -¤Ê¤Î¤Ç¥ì¥¹ÈÖ¹æ¤Ï²òÀϤ·¤¿Êª¤ò»È¤¦É¬Íפ¬¤¢¤ë¡£ +?»ã??¼ã????????¾ã??????¤ã?????????? +????§ã??¹ç??·ã?解æ???????使ã?å¿???????? -¥Ð¥° -¡¦Åê¹Æ¤Î'ÉÃ'¤¬É½¼¨¤µ¤ì¤Ê¤¤ -¡¦Æ©ÌÀ¤Ç¤Ê¤¤¤¢¤Ü¡¼¤ó¤ÎÂбþ¤¬¤Ê¤µ¤ì¤Æ¤¤¤Ê¤¤(¢­¤Ê¤É)¡£ +??? +?»æ?稿ã?'ç§???¡¨ç¤ºã??????+?»é???????????¼ã????å¿???????????????????? http://chugoku.machi.to/bbs/read.pl?BBS=cyugoku&KEY=1084952272 Modified: kita/branches/KITA-KDE4/TODO =================================================================== --- kita/branches/KITA-KDE4/TODO 2009-07-08 13:23:35 UTC (rev 2379) +++ kita/branches/KITA-KDE4/TODO 2009-07-08 13:52:53 UTC (rev 2380) @@ -1,133 +1,133 @@ -¡¦1¹Ô¤Î¤ß¡¢Ì¾Á°¤Ê¤·¤Î´Ê°×Åê¹Æ¡Ê¼Â¶·ÍÑ¡Ë -¡¦¤·¤¿¤é¤Ð¤ÎKita·Ç¼¨ÈĤΥ¨¥é¡¼¤¬Àµ¤·¤¯½ÐÎϤµ¤ì¤Ê¤¤¤Î¤ò½¤Àµ -¡Ê¥ê¥ó¥¯URL¤ò´Þ¤àÅê¹Æ¤òµö²Ä¤·¤Ê¤¤¡Ë -¡¦ºÇ¶á¸«¤¿¥¹¥ì¥Ã¥É¤Î°ìÍ÷ +??è¡???¿ã?????????°¡???稿ï?å®????? +?»ã?????°ã?Kita?²ç¤º?¿ã?????¼ã?æ­£ã???ºå??????????ä¿?? +ï¼???³ã?URL??????稿ã?許å?????ï¼?+?»æ?è¿???????????ä¸?¦§ --- -¤³¤³¤«¤é¸«Ä¾¤¹¤³¤È +??????è¦??????? -´°Î» -¡¦¥¯¥í¡¼¥º¥Ü¥¿¥ó -¡¦¤´¤ßÈ¢¤Î¥Ä¡¼¥ë¥Á¥Ã¥× -¡¦¡üÂбþ¤Î¤¦¤Á¥×¥ê¥Õ¥¡¥ì¥ó¥¹¤È¥í¥°¥¤¥ó -¡¦¤ªµ¤¤ËÆþ¤ê¤Î¥Ç¥Õ¥©¥ë¥È¥½¡¼¥È¤òÈĽç¤Ë -¡¦ÁªÂò¤·¤¿Ã±¸ì¤òGoogle¤Ç¸¡º÷ +å®?? +?»ã?????ºã??¿ã? +?»ã??¿ç?????¼ã??????+?»â?対å?????¡ã?????¡ã??³ã?????°ã???+?»ã?æ°???¥ã???????????½ã?????¿é???+?»é???????èª??Google?§æ?ç´? -¼¡¤Î¥Ð¡¼¥¸¥ç¥ó¤Þ¤Ç¤Ë¼ÂÁõ¤·¤¿¤¤¤â¤Î -¡¦ -¡¦¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Î»ÅÍͳÎÄê -¡¦³°ÉôÈÄÂбþ -¡¦UI¤Î¸«Ä¾¤· -¡¦thread toolbar¤Ë¥¯¥í¡¼¥º¥Ü¥¿¥ó +次ã?????¸ã??³ã??§ã?å®??????????+??+?»ã??³ã?????¹ã??¡ã????ä»??確å? +?»å????対å? +??I????´ã? +??hread toolbar???????ºã??¿ã? -¼ÂÁõ¤·¤¿¤¤µ¡Ç½ -¡¦Ê£¿ôÁªÂò¤·¤Æ¥­¥ã¥Ã¥·¥å¤Îºï½ü -¡¦Favorites¤ÎǤ°ÕʤÓÂؤ¨ -¡¦º¸¥µ¥¤¥É¥Ð¡¼¤ËFavorites¥¿¥Öɽ¼¨ -¡¦¥¹¥ì¤¢¤Ü¡¼¤ó -¡¦¥¹¥ì½ä²ó -¡¦¥¿¥Ö¤¬Â¿¤¯¤Ê¤Ã¤¿¤È¤­¤ÎÂкö -¡¦¤Þ¤ÁBBS½ñ¤­¹þ¤ß -¡¦¥¹¥ì°ìÍ÷ɽ¼¨¤Ë¥·¥ç¡¼¥È¥«¥Ã¥È¤È¥¢¥¤¥³¥ó¤ò³ä¤êÅö¤Æ -¡¦¤¢¤Ü¡¼¤ó¤Î¨»þÈ¿±Ç¡£ -¡¦Ì¤Æɤ¬¤Ê¤¤¤Î¤«ÈÄ°ÜÆ°¤Ê¤Î¤«¤Ï¤Ã¤­¤ê¤·¤ë¡£ --> code¤¬É½¼¨¤µ¤ì¤ë¤Î¤ÇÌäÂê¤Ê¤¤¡© -¡¦¤ªµ¤¤ËÆþ¤ê¤Î¥Ä¥ê¡¼¥Ó¥å¡¼ -¡¦¤ªµ¤¤ËÆþ¤ê¤Î¥«¥Æ¥´¥êʬ¤± -¡¦¥¹¥ìÊÌ¥³¥Æ¥Ï¥ó -¡¦¥¹¥ìΩ¤Æµ¡Ç½ -¡¦¥á¡¼¥ë¤Î¥ê¥ó¥¯¤òºï½ü(Æñ¤·¤¤?) -¡¦¿·Ãå¥ì¥¹¤ò¿§Ê¬¤±(ÆüÉÕ¤ÈID¤òÀÖ»ú¤È¤«) -¡¦¥¹¥ì¤òÊĤ¸¤ë¥Ü¥¿¥ó(¥¿¥Ö¤Î±¦¤¢¤¿¤ê¡¢KDE3.2¤«¤éÆþ¤Ã¤Æ¤¤¤ëKTabWidget¤ò»È¤¦?) -¡¦mailÍó¤Ê¤É¤Îɽ¼¨¤ò¥«¥¹¥¿¥Þ¥¤¥º²Äǽ¤Ë(?) -¡¦¡Ö¥­¥ã¥Ã¥·¥å¤òÀèƬ¤Ëɽ¼¨¡×¤Ê¤É¤ò¼ÂÁõ -¡¦¥À¥¤¥¢¥í¥°¤ò½Ð¤µ¤º¤Ë¥¹¥ì¤ò¥²¥Ã¥È -->°ì±þ¼ÂÁõ¤·¤Æ¤ë¤Ã¤Ý¤¤ -¡¦¥«¥é¥à¤Î½ç½ø¤òÊݸ -¡¦popup¤¬±£¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ -¡¦¿§/¥Õ¥©¥ó¥È¤ÎÀßÄê(¥Ý¥Ã¥×¥¢¥Ã¥×¤È¤«) -¡¦¥¿¥Ö¤Î¾õÂÖ¤òÊݸ(?) -¡¦¥­¡¼¥Ü¡¼¥É¥·¥ç¡¼¥È¥«¥Ã¥È(Ctrl+R: reload) -¡¦navi2ch¸ß´¹¥­¡¼ -¡¦¥ì¥¹¤Î¥Ä¥ê¡¼É½¼¨(¥á¡¼¥é¡¼¤Ë¤¢¤ë¤è¤¦¤Ê¤â¤Î¡¢UI¤¬ÌÌÅÝ?) -¡¦¥í¥´¤À¤±É½¼¨(A Bone¤Ë¤¢¤ëµ¡Ç½) -¡¦¥Ü¥¹¤¬Í褿µ¡Ç½ -¡¦¤ªµ¤¤ËÆþ¤ê¤Ç¤Î¿·Ãå¿ô¥Á¥§¥Ã¥¯¡õɽ¼¨(subject.txt¤Î¤ßÆɤ߹þ¤ß) -¡¦$KDEDIRS¤òÀßÄꤷ¤Ê¤¤¤È¥é¥¤¥Ö¥é¥ê¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤¹¤ë¡£ -¡¦Favorite¤«¤éľÀÜÅÐÏ¿²ò½ü -¡¦½ñ¤­¹þ¤ß¥¦¥£¥ó¥É¥¦¤Î¥µ¥¤¥º¤òÊݸ¡£ -¡¦¤ªµ¤¤ËÆþ¤ê¤ò¥Ä¥ê¡¼¤Ëɽ¼¨ +å®??????????+?»è??°é????????£ã??·ã??????+??avorites??»»?ä¸???¿ã? +?»å·¦?µã?????¼ã?Favorites?¿ã?è¡?¤º +?»ã?????¼ã???+?»ã???·¡??+?»ã????å¤???????????対ç? +?»ã???BS?¸ã?è¾¼ã? +?»ã????覧表示ã??·ã??¼ã????????¢ã??³ã?????????+?»ã??¼ã?????³æ??????+?»æ?èª?????????¿ç§»?????????????????+-> code??¡¨ç¤ºã????????é¡????? +?»ã?æ°???¥ã????????????+?»ã?æ°???¥ã????????????+?»ã?????³ã????+?»ã?????????+?»ã??¼ã?????³ã???????£ã???) +?»æ?????¹ã??²å????¥ä???D??µ¤å­???? +?»ã???????????¿ã?(?¿ã???³ã??????DE3.2????¥ã??????TabWidget??½¿??) +??ailæ¬?????è¡?¤º????¹ã?????ºå?????) +?»ã????????¥ã??????¡¨ç¤ºã???????è£?+?»ã??¤ã?????????????????²ã???+->ä¸??å®?????????½ã? +?»ã???????åº???å­?+??opup?????????????????+?»è?/????³ã???¨­å®?????????????) +?»ã?????¶æ????å­??) +?»ã??¼ã??¼ã??·ã??¼ã??????Ctrl+R: reload) +??avi2chäº?????+?»ã??¹ã?????¼è¡¨ç¤??¡ã??????????????????I?????) +?»ã??´ã???¡¨ç¤?A Bone???????? +?»ã??¹ã??¥ã?æ©?? +?»ã?æ°???¥ã??§ã??°ç??°ã??§ã????è¡?¤º(subject.txt???èª??è¾¼ã?) +??KDEDIRS??¨­å®?????????¤ã????????¿è¾¼?¿ã?失æ??????+??avorite????´æŽ¥?»é?解é? +?»æ???¾¼?¿ã??£ã????????¤ã????å­?? +?»ã?æ°???¥ã?????????¡¨ç¤? -¥Ð¥° -¡¦¥¹¥ì¤ò³«¤¤¤Æ¤¤¤ë¤È¤­¤Ë¥¹¥ì°ìÍ÷¤Î¥³¥ó¥Æ¥­¥¹¥È¥á¥Ë¥å¡¼¤«¤é¥¹¥ì¤ò¤ªµ¤¤ËÆþ¤ê¤ËÆþ¤ì¤Æ¤â¡¢¤½¤Î³«¤¤¤Æ¤¤¤ë¥¹¥ì¤Î¥Ü¥¿¥ó¤ÏÊѤï¤é¤Ê¤¤¡£ -¡¦shownum¤òÀßÄꤷ¤Æ¤â¤¹¤Ù¤Æɽ¼¨¤µ¤ì¤Æ¤·¤Þ¤¦(?) -¡¦URL¤Ë"<",">"¤¬Æþ¤Ã¤Æ¤ë¤È< >¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£ -¡¦Samba24Âбþ -¡¦¤¹¤Ç¤Ë¤ªµ¤¤ËÆþ¤ê¤ËÆþ¤Ã¤Æ¤¤¤ëÈĤò±¦¥¯¥ê¥Ã¥¯¤·¤¿¤È¤­¤Ë½Ð¤ë¥á¥Ë¥å¡¼¤ò -¡Ö¤ªµ¤¤ËÆþ¤ê¤«¤éºï½ü¡×¤Ë¤¹¤ë¡£ -¡¦¤´¤ßÈ¢¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥¦¥£¥ó¥É¥¦¤¬ÊĤ¸¤é¤ì¤ë¤¬¡¢¥¿¥¤¥È¥ë¤¬ÊѤï¤é¤Ê¤¤ -¡¦¤ªµ¤¤ËÆþ¤ê¤ò¥¯¥ê¥Ã¥¯¤·¤¿¤È¤­¤Ë¾ðÊ󤬹¹¿·¤µ¤ì¤ë¤¬¡¢ -ÁªÂò¾ðÊó¤Þ¤Ç¾Ã¤¨¤ë¤Î¤¬µ¤»ý¤Á°­¤¤¡£ -¡¦NetAccess::download¤È¤«¤¬deprecated¤Ë¤Ê¤Ã¤Æ¤ë¡£ -->KDE3.1.xÂбþ¤¬¤Ê¤¯¤Ê¤é¤Ê¤¤¤¦¤Á¤Ï¥À¥á¡£ -¡¦¥¤¥á¡¼¥¸¥Ó¥å¡¼¥¢¤òɽ¼¨¤µ¤»¤¿¤Þ¤Þ½ªÎ»¤¹¤ë¤Èsegfault -¡¦¥¿¥Ö±¦¥¯¥ê¥Ã¥¯¤Î¡Ö¥¦¥§¥Ö¥Ö¥é¥¦¥¶¤Ç³«¤¯¡×¤¬»È¤¨¤Ê¤¤¡£ -¡¦¥¹¥ì¥¿¥¤¥È¥ë¤Î¥é¥Ù¥ë¤¬½Ä¤ËŤ¯¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£ -¡¦½ñ¤­¹þ¤ß¥À¥¤¥¢¥í¥°É½¼¨Ãæ¤ËÊ̤Υ¿¥Ö¤ò³«¤¤¤Æ¤«¤é½ñ¤­¹þ¤à¤È¤½¤Î¥¿¥Ö¤Î -¾ðÊ󤬹¹¿·¤µ¤ì¤Æ¤·¤Þ¤¦¡£ -¡¦¥¹¥ì¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤ËF5¤ò²¡¤¹¤ÈÍî¤Á¤ë -¡¦po¥Õ¥¡¥¤¥ë¤Î¹¹¿·ÊýË¡¤¬ÉÔÌÀ -¡¦¥«¥­¥³¥¦¥£¥ó¥É¥¦¤Î̾Á°Íó¤ÇEnter¤ò²¡¤¹¤ÈÁ÷¿®¤·¤Æ¤·¤Þ¤¦¡£ -¡¦http¤Î¥­¥ã¥Ã¥·¥å¤È´ûÆÉ¿ô¤ÎÀ°¹çÀ­¤¬¼è¤ì¤Æ¤¤¤Ê¤¤¡£ -¡¦1¥ì¥¹¤À¤±¼èÆÀ¤·¤¿¸å900¥ì¥¹Ì¤Æɤ¬¤¢¤ë¤Ègzip¤»¤º¤Ëº¹Ê¬¼èÆÀ¤¹¤ë¤Î¤Ç¡¢ -Á´Éô¼èÆÀ¤¹¤ë¤è¤êÃÙ¤¯¤Ê¤ë¤¬¡¢¤³¤ì¤ò¤Ê¤ó¤È¤«¤·¤¿¤¤ -¡¦½ñ¤­¹þ¤ß³Îǧ¤Î¥Ñ¥Í¥ë¤¬½Ð¤ë¤È(Cookie̤ÀßÄê)¡¢log.txt¤Ë½ñ¤«¤ì¤ëURL¤¬¤ª¤«¤·¤¯¤Ê¤ë¡£ -¡¦½ñ¤­¹þ¤ß»þ¤Î¥¨¥é¡¼½èÍý¤¬´Å¤¤ -¡¦¥Õ¥©¥ó¥È¤Ë¤è¤Ã¤Æ¤Ïɽ¼¨¤Ç¤­¤Ê¤¤Ê¸»ú¤¬½Ð¤ë¤Ï¤º¡£ -¡¦AA¤ò¥Ý¥Ã¥×¥¢¥Ã¥×ɽ¼¨¤¹¤ë¤È¤º¤ì¤ë¡£ -¡¦Æ±¤¸¥¹¥ì¤òÊÌ¥¿¥Ö¤Ç³«¤±¤Æ¤·¤Þ¤¦¡£ -¡¦¥¨¥Ç¥£¥¿¤ËÇÈÀþ¤òÆþÎϤ¹¤ë¤ÈƦÉå¤Ë¤Ê¤ë¡£ -->¤½¤Î¤»¤¤¤Ç½ñ¤­¹þ¤ß½ÐÍè¤Ê¤¤¤Ã¤Ý¤¤¡£ -->ľ¤Ã¤¿¡© -¡¦konqueror¤«¤ék2ch://¤ÇÈÄ°ìÍ÷¤ò¼èÆÀ¤¹¤ë¤È¡¢Æ±¤¸ÈĤ¬2¤Äɽ¼¨¤µ¤ì¤ë¡£ +??? +?»ã?????????????????¹ã?ä¸?¦§????³ã???????????¼ã?????????????????¥ã?????????????????¹ã?????¿ã??????????? +??hownum??¨­å®??????????¡¨ç¤ºã??????????) +??RL??<",">"????£ã????< >????£ã??????? +??amba24対å? +?»ã??§ã???????????¥ã?????????³ã??????????????ºã??¡ã??¥ã???+???æ°???¥ã???????????????+?»ã??¿ç?????????????????³ã?????????????????¤ã????å¤???????+?»ã?æ°???¥ã???????????????????????°ã??????? +?¸æ?????¾ã?æ¶????????????????+??etAccess::download?????eprecated????£ã???? +->KDE3.1.x対å??????????????????¡ã? +?»ã??¡ã??¸ã??¥ã??¢ã?è¡?¤º???????¾ç?äº?????segfault +?»ã???³ã???????????§ã????????§é?????使ã??????+?»ã?????¤ã??????????ç¸???·ã????????????? +?»æ???¾¼?¿ã??¤ã????è¡?¤ºä¸???¥ã??¿ã???????????¸ã?è¾¼ã?????????? +???????°ã?????????? +?»ã????è¡?¤º??????????????5???????½ã???+??o????¤ã?????°æ?æ³??ä¸?? +?»ã????????³ã???????æ¬??Enter????????¿¡????????? +??ttp????£ã??·ã????èª????????????????????+??????????????å¾?00????????????gzip?????·®????????????+???????????????????????????????????? +?»æ???¾¼?¿ç¢ºèª?????????ºã???Cookie??¨­å®???og.txt????????RL????????????+?»æ???¾¼?¿æ???????????????+?»ã?????????????è¡?¤º?§ã???????????????? +??A???????¢ã???¡¨ç¤ºã?????????? +?»å????????¥ã???????????¾ã???+?»ã?????¿ã?æ³¢ç??????????è±???????? +->???????§æ???¾¼?¿å??¥ã?????½ã???+->?´ã???? +??onqueror???k2ch://?§æ?ä¸?¦§??????????????¿ã?2?¤è¡¨ç¤ºã?????? -¼ÂÁõ¤·¤¿¤¤¤â¤Î -¡¦¥Õ¥©¥ó¥ÈÀßÄê¤Ë¡ÖKDE¥Ç¥Õ¥©¥ë¥È¡×¤òÄɲᣠ-¡¦¥¹¥ì¥Ã¥É¤Î¥Ü¥¿¥ó¤ò¥Ä¡¼¥ë¥Ð¡¼¤ÈƱÍͤ˰ÜÆ°²Äǽ¤Ë -¡¦¥é¥¤¥Ö¥é¥ê¤¬Æɤ߹þ¤á¤Ê¤¤¤È¤­(KDEDIRS¤ò»ØÄꤷ¤Æ¤Ê¤¤¤È¤­)¤Ë¥¨¥é¡¼¤ò½Ð¤¹ -¡¦¥¹¥ì¤¢¤Ü¡¼¤ó -¡¦È¯¸À¸¡º÷¤Ê¤É¤ÈÏ¢·È -¡¦¥ª¥Õ¥é¥¤¥ó¥â¡¼¥É¥µ¥Ý¡¼¥È -¡¦½ä²ó¥â¡¼¥É¥Ü¥¿¥ó -¡¦ÃíÌÜ¥­¡¼¥ï¡¼¥É»ØÄê -¡¦¾Ê¥¹¥Ú¡¼¥¹¥â¡¼¥É¡õ¥Õ¥ëµ¡Ç½¥â¡¼¥É¤Î°ìȯÀÚ¤êÂؤ¨ -¡¦RSS²ò¼á -¡¦´ûÆÉ¿ô¤Î¥¯¥ê¥¢ -¡¦Bayesian¥³¥á¥ó¥È¥Õ¥£¥ë¥¿ -¡¦¥¨¥Ç¥£¥¿¤ËCP932¥³¡¼¥Éɽ¤òÄɲà +å®??????????+?»ã??????¨­å®????DE???????????¿½??? +?»ã???????????³ã????????¼ã??????§»??????+?»ã??¤ã????????¿è¾¼????????KDEDIRS???å®?????????????????????+?»ã?????¼ã???+?»ç?è¨??ç´¢ã?????£æ? +?»ã?????¤ã??¢ã?????????+?»å·¡????¼ã??????+?»æ³¨????¼ã??¼ã???? +?»ç??¹ã??¼ã??¢ã???????æ©???¢ã????ä¸??????¿ã? +??SS解é? +?»æ?èª???????? +??ayesian?³ã??³ã??????? +?»ã?????¿ã?CP932?³ã???¡¨??¿½?? -³«È¯¥á¥â -¥Ð¡¼¥¸¥ç¥ó¤¬ÊѤï¤Ã¤¿»þ¤ËÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¥½¡¼¥¹ +????¡ã? +????¸ã??³ã?å¤???£ã????å¤?????å¿?????????¼ã? configure.in.in -kita/src/kita.lsm 3¤Ä +kita/src/kita.lsm 3?? kita.spec -src.rpm¤â¥ê¥ê¡¼¥¹Á°¤Ë¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¡ª +src.rpm???????¹å?????§ã?????????? -¥ê¥ê¡¼¥¹¤¹¤ë¤Þ¤Ç¤Îή¤ì -1. ¥Ð¡¼¥¸¥ç¥ó¤òÊѹ¹(¾å»²¾È) -2. ¥¿¥°¤òÂǤÄ(KITA-x_y-RELEASE) -3. Ê̥ǥ£¥ì¥¯¥È¥ê¤Ëcheckout -4. make -f Makefile.cvs; ./configure; make dist¤ÇÇÛÉÛʪ¤òºîÀ® -5. ÇÛÉÛ¤¹¤ëtar.gz¤ò²òÅà¡¢./configure --prefix=XXX; make; make install -¤Ç¥¤¥ó¥¹¥È¡¼¥ë -6. Æ°ºî³Îǧ -¡¦µ¯Æ° -¡¦¥¹¥ìÆɤ߹þ¤ß½ñ¤­¹þ¤ß³Îǧ -¡¦¤³¤ó¤«¤é¥µ¥¤¥É¥Ð¡¼³Îǧ -¡¦¤¢¤Èµ¤¤Þ¤°¤ì¤Ë¤¤¤í¤¤¤í -7. ¥ê¥ê¡¼¥¹¡¢¥Ë¥å¡¼¥¹¤ÎÅê¹Æ +????¼ã?????¾ã??????+1. ????¸ã??³ã?å¤??(ä¸???) +2. ?¿ã??????KITA-x_y-RELEASE) +3. ?¥ã??£ã???????checkout +4. make -f Makefile.cvs; ./configure; make dist?§é?å¸???????+5. ??????tar.gz??§£???./configure --prefix=XXX; make; make install +?§ã??³ã??????+6. ???確è? +?»èµ·??+?»ã?????¿è¾¼?¿æ???¾¼?¿ç¢ºèª?+?»ã????????¤ã????確è? +?»ã?????¾ã?????????? +7. ????¼ã?????¥ã??¹ã???¨¿ --- -¥ê¥Õ¥¡¥¯¥¿¥ê¥ó¥°¤Î¿ÊĽ +????¡ã??¿ã??³ã?????? code doc KitaDomTree o x KitaPreviewPart o x Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-08 13:23:35 UTC (rev 2379) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-08 13:52:53 UTC (rev 2380) @@ -60,7 +60,7 @@ url = url.replace( 0, fromURL.length(), toURL ); instance->m_readDict.erase( it ); instance->m_readDict.insert( url, num ); - it = instance->m_readDict.begin(); // TODO ¤â¤Ã¤ÈÁᤤÊýË¡¤Ï? + it = instance->m_readDict.begin(); // TODO ?????????æ³??? } } } From svnnotify ¡÷ sourceforge.jp Thu Jul 9 23:53:01 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 09 Jul 2009 23:53:01 +0900 Subject: [Kita-svn] [2381] add WebBrowser and KDE as Categories Message-ID: <1247151181.519593.26700.nullmailer@users.sourceforge.jp> Revision: 2381 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2381 Author: nogu Date: 2009-07-09 23:53:01 +0900 (Thu, 09 Jul 2009) Log Message: ----------- add WebBrowser and KDE as Categories Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/kita.desktop Modified: kita/branches/KITA-KDE4/kita/src/kita.desktop =================================================================== --- kita/branches/KITA-KDE4/kita/src/kita.desktop 2009-07-08 13:52:53 UTC (rev 2380) +++ kita/branches/KITA-KDE4/kita/src/kita.desktop 2009-07-09 14:53:01 UTC (rev 2381) @@ -7,4 +7,4 @@ Comment=Kita - 2ch client for KDE Comment[ja]=Kita - KDEÍÑ2¤Á¤ã¤ó¤Í¤ë¥Ö¥é¥¦¥¶ Terminal=false -Categories=Network; +Categories=Network;WebBrowser;KDE; From svnnotify ¡÷ sourceforge.jp Fri Jul 10 00:13:41 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Fri, 10 Jul 2009 00:13:41 +0900 Subject: [Kita-svn] [2382] install index.docbook Message-ID: <1247152421.245134.22702.nullmailer@users.sourceforge.jp> Revision: 2382 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2382 Author: nogu Date: 2009-07-10 00:13:41 +0900 (Fri, 10 Jul 2009) Log Message: ----------- install index.docbook Modified Paths: -------------- kita/branches/KITA-KDE4/kita/doc/CMakeLists.txt kita/branches/KITA-KDE4/kita/doc/en/CMakeLists.txt Modified: kita/branches/KITA-KDE4/kita/doc/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/doc/CMakeLists.txt 2009-07-09 14:53:01 UTC (rev 2381) +++ kita/branches/KITA-KDE4/kita/doc/CMakeLists.txt 2009-07-09 15:13:41 UTC (rev 2382) @@ -1,8 +1,4 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - -message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(AUTODIRS)") - +add_subdirectory(en) ########### install files ############### Modified: kita/branches/KITA-KDE4/kita/doc/en/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/doc/en/CMakeLists.txt 2009-07-09 14:53:01 UTC (rev 2381) +++ kita/branches/KITA-KDE4/kita/doc/en/CMakeLists.txt 2009-07-09 15:13:41 UTC (rev 2382) @@ -1,11 +1,7 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - ########### install files ############### -kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en) +kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kita) From svnnotify ¡÷ sourceforge.jp Fri Jul 10 00:42:11 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Fri, 10 Jul 2009 00:42:11 +0900 Subject: [Kita-svn] [2383] update index.docbook Message-ID: <1247154131.663946.1570.nullmailer@users.sourceforge.jp> Revision: 2383 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2383 Author: nogu Date: 2009-07-10 00:42:11 +0900 (Fri, 10 Jul 2009) Log Message: ----------- update index.docbook Modified Paths: -------------- kita/branches/KITA-KDE4/kita/doc/en/index.docbook Modified: kita/branches/KITA-KDE4/kita/doc/en/index.docbook =================================================================== --- kita/branches/KITA-KDE4/kita/doc/en/index.docbook 2009-07-09 15:13:41 UTC (rev 2382) +++ kita/branches/KITA-KDE4/kita/doc/en/index.docbook 2009-07-09 15:42:11 UTC (rev 2383) @@ -1,5 +1,5 @@ - @@ -19,6 +19,7 @@ Hideki Ikemoto
ikemo@wakaba.jp
+ date 0.1 From svnnotify ¡÷ sourceforge.jp Sat Jul 11 06:05:53 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 11 Jul 2009 06:05:53 +0900 Subject: [Kita-svn] [2384] Qt Reference Documentation for Qt3 adopts the following style: Message-ID: <1247259953.382581.28056.nullmailer@users.sourceforge.jp> Revision: 2384 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2384 Author: nogu Date: 2009-07-11 06:05:53 +0900 (Sat, 11 Jul 2009) Log Message: ----------- Qt Reference Documentation for Qt3 adopts the following style: foo( bar ); while that for Qt4 does the following one: foo(bar); adopt the latter style Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp kita/branches/KITA-KDE4/kita/src/bbstabwidget.h kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp kita/branches/KITA-KDE4/kita/src/boardtabwidget.h kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.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/favoritelistview.h kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.h kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h kita/branches/KITA-KDE4/kita/src/libkita/access.cpp kita/branches/KITA-KDE4/kita/src/libkita/access.h 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/cache.cpp kita/branches/KITA-KDE4/kita/src/libkita/cache.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/event.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/flashcgi.cpp kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h 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/libkita/threadinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h kita/branches/KITA-KDE4/kita/src/main.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.h kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.h kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h kita/branches/KITA-KDE4/kita/src/respopup.cpp kita/branches/KITA-KDE4/kita/src/respopup.h kita/branches/KITA-KDE4/kita/src/threadlistview.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.h kita/branches/KITA-KDE4/kita/src/threadlistviewitem.cpp kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/threadtabwidget.h kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/threadview.h kita/branches/KITA-KDE4/kita/src/viewmediator.cpp kita/branches/KITA-KDE4/kita/src/viewmediator.h kita/branches/KITA-KDE4/kita/src/writedialogbase.ui.h kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp kita/branches/KITA-KDE4/kita/src/writetabwidget.h kita/branches/KITA-KDE4/kita/src/writeview.cpp kita/branches/KITA-KDE4/kita/src/writeview.h Modified: kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/bbstabwidget.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -17,11 +17,11 @@ /*--------------------------------------------------------------*/ -KitaBBSTabWidget::KitaBBSTabWidget( QWidget* parent, Qt::WFlags fl ) - : KitaTabWidgetBase( parent, fl ) +KitaBBSTabWidget::KitaBBSTabWidget(QWidget* parent, Qt::WFlags fl) + : KitaTabWidgetBase(parent, fl) { - KitaBBSView * view = new KitaBBSView( this ); - addTab( view, i18n( "board name" ) ); + KitaBBSView * view = new KitaBBSView(this); + addTab(view, i18n("board name")); } @@ -31,26 +31,26 @@ /* public slot */ void KitaBBSTabWidget::showBoardList() { - static_cast < KitaBBSView* > ( widget( 0 ) ) ->showBoardList(); + static_cast < KitaBBSView* > (widget(0)) ->showBoardList(); } void KitaBBSTabWidget::updateBoardList() { - static_cast < KitaBBSView* > ( widget( 0 ) ) ->updateBoardList(); + static_cast < KitaBBSView* > (widget(0)) ->updateBoardList(); } /* public slot */ -void KitaBBSTabWidget::setFont( const QFont& font ) +void KitaBBSTabWidget::setFont(const QFont& font) { - KTabWidget::setFont( font ); - static_cast < KitaBBSView* > ( widget( 0 ) ) ->setFont( font ); + KTabWidget::setFont(font); + static_cast < KitaBBSView* > (widget(0)) ->setFont(font); } void KitaBBSTabWidget::loadOpened() { - static_cast < KitaBBSView* > ( widget( 0 ) ) ->loadOpened(); + static_cast < KitaBBSView* > (widget(0)) ->loadOpened(); } /* protected */ /* virtual */ -void KitaBBSTabWidget::deleteWidget( QWidget* w ) {} +void KitaBBSTabWidget::deleteWidget(QWidget* w) {} Modified: kita/branches/KITA-KDE4/kita/src/bbstabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbstabwidget.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/bbstabwidget.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -23,17 +23,17 @@ Q_OBJECT public: - explicit KitaBBSTabWidget( QWidget* parent, Qt::WFlags fl = 0 ); + explicit KitaBBSTabWidget(QWidget* parent, Qt::WFlags fl = 0); ~KitaBBSTabWidget(); public slots: void showBoardList(); void updateBoardList(); - void setFont( const QFont& font ); + void setFont(const QFont& font); void loadOpened(); protected: - virtual void deleteWidget( QWidget* w ); + virtual void deleteWidget(QWidget* w); }; #endif Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -55,41 +55,41 @@ /*--------------------------------------*/ -KitaBBSView::KitaBBSView( QWidget *, const char *name ) - : m_favorites( 0 ) +KitaBBSView::KitaBBSView(QWidget *, const char *name) + : m_favorites(0) { /* copied from Base class */ - if ( !name ) - setObjectName( "KitaBBSViewBase" ); - KitaBBSViewBaseLayout = new QVBoxLayout( this ); + if (!name) + setObjectName("KitaBBSViewBase"); + KitaBBSViewBaseLayout = new QVBoxLayout(this); - layout10 = new QHBoxLayout( 0 ); + layout10 = new QHBoxLayout(0); - SearchCombo = new KComboBox( this ); - QSizePolicy sizePolicy( static_cast(1), static_cast(4) ); - sizePolicy.setHorizontalStretch( 0 ); - sizePolicy.setVerticalStretch( 0 ); - sizePolicy.setHeightForWidth( SearchCombo->sizePolicy().hasHeightForWidth() ); - SearchCombo->setSizePolicy( sizePolicy ); - SearchCombo->setEditable( true ); - SearchCombo->setMaxCount( 10 ); - layout10->addWidget( SearchCombo ); - spacer2 = new QSpacerItem( 467, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - layout10->addItem( spacer2 ); - KitaBBSViewBaseLayout->addLayout( layout10 ); + SearchCombo = new KComboBox(this); + QSizePolicy sizePolicy(static_cast(1), static_cast(4)); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(SearchCombo->sizePolicy().hasHeightForWidth()); + SearchCombo->setSizePolicy(sizePolicy); + SearchCombo->setEditable(true); + SearchCombo->setMaxCount(10); + layout10->addWidget(SearchCombo); + spacer2 = new QSpacerItem(467, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + layout10->addItem(spacer2); + KitaBBSViewBaseLayout->addLayout(layout10); - m_boardList = new K3ListView( this ); - m_boardList->setRootIsDecorated( true ); - m_boardList->setTreeStepSize( 10 ); - m_boardList->setFullWidth( true ); - KitaBBSViewBaseLayout->addWidget( m_boardList ); - resize( QSize(600, 482).expandedTo(minimumSizeHint()) ); - setAttribute( Qt::WA_WState_Polished ); + m_boardList = new K3ListView(this); + m_boardList->setRootIsDecorated(true); + m_boardList->setTreeStepSize(10); + m_boardList->setFullWidth(true); + KitaBBSViewBaseLayout->addWidget(m_boardList); + resize(QSize(600, 482).expandedTo(minimumSizeHint())); + setAttribute(Qt::WA_WState_Polished); /* copy end */ - m_boardList->setSorting( -1 ); - m_boardList->addColumn( i18n( "board name" ) ); - m_boardList->header() ->setClickEnabled( false ); + m_boardList->setSorting(-1); + m_boardList->addColumn(i18n("board name")); + m_boardList->header() ->setClickEnabled(false); /* default colors */ QPalette palette = m_boardList->viewport() ->palette(); @@ -98,14 +98,14 @@ // m_backColor = m_boardList->viewport() ->paletteBackgroundColor(); // TODO // m_altColor = m_boardList->alternateBackground(); - connect( m_boardList, SIGNAL( mouseButtonClicked( int, Q3ListViewItem*, const QPoint&, int ) ), - SLOT( slotMouseButtonClicked( int, Q3ListViewItem* ) ) ); - connect( m_boardList, SIGNAL( returnPressed( Q3ListViewItem* ) ), SLOT( loadBoard( Q3ListViewItem* ) ) ); - connect( m_boardList, SIGNAL( contextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ), - SLOT( slotContextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ) ); - connect( Kita::FavoriteBoards::getInstance(), SIGNAL( changed() ), SLOT( refreshFavoriteBoards() ) ); - connect( SearchCombo, SIGNAL( textChanged( const QString& ) ), - SLOT( filter( const QString& ) ) ); + connect(m_boardList, SIGNAL(mouseButtonClicked(int, Q3ListViewItem*, const QPoint&, int)), + SLOT(slotMouseButtonClicked(int, Q3ListViewItem*))); + connect(m_boardList, SIGNAL(returnPressed(Q3ListViewItem*)), SLOT(loadBoard(Q3ListViewItem*))); + connect(m_boardList, SIGNAL(contextMenuRequested(Q3ListViewItem*, const QPoint&, int)), + SLOT(slotContextMenuRequested(Q3ListViewItem*, const QPoint&, int))); + connect(Kita::FavoriteBoards::getInstance(), SIGNAL(changed()), SLOT(refreshFavoriteBoards())); + connect(SearchCombo, SIGNAL(textChanged(const QString&)), + SLOT(filter(const QString&))); } KitaBBSView::~KitaBBSView() @@ -127,47 +127,47 @@ QString tmpFile; QString url = Kita::Config::boardListUrl(); - if ( ! KIO::NetAccess::download( url, tmpFile, 0 ) ) { + if (! KIO::NetAccess::download(url, tmpFile, 0)) { return false; } - QFile file( tmpFile ); - if ( ! file.open( QIODevice::ReadOnly ) ) { + QFile file(tmpFile); + if (! file.open(QIODevice::ReadOnly)) { return false; } - QTextStream stream( &file ); + QTextStream stream(&file); QTextCodec* codec = QTextCodec::codecForName("Shift-JIS"); - stream.setCodec( codec ); + stream.setCodec(codec); QString html = stream.readAll(); // parse QStringList list; - Q3ValueList categoryList = getCategoryList( html ); + Q3ValueList categoryList = getCategoryList(html); Q3ValueList::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 ); + for (it = categoryList.begin(); it != categoryList.end(); ++it) { + Kita::Category category = (*it); Q3ValueList board_url_list = category.boardURLList; - if ( board_url_list.isEmpty() ) continue; + if (board_url_list.isEmpty()) continue; int count = 0; - for ( Q3ValueList::iterator it2 = board_url_list.begin(); - it2 != board_url_list.end(); ++it2 ) { + for (Q3ValueList::iterator it2 = board_url_list.begin(); + it2 != board_url_list.end(); ++it2) { QString boardURL = *it2; QString boardName = category.boardNameList[ count ]; QString oldURL; - int ret = Kita::BoardManager::enrollBoard( boardURL, boardName, oldURL, Kita::Board_Unknown, + int ret = Kita::BoardManager::enrollBoard(boardURL, boardName, oldURL, Kita::Board_Unknown, true /* test only */ - ); - if ( ret == Kita::Board_enrollNew ) { + ); + if (ret == Kita::Board_enrollNew) { newBoards += boardName + " ( " + category.category_name + " ) " + boardURL + '\n'; } - if ( ret == Kita::Board_enrollMoved ) { + if (ret == Kita::Board_enrollMoved) { oldBoards += boardName + " ( " + category.category_name + " ) " + oldURL + " -> " + boardURL + '\n'; } count++; @@ -179,100 +179,100 @@ const int maxNewBoard = 64; /* show new board names */ - if ( !newBoards.isEmpty() && newBoards.count( "\n" ) < maxNewBoard ) { + if (!newBoards.isEmpty() && newBoards.count("\n") < maxNewBoard) { - QStringList boardList = newBoards.split( '\n' ); - KMessageBox::informationList( this, - i18n( "New boards:\n\n" ), - boardList, "Kita" ); + QStringList boardList = newBoards.split('\n'); + KMessageBox::informationList(this, + i18n("New boards:\n\n"), + boardList, "Kita"); } /* show moved board names */ - if ( !oldBoards.isEmpty() ) { + if (!oldBoards.isEmpty()) { - QStringList boardList = oldBoards.split( '\n' ); - KMessageBox::informationList( this, - i18n( "These boards were moved:\n\n" ) - + i18n( "\nPlease create the backup of those caches.\n" ), - boardList, "Kita" ); + QStringList boardList = oldBoards.split('\n'); + KMessageBox::informationList(this, + i18n("These boards were moved:\n\n") + + i18n("\nPlease create the backup of those caches.\n"), + boardList, "Kita"); } - if ( ( !newBoards.isEmpty() && newBoards.count( "\n" ) < maxNewBoard ) - || !oldBoards.isEmpty() ) { + if ((!newBoards.isEmpty() && newBoards.count("\n") < maxNewBoard) + || !oldBoards.isEmpty()) { - QMessageBox mb( "kita", i18n( "Do you really want to update board list?" ), + QMessageBox mb("kita", i18n("Do you really want to update board list?"), QMessageBox::Information, QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default | QMessageBox::Escape, - QMessageBox::No, this ); + QMessageBox::No, this); - mb.setButtonText( QMessageBox::No, i18n( "Copy" ) ); + mb.setButtonText(QMessageBox::No, i18n("Copy")); int ret; - while ( ( ret = mb.exec() ) == QMessageBox::No ) { - QString str = i18n( "New boards:\n\n" ) + newBoards + '\n' - + i18n( "These boards were moved:\n\n" ) + oldBoards; - QApplication::clipboard() ->setText( str , QClipboard::Clipboard ); - QApplication::clipboard() ->setText( str , QClipboard::Selection ); + while ((ret = mb.exec()) == QMessageBox::No) { + QString str = i18n("New boards:\n\n") + newBoards + '\n' + + i18n("These boards were moved:\n\n") + oldBoards; + QApplication::clipboard() ->setText(str , QClipboard::Clipboard); + QApplication::clipboard() ->setText(str , QClipboard::Selection); } - if ( ret == QMessageBox::Cancel ) return false; - } else if ( newBoards.isEmpty() && oldBoards.isEmpty() ) { + if (ret == QMessageBox::Cancel) return false; + } else if (newBoards.isEmpty() && oldBoards.isEmpty()) { - QMessageBox::information( this, "Kita", i18n( "no new boards" ) ); + QMessageBox::information(this, "Kita", i18n("no new boards")); return false; } // if moved URL exists. move files. - for( int i=0; i %s", oldURL.latin1(), newURL.latin1()); - Kita::BoardManager::moveBoard( oldURL, newURL ); + Kita::BoardManager::moveBoard(oldURL, newURL); } /* save config */ - QString configPath = KStandardDirs::locateLocal( "appdata", "board_list" ); - KConfig config( configPath ); - for ( it = categoryList.begin(); it != categoryList.end(); ++it ) { - Kita::Category category = ( *it ); + QString configPath = KStandardDirs::locateLocal("appdata", "board_list"); + KConfig config(configPath); + for (it = categoryList.begin(); it != categoryList.end(); ++it) { + Kita::Category category = (*it); Q3ValueList board_url_list = category.boardURLList; - if ( board_url_list.isEmpty() ) { + if (board_url_list.isEmpty()) { continue; } list << category.category_name; - KConfigGroup group = config.group( category.category_name ); + KConfigGroup group = config.group(category.category_name); Q3ValueList::iterator it2; int count = 0; - for ( it2 = board_url_list.begin(); it2 != board_url_list.end(); ++it2 ) { - QString key = QString( "item%1" ).arg( count ); + for (it2 = board_url_list.begin(); it2 != board_url_list.end(); ++it2) { + QString key = QString("item%1").arg(count); QString boardURL = *it2; QString boardName = category.boardNameList[ count ]; QStringList tmpList; tmpList << boardURL; tmpList << boardName; - group.writeEntry( key, tmpList ); + group.writeEntry(key, tmpList); count++; } } - KConfigGroup group2 = config.group( "" ); - group2.writeEntry( "Categories", list ); + KConfigGroup group2 = config.group(""); + group2.writeEntry("Categories", list); QDateTime now = QDateTime::currentDateTime(); - QString logPath = KStandardDirs::locateLocal( "appdata", "board_log.txt" ); + QString logPath = KStandardDirs::locateLocal("appdata", "board_log.txt"); - QFile logfile( logPath ); - if ( logfile.open( QIODevice::WriteOnly | QIODevice::Append ) ) { - QTextStream stream( &logfile ); - stream.setCodec( "UTF-8" ); + QFile logfile(logPath); + if (logfile.open(QIODevice::WriteOnly | QIODevice::Append)) { + QTextStream stream(&logfile); + stream.setCodec("UTF-8"); - stream << "Date: " << now.toString( "yyyy/MM/dd hh:mm:ss" ) << endl; - stream << i18n( "New boards:\n\n" ) + newBoards + '\n'; - stream << i18n( "These boards were moved:\n\n" ) + oldBoards; + stream << "Date: " << now.toString("yyyy/MM/dd hh:mm:ss") << endl; + stream << i18n("New boards:\n\n") + newBoards + '\n'; + stream << i18n("These boards were moved:\n\n") + oldBoards; stream << "----------------------------------------" << endl; logfile.close(); } @@ -282,7 +282,7 @@ void KitaBBSView::updateBoardList() { - if ( downloadBoardList() ) showBoardList(); + if (downloadBoardList()) showBoardList(); } /** @@ -295,63 +295,63 @@ { /* color setting */ /* - m_textColor = QColor( "white" ); - m_baseColor = QColor( "red" ); - m_backColor = QColor( "yellow" ); - m_altColor = QColor( "blue" ); + m_textColor = QColor("white"); + m_baseColor = QColor("red"); + m_backColor = QColor("yellow"); + m_altColor = QColor("blue"); */ /*-------------------------------------------------*/ /* set background color */ -// m_boardList->viewport() ->setPaletteBackgroundColor( m_backColor ); // TODO -// m_boardList->setAlternateBackground( m_altColor ); // TODO +// m_boardList->viewport() ->setPaletteBackgroundColor(m_backColor); // TODO +// m_boardList->setAlternateBackground(m_altColor); // TODO // clear list m_boardList->clear(); m_favorites = 0; - QString configPath = KStandardDirs::locateLocal( "appdata", "board_list" ); - KConfig config( configPath ); - QStringList category_list = config.group("").readEntry( "Categories", QStringList() ); + QString configPath = KStandardDirs::locateLocal("appdata", "board_list"); + KConfig config(configPath); + QStringList category_list = config.group("").readEntry("Categories", QStringList()); Kita::ListViewItem* previous = 0; QStringList::iterator it; - for ( it = category_list.begin(); it != category_list.end(); ++it ) { - QString category = ( *it ); + for (it = category_list.begin(); it != category_list.end(); ++it) { + QString category = (*it); - KConfigGroup group = config.group( category ); - Kita::ListViewItem* categoryItem = new Kita::ListViewItem( m_boardList, previous, category ); -// categoryItem->setColor( m_textColor, m_baseColor ); // TODO + KConfigGroup group = config.group(category); + Kita::ListViewItem* categoryItem = new Kita::ListViewItem(m_boardList, previous, category); +// categoryItem->setColor(m_textColor, m_baseColor); // TODO Kita::ListViewItem* previousBoard = 0; - for ( int count = 0; ; count++ ) { - QString key = QString( "item%1" ).arg( count ); - QStringList value = group.readEntry( key, QStringList() ); - if ( value.count() != 2 ) { + for (int count = 0; ; count++) { + QString key = QString("item%1").arg(count); + QStringList value = group.readEntry(key, QStringList()); + if (value.count() != 2) { break; } QString boardURL = value[ 0 ]; QString boardName = value[ 1 ]; - if ( boardURL.contains( '/' ) != 4 || boardURL.right( 1 ) != "/" ) { + if (boardURL.contains('/') != 4 || boardURL.right(1) != "/") { // OK: http://pc8.2ch.net/linux/ // NG: http://www.machi.to/ // NG: http://find.2ch.net/enq/board.php continue; } QString oldURL; - Kita::BoardManager::enrollBoard( boardURL, boardName, oldURL ); - Kita::BoardManager::loadBBSHistory( boardURL ); - previousBoard = new Kita::ListViewItem( categoryItem, previousBoard, boardName, boardURL ); -// previousBoard->setColor( m_textColor, m_baseColor ); // TODO + Kita::BoardManager::enrollBoard(boardURL, boardName, oldURL); + Kita::BoardManager::loadBBSHistory(boardURL); + previousBoard = new Kita::ListViewItem(categoryItem, previousBoard, boardName, boardURL); +// previousBoard->setColor(m_textColor, m_baseColor); // TODO } previous = categoryItem; } QString boardURL = "http://jbbs.livedoor.jp/computer/18420/" ; - QString boardName = i18n( "Kita Board" ); + QString boardName = i18n("Kita Board"); QString oldURL; - new Kita::ListViewItem( m_boardList, 0, boardName, boardURL ); - Kita::BoardManager::enrollBoard( boardURL, boardName, oldURL ); + new Kita::ListViewItem(m_boardList, 0, boardName, boardURL); + Kita::BoardManager::enrollBoard(boardURL, boardName, oldURL); loadExtBoard(); refreshFavoriteBoards(); @@ -361,33 +361,33 @@ /* private */ void KitaBBSView::loadExtBoard() { - QString configPath = KStandardDirs::locateLocal( "appdata", "extbrd.conf" ); - QFile file( configPath ); - if ( file.open( QIODevice::ReadOnly ) ) { + QString configPath = KStandardDirs::locateLocal("appdata", "extbrd.conf"); + QFile file(configPath); + if (file.open(QIODevice::ReadOnly)) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QTextStream stream(&file); + stream.setCodec("UTF-8"); QStringList list; QString str; - Kita::ListViewItem* categoryItem = new Kita::ListViewItem( m_boardList, "extboard" ); -// categoryItem->setColor( m_textColor, m_baseColor ); // TODO + Kita::ListViewItem* categoryItem = new Kita::ListViewItem(m_boardList, "extboard"); +// categoryItem->setColor(m_textColor, m_baseColor); // TODO - while ( !( str = stream.readLine() ).isEmpty() ) { - if ( ! str.isEmpty() ) { - QStringList list = str.split( "<>" ); + while (!(str = stream.readLine()).isEmpty()) { + if (! str.isEmpty()) { + QStringList list = str.split("<>"); - if ( list.size() == 2 || list.size() == 3 ) { + if (list.size() == 2 || list.size() == 3) { QString board_title = list[ 0 ]; QString board_url = list[ 1 ]; - Kita::ListViewItem* tmpitem = new Kita::ListViewItem( categoryItem, board_title, board_url ); -// tmpitem->setColor( m_textColor, m_baseColor ); // TODO + Kita::ListViewItem* tmpitem = new Kita::ListViewItem(categoryItem, board_title, board_url); +// tmpitem->setColor(m_textColor, m_baseColor); // TODO QString oldURL; int type = Kita::Board_Unknown; - if ( list.size() == 3 ) type = list[ 2 ].toInt(); - Kita::BoardManager::enrollBoard( board_url, board_title, oldURL, type ); + if (list.size() == 3) type = list[ 2 ].toInt(); + Kita::BoardManager::enrollBoard(board_url, board_title, oldURL, type); } } } @@ -396,34 +396,34 @@ } } -Q3ValueList KitaBBSView::getCategoryList( const QString& html ) const +Q3ValueList KitaBBSView::getCategoryList(const QString& html) const { Q3ValueList result; - QStringList lines = html.split( '\n' ); + QStringList lines = html.split('\n'); QStringList::iterator it; Kita::Category current_category; current_category.category_name.clear(); current_category.boardNameList.clear(); current_category.boardURLList.clear(); - for ( it = lines.begin(); it != lines.end(); ++it ) { - QString category_name = Kita::getCategory( *it ); - if ( !category_name.isEmpty() ) { - if ( !current_category.category_name.isEmpty() ) { - result.append( current_category ); + for (it = lines.begin(); it != lines.end(); ++it) { + QString category_name = Kita::getCategory(*it); + if (!category_name.isEmpty()) { + if (!current_category.category_name.isEmpty()) { + result.append(current_category); } current_category.category_name = category_name; current_category.boardNameList.clear(); current_category.boardURLList.clear(); } else { - QRegExp regexp( "(.*)", Qt::CaseInsensitive ); - if ( regexp.indexIn( ( *it ) ) != -1 ) { - QString url = regexp.cap( 1 ); - QString title = regexp.cap( 2 ); - if ( Kita::isBoardURL( url ) && !current_category.category_name.isEmpty() ) { - current_category.boardNameList.append( title ); - current_category.boardURLList.append( url ); + QRegExp regexp("(.*)", Qt::CaseInsensitive); + if (regexp.indexIn((*it)) != -1) { + QString url = regexp.cap(1); + QString title = regexp.cap(2); + if (Kita::isBoardURL(url) && !current_category.category_name.isEmpty()) { + current_category.boardNameList.append(title); + current_category.boardURLList.append(url); } } } @@ -433,48 +433,48 @@ void KitaBBSView::refreshFavoriteBoards() { - if ( ! m_favorites ) { - m_favorites = new Kita::ListViewItem( m_boardList, 0, i18n( "Favorites" ) ); + if (! m_favorites) { + m_favorites = new Kita::ListViewItem(m_boardList, 0, i18n("Favorites")); } -// m_favorites->setColor( m_textColor, m_baseColor ); // TODO +// m_favorites->setColor(m_textColor, m_baseColor); // TODO // remove all items. do { Q3ListViewItem* child = m_favorites->firstChild(); delete child; - } while ( m_favorites->childCount() != 0 ); + } while (m_favorites->childCount() != 0); // insert items. Q3ValueList boards = Kita::FavoriteBoards::boards(); Q3ValueList::iterator it; - for ( it = boards.begin(); it != boards.end(); ++it ) { - QString boardURL = ( *it ).prettyUrl(); - QString boardName = Kita::BoardManager::boardName( boardURL ); + for (it = boards.begin(); it != boards.end(); ++it) { + QString boardURL = (*it).prettyUrl(); + QString boardName = Kita::BoardManager::boardName(boardURL); - Kita::ListViewItem* item = new Kita::ListViewItem( m_favorites, 0, boardName, boardURL ); -// item->setColor( m_textColor, m_baseColor ); // TODO + Kita::ListViewItem* item = new Kita::ListViewItem(m_favorites, 0, boardName, boardURL); +// item->setColor(m_textColor, m_baseColor); // TODO } } -void KitaBBSView::loadBoard( Q3ListViewItem* item ) +void KitaBBSView::loadBoard(Q3ListViewItem* item) { - if ( ! item ) return ; + if (! item) return ; - QString boardName = item->text( 0 ); - QString boardURL = Kita::BoardManager::boardURL( item->text( 1 ) ); + QString boardName = item->text(0); + QString boardURL = Kita::BoardManager::boardURL(item->text(1)); - if ( boardURL.isEmpty() ) { + if (boardURL.isEmpty()) { return ; } - ViewMediator::getInstance()->openBoard( boardURL ); + ViewMediator::getInstance()->openBoard(boardURL); } -void KitaBBSView::setFont( const QFont& font ) +void KitaBBSView::setFont(const QFont& font) { - m_boardList->setFont( font ); - SearchCombo->setFont( font ); + m_boardList->setFont(font); + SearchCombo->setFont(font); } /* public slot :*/ /* virtual */ @@ -486,95 +486,95 @@ void KitaBBSView::slotMenuOpenWithBrowser() { Q3ListViewItem* item = m_boardList->currentItem(); - QString boardName = item->text( 0 ); - KUrl boardURL = item->text( 1 ); - KRun::runUrl( boardURL, "text/html", 0 ); + QString boardName = item->text(0); + KUrl boardURL = item->text(1); + KRun::runUrl(boardURL, "text/html", 0); } -void KitaBBSView::slotContextMenuRequested( Q3ListViewItem* item, const QPoint& point, int ) +void KitaBBSView::slotContextMenuRequested(Q3ListViewItem* item, const QPoint& point, int) { - if ( item == 0 ) { + if (item == 0) { return ; } - KMenu popup( 0 ); + KMenu popup(0); - KAction* openWithBrowserAct = new KAction( i18n( "Open with Web Browser" ), this ); - popup.addAction( openWithBrowserAct ); + KAction* openWithBrowserAct = new KAction(i18n("Open with Web Browser"), this); + popup.addAction(openWithBrowserAct); - KAction* copyURLAct = new KAction( i18n( "Copy URL" ), this ); - popup.addAction( copyURLAct ); + KAction* copyURLAct = new KAction(i18n("Copy URL"), this); + popup.addAction(copyURLAct); - KAction* copyTitleAndURLAct = new KAction( i18n( "Copy title and URL" ), this ); - popup.addAction( copyTitleAndURLAct ); + KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); + popup.addAction(copyTitleAndURLAct); KAction* removeFromFavoritesAct = 0; KAction* addToFavoritesAct = 0; - if ( item->parent() == m_favorites ) { - removeFromFavoritesAct = new KAction( i18n( "Remove from Favorites" ), this ); - popup.addAction( removeFromFavoritesAct ); + if (item->parent() == m_favorites) { + removeFromFavoritesAct = new KAction(i18n("Remove from Favorites"), this); + popup.addAction(removeFromFavoritesAct); } else { - addToFavoritesAct = new KAction( i18n( "Add to Favorites" ), this ); - popup.addAction( addToFavoritesAct ); + addToFavoritesAct = new KAction(i18n("Add to Favorites"), this); + popup.addAction(addToFavoritesAct); } - QString boardName = item->text( 0 ); - KUrl boardURL = item->text( 1 ); - KUrl boardURL_upToDate = Kita::BoardManager::boardURL( boardURL ); + QString boardName = item->text(0); + KUrl boardURL = item->text(1); + KUrl boardURL_upToDate = Kita::BoardManager::boardURL(boardURL); QClipboard* clipboard = QApplication::clipboard(); - QAction *action = popup.exec( point ); - if ( !action ) { + QAction *action = popup.exec(point); + if (!action) { return; } - if ( action == openWithBrowserAct ) { - KRun::runUrl( boardURL, "text/html", this ); - } else if ( action == copyURLAct ) { - clipboard->setText( boardURL_upToDate.prettyUrl(), QClipboard::Clipboard ); - clipboard->setText( boardURL_upToDate.prettyUrl(), QClipboard::Selection ); - } else if ( action == copyTitleAndURLAct ) { - clipboard->setText( boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Clipboard ); - clipboard->setText( boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Selection ); - } else if ( action == addToFavoritesAct ) { - Kita::FavoriteBoards::append( boardURL_upToDate ); - } else if ( action == removeFromFavoritesAct ) { - Kita::FavoriteBoards::remove( boardURL ); + if (action == openWithBrowserAct) { + KRun::runUrl(boardURL, "text/html", this); + } else if (action == copyURLAct) { + clipboard->setText(boardURL_upToDate.prettyUrl(), QClipboard::Clipboard); + clipboard->setText(boardURL_upToDate.prettyUrl(), QClipboard::Selection); + } else if (action == copyTitleAndURLAct) { + clipboard->setText(boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Clipboard); + clipboard->setText(boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Selection); + } else if (action == addToFavoritesAct) { + Kita::FavoriteBoards::append(boardURL_upToDate); + } else if (action == removeFromFavoritesAct) { + Kita::FavoriteBoards::remove(boardURL); } } -void KitaBBSView::slotMouseButtonClicked( int button, Q3ListViewItem* item ) +void KitaBBSView::slotMouseButtonClicked(int button, Q3ListViewItem* item) { - if ( ! item ) return ; + if (! item) return ; - QString boardName = item->text( 0 ); - QString boardURL = Kita::BoardManager::boardURL( item->text( 1 ) ); - if ( boardURL.isEmpty() ) { - m_boardList->setOpen( item, !item->isOpen() ); + QString boardName = item->text(0); + QString boardURL = Kita::BoardManager::boardURL(item->text(1)); + if (boardURL.isEmpty()) { + m_boardList->setOpen(item, !item->isOpen()); return ; } - switch ( button ) { + switch (button) { case Qt::MidButton: - ViewMediator::getInstance()->openBoard( boardURL ); + ViewMediator::getInstance()->openBoard(boardURL); break; case Qt::LeftButton: - ViewMediator::getInstance()->openBoard( boardURL ); + ViewMediator::getInstance()->openBoard(boardURL); break; } } void KitaBBSView::loadOpened() { - QString configPath = KStandardDirs::locateLocal( "appdata", "board_state.conf" ); - KConfig config( configPath ); + QString configPath = KStandardDirs::locateLocal("appdata", "board_state.conf"); + KConfig config(configPath); - QStringList openedList = config.group("").readEntry( "Opened", QStringList() ); + QStringList openedList = config.group("").readEntry("Opened", QStringList()); Q3ListViewItem* item; - for ( item = m_boardList->firstChild(); item; item = item->nextSibling() ) { - QString categoryName = item->text( 0 ); - if ( openedList.indexOf( categoryName ) != -1 ) { - item->setOpen( true ); + for (item = m_boardList->firstChild(); item; item = item->nextSibling()) { + QString categoryName = item->text(0); + if (openedList.indexOf(categoryName) != -1) { + item->setOpen(true); } } } @@ -584,17 +584,17 @@ QStringList openedList; Q3ListViewItem* item; - for ( item = m_boardList->firstChild(); item; item = item->nextSibling() ) { - QString categoryName = item->text( 0 ); - if ( item->isOpen() ) { + for (item = m_boardList->firstChild(); item; item = item->nextSibling()) { + QString categoryName = item->text(0); + if (item->isOpen()) { openedList << categoryName; } } - QString configPath = KStandardDirs::locateLocal( "appdata", "board_state.conf" ); - KConfig config( configPath ); + QString configPath = KStandardDirs::locateLocal("appdata", "board_state.conf"); + KConfig config(configPath); - config.group("").writeEntry( "Opened", openedList ); + config.group("").writeEntry("Opened", openedList); } /** @@ -602,24 +602,24 @@ * * @param str string to search. */ -void KitaBBSView::filter( const QString& str ) +void KitaBBSView::filter(const QString& str) { Q3ListViewItem* categoryItem; Q3ListViewItem* boardItem; - for ( categoryItem = m_boardList->firstChild(); categoryItem; categoryItem = categoryItem->nextSibling() ) { + for (categoryItem = m_boardList->firstChild(); categoryItem; categoryItem = categoryItem->nextSibling()) { bool matched = false; - for ( boardItem = categoryItem->firstChild(); boardItem; boardItem = boardItem->nextSibling() ) { - QString boardName = boardItem->text( 0 ); - if ( boardName.contains( str ) ) { - boardItem->setVisible( true ); + for (boardItem = categoryItem->firstChild(); boardItem; boardItem = boardItem->nextSibling()) { + QString boardName = boardItem->text(0); + if (boardName.contains(str)) { + boardItem->setVisible(true); matched = true; } else { - boardItem->setVisible( false ); + boardItem->setVisible(false); } } - categoryItem->setVisible( matched ); + categoryItem->setVisible(matched); } } Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -47,7 +47,7 @@ QColor m_backColor; QColor m_altColor; - Q3ValueList getCategoryList( const QString& html ) const; + Q3ValueList getCategoryList(const QString& html) const; void saveOpened(); KComboBox* SearchCombo; @@ -59,15 +59,15 @@ QSpacerItem* spacer2; private slots: - void loadBoard( Q3ListViewItem* item ); - void slotContextMenuRequested( Q3ListViewItem*, const QPoint&, int ); - void slotMouseButtonClicked( int, Q3ListViewItem* ); + void loadBoard(Q3ListViewItem* item); + void slotContextMenuRequested(Q3ListViewItem*, const QPoint&, int); + void slotMouseButtonClicked(int, Q3ListViewItem*); void refreshFavoriteBoards(); - void filter( const QString& str ); + void filter(const QString& str); void slotMenuOpenWithBrowser(); public: - explicit KitaBBSView( QWidget *parent, const char *name = 0 ); + explicit KitaBBSView(QWidget *parent, const char *name = 0); ~KitaBBSView(); void loadOpened(); @@ -75,7 +75,7 @@ public slots: void updateBoardList(); void showBoardList(); - void setFont( const QFont& font ); + void setFont(const QFont& font); virtual void setFocus(); private: Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,17 +24,17 @@ #include "viewmediator.h" #include "libkita/boardmanager.h" -KitaBoardTabWidget::KitaBoardTabWidget( QWidget* parent, Qt::WFlags f ) - : KitaTabWidgetBase( parent, f ) +KitaBoardTabWidget::KitaBoardTabWidget(QWidget* parent, Qt::WFlags f) + : KitaTabWidgetBase(parent, f) { - setXMLFile( "boardtabwidgetui.rc" ); + setXMLFile("boardtabwidgetui.rc"); - setTabBar( new SubjectTabBar( this ) ); + setTabBar(new SubjectTabBar(this)); - FavoriteListView* favoriteList = new FavoriteListView( this ); - favoriteList->setObjectName( "favoriteTab" ); - ViewMediator::getInstance()->setFavoriteListView( favoriteList ); - addTab( favoriteList, i18n( "Favorite" ) ); + FavoriteListView* favoriteList = new FavoriteListView(this); + favoriteList->setObjectName("favoriteTab"); + ViewMediator::getInstance()->setFavoriteListView(favoriteList); + addTab(favoriteList, i18n("Favorite")); setupActions(); } @@ -42,52 +42,52 @@ KitaBoardTabWidget::~KitaBoardTabWidget() {} -void KitaBoardTabWidget::updateBoardView( const KUrl& datURL ) +void KitaBoardTabWidget::updateBoardView(const KUrl& datURL) { - for( int i=0; islotUpdateSubject( datURL ); + for(int i=0; islotUpdateSubject(datURL); } } } /* public slots */ -void KitaBoardTabWidget::loadBoard( const KUrl& boardURL ) +void KitaBoardTabWidget::loadBoard(const KUrl& boardURL) { - KitaBoardView * view = findView( boardURL ); - QString boardName = Kita::BoardManager::boardName( boardURL ); - if ( !view ) { - view = createView( boardName ); + KitaBoardView * view = findView(boardURL); + QString boardName = Kita::BoardManager::boardName(boardURL); + if (!view) { + view = createView(boardName); } - if ( view ) { - setCurrentWidget( view ); - view->loadBoard( boardURL ); + if (view) { + setCurrentWidget(view); + view->loadBoard(boardURL); } } /* create KitaBoardView */ /* private */ -KitaBoardView* KitaBoardTabWidget::createView( QString label ) +KitaBoardView* KitaBoardTabWidget::createView(QString label) { - KitaBoardView * view = new KitaBoardView( this ); - if ( view ) { - insertTab( count() - 1, view, label ); + KitaBoardView * view = new KitaBoardView(this); + if (view) { + insertTab(count() - 1, view, label); } return view; } /* private */ -KitaBoardView* KitaBoardTabWidget::findView( const KUrl& boardURL ) +KitaBoardView* KitaBoardTabWidget::findView(const KUrl& boardURL) { int max = count() - 1; - if ( max <= 0 ) return 0; + if (max <= 0) return 0; int i = 0; - while ( i < max ) { - KitaBoardView * view = isSubjectView( widget( i ) ); - if ( view && view->boardURL() == boardURL ) return view; + while (i < max) { + KitaBoardView * view = isSubjectView(widget(i)); + if (view && view->boardURL() == boardURL) return view; i++; } @@ -96,21 +96,21 @@ /* protected */ /* virtual */ -void KitaBoardTabWidget::deleteWidget( QWidget* w ) +void KitaBoardTabWidget::deleteWidget(QWidget* w) { - KitaBoardView * view = isSubjectView( w ); - if ( !view ) return ; - removePage( view ); + KitaBoardView * view = isSubjectView(w); + if (!view) return ; + removePage(view); delete view; } /* private */ -KitaBoardView* KitaBoardTabWidget::isSubjectView( QWidget* w ) +KitaBoardView* KitaBoardTabWidget::isSubjectView(QWidget* w) { KitaBoardView * view = 0; - if ( w ) { - if ( w->inherits( "KitaBoardView" ) ) view = static_cast< KitaBoardView* >( w ); + if (w) { + if (w->inherits("KitaBoardView")) view = static_cast< KitaBoardView* >(w); } return view; @@ -123,41 +123,41 @@ void KitaBoardTabWidget::setupActions() { KAction* find_action = actionCollection()->addAction("subjectview_find"); - find_action->setText( i18n( "Find" ) ); + find_action->setText(i18n("Find")); find_action->setShortcut(KStandardShortcut::find()); connect(find_action, SIGNAL(triggered()), this, SLOT(slotFocusSearchCombo())); KAction* reload_action = actionCollection()->addAction("subjectview_reload"); - reload_action->setText( i18n( "Reload" ) ); + reload_action->setText(i18n("Reload")); reload_action->setShortcut(KStandardShortcut::reload()); connect(reload_action, SIGNAL(triggered()), this, SLOT(slotReloadButton())); KAction* showoldlogs_action = actionCollection()->addAction("subjectview_showoldlogs"); - showoldlogs_action->setText( i18n( "Show Old Logs" ) ); + showoldlogs_action->setText(i18n("Show Old Logs")); connect(showoldlogs_action, SIGNAL(triggered()), this, SLOT(slotShowOldLogs())); } /* public slot */ void KitaBoardTabWidget::slotReloadButton() { - KitaBoardView * view = isSubjectView( currentWidget() ); - if ( view ) view->reloadSubject(); + KitaBoardView * view = isSubjectView(currentWidget()); + if (view) view->reloadSubject(); } /* public slot */ void KitaBoardTabWidget::slotFocusSearchCombo() { - KitaBoardView * view = isSubjectView( currentWidget() ); - if ( view ) view->slotFocusSearchCombo(); + KitaBoardView * view = isSubjectView(currentWidget()); + if (view) view->slotFocusSearchCombo(); } /* public slot */ -void KitaBoardTabWidget::slotShowOldLogs( int idx ) +void KitaBoardTabWidget::slotShowOldLogs(int idx) { KitaBoardView * view; - if ( idx == -1 ) view = isSubjectView( currentWidget() ); - else view = isSubjectView( widget( idx ) ); - if ( view ) view->toggleShowOldLogs(); + if (idx == -1) view = isSubjectView(currentWidget()); + else view = isSubjectView(widget(idx)); + if (view) view->toggleShowOldLogs(); } /*---------------------------------------------------------------------*/ @@ -166,11 +166,11 @@ -SubjectTabBar::SubjectTabBar( QWidget* parent ) - : KTabBar( parent ) +SubjectTabBar::SubjectTabBar(QWidget* parent) + : KTabBar(parent) { - connect( this, SIGNAL( contextMenu( int, const QPoint& ) ), - SLOT( showPopupMenu( int, const QPoint& ) ) ); + connect(this, SIGNAL(contextMenu(int, const QPoint&)), + SLOT(showPopupMenu(int, const QPoint&))); } SubjectTabBar::~SubjectTabBar() @@ -178,67 +178,67 @@ /* private */ /* virtual */ -void SubjectTabBar::showPopupMenu( int idx, const QPoint& global ) +void SubjectTabBar::showPopupMenu(int idx, const QPoint& global) { - KitaBoardTabWidget* tabwidget = static_cast( parentWidget() ); + KitaBoardTabWidget* tabwidget = static_cast(parentWidget()); KActionCollection * collection = tabwidget->actionCollection(); - if ( QString::compare( tabwidget->widget( idx ) ->objectName(), "favoriteTab" ) == 0 ) return ; - KMenu popup( this ); + if (QString::compare(tabwidget->widget(idx) ->objectName(), "favoriteTab") == 0) return ; + KMenu popup(this); - KAction* closeAct = new KAction( i18n( "Close this tab" ), this ); - popup.addAction( closeAct ); + KAction* closeAct = new KAction(i18n("Close this tab"), this); + popup.addAction(closeAct); - popup.addAction( collection->action( "tab_prevtab" ) ); - popup.addAction( collection->action( "tab_nexttab" ) ); + popup.addAction(collection->action("tab_prevtab")); + popup.addAction(collection->action("tab_nexttab")); popup.addSeparator(); - KAction* closeOtherAct = new KAction( i18n( "Close Other Tabs" ), this ); - popup.addAction( closeOtherAct ); + KAction* closeOtherAct = new KAction(i18n("Close Other Tabs"), this); + popup.addAction(closeOtherAct); - KAction* closeRightAct = new KAction( i18n( "Close right tabs" ), this ); - popup.addAction( closeRightAct ); + KAction* closeRightAct = new KAction(i18n("Close right tabs"), this); + popup.addAction(closeRightAct); - KAction* closeLeftAct = new KAction( i18n( "Close left tabs" ), this ); - popup.addAction( closeLeftAct ); + KAction* closeLeftAct = new KAction(i18n("Close left tabs"), this); + popup.addAction(closeLeftAct); - popup.addAction( collection->action( "tab_closealltab" ) ); + popup.addAction(collection->action("tab_closealltab")); popup.addSeparator(); - KAction* showOldLogsAct = new KAction( i18n( "Show Old Logs" ), this ); - popup.addAction( showOldLogsAct ); + KAction* showOldLogsAct = new KAction(i18n("Show Old Logs"), this); + popup.addAction(showOldLogsAct); - KAction* openBrowserAct = new KAction( i18n( "Open with Web Browser" ), this ); - popup.addAction( openBrowserAct ); + KAction* openBrowserAct = new KAction(i18n("Open with Web Browser"), this); + popup.addAction(openBrowserAct); - KAction* copyTitleAct = new KAction( i18n( "Copy title and URL" ), this ); - popup.addAction( copyTitleAct ); + KAction* copyTitleAct = new KAction(i18n("Copy title and URL"), this); + popup.addAction(copyTitleAct); popup.addSeparator(); - popup.addAction( collection->action( "tab_configkeys" ) ); + popup.addAction(collection->action("tab_configkeys")); - KitaBoardView* subjectView = static_cast( tabwidget->widget( idx ) ); + KitaBoardView* subjectView = static_cast(tabwidget->widget(idx)); QClipboard* clipboard = QApplication::clipboard(); - QAction* action = popup.exec( global ); - if ( !action ) { + QAction* action = popup.exec(global); + if (!action) { return; } - if ( action == closeAct ) { - tabwidget->slotCloseTab( idx ); - } else if ( action == closeOtherAct ) { - tabwidget->slotCloseOtherTab( idx ); - } else if ( action == closeRightAct ) { - tabwidget->slotCloseRightTab( idx ); - } else if ( action == closeLeftAct ) { - tabwidget->slotCloseLeftTab( idx ); - } else if ( action == showOldLogsAct ) { - tabwidget->slotShowOldLogs( idx ); - } else if ( action == openBrowserAct ) { - KRun::runUrl( subjectView->boardURL(), "text/html", this ); - } else if ( action == copyTitleAct ) { - QString cliptxt = Kita::BoardManager::boardName( subjectView->boardURL() ) + '\n' + subjectView->boardURL().prettyUrl(); - clipboard->setText( cliptxt , QClipboard::Clipboard ); - clipboard->setText( cliptxt , QClipboard::Selection ); + if (action == closeAct) { + tabwidget->slotCloseTab(idx); + } else if (action == closeOtherAct) { + tabwidget->slotCloseOtherTab(idx); + } else if (action == closeRightAct) { + tabwidget->slotCloseRightTab(idx); + } else if (action == closeLeftAct) { + tabwidget->slotCloseLeftTab(idx); + } else if (action == showOldLogsAct) { + tabwidget->slotShowOldLogs(idx); + } else if (action == openBrowserAct) { + KRun::runUrl(subjectView->boardURL(), "text/html", this); + } else if (action == copyTitleAct) { + QString cliptxt = Kita::BoardManager::boardName(subjectView->boardURL()) + '\n' + subjectView->boardURL().prettyUrl(); + clipboard->setText(cliptxt , QClipboard::Clipboard); + clipboard->setText(cliptxt , QClipboard::Selection); } } Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -23,20 +23,20 @@ Q_OBJECT public: - explicit KitaBoardTabWidget( QWidget* parent = 0, Qt::WFlags f = 0 ); + explicit KitaBoardTabWidget(QWidget* parent = 0, Qt::WFlags f = 0); ~KitaBoardTabWidget(); - void updateBoardView( const KUrl& datURL ); + void updateBoardView(const KUrl& datURL); public slots: - void loadBoard( const KUrl& ); + void loadBoard(const KUrl&); private: - KitaBoardView* createView( QString label ); - KitaBoardView* findView( const KUrl& boardURL ); - KitaBoardView* isSubjectView( QWidget* w ); + KitaBoardView* createView(QString label); + KitaBoardView* findView(const KUrl& boardURL); + KitaBoardView* isSubjectView(QWidget* w); protected: - virtual void deleteWidget( QWidget* w ); + virtual void deleteWidget(QWidget* w); /* tab actions */ @@ -47,7 +47,7 @@ public slots: void slotReloadButton(); void slotFocusSearchCombo(); - void slotShowOldLogs( int idx = -1 ); + void slotShowOldLogs(int idx = -1); }; /*--------------------------------------------------*/ @@ -57,11 +57,11 @@ Q_OBJECT public: - SubjectTabBar( QWidget* parent = 0 ); + SubjectTabBar(QWidget* parent = 0); ~SubjectTabBar(); public slots: - virtual void showPopupMenu( int idx, const QPoint& global ); + virtual void showPopupMenu(int idx, const QPoint& global); }; Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -50,28 +50,28 @@ #include "libkita/threadindex.h" #include "libkita/threadinfo.h" -KitaBoardView::KitaBoardView( KitaBoardTabWidget* parent ) - : Kita::ThreadListView( parent ) +KitaBoardView::KitaBoardView(KitaBoardTabWidget* parent) + : Kita::ThreadListView(parent) { init(); m_parent = parent; - closeButton->setEnabled( true ); + closeButton->setEnabled(true); - connect( subjectList, SIGNAL( contextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ), - SLOT( slotContextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ) ); - connect( subjectList, SIGNAL( returnPressed( Q3ListViewItem* ) ), - SLOT( loadThread( Q3ListViewItem* ) ) ); - connect( ReloadButton, SIGNAL( clicked() ), - SLOT( reloadSubject() ) ); + connect(subjectList, SIGNAL(contextMenuRequested(Q3ListViewItem*, const QPoint&, int)), + SLOT(slotContextMenuRequested(Q3ListViewItem*, const QPoint&, int))); + connect(subjectList, SIGNAL(returnPressed(Q3ListViewItem*)), + SLOT(loadThread(Q3ListViewItem*))); + connect(ReloadButton, SIGNAL(clicked()), + SLOT(reloadSubject())); - connect( closeButton, SIGNAL( clicked() ), - SLOT( slotCloseButton() ) ); + connect(closeButton, SIGNAL(clicked()), + SLOT(slotCloseButton())); Q3Header* header = subjectList->header(); - connect( header, SIGNAL( sizeChange( int, int, int ) ), - SLOT( slotSizeChange( int, int, int ) ) ); + connect(header, SIGNAL(sizeChange(int, int, int)), + SLOT(slotSizeChange(int, int, int))); - header->installEventFilter( this ); + header->installEventFilter(this); loadLayout(); loadHeaderOnOff(); } @@ -92,8 +92,8 @@ void KitaBoardView::reloadSubject() { - if ( ! m_boardURL.isEmpty() ) { - loadBoard( m_boardURL ); + if (! m_boardURL.isEmpty()) { + loadBoard(m_boardURL); } } @@ -113,16 +113,16 @@ void KitaBoardView::toggleShowOldLogs() { m_showOldLogs = !m_showOldLogs; - loadBoard( m_boardURL, false ); + loadBoard(m_boardURL, false); } -void KitaBoardView::loadThread( Q3ListViewItem* item ) +void KitaBoardView::loadThread(Q3ListViewItem* item) { - if ( ! item ) return ; + if (! item) return ; - KUrl datURL = item->text( Col_DatURL ); + KUrl datURL = item->text(Col_DatURL); - ViewMediator::getInstance()->openThread( datURL ); + ViewMediator::getInstance()->openThread(datURL); } enum { @@ -134,7 +134,7 @@ Thread_HasUnread }; -void KitaBoardView::loadBoard( const KUrl& url, bool online ) +void KitaBoardView::loadBoard(const KUrl& url, bool online) { activateWindow(); topLevelWidget() ->raise(); @@ -156,7 +156,7 @@ /* get list of pointers of Thread classes */ Q3PtrList oldLogList; Q3PtrList threadList; - Kita::BoardManager::getThreadList( m_boardURL, m_showOldLogs, online, threadList, oldLogList ); + Kita::BoardManager::getThreadList(m_boardURL, m_showOldLogs, online, threadList, oldLogList); // reset list subjectList->clear(); @@ -164,34 +164,34 @@ QDateTime current = QDateTime::currentDateTime(); unsigned int countNew = threadList.count(); unsigned int countOld = oldLogList.count(); - for ( unsigned i = 0; i < countNew + countOld; i++ ) { + for (unsigned i = 0; i < countNew + countOld; i++) { - Kita::Thread* thread = i < countNew ? threadList.at( i ) : oldLogList.at( i - countNew ); + Kita::Thread* thread = i < countNew ? threadList.at(i) : oldLogList.at(i - countNew); KUrl datURL = thread->datURL(); - Kita::ThreadListViewItem* item = new Kita::ThreadListViewItem( subjectList ); - int id = ( i < countNew ? i + 1 : 0 ); + Kita::ThreadListViewItem* item = new Kita::ThreadListViewItem(subjectList); + int id = (i < countNew ? i + 1 : 0); int order = i + 1; - updateListViewItem( item, datURL, current, id, order ); + updateListViewItem(item, datURL, current, id, order); } - if ( HideButton->isChecked() ) { + if (HideButton->isChecked()) { HideButton->toggle(); } - ViewMediator::getInstance()->setMainURLLine( m_boardURL ); + ViewMediator::getInstance()->setMainURLLine(m_boardURL); - switch ( Kita::Config::listSortOrder() ) { + switch (Kita::Config::listSortOrder()) { case Kita::Config::EnumListSortOrder::Mark: - subjectList->setSorting( Col_Mark ); + subjectList->setSorting(Col_Mark); break; case Kita::Config::EnumListSortOrder::ID: - subjectList->setSorting( Col_ID ); + subjectList->setSorting(Col_ID); break; default: // do nothing break; } - subjectList->setSelected( subjectList->firstChild(), true ); + subjectList->setSelected(subjectList->firstChild(), true); subjectList->setFocus(); UpdateKindLabel(); @@ -210,7 +210,7 @@ /* public slot */ void KitaBoardView::slotFocusSearchCombo() { - if ( ! SearchCombo->hasFocus() ) { + if (! SearchCombo->hasFocus()) { SearchCombo->setFocus(); } else { setFocus(); @@ -220,38 +220,38 @@ void KitaBoardView::UpdateKindLabel() { QString fmtstr; - fmtstr += QString( "%1" ).arg( m_unreadNum ); - fmtstr += QString( "/%1" ).arg( m_readNum ); - fmtstr += QString( "/%1" ).arg( m_newNum ); - KindLabel->setText( fmtstr ); + fmtstr += QString("%1").arg(m_unreadNum); + fmtstr += QString("/%1").arg(m_readNum); + fmtstr += QString("/%1").arg(m_newNum); + KindLabel->setText(fmtstr); } -void KitaBoardView::setFont( const QFont& font ) +void KitaBoardView::setFont(const QFont& font) { - subjectList->setFont( font ); - SearchCombo->setFont( font ); + subjectList->setFont(font); + SearchCombo->setFont(font); } -void KitaBoardView::slotUpdateSubject( const KUrl& url ) +void KitaBoardView::slotUpdateSubject(const KUrl& url) { QDateTime current = QDateTime::currentDateTime(); - KUrl datURL = Kita::getDatURL( url ); - for ( Q3ListViewItem * item = subjectList->firstChild(); item; item = item->nextSibling() ) { - if ( item->text( Col_DatURL ) == datURL.prettyUrl() ) { + KUrl datURL = Kita::getDatURL(url); + for (Q3ListViewItem * item = subjectList->firstChild(); item; item = item->nextSibling()) { + if (item->text(Col_DatURL) == datURL.prettyUrl()) { - switch ( item->text( Col_MarkOrder ).toInt() ) { + switch (item->text(Col_MarkOrder).toInt()) { case Thread_Readed : case Thread_Read : m_readNum--; break; case Thread_New : m_newNum--; break; case Thread_HasUnread : m_unreadNum--; break; } - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == 0 ) return ; - int id = item->text( Col_ID ).toInt(); - int order = item->text( Col_IDOrder ).toInt(); - updateListViewItem( item, datURL, current, id, order ); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread == 0) return ; + int id = item->text(Col_ID).toInt(); + int order = item->text(Col_IDOrder).toInt(); + updateListViewItem(item, datURL, current, id, order); UpdateKindLabel(); @@ -264,208 +264,208 @@ /* if id == 0, this thread is old thread. */ /* private */ -void KitaBoardView::updateListViewItem( Q3ListViewItem* item, const KUrl& datURL, const QDateTime& current, int id, int order ) +void KitaBoardView::updateListViewItem(Q3ListViewItem* item, const KUrl& datURL, const QDateTime& current, int id, int order) { QDateTime since; - since.setTime_t( Kita::datToSince( datURL ) ); - QString threadName = Kita::DatManager::threadName( datURL ); - int resNum = Kita::DatManager::getResNum( datURL ); - int readNum = Kita::DatManager::getReadNum( datURL ); - int viewPos = Kita::DatManager::getViewPos( datURL ); - double speed = resNum / ( since.secsTo( current ) / ( 60.0 * 60.0 * 24.0 ) ); + since.setTime_t(Kita::datToSince(datURL)); + QString threadName = Kita::DatManager::threadName(datURL); + int resNum = Kita::DatManager::getResNum(datURL); + int readNum = Kita::DatManager::getReadNum(datURL); + int viewPos = Kita::DatManager::getViewPos(datURL); + double speed = resNum / (since.secsTo(current) / (60.0 * 60.0 * 24.0)); - if ( id ) item->setText( Col_ID, QString().setNum( id ) ); - item->setText( Col_IDOrder, QString().setNum( order ) ); - item->setText( Col_Subject, threadName ); - item->setText( Col_ResNum, QString( "%1" ).arg( resNum, 4 ) ); - item->setText( Col_ReadNum, ( viewPos > 0 ) ? QString( "%1" ).arg( viewPos, 4 ) : QString( "" ) ); - item->setText( Col_Unread, ( viewPos > 0 && resNum > viewPos ) ? QString( "%1" ).arg( resNum - viewPos, 4 ) : QString( "" ) ); - item->setText( Col_Since, since.toString( "yy/MM/dd hh:mm" ) ); - item->setText( Col_DatURL, datURL.prettyUrl() ); - item->setText( Col_Speed, QString( " %1 " ).arg( speed, 0, 'f', 2 ) ); + if (id) item->setText(Col_ID, QString().setNum(id)); + item->setText(Col_IDOrder, QString().setNum(order)); + item->setText(Col_Subject, threadName); + item->setText(Col_ResNum, QString("%1").arg(resNum, 4)); + item->setText(Col_ReadNum, (viewPos > 0) ? QString("%1").arg(viewPos, 4) : QString("")); + item->setText(Col_Unread, (viewPos > 0 && resNum > viewPos) ? QString("%1").arg(resNum - viewPos, 4) : QString("")); + item->setText(Col_Since, since.toString("yy/MM/dd hh:mm")); + item->setText(Col_DatURL, datURL.prettyUrl()); + item->setText(Col_Speed, QString(" %1 ").arg(speed, 0, 'f', 2)); /* set mark order */ - if ( !id ) { /* old thread */ + if (!id) { /* old thread */ - item->setText( Col_MarkOrder, QString::number( Thread_Old ) ); - } else if ( readNum > 0 && ( resNum > readNum || resNum > viewPos ) ) { /* There are new responses. */ + item->setText(Col_MarkOrder, QString::number(Thread_Old)); + } else if (readNum > 0 && (resNum > readNum || resNum > viewPos)) { /* There are new responses. */ - item->setPixmap( Col_Mark, SmallIcon( "unread" ) ); + item->setPixmap(Col_Mark, SmallIcon("unread")); m_unreadNum++; - item->setText( Col_MarkOrder, QString::number( Thread_HasUnread ) ); + item->setText(Col_MarkOrder, QString::number(Thread_HasUnread)); - } else if ( readNum > 0 ) { /* Cache exists */ + } else if (readNum > 0) { /* Cache exists */ - item->setPixmap( Col_Mark, SmallIcon( "read" ) ); + item->setPixmap(Col_Mark, SmallIcon("read")); m_readNum++; - item->setText( Col_MarkOrder, QString::number( ( viewPos > 1000 ) ? Thread_Readed : Thread_Read ) ); + item->setText(Col_MarkOrder, QString::number((viewPos > 1000) ? Thread_Readed : Thread_Read)); - } else if ( since.secsTo( current ) < 3600 * Kita::Config::markTime() ) { /* new thread */ + } else if (since.secsTo(current) < 3600 * Kita::Config::markTime()) { /* new thread */ - item->setPixmap( Col_Mark, SmallIcon( "newthread" ) ); + item->setPixmap(Col_Mark, SmallIcon("newthread")); m_newNum++; - item->setText( Col_MarkOrder, QString::number( Thread_New ) ); + item->setText(Col_MarkOrder, QString::number(Thread_New)); } else { /* normal */ - item->setText( Col_MarkOrder, QString::number( Thread_Normal ) ); - item->setPixmap( Col_Mark, 0 ); + item->setText(Col_MarkOrder, QString::number(Thread_Normal)); + item->setPixmap(Col_Mark, 0); } // no effect: m_unreadNum, m_readNum, m_newNum, markOrder - if ( Kita::DatManager::isMainThreadOpened( datURL ) && resNum == readNum ) { /* opened */ - item->setPixmap( Col_Mark, SmallIcon( "open" ) ); + if (Kita::DatManager::isMainThreadOpened(datURL) && resNum == readNum) { /* opened */ + item->setPixmap(Col_Mark, SmallIcon("open")); } } -void KitaBoardView::slotContextMenuRequested( Q3ListViewItem* item, const QPoint& point, int ) +void KitaBoardView::slotContextMenuRequested(Q3ListViewItem* item, const QPoint& point, int) { - if ( item == 0 ) { + if (item == 0) { return ; } - QString datURL = item->text( Col_DatURL ); - QString threadURL = Kita::DatManager::threadURL( datURL ); - bool isFavorites = FavoriteThreads::getInstance() ->contains( datURL ); + QString datURL = item->text(Col_DatURL); + QString threadURL = Kita::DatManager::threadURL(datURL); + bool isFavorites = FavoriteThreads::getInstance() ->contains(datURL); // create popup menu. - KMenu popup( 0 ); + KMenu popup(0); - KAction* openWithBrowserAct = new KAction( i18n( "Open with Web Browser" ) , this); - popup.addAction( openWithBrowserAct ); + KAction* openWithBrowserAct = new KAction(i18n("Open with Web Browser") , this); + popup.addAction(openWithBrowserAct); - KAction* copyURLAct = new KAction( i18n( "Copy URL" ), this ); - popup.addAction( copyURLAct ); + KAction* copyURLAct = new KAction(i18n("Copy URL"), this); + popup.addAction(copyURLAct); - KAction* copyTitleAndURLAct = new KAction( i18n( "Copy title and URL" ), this ); - popup.addAction( copyTitleAndURLAct ); + KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); + popup.addAction(copyTitleAndURLAct); KAction* favoritesAct; - if ( isFavorites ) { - favoritesAct = new KAction( i18n( "Remove from Favorites" ), this ); + if (isFavorites) { + favoritesAct = new KAction(i18n("Remove from Favorites"), this); } else { - favoritesAct = new KAction( i18n( "Add to Favorites" ), this ); + favoritesAct = new KAction(i18n("Add to Favorites"), this); } - popup.addAction( favoritesAct ); + popup.addAction(favoritesAct); KAction* deleteLogAct = 0; - if ( Kita::DatManager::getReadNum( datURL ) ) { + if (Kita::DatManager::getReadNum(datURL)) { popup.addSeparator(); - deleteLogAct = new KAction( i18n( "Delete Log" ), this ); - popup.addAction( deleteLogAct ); + deleteLogAct = new KAction(i18n("Delete Log"), this); + popup.addAction(deleteLogAct); } popup.addSeparator(); - KAction* propertyAct = new KAction( i18n( "Property" ), this ); - popup.addAction( propertyAct ); + KAction* propertyAct = new KAction(i18n("Property"), this); + popup.addAction(propertyAct); // exec popup menu. QClipboard* clipboard = QApplication::clipboard(); QString cliptxt; - QAction* action = popup.exec( QCursor::pos() ); - if ( !action ) { + QAction* action = popup.exec(QCursor::pos()); + if (!action) { return; } - if ( action == openWithBrowserAct ) { - KRun::runUrl( threadURL, "text/html", this ); - } else if ( action == copyURLAct ) { - clipboard->setText( threadURL, QClipboard::Clipboard ); - clipboard->setText( threadURL, QClipboard::Selection ); - } else if ( action == copyTitleAndURLAct ) { - cliptxt = Kita::DatManager::threadName( datURL ) + '\n' + threadURL; - clipboard->setText( cliptxt , QClipboard::Clipboard ); - clipboard->setText( cliptxt , QClipboard::Selection ); - } else if ( action == favoritesAct ) { - ViewMediator::getInstance()->bookmark( datURL, !isFavorites ); - } else if ( action == deleteLogAct ) { - deleteLog( threadURL ); - } else if ( action == propertyAct ) { + if (action == openWithBrowserAct) { + KRun::runUrl(threadURL, "text/html", this); + } else if (action == copyURLAct) { + clipboard->setText(threadURL, QClipboard::Clipboard); + clipboard->setText(threadURL, QClipboard::Selection); + } else if (action == copyTitleAndURLAct) { + cliptxt = Kita::DatManager::threadName(datURL) + '\n' + threadURL; + clipboard->setText(cliptxt , QClipboard::Clipboard); + clipboard->setText(cliptxt , QClipboard::Selection); + } else if (action == favoritesAct) { + ViewMediator::getInstance()->bookmark(datURL, !isFavorites); + } else if (action == deleteLogAct) { + deleteLog(threadURL); + } else if (action == propertyAct) { // FIXME: memory leak Kita::Ui::ThreadProperty* propertyWidget = new Kita::Ui::ThreadProperty; - propertyWidget->threadURLLabel->setText( threadURL ); - propertyWidget->datURLLabel->setText( datURL ); + propertyWidget->threadURLLabel->setText(threadURL); + propertyWidget->datURLLabel->setText(datURL); - propertyWidget->threadNameLabel->setText( Kita::DatManager::threadName( datURL ) ); - propertyWidget->cachePathLabel->setText( Kita::DatManager::getCachePath( datURL ) ); - propertyWidget->indexPathLabel->setText( Kita::DatManager::getCacheIndexPath( datURL ) ); - propertyWidget->resNumLabel->setText( QString( "%1" ).arg( Kita::DatManager::getResNum( datURL ) ) ); - propertyWidget->readNumLabel->setText( QString( "%1" ).arg( Kita::DatManager::getReadNum( datURL ) ) ); - propertyWidget->viewPosLabel->setText( QString( "%1" ).arg( Kita::DatManager::getViewPos( datURL ) ) ); + propertyWidget->threadNameLabel->setText(Kita::DatManager::threadName(datURL)); + propertyWidget->cachePathLabel->setText(Kita::DatManager::getCachePath(datURL)); + propertyWidget->indexPathLabel->setText(Kita::DatManager::getCacheIndexPath(datURL)); + propertyWidget->resNumLabel->setText(QString("%1").arg(Kita::DatManager::getResNum(datURL))); + propertyWidget->readNumLabel->setText(QString("%1").arg(Kita::DatManager::getReadNum(datURL))); + propertyWidget->viewPosLabel->setText(QString("%1").arg(Kita::DatManager::getViewPos(datURL))); - propertyWidget->idx_threadNameWithIndexLabel->setText( Kita::ThreadIndex::getSubject( datURL ) ); - propertyWidget->idx_resNumLabel->setText( QString( "%1" ).arg( Kita::ThreadIndex::getResNum( datURL ) ) ); - propertyWidget->idx_readNumLabel->setText( QString( "%1" ).arg( Kita::ThreadIndex::getReadNum( datURL ) ) ); - propertyWidget->idx_viewPosLabel->setText( QString( "%1" ).arg( Kita::ThreadIndex::getViewPos( datURL ) ) ); + propertyWidget->idx_threadNameWithIndexLabel->setText(Kita::ThreadIndex::getSubject(datURL)); + propertyWidget->idx_resNumLabel->setText(QString("%1").arg(Kita::ThreadIndex::getResNum(datURL))); + propertyWidget->idx_readNumLabel->setText(QString("%1").arg(Kita::ThreadIndex::getReadNum(datURL))); + propertyWidget->idx_viewPosLabel->setText(QString("%1").arg(Kita::ThreadIndex::getViewPos(datURL))); - propertyWidget->cache_readNumLabel->setText( QString( "%1" ).arg( KitaThreadInfo::readNum( datURL ) ) ); + propertyWidget->cache_readNumLabel->setText(QString("%1").arg(KitaThreadInfo::readNum(datURL))); } } -void KitaBoardView::deleteLog( const KUrl& url ) +void KitaBoardView::deleteLog(const KUrl& url) { - if ( QMessageBox::warning( this, + if (QMessageBox::warning(this, "Kita", - i18n( "Do you want to delete Log ?" ), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default ) - == QMessageBox::Ok ) { - if ( Kita::DatManager::deleteCache( url ) ) { - ViewMediator::getInstance()->closeThreadTab( url ); - slotUpdateSubject( url ); + i18n("Do you want to delete Log ?"), + QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) + == QMessageBox::Ok) { + if (Kita::DatManager::deleteCache(url)) { + ViewMediator::getInstance()->closeThreadTab(url); + slotUpdateSubject(url); } } } -void KitaBoardView::slotSizeChange( int section, int oldSize, int newSize ) +void KitaBoardView::slotSizeChange(int section, int oldSize, int newSize) { - if ( ! m_enableSizeChange ) return ; - if ( autoResize() ) return ; + if (! m_enableSizeChange) return ; + if (autoResize()) return ; - QString configPath = KStandardDirs::locateLocal( "appdata", "subjectview.conf" ); - KConfig config( configPath ); - subjectList->saveLayout( &config, "Layout" ); + QString configPath = KStandardDirs::locateLocal("appdata", "subjectview.conf"); + KConfig config(configPath); + subjectList->saveLayout(&config, "Layout"); } void KitaBoardView::loadLayout() { - if ( autoResize() ) return ; - QString configPath = KStandardDirs::locateLocal( "appdata", "subjectview.conf" ); - KConfig config( configPath ); - subjectList->restoreLayout( &config, "Layout" ); + if (autoResize()) return ; + QString configPath = KStandardDirs::locateLocal("appdata", "subjectview.conf"); + KConfig config(configPath); + subjectList->restoreLayout(&config, "Layout"); } -bool KitaBoardView::eventFilter( QObject* watched, QEvent* e ) +bool KitaBoardView::eventFilter(QObject* watched, QEvent* e) { - if ( e->type() == QEvent::MouseButtonPress ) { - QMouseEvent * mouseEvent = static_cast( e ); - if ( mouseEvent->button() == Qt::RightButton ) { + if (e->type() == QEvent::MouseButtonPress) { + QMouseEvent * mouseEvent = static_cast(e); + if (mouseEvent->button() == Qt::RightButton) { KMenu popup; - for ( int i = Col_Begin; i <= Col_End; i++ ) { - if ( i != Col_Subject && i != Col_MarkOrder && i != Col_IDOrder ) { - KAction* action = new KAction( s_colAttr[ i ].itemName, this ); - action->setCheckable( true ); - action->setChecked( subjectList->columnWidth( i ) != 0 ); - action->setData( QVariant( i ) ); - popup.addAction( action ); + for (int i = Col_Begin; i <= Col_End; i++) { + if (i != Col_Subject && i != Col_MarkOrder && i != Col_IDOrder) { + KAction* action = new KAction(s_colAttr[ i ].itemName, this); + action->setCheckable(true); + action->setChecked(subjectList->columnWidth(i) != 0); + action->setData(QVariant(i)); + popup.addAction(action); } } - KAction* autoResizeAct = new KAction( i18n( "Auto Resize" ), this ); - autoResizeAct->setCheckable( true ); - autoResizeAct->setChecked( autoResize() ); - popup.addAction( autoResizeAct ); + KAction* autoResizeAct = new KAction(i18n("Auto Resize"), this); + autoResizeAct->setCheckable(true); + autoResizeAct->setChecked(autoResize()); + popup.addAction(autoResizeAct); - QAction* action = popup.exec( mouseEvent->globalPos() ); - if ( !action ) { + QAction* action = popup.exec(mouseEvent->globalPos()); + if (!action) { return true; } - if ( action == autoResizeAct ) { - setAutoResize( !action->isChecked() ); - } else if ( action->isChecked() ) { - hideColumn( action->data().toInt() ); + if (action == autoResizeAct) { + setAutoResize(!action->isChecked()); + } else if (action->isChecked()) { + hideColumn(action->data().toInt()); } else { - showColumn( action->data().toInt() ); + showColumn(action->data().toInt()); } saveHeaderOnOff(); return true; @@ -473,54 +473,54 @@ return false; } } else { - return subjectList->header() ->eventFilter( watched, e ); + return subjectList->header() ->eventFilter(watched, e); } } void KitaBoardView::saveHeaderOnOff() { - QString configPath = KStandardDirs::locateLocal( "appdata", "subjectview.conf" ); - KConfig config( configPath ); + QString configPath = KStandardDirs::locateLocal("appdata", "subjectview.conf"); + KConfig config(configPath); - KConfigGroup group = config.group( "Column" ); - for ( int i = Col_Begin; i <= Col_End; i++ ) { - if ( subjectList->columnWidth( i ) != 0 ) { - group.writeEntry( s_colAttr[ i ].keyName, true ); + KConfigGroup group = config.group("Column"); + for (int i = Col_Begin; i <= Col_End; i++) { + if (subjectList->columnWidth(i) != 0) { + group.writeEntry(s_colAttr[ i ].keyName, true); } else { - group.writeEntry( s_colAttr[ i ].keyName, false ); + group.writeEntry(s_colAttr[ i ].keyName, false); } } } void KitaBoardView::loadHeaderOnOff() { - QString configPath = KStandardDirs::locateLocal( "appdata", "subjectview.conf" ); - KConfig config( configPath ); + QString configPath = KStandardDirs::locateLocal("appdata", "subjectview.conf"); + KConfig config(configPath); - KConfigGroup group = config.group( "Column" ); - for ( int i = Col_Begin; i <= Col_End; i++ ) { - bool isShown = group.readEntry( s_colAttr[ i ].keyName, s_colAttr[ i ].showDefault ); -// qDebug("%s: isShown %d", s_colAttr[i].keyName.latin1(), isShown ); - if ( isShown ) { - showColumn( i ); + KConfigGroup group = config.group("Column"); + for (int i = Col_Begin; i <= Col_End; i++) { + bool isShown = group.readEntry(s_colAttr[ i ].keyName, s_colAttr[ i ].showDefault); +// qDebug("%s: isShown %d", s_colAttr[i].keyName.latin1(), isShown); + if (isShown) { + showColumn(i); } else { - hideColumn( i ); + hideColumn(i); } } } bool KitaBoardView::autoResize() { - QString configPath = KStandardDirs::locateLocal( "appdata", "subjectview.conf" ); - KConfig config( configPath ); + QString configPath = KStandardDirs::locateLocal("appdata", "subjectview.conf"); + KConfig config(configPath); - return config.group( "Column" ).readEntry( "AutoResize", true ); + return config.group("Column").readEntry("AutoResize", true); } -void KitaBoardView::setAutoResize( bool flag ) +void KitaBoardView::setAutoResize(bool flag) { - QString configPath = KStandardDirs::locateLocal( "appdata", "subjectview.conf" ); - KConfig config( configPath ); + QString configPath = KStandardDirs::locateLocal("appdata", "subjectview.conf"); + KConfig config(configPath); - config.group( "Column" ).writeEntry( "AutoResize", flag ); + config.group("Column").writeEntry("AutoResize", flag); } Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -30,7 +30,7 @@ KitaBoardTabWidget* m_parent; public: - KitaBoardView( KitaBoardTabWidget* parent ); + KitaBoardView(KitaBoardTabWidget* parent); ~KitaBoardView(); void init(); const KUrl boardURL(); @@ -40,9 +40,9 @@ virtual void setFocus(); void slotFocusSearchCombo(); void reloadSubject(); - void loadBoard( const KUrl& url, bool online = true ); - void setFont( const QFont& font ); - void slotUpdateSubject( const KUrl& url ); + void loadBoard(const KUrl& url, bool online = true); + void setFont(const QFont& font); + void slotUpdateSubject(const KUrl& url); private: KUrl m_boardURL; @@ -51,25 +51,25 @@ bool m_enableSizeChange; void UpdateKindLabel(); - void deleteLog( const KUrl& url ); + void deleteLog(const KUrl& url); void loadLayout(); - void updateListViewItem( Q3ListViewItem* item, const KUrl& datURL, const QDateTime& current, int id, int order ); - bool eventFilter( QObject* watched, QEvent* e ); + void updateListViewItem(Q3ListViewItem* item, const KUrl& datURL, const QDateTime& current, int id, int order); + bool eventFilter(QObject* watched, QEvent* e); void saveHeaderOnOff(); void loadHeaderOnOff(); bool autoResize(); - void setAutoResize( bool flag ); + void setAutoResize(bool flag); KitaBoardView(const KitaBoardView&); KitaBoardView& operator=(const KitaBoardView&); private slots: - void loadThread( Q3ListViewItem* item ); - void slotContextMenuRequested( Q3ListViewItem*, const QPoint&, int ); + void loadThread(Q3ListViewItem* item); + void slotContextMenuRequested(Q3ListViewItem*, const QPoint&, int); void slotCloseButton(); - void slotSizeChange( int section, int oldSize, int newSize ); + void slotSizeChange(int section, int oldSize, int newSize); signals: - void loadBoardCompleted( const KUrl& ); + void loadBoardCompleted(const KUrl&); }; #endif Modified: kita/branches/KITA-KDE4/kita/src/domtree.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/domtree.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -20,7 +20,7 @@ #include "libkita/kita_misc.h" #include "libkita/kita-utf8.h" -KitaDomTree::KitaDomTree( const DOM::HTMLDocument& hdoc, const KUrl& datURL ) +KitaDomTree::KitaDomTree(const DOM::HTMLDocument& hdoc, const KUrl& datURL) { m_hdoc = hdoc; m_bufSize = 0; @@ -33,7 +33,7 @@ /* get pointer of DatInfo */ /* Note that m_datURL is already locked in the KitaHTMLPart. */ - m_datInfo = Kita::DatManager::getDatInfoPointer( datURL ); + m_datInfo = Kita::DatManager::getDatInfoPointer(datURL); } KitaDomTree::~KitaDomTree() {} @@ -42,44 +42,44 @@ * This function creates DOM elements of both title and body. * To show the res, call appendRes() */ -bool KitaDomTree::createResElement( int num ) +bool KitaDomTree::createResElement(int num) { - Q_ASSERT( num > 0 ); - Q_ASSERT( m_datInfo != 0 ); + Q_ASSERT(num > 0); + Q_ASSERT(m_datInfo != 0); - if ( num < m_bufSize && m_resStatus[ num ] != KITA_HTML_NOTPARSED ) { + if (num < m_bufSize && m_resStatus[ num ] != KITA_HTML_NOTPARSED) { /* already parsed */ return true; } - if ( num >= m_bufSize ) { + if (num >= m_bufSize) { /* resize buffer size */ - if ( m_bufSize == 0 ) m_bufSize = 100; - while ( num >= m_bufSize ) m_bufSize += 500; + if (m_bufSize == 0) m_bufSize = 100; + while (num >= m_bufSize) m_bufSize += 500; - m_titleElm.resize( m_bufSize ); - m_bodyElm.resize( m_bufSize ); - m_resStatus.resize( m_bufSize, false ); - m_coloredNum.resize( m_bufSize, false ); + m_titleElm.resize(m_bufSize); + m_bodyElm.resize(m_bufSize); + m_resStatus.resize(m_bufSize, false); + m_coloredNum.resize(m_bufSize, false); } /* cleate elements */ QString titleHTML, bodyHTML; - m_resStatus[ num ] = m_datInfo->getHTML( num, true, titleHTML, bodyHTML ); + m_resStatus[ num ] = m_datInfo->getHTML(num, true, titleHTML, bodyHTML); - if ( m_resStatus[ num ] == KITA_HTML_NOTPARSED ) { + if (m_resStatus[ num ] == KITA_HTML_NOTPARSED) { return false; } - m_titleElm[ num ] = m_hdoc.createElement( "DIV" ); - m_titleElm[ num ].setAttribute( "class", "res_title" ); - m_titleElm[ num ].setAttribute( "id", QString().setNum( num ) ); - m_titleElm[ num ].setInnerHTML( titleHTML ); + m_titleElm[ num ] = m_hdoc.createElement("DIV"); + m_titleElm[ num ].setAttribute("class", "res_title"); + m_titleElm[ num ].setAttribute("id", QString().setNum(num)); + m_titleElm[ num ].setInnerHTML(titleHTML); - m_bodyElm[ num ] = m_hdoc.createElement( "DIV" ); - m_bodyElm[ num ].setAttribute( "class", "res_body" ); - m_bodyElm[ num ].setAttribute( "id", QString().setNum( num ) ); - m_bodyElm[ num ].setInnerHTML( bodyHTML ); + m_bodyElm[ num ] = m_hdoc.createElement("DIV"); + m_bodyElm[ num ].setAttribute("class", "res_body"); + m_bodyElm[ num ].setAttribute("id", QString().setNum(num)); + m_bodyElm[ num ].setInnerHTML(bodyHTML); return true; } @@ -87,14 +87,14 @@ /* * append the response */ -bool KitaDomTree::appendRes( int num ) +bool KitaDomTree::appendRes(int num) { - if ( !createResElement( num ) ) return false; + if (!createResElement(num)) return false; - m_hdoc.body().appendChild( m_titleElm[ num ] ); - m_hdoc.body().appendChild( m_bodyElm[ num ] ); + m_hdoc.body().appendChild(m_titleElm[ num ]); + m_hdoc.body().appendChild(m_bodyElm[ num ]); - if ( num > m_bottomNum ) m_bottomNum = num; + if (num > m_bottomNum) m_bottomNum = num; return true; } @@ -102,24 +102,24 @@ /* * redraw all */ -void KitaDomTree::redraw( bool force ) +void KitaDomTree::redraw(bool force) { - Q_ASSERT( m_datInfo != 0 ); + Q_ASSERT(m_datInfo != 0); int readNum = m_datInfo->getReadNum(); /* don't forget to reset abone here... */ m_datInfo->resetAbone(); - for ( int i = 1; i <= readNum; i++ ) { + for (int i = 1; i <= readNum; i++) { QString titleHTML, bodyHTML; int oldStatus = m_resStatus[ i ]; - m_resStatus[ i ] = m_datInfo->getHTML( i , true, titleHTML, bodyHTML ); + m_resStatus[ i ] = m_datInfo->getHTML(i , true, titleHTML, bodyHTML); - if ( force || oldStatus != m_resStatus[ i ] ) { - m_titleElm[ i ].setInnerHTML( titleHTML ); - m_bodyElm[ i ].setInnerHTML( bodyHTML ); + if (force || oldStatus != m_resStatus[ i ]) { + m_titleElm[ i ].setInnerHTML(titleHTML); + m_bodyElm[ i ].setInnerHTML(bodyHTML); } } } @@ -134,9 +134,9 @@ */ void KitaDomTree::changeColorOfAllResponsedNumber() { - for ( int i = 1; i <= m_bottomNum; ++i ) { - if ( m_datInfo->isResponsed( i ) ) { - changeColorOfNumber( i ); + for (int i = 1; i <= m_bottomNum; ++i) { + if (m_datInfo->isResponsed(i)) { + changeColorOfNumber(i); } } } @@ -151,16 +151,16 @@ */ void KitaDomTree::appendFooterAndHeader() { - Q_ASSERT( m_datInfo != 0 ); + Q_ASSERT(m_datInfo != 0); int readNum = m_datInfo->getReadNum(); - if ( !readNum ) return ; + if (!readNum) return ; - updateHeader( m_header ); - updateFooter( m_footer ); + updateHeader(m_header); + updateFooter(m_footer); - m_hdoc.body().insertBefore( m_header, m_hdoc.body().firstChild() ); - m_hdoc.body().appendChild( m_footer ); + m_hdoc.body().insertBefore(m_header, m_hdoc.body().firstChild()); + m_hdoc.body().appendChild(m_footer); } /* @@ -168,18 +168,18 @@ */ void KitaDomTree::appendKokoyon() { - Q_ASSERT( m_datInfo != 0 ); + Q_ASSERT(m_datInfo != 0); int readNum = m_datInfo->getReadNum(); - if ( !readNum ) return ; + if (!readNum) return ; int viewPos = m_datInfo->getViewPos(); - if ( viewPos == 0 ) return ; + if (viewPos == 0) return ; int i = viewPos + 1; - if ( i <= readNum ) m_hdoc.body().insertBefore( m_kokoyon, m_titleElm[ i ] ); - else m_hdoc.body().appendChild( m_kokoyon ); + if (i <= readNum) m_hdoc.body().insertBefore(m_kokoyon, m_titleElm[ i ]); + else m_hdoc.body().appendChild(m_kokoyon); } /* @@ -189,14 +189,14 @@ /* * append "A" Node to rootnode */ -void KitaDomTree::appendAnchorNode( DOM::Element rootnode, const QString& href, const QString& linkstr ) +void KitaDomTree::appendAnchorNode(DOM::Element rootnode, const QString& href, const QString& linkstr) { DOM::Element element; - element = rootnode.appendChild( m_hdoc.createElement( "A" ) ); + element = rootnode.appendChild(m_hdoc.createElement("A")); { - element.setAttribute( "href", href ); - element.appendChild( m_hdoc.createTextNode( linkstr ) ); + element.setAttribute("href", href); + element.appendChild(m_hdoc.createTextNode(linkstr)); } } @@ -208,42 +208,42 @@ * before: #KokomadeYonda 1- 101- 201- #ToSaigo

* after : #KokomadeYonda 1- 101- 201- 301- 401- #ToSaigo

*/ -void KitaDomTree::updateHeader( DOM::Element& headerElement ) +void KitaDomTree::updateHeader(DOM::Element& headerElement) { - if ( ! m_datInfo ) return ; + if (! m_datInfo) return ; DOM::Element backupElement1, backupElement2, backupElement3; int readNum = m_datInfo->getReadNum(); /* remove and
*/ - backupElement1 = headerElement.removeChild( headerElement.lastChild() ); /* BR */ - backupElement2 = headerElement.removeChild( headerElement.lastChild() ); /* BR */ - backupElement3 = headerElement.removeChild( headerElement.lastChild() ); /* "#tosaigo" */ + backupElement1 = headerElement.removeChild(headerElement.lastChild()); /* BR */ + backupElement2 = headerElement.removeChild(headerElement.lastChild()); /* BR */ + backupElement3 = headerElement.removeChild(headerElement.lastChild()); /* "#tosaigo" */ DOM::Node node = headerElement.firstChild(); /* node is now "#kokomade_yonda" */ node = node.nextSibling(); /* " " */ node = node.nextSibling(); /* '1-', '101-' ¤Ê¤É¤Î¥ê¥ó¥¯¤òºîÀ® */ - for ( int num = 1; num < readNum ; num += 100 ) { - if ( node == 0 ) { - QString href = QString( "#%1" ).arg( num ); - QString linkStr = QString( "%1-" ).arg( num ); + for (int num = 1; num < readNum ; num += 100) { + if (node == 0) { + QString href = QString("#%1").arg(num); + QString linkStr = QString("%1-").arg(num); - appendAnchorNode( headerElement, href, linkStr ); - node = headerElement.appendChild( m_hdoc.createTextNode( " " ) ); + appendAnchorNode(headerElement, href, linkStr); + node = headerElement.appendChild(m_hdoc.createTextNode(" ")); node = node.nextSibling(); } else { // ´û¤Ë¥ê¥ó¥¯¤¬ºî¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤ÏÈô¤Ð¤¹ node = node.nextSibling(); - if ( node != 0 ) node = node.nextSibling(); + if (node != 0) node = node.nextSibling(); } } /* restore
and
*/ - headerElement.appendChild( backupElement3 ); /* "#tosaigo" */ - headerElement.appendChild( backupElement2 ); /* BR */ - headerElement.appendChild( backupElement1 ); /* BR */ + headerElement.appendChild(backupElement3); /* "#tosaigo" */ + headerElement.appendChild(backupElement2); /* BR */ + headerElement.appendChild(backupElement1); /* BR */ } /* @@ -253,36 +253,36 @@ * before: #KokomadeYonda 1- 101- 201- #ToSaigo * after : #KokomadeYonda 1- 101- 201- 301- 401- #ToSaigo */ -void KitaDomTree::updateFooter( DOM::Element& footerElement ) +void KitaDomTree::updateFooter(DOM::Element& footerElement) { - Q_ASSERT( m_datInfo != 0 ); + Q_ASSERT(m_datInfo != 0); DOM::Element backupElement; int readNum = m_datInfo->getReadNum(); - backupElement = footerElement.removeChild( footerElement.lastChild() ); /* "#tosaigo" */ + backupElement = footerElement.removeChild(footerElement.lastChild()); /* "#tosaigo" */ DOM::Node node = footerElement.firstChild(); /* node is now "#kokomade_yonda" */ node = node.nextSibling(); /* " " */ node = node.nextSibling(); /* '1-', '101-' ¤Ê¤É¤Î¥ê¥ó¥¯¤òºîÀ® */ - for ( int num = 1; num < readNum ; num += 100 ) { - if ( node == 0 ) { - QString href = QString( "#%1" ).arg( num ); - QString linkStr = QString( "%1-" ).arg( num ); + for (int num = 1; num < readNum ; num += 100) { + if (node == 0) { + QString href = QString("#%1").arg(num); + QString linkStr = QString("%1-").arg(num); - appendAnchorNode( footerElement, href, linkStr ); - node = footerElement.appendChild( m_hdoc.createTextNode( " " ) ); + appendAnchorNode(footerElement, href, linkStr); + node = footerElement.appendChild(m_hdoc.createTextNode(" ")); node = node.nextSibling(); } else { // ´û¤Ë¥ê¥ó¥¯¤¬ºî¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤ÏÈô¤Ð¤¹ node = node.nextSibling(); - if ( node != 0 ) node = node.nextSibling(); + if (node != 0) node = node.nextSibling(); } } - footerElement.appendChild( backupElement ); /* "#tosaigo" */ + footerElement.appendChild(backupElement); /* "#tosaigo" */ } /* @@ -293,20 +293,20 @@ QString str; DOM::Element rootnode; - rootnode = m_hdoc.createElement( "DIV" ); + rootnode = m_hdoc.createElement("DIV"); { - rootnode.setAttribute( "kita_type", "header" ); - rootnode.setAttribute( "id", "header" ); + rootnode.setAttribute("kita_type", "header"); + rootnode.setAttribute("id", "header"); - str = Kita::utf8ToUnicode( KITAUTF8_KOKOYON ); - appendAnchorNode( rootnode, "#kokomade_yonda", str ); - rootnode.appendChild( m_hdoc.createTextNode( " " ) ); + str = Kita::utf8ToUnicode(KITAUTF8_KOKOYON); + appendAnchorNode(rootnode, "#kokomade_yonda", str); + rootnode.appendChild(m_hdoc.createTextNode(" ")); - str = Kita::utf8ToUnicode( KITAUTF8_SAIGO ); - appendAnchorNode( rootnode, "#tosaigo", str ); + str = Kita::utf8ToUnicode(KITAUTF8_SAIGO); + appendAnchorNode(rootnode, "#tosaigo", str); - rootnode.appendChild( m_hdoc.createElement( "BR" ) ); - rootnode.appendChild( m_hdoc.createElement( "BR" ) ); + rootnode.appendChild(m_hdoc.createElement("BR")); + rootnode.appendChild(m_hdoc.createElement("BR")); } m_header = rootnode; @@ -321,17 +321,17 @@ QString str; DOM::Element rootnode; - rootnode = m_hdoc.createElement( "DIV" ); + rootnode = m_hdoc.createElement("DIV"); { - rootnode.setAttribute( "kita_type", "footer" ); - rootnode.setAttribute( "id", "footer" ); + rootnode.setAttribute("kita_type", "footer"); + rootnode.setAttribute("id", "footer"); - str = Kita::utf8ToUnicode( KITAUTF8_KOKOYON ); - appendAnchorNode( rootnode, "#kokomade_yonda", str ); - rootnode.appendChild( m_hdoc.createTextNode( " " ) ); + str = Kita::utf8ToUnicode(KITAUTF8_KOKOYON); + appendAnchorNode(rootnode, "#kokomade_yonda", str); + rootnode.appendChild(m_hdoc.createTextNode(" ")); - str = Kita::utf8ToUnicode( KITAUTF8_SAIGO ); - appendAnchorNode( rootnode, "#tosaigo", str ); + str = Kita::utf8ToUnicode(KITAUTF8_SAIGO); + appendAnchorNode(rootnode, "#tosaigo", str); } m_footer = rootnode; @@ -345,14 +345,14 @@ QString str, style; DOM::Element rootnode; - str = Kita::utf8ToUnicode( KITAUTF8_KOKOYON2 ); + str = Kita::utf8ToUnicode(KITAUTF8_KOKOYON2); - rootnode = m_hdoc.createElement( "DIV" ); + rootnode = m_hdoc.createElement("DIV"); { - rootnode.setAttribute( "class", "kokoyon" ); - rootnode.setAttribute( "kita_type", "kokoyon" ); - rootnode.setAttribute( "id", "kokomade_yonda" ); - rootnode.appendChild( m_hdoc.createTextNode( str ) ); + rootnode.setAttribute("class", "kokoyon"); + rootnode.setAttribute("kita_type", "kokoyon"); + rootnode.setAttribute("id", "kokomade_yonda"); + rootnode.appendChild(m_hdoc.createTextNode(str)); } m_kokoyon = rootnode; @@ -362,14 +362,14 @@ * change color of number * specify color like this: "a.coloredLink:link{ color: red; }" */ -void KitaDomTree::changeColorOfNumber( int num ) +void KitaDomTree::changeColorOfNumber(int num) { - if ( m_coloredNum[ num ] ) return ; + if (m_coloredNum[ num ]) return ; m_coloredNum[ num ] = true; DOM::Node node = m_titleElm[ num ]; node = node.firstChild(); - static_cast( node ).setAttribute( "class", "coloredLink" ); + static_cast(node).setAttribute("class", "coloredLink"); } Modified: kita/branches/KITA-KDE4/kita/src/domtree.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/domtree.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -45,14 +45,14 @@ DOM::Element m_kokoyon; public: - KitaDomTree( const DOM::HTMLDocument& hdoc, const KUrl& datURL ); + KitaDomTree(const DOM::HTMLDocument& hdoc, const KUrl& datURL); ~KitaDomTree(); /* rendering functions */ - bool createResElement( int num ); - bool appendRes( int num ); - void redraw( bool force ); + bool createResElement(int num); + bool appendRes(int num); + void redraw(bool force); void changeColorOfAllResponsedNumber(); /* information */ @@ -65,13 +65,13 @@ void appendKokoyon(); private: - void appendAnchorNode( DOM::Element rootnode, const QString& linkstr, const QString& comment ); - void updateHeader( DOM::Element& targetelm ); - void updateFooter( DOM::Element& targetelm ); + void appendAnchorNode(DOM::Element rootnode, const QString& linkstr, const QString& comment); + void updateHeader(DOM::Element& targetelm); + void updateFooter(DOM::Element& targetelm); void createHeader(); void createFooter(); void createKokoyon(); - void changeColorOfNumber( int num ); + void changeColorOfNumber(int num); }; #endif Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -32,19 +32,19 @@ /** * */ -FavoriteListView::FavoriteListView( QWidget* parent ) - : Kita::ThreadListView( parent ) +FavoriteListView::FavoriteListView(QWidget* parent) + : Kita::ThreadListView(parent) { KindLabel->hide(); - connect( subjectList, SIGNAL( returnPressed( Q3ListViewItem* ) ), - SLOT( loadThread( Q3ListViewItem* ) ) ); - connect( subjectList, SIGNAL( contextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ), - SLOT( slotContextMenuRequested( Q3ListViewItem*, const QPoint&, int ) ) ); - connect( ReloadButton, SIGNAL( clicked() ), - SLOT( reload() ) ); + connect(subjectList, SIGNAL(returnPressed(Q3ListViewItem*)), + SLOT(loadThread(Q3ListViewItem*))); + connect(subjectList, SIGNAL(contextMenuRequested(Q3ListViewItem*, const QPoint&, int)), + SLOT(slotContextMenuRequested(Q3ListViewItem*, const QPoint&, int))); + connect(ReloadButton, SIGNAL(clicked()), + SLOT(reload())); - showColumn( Col_Board ); + showColumn(Col_Board); } /** @@ -66,45 +66,45 @@ subjectList->clear(); // insert item. - for ( int i = 0; FavoriteThreads::count() > i; i++ ) { - QString datURL = FavoriteThreads::getDatURL( i ); + for (int i = 0; FavoriteThreads::count() > i; i++) { + QString datURL = FavoriteThreads::getDatURL(i); QDateTime since; - since.setTime_t( Kita::datToSince( datURL ) ); + since.setTime_t(Kita::datToSince(datURL)); - int viewPos = Kita::DatManager::getViewPos( datURL ); - int resNum = Kita::DatManager::getResNum( datURL ); + int viewPos = Kita::DatManager::getViewPos(datURL); + int resNum = Kita::DatManager::getResNum(datURL); - K3ListViewItem* item = new K3ListViewItem( subjectList ); - item->setText( Col_Board, Kita::BoardManager::boardName( datURL ) ); - item->setText( Col_Subject, Kita::DatManager::threadName( datURL ) ); - item->setText( Col_ReadNum, QString( "%1" ).arg( viewPos, 4 ) ); - if ( resNum > 0 ) { - item->setText( Col_ResNum, QString( "%1" ).arg( resNum, 4 ) ); + K3ListViewItem* item = new K3ListViewItem(subjectList); + item->setText(Col_Board, Kita::BoardManager::boardName(datURL)); + item->setText(Col_Subject, Kita::DatManager::threadName(datURL)); + item->setText(Col_ReadNum, QString("%1").arg(viewPos, 4)); + if (resNum > 0) { + item->setText(Col_ResNum, QString("%1").arg(resNum, 4)); } - if ( resNum != 0 && resNum != viewPos ) { - item->setText( Col_Unread, QString( "%1" ).arg( resNum - viewPos, 4 ) ); + if (resNum != 0 && resNum != viewPos) { + item->setText(Col_Unread, QString("%1").arg(resNum - viewPos, 4)); } - item->setText( Col_Since, since.toString( "yy/MM/dd hh:mm" ) ); - item->setText( Col_DatURL, datURL ); + item->setText(Col_Since, since.toString("yy/MM/dd hh:mm")); + item->setText(Col_DatURL, datURL); } - subjectList->setSorting( Col_Board ); + subjectList->setSorting(Col_Board); } /** * */ -void FavoriteListView::loadThread( Q3ListViewItem* item ) +void FavoriteListView::loadThread(Q3ListViewItem* item) { - if ( ! item ) return ; + if (! item) return ; - QString itemURL = item->text( Col_DatURL ); + QString itemURL = item->text(Col_DatURL); - for ( int i = 0; FavoriteThreads::count() > i; i++ ) { - QString datURL = FavoriteThreads::getDatURL( i ); + for (int i = 0; FavoriteThreads::count() > i; i++) { + QString datURL = FavoriteThreads::getDatURL(i); - if ( datURL == itemURL ) { - ViewMediator::getInstance()->openThread( datURL ); + if (datURL == itemURL) { + ViewMediator::getInstance()->openThread(datURL); } } } @@ -112,46 +112,46 @@ /** * show and exec popup menu. */ -void FavoriteListView::slotContextMenuRequested( Q3ListViewItem* item, const QPoint& point, int ) +void FavoriteListView::slotContextMenuRequested(Q3ListViewItem* item, const QPoint& point, int) { - if ( ! item ) { + if (! item) { return; } - KMenu popup( 0 ); + KMenu popup(0); - KAction* openWithBrowserAct = new KAction( i18n( "Open with Web Browser" ), this ); - popup.addAction( openWithBrowserAct ); + KAction* openWithBrowserAct = new KAction(i18n("Open with Web Browser"), this); + popup.addAction(openWithBrowserAct); - KAction* copyURLAct = new KAction( i18n( "Copy URL" ), this ); - popup.addAction( copyURLAct ); + KAction* copyURLAct = new KAction(i18n("Copy URL"), this); + popup.addAction(copyURLAct); - KAction* copyTitleAndURLAct = new KAction( i18n( "Copy title and URL" ), this ); - popup.addAction( copyTitleAndURLAct ); + KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); + popup.addAction(copyTitleAndURLAct); - KAction* removeFromFavoritesAct = new KAction( i18n( "Remove from Favorites" ), this ); - popup.addAction( removeFromFavoritesAct ); + KAction* removeFromFavoritesAct = new KAction(i18n("Remove from Favorites"), this); + popup.addAction(removeFromFavoritesAct); - QString datURL = item->text( Col_DatURL ); - QString threadURL = Kita::DatManager::threadURL( datURL ); + QString datURL = item->text(Col_DatURL); + QString threadURL = Kita::DatManager::threadURL(datURL); QClipboard* clipboard = QApplication::clipboard(); QString clipText; - QAction* action = popup.exec( point ); - if ( !action ) { + QAction* action = popup.exec(point); + if (!action) { return; } - if ( action == openWithBrowserAct ) { - KRun::runUrl( Kita::DatManager::threadURL( datURL ), "text/html", this ); - } else if ( action == copyURLAct ) { - clipboard->setText( threadURL ); - } else if ( action == copyTitleAndURLAct ) { - clipText = Kita::DatManager::threadName( datURL ) + '\n' + threadURL; - clipboard->setText( clipText , QClipboard::Clipboard ); - clipboard->setText( clipText , QClipboard::Selection ); - } else if ( action == removeFromFavoritesAct ) { - ViewMediator::getInstance()->bookmark( datURL, false ); + if (action == openWithBrowserAct) { + KRun::runUrl(Kita::DatManager::threadURL(datURL), "text/html", this); + } else if (action == copyURLAct) { + clipboard->setText(threadURL); + } else if (action == copyTitleAndURLAct) { + clipText = Kita::DatManager::threadName(datURL) + '\n' + threadURL; + clipboard->setText(clipText , QClipboard::Clipboard); + clipboard->setText(clipText , QClipboard::Selection); + } else if (action == removeFromFavoritesAct) { + ViewMediator::getInstance()->bookmark(datURL, false); } } @@ -162,19 +162,19 @@ { Q3ValueList boardList; - for ( int i = 0; FavoriteThreads::count() > i; i++ ) { - QString datURL = FavoriteThreads::getDatURL( i ); - QString boardURL = Kita::BoardManager::boardURL( datURL ); - if ( boardList.contains( boardURL ) == 0 ) { - boardList.append( boardURL ); + for (int i = 0; FavoriteThreads::count() > i; i++) { + QString datURL = FavoriteThreads::getDatURL(i); + QString boardURL = Kita::BoardManager::boardURL(datURL); + if (boardList.contains(boardURL) == 0) { + boardList.append(boardURL); } } Q3ValueList::const_iterator it; - for ( it = boardList.begin(); it != boardList.end(); ++it ) { + for (it = boardList.begin(); it != boardList.end(); ++it) { bool online = true; Q3PtrList threadList; Q3PtrList tmpList; - Kita::BoardManager::getThreadList( ( *it ), false, online, threadList, tmpList ); + Kita::BoardManager::getThreadList((*it), false, online, threadList, tmpList); } } Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -23,14 +23,14 @@ Q_OBJECT public: - FavoriteListView( QWidget* parent = 0 ); + FavoriteListView(QWidget* parent = 0); ~FavoriteListView(); void refresh(); private slots: - void loadThread( Q3ListViewItem* item ); - void slotContextMenuRequested( Q3ListViewItem*, const QPoint&, int ); + void loadThread(Q3ListViewItem* item); + void slotContextMenuRequested(Q3ListViewItem*, const QPoint&, int); void reload(); }; Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -43,8 +43,8 @@ /*-------------------------------------*/ /* Don't forget to call setup() later. */ -KitaHTMLPart::KitaHTMLPart( QWidget* parent ) - : KHTMLPart( new KitaHTMLView( this, parent ) ) +KitaHTMLPart::KitaHTMLPart(QWidget* parent) + : KHTMLPart(new KitaHTMLView(this, parent)) { m_mode = HTMLPART_MODE_MAINPART; m_popup = 0; @@ -74,10 +74,10 @@ m_domtree = 0; /* update ViewPos */ - if ( m_mode == HTMLPART_MODE_MAINPART && !m_updatedKokoyon && !m_datURL.isEmpty() ) { - int readNum = Kita::DatManager::getReadNum( m_datURL ); - if ( readNum ) { - Kita::DatManager::setViewPos( m_datURL, readNum ); + if (m_mode == HTMLPART_MODE_MAINPART && !m_updatedKokoyon && !m_datURL.isEmpty()) { + int readNum = Kita::DatManager::getReadNum(m_datURL); + if (readNum) { + Kita::DatManager::setViewPos(m_datURL, readNum); } } m_updatedKokoyon = false; @@ -88,16 +88,16 @@ m_jumpNumAfterLoading = 0; findTextInit(); - if ( !m_datURL.isEmpty() ) { /* This part is opened. */ + if (!m_datURL.isEmpty()) { /* This part is opened. */ - if ( m_mode == HTMLPART_MODE_MAINPART ) { /* This part is on the main thread view. */ + if (m_mode == HTMLPART_MODE_MAINPART) { /* This part is on the main thread view. */ /* tell Thread class that "thread is closed" */ - Kita::DatManager::setMainThreadOpened( m_datURL, false ); + Kita::DatManager::setMainThreadOpened(m_datURL, false); /* emit "deactivated all thread view" SIGNAL */ KUrl nullUrl(""); - ViewMediator::getInstance()->changeWriteTab( nullUrl ); + ViewMediator::getInstance()->changeWriteTab(nullUrl); /* update subject tab. */ } @@ -110,36 +110,36 @@ /* public */ -bool KitaHTMLPart::setup( int mode, const KUrl& url ) +bool KitaHTMLPart::setup(int mode, const KUrl& url) { - Q_ASSERT( !url.isEmpty() ); + Q_ASSERT(!url.isEmpty()); clearPart(); - m_datURL = Kita::getDatURL( url ); + m_datURL = Kita::getDatURL(url); m_mode = mode; - if ( m_mode == HTMLPART_MODE_MAINPART ) { /* This part is on the main thread view. */ + if (m_mode == HTMLPART_MODE_MAINPART) { /* This part is on the main thread view. */ /* create DatInfo explicitly to open new thread. */ /* Usually, DatInfo is NOT created if ReadNum == 0.*/ /* See also DatManager::createDatInfo() and */ /* DatManager::getDatInfo(). */ - Kita::DatManager::createDatInfo( m_datURL ); + Kita::DatManager::createDatInfo(m_datURL); /* tell Thread class that "thread is opened" */ - Kita::DatManager::setMainThreadOpened( m_datURL, true ); + Kita::DatManager::setMainThreadOpened(m_datURL, true); /* reset abone */ - Kita::DatManager::resetAbone( m_datURL ); + Kita::DatManager::resetAbone(m_datURL); } /* create HTML Document */ createHTMLDocument(); /* create DOM manager */ - if ( m_mode == HTMLPART_MODE_MAINPART ) { - m_domtree = new KitaDomTree( htmlDocument(), m_datURL ); + if (m_mode == HTMLPART_MODE_MAINPART) { + m_domtree = new KitaDomTree(htmlDocument(), m_datURL); } return true; @@ -150,11 +150,11 @@ void KitaHTMLPart::connectSignals() { /* popup */ - connect( this, SIGNAL( onURL( const QString& ) ), SLOT( slotOnURL( const QString& ) ) ); + connect(this, SIGNAL(onURL(const QString&)), SLOT(slotOnURL(const QString&))); - connect( view(), SIGNAL( leave() ), SLOT( slotLeave() ) ); - connect( view()->verticalScrollBar(), SIGNAL( sliderReleased() ), SLOT( slotVSliderReleased() ) ); - connect( view()->horizontalScrollBar(), SIGNAL( sliderReleased() ), SLOT( slotHSliderReleased() ) ); + connect(view(), SIGNAL(leave()), SLOT(slotLeave())); + connect(view()->verticalScrollBar(), SIGNAL(sliderReleased()), SLOT(slotVSliderReleased())); + connect(view()->horizontalScrollBar(), SIGNAL(sliderReleased()), SLOT(slotHSliderReleased())); } @@ -163,26 +163,26 @@ void KitaHTMLPart::createHTMLDocument() { /* style */ - QString style = QString( "body { font-size: %1pt; font-family: \"%2\"; color: %3; background-color: %4; }" ) - .arg( Kita::Config::threadFont().pointSize() ) - .arg( Kita::Config::threadFont().family() ) - .arg( Kita::Config::threadColor().name() ) - .arg( Kita::Config::threadBackground().name() ); + QString style = QString("body { font-size: %1pt; font-family: \"%2\"; color: %3; background-color: %4; }") + .arg(Kita::Config::threadFont().pointSize()) + .arg(Kita::Config::threadFont().family()) + .arg(Kita::Config::threadColor().name()) + .arg(Kita::Config::threadBackground().name()); QString text = ""; - setJScriptEnabled( false ); - setJavaEnabled( false ); + setJScriptEnabled(false); + setJavaEnabled(false); /* Use dummy URL here, and protocol should be "file:". If protocol is "http:", local image files are not shown (for security reasons ?). */ - begin( KUrl("file:/dummy.htm") ); - write( text ); + begin(KUrl("file:/dummy.htm")); + write(text); end(); } @@ -194,21 +194,21 @@ * show responses. * @warning don't forget to call updateScreen() later. */ -void KitaHTMLPart::showResponses( int startnum, int endnum ) +void KitaHTMLPart::showResponses(int startnum, int endnum) { - if ( !m_domtree ) return ; + if (!m_domtree) return ; - for ( int i = startnum ; i <= endnum; i++ ) m_domtree->appendRes( i ); + for (int i = startnum ; i <= endnum; i++) m_domtree->appendRes(i); } /* do parsing only. */ /* call showResponses() later */ /* public */ -void KitaHTMLPart::parseResponses( int startnum, int endnum ) +void KitaHTMLPart::parseResponses(int startnum, int endnum) { - if ( !m_domtree ) return ; + if (!m_domtree) return ; - for ( int i = startnum ; i <= endnum; i++ ) m_domtree->createResElement( i ); + for (int i = startnum ; i <= endnum; i++) m_domtree->createResElement(i); } @@ -220,17 +220,17 @@ /* So, you need not call it later. */ /* public slot */ void KitaHTMLPart::showAll() { - if ( !m_domtree ) return ; + if (!m_domtree) return ; int bottom = m_domtree->getBottomResNumber(); - int readNum = Kita::DatManager::getReadNum( m_datURL ); - if ( bottom != readNum ) { + int readNum = Kita::DatManager::getReadNum(m_datURL); + if (bottom != readNum) { - QCursor qc; qc.setShape( Qt::WaitCursor ); - QApplication::setOverrideCursor( qc ); + QCursor qc; qc.setShape(Qt::WaitCursor); + QApplication::setOverrideCursor(qc); - showResponses( 1, readNum ); - updateScreen( true, false ); + showResponses(1, readNum); + updateScreen(true, false); QApplication::restoreOverrideCursor(); } @@ -239,29 +239,29 @@ /* * update screen */ -void KitaHTMLPart::updateScreen( bool showHeaderEtc, bool clock ) +void KitaHTMLPart::updateScreen(bool showHeaderEtc, bool clock) { - if ( !m_domtree ) { + if (!m_domtree) { view()->setFocus(); return ; } /* show clock cursor */ - if ( clock ) { - QCursor qc; qc.setShape( Qt::WaitCursor ); - QApplication::setOverrideCursor( qc ); + if (clock) { + QCursor qc; qc.setShape(Qt::WaitCursor); + QApplication::setOverrideCursor(qc); } /* show header, footer, and kokomadeyonda, etc. */ - if ( showHeaderEtc ) { + if (showHeaderEtc) { m_domtree->appendKokoyon(); m_domtree->appendFooterAndHeader(); } /* change color of number of the res which is responsed. */ - if ( m_mode == HTMLPART_MODE_MAINPART ) { + if (m_mode == HTMLPART_MODE_MAINPART) { - if ( Kita::Config::checkResponsed() ) { + if (Kita::Config::checkResponsed()) { m_domtree->changeColorOfAllResponsedNumber(); } } @@ -269,32 +269,32 @@ /* update display */ htmlDocument().applyChanges(); view()->layout(); - view()->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); + view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); view()->setFocus(); /* restore cursor */ - if ( clock ) { + if (clock) { QApplication::restoreOverrideCursor(); } } /* public */ -void KitaHTMLPart::setInnerHTML( const QString& innerHTML ) +void KitaHTMLPart::setInnerHTML(const QString& innerHTML) { createHTMLDocument(); - htmlDocument().body().setInnerHTML( innerHTML ); + htmlDocument().body().setInnerHTML(innerHTML); } /* redraw screen */ -void KitaHTMLPart::redrawHTMLPart( const KUrl& datURL, bool force ) +void KitaHTMLPart::redrawHTMLPart(const KUrl& datURL, bool force) { - if ( m_domtree == 0 ) return ; - if ( m_datURL != datURL ) return ; + if (m_domtree == 0) return ; + if (m_datURL != datURL) return ; - m_domtree->redraw( force ); + m_domtree->redraw(force); } /* public slot */ @@ -303,10 +303,10 @@ QFont font = Kita::Config::threadFont(); DOM::CSSStyleDeclaration style = htmlDocument().body().style(); - style.setProperty( "font-family", font.family(), "" ); - style.setProperty( "font-size", QString( "%1pt" ).arg( font.pointSize() ), "" ); - style.setProperty( "color", Kita::Config::threadColor().name(), "" ); - style.setProperty( "background-color", Kita::Config::threadBackground().name(), "" ); + style.setProperty("font-family", font.family(), ""); + style.setProperty("font-size", QString("%1pt").arg(font.pointSize()), ""); + style.setProperty("color", Kita::Config::threadColor().name(), ""); + style.setProperty("background-color", Kita::Config::threadBackground().name(), ""); htmlDocument().applyChanges(); } @@ -324,19 +324,19 @@ No.1 <- show -> No.20 <- not show -> No.(top) <- show -> No.(bottom) <- not show -> No.(readNum) */ -bool KitaHTMLPart::load( int centerNum ) +bool KitaHTMLPart::load(int centerNum) { m_centerNum = centerNum; m_jumpNumAfterLoading = 0; - if ( m_mode != HTMLPART_MODE_MAINPART ) return false; - if ( !m_domtree ) return false; - if ( Kita::DatManager::getReadNum( m_datURL ) == 0 ) return false; + if (m_mode != HTMLPART_MODE_MAINPART) return false; + if (!m_domtree) return false; + if (Kita::DatManager::getReadNum(m_datURL) == 0) return false; - int endNum = Kita::DatManager::getReadNum( m_datURL ); - showResponses( 1, endNum ); - updateScreen( true , false ); - gotoAnchor( QString().setNum( m_centerNum ), false ); + int endNum = Kita::DatManager::getReadNum(m_datURL); + showResponses(1, endNum); + updateScreen(true , false); + gotoAnchor(QString().setNum(m_centerNum), false); view() ->setFocus(); return true; @@ -349,21 +349,21 @@ /* see also slotReceiveData() and slotFinishLoad(). */ /* public */ -bool KitaHTMLPart::reload( int jumpNum ) +bool KitaHTMLPart::reload(int jumpNum) { - if ( !m_domtree ) return false; - if ( m_mode != HTMLPART_MODE_MAINPART ) { + if (!m_domtree) return false; + if (m_mode != HTMLPART_MODE_MAINPART) { /* If this is not MainPart, then open MainPart. */ - ViewMediator::getInstance()->openURL( m_datURL ); + ViewMediator::getInstance()->openURL(m_datURL); return false; } m_firstReceive = true; - if ( m_centerNum == 0 ) m_centerNum = m_domtree->getBottomResNumber(); + if (m_centerNum == 0) m_centerNum = m_domtree->getBottomResNumber(); m_jumpNumAfterLoading = jumpNum; /* DatManager will call back slotReceiveData and slotFinishLoad. */ - Kita::DatManager::updateCache( m_datURL , this ); + Kita::DatManager::updateCache(m_datURL , this); view() ->setFocus(); return true; @@ -378,23 +378,23 @@ { const int delta = 20; - if ( m_mode != HTMLPART_MODE_MAINPART ) return ; - if ( !m_domtree ) return ; + if (m_mode != HTMLPART_MODE_MAINPART) return ; + if (!m_domtree) return ; - int readNum = Kita::DatManager::getReadNum( m_datURL ); + int readNum = Kita::DatManager::getReadNum(m_datURL); int bottom = m_domtree->getBottomResNumber(); /* parsing */ - parseResponses( bottom + 1, readNum ); + parseResponses(bottom + 1, readNum); /* rendering */ - if ( m_firstReceive || bottom + delta < readNum ) { - showResponses( bottom + 1, readNum ); - updateScreen( true, false ); + if (m_firstReceive || bottom + delta < readNum) { + showResponses(bottom + 1, readNum); + updateScreen(true, false); } - if ( m_firstReceive && m_centerNum < readNum ) { - gotoAnchor( QString().setNum( m_centerNum ), false ); + if (m_firstReceive && m_centerNum < readNum) { + gotoAnchor(QString().setNum(m_centerNum), false); m_firstReceive = false; } @@ -408,18 +408,18 @@ and emits finishReload() */ /* !!! "public" slot !!! */ void KitaHTMLPart::slotFinishLoad() { - if ( m_mode != HTMLPART_MODE_MAINPART ) return ; - if ( !m_domtree ) return ; + if (m_mode != HTMLPART_MODE_MAINPART) return ; + if (!m_domtree) return ; int bottom = m_domtree->getBottomResNumber(); int shownNum = m_centerNum + 5000; - showResponses( bottom + 1, shownNum ); - updateScreen( true, false ); + showResponses(bottom + 1, shownNum); + updateScreen(true, false); // m_domtree->parseAllRes(); m_centerNum = 0; - if ( m_jumpNumAfterLoading ) gotoAnchor( QString().setNum( m_jumpNumAfterLoading ), false ); + if (m_jumpNumAfterLoading) gotoAnchor(QString().setNum(m_jumpNumAfterLoading), false); m_jumpNumAfterLoading = 0; emit finishReload(); @@ -434,33 +434,33 @@ /* public */ -bool KitaHTMLPart::gotoAnchor( const QString& anc, bool pushPosition ) +bool KitaHTMLPart::gotoAnchor(const QString& anc, bool pushPosition) { - if ( anc.isEmpty() ) return false; - if ( !m_domtree || m_mode == HTMLPART_MODE_POPUP ) - return KHTMLPart::gotoAnchor( anc ); + if (anc.isEmpty()) return false; + if (!m_domtree || m_mode == HTMLPART_MODE_POPUP) + return KHTMLPart::gotoAnchor(anc); hidePopup(); QString ancstr = anc; int res = ancstr.toInt(); - if ( res > 1 ) { + if (res > 1) { /* is target valid ? */ - if ( !Kita::DatManager::isResValid( m_datURL, res ) ) return false; + if (!Kita::DatManager::isResValid(m_datURL, res)) return false; - ancstr = QString().setNum( res ); + ancstr = QString().setNum(res); } - if ( res == 1 ) ancstr = "header"; - if ( pushPosition ) pushCurrentPosition(); + if (res == 1) ancstr = "header"; + if (pushPosition) pushCurrentPosition(); /* KHTMLPart::gotoAnchor() will fail if the thread is not shown. */ /* So KHTMLPart::gotoAnchor() should be called via custom event. */ /* See also KitaHTMLPart::customEvent() */ - GotoAnchorEvent * e = new GotoAnchorEvent( ancstr ); - QApplication::postEvent( this, e ); // Qt will delete it when done + GotoAnchorEvent * e = new GotoAnchorEvent(ancstr); + QApplication::postEvent(this, e); // Qt will delete it when done return true; } @@ -470,11 +470,11 @@ /* jump to kokomade yonda */ /* public slot */ void KitaHTMLPart::slotGotoKokoyon() { - if ( !m_domtree ) return ; - if ( m_mode != HTMLPART_MODE_MAINPART ) return ; + if (!m_domtree) return ; + if (m_mode != HTMLPART_MODE_MAINPART) return ; - int kokoyon = Kita::DatManager::getViewPos( m_datURL ); - gotoAnchor( QString().setNum( kokoyon ), false ); + int kokoyon = Kita::DatManager::getViewPos(m_datURL); + gotoAnchor(QString().setNum(kokoyon), false); } @@ -482,11 +482,11 @@ /* public slot */ void KitaHTMLPart::slotGobackAnchor() { - if ( m_anchorStack.empty() ) return ; + if (m_anchorStack.empty()) return ; QString anc = m_anchorStack.last(); m_anchorStack.pop_back(); - gotoAnchor( anc , false ); + gotoAnchor(anc , false); } @@ -504,29 +504,29 @@ { DOM::Node node; node = nodeUnderMouse(); - while ( node != 0 && node.nodeName().string() != "div" ) node = node.parentNode(); - if ( node == 0 ) return QString(); + while (node != 0 && node.nodeName().string() != "div") node = node.parentNode(); + if (node == 0) return QString(); - return static_cast( node ).getAttribute( "id" ).string(); + return static_cast(node).getAttribute("id").string(); } /* public slot */ void KitaHTMLPart::slotClickGotoFooter() { - if ( !m_domtree || m_mode != HTMLPART_MODE_MAINPART ) { - gotoAnchor( "footer", false ); + if (!m_domtree || m_mode != HTMLPART_MODE_MAINPART) { + gotoAnchor("footer", false); return ; } int bottom = m_domtree->getBottomResNumber(); - int readNum = Kita::DatManager::getReadNum( m_datURL ); + int readNum = Kita::DatManager::getReadNum(m_datURL); - if ( readNum != bottom ) { - showResponses( bottom + 1, readNum ); - updateScreen( true, true ); + if (readNum != bottom) { + showResponses(bottom + 1, readNum); + updateScreen(true, true); } - gotoAnchor( "footer", false ); + gotoAnchor("footer", false); } @@ -546,75 +546,75 @@ /* public */ -bool KitaHTMLPart::findText( const QString &query, bool reverse ) +bool KitaHTMLPart::findText(const QString &query, bool reverse) { - if ( m_mode != HTMLPART_MODE_MAINPART ) return false; + if (m_mode != HTMLPART_MODE_MAINPART) return false; - QRegExp regexp( query ); - regexp.setCaseSensitivity( Qt::CaseInsensitive ); + QRegExp regexp(query); + regexp.setCaseSensitivity(Qt::CaseInsensitive); /* init */ - if ( m_findNode.isNull() ) { + if (m_findNode.isNull()) { m_findNode = htmlDocument().body(); m_find_y = 0; /* move to the last child node */ - if ( reverse ) { - while ( !m_findNode.lastChild().isNull() ) m_findNode = m_findNode.lastChild(); + if (reverse) { + while (!m_findNode.lastChild().isNull()) m_findNode = m_findNode.lastChild(); m_find_y = view() ->contentsHeight(); } } - while ( 1 ) { + while (1) { - if ( m_findNode.nodeType() == DOM::Node::TEXT_NODE - || m_findNode.nodeType() == DOM::Node::CDATA_SECTION_NODE ) { + if (m_findNode.nodeType() == DOM::Node::TEXT_NODE + || m_findNode.nodeType() == DOM::Node::CDATA_SECTION_NODE) { /* find the word in the current node */ DOM::DOMString nodeText = m_findNode.nodeValue(); QString nodestr = nodeText.string(); - if ( reverse && m_findPos != -1 ) nodestr.resize( m_findPos ); + if (reverse && m_findPos != -1) nodestr.resize(m_findPos); - if ( reverse ) m_findPos = nodestr.lastIndexOf( regexp, m_findPos ); - else m_findPos = nodestr.indexOf( regexp, m_findPos + 1 ); + if (reverse) m_findPos = nodestr.lastIndexOf(regexp, m_findPos); + else m_findPos = nodestr.indexOf(regexp, m_findPos + 1); /* scroll & select & return */ - if ( m_findPos != -1 ) { + if (m_findPos != -1) { int matchLen = regexp.matchedLength(); QRect qr = m_findNode.getRect(); - view() ->setContentsPos( qr.left() - 50, m_find_y - 100 ); - DOM::Range rg( m_findNode, m_findPos, m_findNode, m_findPos + matchLen ); - setSelection( rg ); + view() ->setContentsPos(qr.left() - 50, m_find_y - 100); + DOM::Range rg(m_findNode, m_findPos, m_findNode, m_findPos + matchLen); + setSelection(rg); return true; } - } else if ( m_findNode.nodeName().string() == "table" ) { + } else if (m_findNode.nodeName().string() == "table") { QRect qr = m_findNode.getRect(); m_find_y = qr.bottom(); - } else if ( m_findNode.nodeName().string() == "div" ) { + } else if (m_findNode.nodeName().string() == "div") { QRect qr = m_findNode.getRect(); - if ( reverse ) { + if (reverse) { m_find_y = qr.bottom(); } else { m_find_y = qr.top(); } - } else if ( m_findNode.nodeName().string() == "br" ) { + } else if (m_findNode.nodeName().string() == "br") { DOM::Node tmpnode = m_findNode.previousSibling(); - if ( tmpnode != 0 ) { + if (tmpnode != 0) { QRect qr = tmpnode.getRect(); - if ( reverse ) m_find_y -= qr.bottom() - qr.top(); + if (reverse) m_find_y -= qr.bottom() - qr.top(); else m_find_y += qr.bottom() - qr.top(); } } @@ -625,14 +625,14 @@ DOM::Node next; /* move to the next node */ - if ( !reverse ) { + if (!reverse) { next = m_findNode.firstChild(); - if ( next.isNull() ) next = m_findNode.nextSibling(); + if (next.isNull()) next = m_findNode.nextSibling(); - while ( !m_findNode.isNull() && next.isNull() ) { + while (!m_findNode.isNull() && next.isNull()) { m_findNode = m_findNode.parentNode(); - if ( !m_findNode.isNull() ) { + if (!m_findNode.isNull()) { next = m_findNode.nextSibling(); } } @@ -641,18 +641,18 @@ else { next = m_findNode.lastChild(); - if ( next.isNull() ) next = m_findNode.previousSibling(); + if (next.isNull()) next = m_findNode.previousSibling(); - while ( !m_findNode.isNull() && next.isNull() ) { + while (!m_findNode.isNull() && next.isNull()) { m_findNode = m_findNode.parentNode(); - if ( !m_findNode.isNull() ) { + if (!m_findNode.isNull()) { next = m_findNode.previousSibling(); } } } m_findNode = next; - if ( m_findNode.isNull() ) { + if (m_findNode.isNull()) { m_findNode = 0; return false; } @@ -672,7 +672,7 @@ /* private */ -void KitaHTMLPart::showPopupMenu( const KUrl& kurl ) +void KitaHTMLPart::showPopupMenu(const KUrl& kurl) { QString url = kurl.prettyUrl(); bool showppm = false; @@ -680,12 +680,12 @@ QString str; /* If selected Text is composed of only digits, then show res popup. */ - if ( !m_pushctrl && showSelectedDigitPopup() ) return ; + if (!m_pushctrl && showSelectedDigitPopup()) return ; /*-----------------------------------*/ /* create menu items */ - KMenu popupMenu( view() ); + KMenu popupMenu(view()); KMenu* backSubMenu = 0; KMenu* markSubMenu = 0; @@ -694,143 +694,143 @@ KAction* homeLinkAct = 0; KAction* kokoLinkAct = 0; KAction* endLinkAct = 0; - if ( m_domtree && - ( m_mode == HTMLPART_MODE_MAINPART ) ) { + if (m_domtree && + (m_mode == HTMLPART_MODE_MAINPART)) { showppm = true; // back - if ( !m_anchorStack.empty() ) { - backSubMenu = new KMenu( view() ); + if (!m_anchorStack.empty()) { + backSubMenu = new KMenu(view()); int i = m_anchorStack.size(); QStringList::iterator it; - for ( it = m_anchorStack.begin(); it != m_anchorStack.end(); it++, i-- ) { - str = ( *it ) + " " + Kita::DatManager::getPlainBody( m_datURL, ( *it ).toInt() ).left( 10 ); - KAction* backLink = new KAction( str, this ); - backSubMenu->addAction( backLink ); + for (it = m_anchorStack.begin(); it != m_anchorStack.end(); it++, i--) { + str = (*it) + " " + Kita::DatManager::getPlainBody(m_datURL, (*it).toInt()).left(10); + KAction* backLink = new KAction(str, this); + backSubMenu->addAction(backLink); } - backSubMenu->setTitle( i18n( "Back" ) ); - popupMenu.addMenu( backSubMenu ); + backSubMenu->setTitle(i18n("Back")); + popupMenu.addMenu(backSubMenu); popupMenu.addSeparator(); } // mark - int readNum = Kita::DatManager::getReadNum( m_datURL ); - for ( int i = 1; i <= readNum ; i++ ) { - if ( Kita::DatManager::isMarked( m_datURL, i ) ) { - if ( !markSubMenu ) { - markSubMenu = new KMenu( view() ); - markSubMenu->setTitle( i18n( "Mark" ) ); - popupMenu.addMenu( markSubMenu ); + int readNum = Kita::DatManager::getReadNum(m_datURL); + for (int i = 1; i <= readNum ; i++) { + if (Kita::DatManager::isMarked(m_datURL, i)) { + if (!markSubMenu) { + markSubMenu = new KMenu(view()); + markSubMenu->setTitle(i18n("Mark")); + popupMenu.addMenu(markSubMenu); popupMenu.addSeparator(); } - str = QString().setNum( i ) + " " + Kita::DatManager::getPlainBody( m_datURL, i ).left( 10 ); - KAction *gotoMarkAct = new KAction( str, this ); - markSubMenu->addAction( gotoMarkAct ); + str = QString().setNum(i) + " " + Kita::DatManager::getPlainBody(m_datURL, i).left(10); + KAction *gotoMarkAct = new KAction(str, this); + markSubMenu->addAction(gotoMarkAct); } } // home - homeLinkAct = new KAction( i18n( "Start" ), this ); + homeLinkAct = new KAction(i18n("Start"), this); popupMenu.addAction(homeLinkAct); // template - if ( m_mode == HTMLPART_MODE_MAINPART ) { - int kokoyon = Kita::DatManager::getViewPos( m_datURL ); - if ( kokoyon ) { - str = i18n( "Kokomade Yonda (%1)" ).arg( kokoyon ); - kokoLinkAct = new KAction( str, this ); - popupMenu.addAction( kokoLinkAct ); + if (m_mode == HTMLPART_MODE_MAINPART) { + int kokoyon = Kita::DatManager::getViewPos(m_datURL); + if (kokoyon) { + str = i18n("Kokomade Yonda (%1)").arg(kokoyon); + kokoLinkAct = new KAction(str, this); + popupMenu.addAction(kokoLinkAct); } } // end - endLinkAct = new KAction( i18n( "End" ), this ); - popupMenu.addAction( endLinkAct ); + endLinkAct = new KAction(i18n("End"), this); + popupMenu.addAction(endLinkAct); } // copy & abone KAction* copyStrAct = 0; KAction* aboneWordAct = 0; - if ( hasSelection() ) { - if ( showppm ) popupMenu.addSeparator(); + if (hasSelection()) { + if (showppm) popupMenu.addSeparator(); showppm = true; - copyStrAct = new KAction( i18n( "Copy" ), this ); + copyStrAct = new KAction(i18n("Copy"), this); popupMenu.addAction(copyStrAct); // truncated QString selectedStr = selectedText(); - if ( selectedStr.length() > 20 ) { - selectedStr.truncate( 20 ); - selectedStr.append( "..." ); + if (selectedStr.length() > 20) { + selectedStr.truncate(20); + selectedStr.append("..."); } - aboneWordAct = new KAction( i18n( "Add '%1' to abone list" ).arg( selectedStr ), this ); - popupMenu.addAction( aboneWordAct ); + aboneWordAct = new KAction(i18n("Add '%1' to abone list").arg(selectedStr), this); + popupMenu.addAction(aboneWordAct); } // copy link KAction* openBrowserAct = 0; KAction* copyLinkAct = 0; - if ( !url.isEmpty() ) { - if ( showppm ) popupMenu.addSeparator(); + if (!url.isEmpty()) { + if (showppm) popupMenu.addSeparator(); showppm = true; - openBrowserAct = new KAction( i18n( "Open with Web Browser" ), this ); - popupMenu.addAction( openBrowserAct ); + openBrowserAct = new KAction(i18n("Open with Web Browser"), this); + popupMenu.addAction(openBrowserAct); popupMenu.addSeparator(); - copyLinkAct = new KAction( i18n( "Copy Link Location" ), this ); - popupMenu.addAction( copyLinkAct ); + copyLinkAct = new KAction(i18n("Copy Link Location"), this); + popupMenu.addAction(copyLinkAct); } // show menu - if ( showppm ) { + if (showppm) { QClipboard * clipboard = QApplication::clipboard(); - QAction* action = popupMenu.exec( QCursor::pos() ); - if ( !action ) { + QAction* action = popupMenu.exec(QCursor::pos()); + if (!action) { delete backSubMenu; delete markSubMenu; return; } - if ( action == copyLinkAct ) { - clipboard->setText( url , QClipboard::Clipboard ); - clipboard->setText( url , QClipboard::Selection ); - } else if ( action == openBrowserAct ) { - KRun::runUrl( kurl, "text/html", view() ); - } else if ( action == homeLinkAct ) { - gotoAnchor( "header", false ); - } else if ( action == kokoLinkAct ) { + if (action == copyLinkAct) { + clipboard->setText(url , QClipboard::Clipboard); + clipboard->setText(url , QClipboard::Selection); + } else if (action == openBrowserAct) { + KRun::runUrl(kurl, "text/html", view()); + } else if (action == homeLinkAct) { + gotoAnchor("header", false); + } else if (action == kokoLinkAct) { slotGotoKokoyon(); - } else if ( action == endLinkAct ) { + } else if (action == endLinkAct) { slotClickGotoFooter(); - } else if ( action == copyStrAct ) { - clipboard->setText( selectedText(), QClipboard::Clipboard ); - } else if ( action == aboneWordAct ) { - if ( QMessageBox::information( view(), "Kita", - i18n( "Do you want to add '%1' to abone list ?" ).arg( selectedText() ), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default ) - == QMessageBox::Ok ) { + } else if (action == copyStrAct) { + clipboard->setText(selectedText(), QClipboard::Clipboard); + } else if (action == aboneWordAct) { + if (QMessageBox::information(view(), "Kita", + i18n("Do you want to add '%1' to abone list ?").arg(selectedText()), + QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) + == QMessageBox::Ok) { - Kita::AboneConfig::aboneWordList().append( selectedText() ); - redrawHTMLPart( m_datURL, false ); + Kita::AboneConfig::aboneWordList().append(selectedText()); + redrawHTMLPart(m_datURL, false); } } else { QMenu* menu = action->menu(); - if ( !menu ) { + if (!menu) { delete backSubMenu; delete markSubMenu; return; } - if ( menu == markSubMenu ) { - gotoAnchor( QString().setNum( menu->actions().indexOf( action ) ), false ); - } else if ( menu == backSubMenu ) { - for ( int i = 0; i < menu->actions().indexOf( action ); i++ ) + if (menu == markSubMenu) { + gotoAnchor(QString().setNum(menu->actions().indexOf(action)), false); + } else if (menu == backSubMenu) { + for (int i = 0; i < menu->actions().indexOf(action); i++) m_anchorStack.pop_back(); slotGobackAnchor(); } @@ -846,14 +846,14 @@ /* protected */ /* virtual */ -void KitaHTMLPart::customEvent( QEvent * e ) +void KitaHTMLPart::customEvent(QEvent * e) { - if ( e->type() == EVENT_GotoAnchor ) { - KHTMLPart::gotoAnchor( static_cast< GotoAnchorEvent* >( e ) ->getAnc() ); + if (e->type() == EVENT_GotoAnchor) { + KHTMLPart::gotoAnchor(static_cast< GotoAnchorEvent* >(e) ->getAnc()); return ; } - KHTMLPart::customEvent( e ); + KHTMLPart::customEvent(e); } @@ -863,39 +863,39 @@ /* protected */ -void KitaHTMLPart::khtmlMousePressEvent( khtml::MousePressEvent* e ) +void KitaHTMLPart::khtmlMousePressEvent(khtml::MousePressEvent* e) { emit mousePressed(); /* to KitaThreadView to focus this view. */ KUrl kurl; - if ( !e->url().string().isEmpty() ) - kurl = KUrl( Kita::BoardManager::boardURL( m_datURL ), e->url().string() ); + if (!e->url().string().isEmpty()) + kurl = KUrl(Kita::BoardManager::boardURL(m_datURL), e->url().string()); m_pushctrl = m_pushmidbt = m_pushrightbt = false; - if ( e->qmouseEvent() ->button() & Qt::RightButton ) m_pushrightbt = true; - if ( e->qmouseEvent() ->modifiers() & Qt::ControlModifier ) m_pushctrl = true; - if ( e->qmouseEvent() ->button() & Qt::MidButton ) m_pushmidbt = true; + if (e->qmouseEvent() ->button() & Qt::RightButton) m_pushrightbt = true; + if (e->qmouseEvent() ->modifiers() & Qt::ControlModifier) m_pushctrl = true; + if (e->qmouseEvent() ->button() & Qt::MidButton) m_pushmidbt = true; - if ( e->url() != 0 ) { + if (e->url() != 0) { - if ( e->url().string().at( 0 ) == '#' ) { /* anchor */ + if (e->url().string().at(0) == '#') { /* anchor */ kurl = m_datURL; - kurl.setRef( e->url().string().mid( 1 ) ) ; + kurl.setRef(e->url().string().mid(1)) ; } - clickAnchor( kurl ); + clickAnchor(kurl); m_pushctrl = m_pushmidbt = m_pushrightbt = false; return ; } /* popup menu */ - if ( m_pushrightbt ) { - showPopupMenu( kurl ); + if (m_pushrightbt) { + showPopupMenu(kurl); m_pushctrl = m_pushmidbt = m_pushrightbt = false; return ; } - KHTMLPart::khtmlMousePressEvent( e ); + KHTMLPart::khtmlMousePressEvent(e); } @@ -909,23 +909,23 @@ /* private slot */ -void KitaHTMLPart::slotOpenURLRequest( const KUrl& urlin, const KParts::OpenUrlArguments& ) +void KitaHTMLPart::slotOpenURLRequest(const KUrl& urlin, const KParts::OpenUrlArguments&) { - clickAnchor( urlin ); + clickAnchor(urlin); } /*------------------------------------------------------*/ /* This function is called when user clicked res anchor */ /* private */ -void KitaHTMLPart::clickAnchor( const KUrl& urlin ) +void KitaHTMLPart::clickAnchor(const KUrl& urlin) { QString refstr; - KUrl datURL = Kita::getDatURL( urlin , refstr ); + KUrl datURL = Kita::getDatURL(urlin , refstr); /*--------------------*/ /* Ctrl + right click */ - if ( m_pushctrl && m_pushrightbt ) { - showPopupMenu( urlin ); + if (m_pushctrl && m_pushrightbt) { + showPopupMenu(urlin); return ; } @@ -933,57 +933,57 @@ /* If this is not anchor, then */ /* emit openURLRequest and return */ - if ( datURL.host() != m_datURL.host() || datURL.path() != m_datURL.path() ) { + if (datURL.host() != m_datURL.host() || datURL.path() != m_datURL.path()) { /* right click */ - if ( m_pushrightbt ) { + if (m_pushrightbt) { /* start multi-popup mode or show popup menu */ - if ( !startMultiPopup() ) showPopupMenu( urlin ); + if (!startMultiPopup()) showPopupMenu(urlin); return ; } /* right click */ - ViewMediator::getInstance()->openURL( urlin ); + ViewMediator::getInstance()->openURL(urlin); return ; } - if ( refstr.isEmpty() ) return ; + if (refstr.isEmpty()) return ; /*---------------------------*/ /* show popupmenu for #write */ - if ( refstr.left( 5 ) == "write" ) { - showWritePopupMenu( refstr ); + if (refstr.left(5) == "write") { + showWritePopupMenu(refstr); return ; } /*----------------------------*/ /* extract responses by ID */ - if ( refstr.left( 5 ) == "idpop" ) { - showIDPopup( refstr ); + if (refstr.left(5) == "idpop") { + showIDPopup(refstr); return ; } /*---------------------------*/ /* show popupmenu for #bepop */ - if ( refstr.left( 5 ) == "bepop" ) { - showBePopupMenu( refstr ); + if (refstr.left(5) == "bepop") { + showBePopupMenu(refstr); return ; } /*-------------------------*/ /* start multi-popup mdde */ - if ( m_pushrightbt && startMultiPopup() ) return ; + if (m_pushrightbt && startMultiPopup()) return ; /*----------------------------*/ /* next 100 ,before 100 ,etc. */ - if ( m_mode == HTMLPART_MODE_MAINPART ) { - if ( refstr.left( 7 ) == "tosaigo" ) { + if (m_mode == HTMLPART_MODE_MAINPART) { + if (refstr.left(7) == "tosaigo") { slotClickGotoFooter(); return; } @@ -994,23 +994,23 @@ int refNum, refNum2; - int i = refstr.indexOf( "-" ); - if ( i != -1 ) { - refNum = refstr.left( i ).toInt(); - refNum2 = refstr.mid( i + 1 ).toInt(); - if ( refNum2 < refNum ) { + int i = refstr.indexOf("-"); + if (i != -1) { + refNum = refstr.left(i).toInt(); + refNum2 = refstr.mid(i + 1).toInt(); + if (refNum2 < refNum) { refNum2 = refNum; } } else { refNum = refNum2 = refstr.toInt(); } - if ( !refNum ) return ; + if (!refNum) return ; - if ( m_mode == HTMLPART_MODE_POPUP ) { - ViewMediator::getInstance()->openURL( urlin ); + if (m_mode == HTMLPART_MODE_POPUP) { + ViewMediator::getInstance()->openURL(urlin); } else { - gotoAnchor( QString().setNum( refNum ), true ); + gotoAnchor(QString().setNum(refNum), true); } } @@ -1019,21 +1019,21 @@ /*---------------------------------------------------------*/ /* popup menu that is opened when user clicked res number. */ /* This funtcion is called in only clickAnchor(). */ /* private */ -void KitaHTMLPart::showWritePopupMenu( const QString& refstr ) +void KitaHTMLPart::showWritePopupMenu(const QString& refstr) { QClipboard * clipboard = QApplication::clipboard(); QString str, resstr; - int resNum = refstr.mid( 5 ).toInt(); - QString namestr = Kita::DatManager::getPlainName( m_datURL, resNum ); + int resNum = refstr.mid(5).toInt(); + QString namestr = Kita::DatManager::getPlainName(m_datURL, resNum); /* show res tree */ - if ( m_pushrightbt ) { + if (m_pushrightbt) { int num; - QString htmlstr = Kita::DatManager::getTreeByRes( m_datURL, resNum, num ); - if ( !num ) return ; - QString tmpstr = QString( "
No.%1 : [%2]
" ).arg( resNum ).arg( num ); + QString htmlstr = Kita::DatManager::getTreeByRes(m_datURL, resNum, num); + if (!num) return ; + QString tmpstr = QString("
No.%1 : [%2]
").arg(resNum).arg(num); tmpstr += htmlstr + "

"; - showPopup( m_datURL, tmpstr ); + showPopup(m_datURL, tmpstr); startMultiPopup(); return ; } @@ -1042,129 +1042,129 @@ /* create popup menu */ QString plainStr; - KMenu popupMenu( view() ); + KMenu popupMenu(view()); KAction* resAct = 0; KAction* quoteAct = 0; - if ( m_mode == HTMLPART_MODE_MAINPART ) { - resAct = new KAction( i18n( "write response" ), this ); - popupMenu.addAction( resAct ); + if (m_mode == HTMLPART_MODE_MAINPART) { + resAct = new KAction(i18n("write response"), this); + popupMenu.addAction(resAct); - quoteAct = new KAction( i18n( "quote this" ), this ); - popupMenu.addAction( quoteAct ); + quoteAct = new KAction(i18n("quote this"), this); + popupMenu.addAction(quoteAct); popupMenu.addSeparator(); } // mark - KAction* markAct = new KAction( i18n( "Mark" ), this ); - markAct->setCheckable( true ); - markAct->setChecked( Kita::DatManager::isMarked( m_datURL, resNum ) ); - popupMenu.addAction( markAct ); + KAction* markAct = new KAction(i18n("Mark"), this); + markAct->setCheckable(true); + markAct->setChecked(Kita::DatManager::isMarked(m_datURL, resNum)); + popupMenu.addAction(markAct); popupMenu.addSeparator(); // open - KAction* showBrowserAct = new KAction( i18n( "Open with Web Browser" ), this ); - popupMenu.addAction( showBrowserAct ); + KAction* showBrowserAct = new KAction(i18n("Open with Web Browser"), this); + popupMenu.addAction(showBrowserAct); popupMenu.addSeparator(); // util - KAction* resTreeAct = new KAction( i18n( "res tree" ), this ); - popupMenu.addAction( resTreeAct ); + KAction* resTreeAct = new KAction(i18n("res tree"), this); + popupMenu.addAction(resTreeAct); - KAction* reverseResTreeAct = new KAction( i18n( "reverse res tree" ), this ); - popupMenu.addAction( reverseResTreeAct ); + KAction* reverseResTreeAct = new KAction(i18n("reverse res tree"), this); + popupMenu.addAction(reverseResTreeAct); - KAction* extractNameAct = new KAction( i18n( "extract by name" ), this ); - popupMenu.addAction( extractNameAct ); + KAction* extractNameAct = new KAction(i18n("extract by name"), this); + popupMenu.addAction(extractNameAct); popupMenu.addSeparator(); // copy - KAction* copyUrlAct = new KAction( i18n( "copy URL" ), this ); - popupMenu.addAction( copyUrlAct ); + KAction* copyUrlAct = new KAction(i18n("copy URL"), this); + popupMenu.addAction(copyUrlAct); - KAction* copyThreadNameAct = new KAction( i18n( "Copy title and URL" ), this ); - popupMenu.addAction( copyThreadNameAct ); + KAction* copyThreadNameAct = new KAction(i18n("Copy title and URL"), this); + popupMenu.addAction(copyThreadNameAct); - KAction* copyAct = new KAction( i18n( "copy" ), this ); - popupMenu.addAction( copyAct ); + KAction* copyAct = new KAction(i18n("copy"), this); + popupMenu.addAction(copyAct); // kokkoma de yonda KAction* setKokoYonAct = 0; - if ( m_domtree && m_mode == HTMLPART_MODE_MAINPART ) { + if (m_domtree && m_mode == HTMLPART_MODE_MAINPART) { popupMenu.addSeparator(); - setKokoYonAct = new KAction( i18n( "set Kokomade Yonda" ), this ); - popupMenu.addAction( setKokoYonAct ); + setKokoYonAct = new KAction(i18n("set Kokomade Yonda"), this); + popupMenu.addAction(setKokoYonAct); } // abone popupMenu.addSeparator(); - KAction* aboneNameAct = new KAction( i18n( "add name to abone list" ), this ); - popupMenu.addAction( aboneNameAct ); + KAction* aboneNameAct = new KAction(i18n("add name to abone list"), this); + popupMenu.addAction(aboneNameAct); // show popup menu - QAction* action = popupMenu.exec( QCursor::pos() ); - if ( !action ) { + QAction* action = popupMenu.exec(QCursor::pos()); + if (!action) { return; } - if ( action == resAct ) { - resstr = ">>" + QString().setNum( resNum ) + '\n'; - ViewMediator::getInstance()->showWriteView( m_datURL, resstr ); - } else if ( action == quoteAct ) { - resstr = ">>" + QString().setNum( resNum ) + '\n' - + "> " + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + '\n' - + "> " + Kita::DatManager::getPlainBody( m_datURL, resNum ).replace( '\n', "\n> " ) + '\n'; - ViewMediator::getInstance()->showWriteView( m_datURL, resstr ); - } else if ( action == markAct ) { - Kita::DatManager::setMark( m_datURL, resNum, ! Kita::DatManager::isMarked( m_datURL, resNum ) ); - } else if ( action == copyAct || action == copyUrlAct || action == copyThreadNameAct ) { + if (action == resAct) { + resstr = ">>" + QString().setNum(resNum) + '\n'; + ViewMediator::getInstance()->showWriteView(m_datURL, resstr); + } else if (action == quoteAct) { + resstr = ">>" + QString().setNum(resNum) + '\n' + + "> " + Kita::DatManager::getPlainTitle(m_datURL, resNum) + '\n' + + "> " + Kita::DatManager::getPlainBody(m_datURL, resNum).replace('\n', "\n> ") + '\n'; + ViewMediator::getInstance()->showWriteView(m_datURL, resstr); + } else if (action == markAct) { + Kita::DatManager::setMark(m_datURL, resNum, ! Kita::DatManager::isMarked(m_datURL, resNum)); + } else if (action == copyAct || action == copyUrlAct || action == copyThreadNameAct) { str.clear(); // title - if ( action == copyThreadNameAct || action == copyAct ) { - str = Kita::DatManager::threadName( m_datURL ); + if (action == copyThreadNameAct || action == copyAct) { + str = Kita::DatManager::threadName(m_datURL); } // url - if ( !str.isEmpty() ) str += '\n'; - str += Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ) + '\n'; + if (!str.isEmpty()) str += '\n'; + str += Kita::DatManager::threadURL(m_datURL) + '/' + QString().setNum(resNum) + '\n'; // body - if ( action == copyAct ) { + if (action == copyAct) { str += '\n' - + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + '\n' - + Kita::DatManager::getPlainBody( m_datURL, resNum ) + '\n'; + + Kita::DatManager::getPlainTitle(m_datURL, resNum) + '\n' + + Kita::DatManager::getPlainBody(m_datURL, resNum) + '\n'; } // copy - clipboard->setText( str , QClipboard::Clipboard ); - clipboard->setText( str , QClipboard::Selection ); + clipboard->setText(str , QClipboard::Clipboard); + clipboard->setText(str , QClipboard::Selection); - } else if ( action == setKokoYonAct ) { - Kita::DatManager::setViewPos( m_datURL, resNum ); - ViewMediator::getInstance()->updateBoardView( m_datURL ); + } else if (action == setKokoYonAct) { + Kita::DatManager::setViewPos(m_datURL, resNum); + ViewMediator::getInstance()->updateBoardView(m_datURL); m_updatedKokoyon = true; - updateScreen( true, true ); - gotoAnchor( QString().setNum( resNum ), false ); + updateScreen(true, true); + gotoAnchor(QString().setNum(resNum), false); - } else if ( action == showBrowserAct ) { - str = Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ); + } else if (action == showBrowserAct) { + str = Kita::DatManager::threadURL(m_datURL) + '/' + QString().setNum(resNum); - KRun::runUrl( str, "text/html", view() ); - } else if ( action == aboneNameAct ) { - if ( QMessageBox::information( view(), "Kita", - i18n( "Do you want to add '%1' to abone list ?" ).arg( namestr ), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default ) - == QMessageBox::Ok ) { + KRun::runUrl(str, "text/html", view()); + } else if (action == aboneNameAct) { + if (QMessageBox::information(view(), "Kita", + i18n("Do you want to add '%1' to abone list ?").arg(namestr), + QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) + == QMessageBox::Ok) { - Kita::AboneConfig::aboneNameList().append( namestr ); - redrawHTMLPart( m_datURL, false ); + Kita::AboneConfig::aboneNameList().append(namestr); + redrawHTMLPart(m_datURL, false); } } } @@ -1174,43 +1174,43 @@ /*--------------------------------------------------*/ /* popup that is opened when user clicked ID */ /* This funtcion is called in only clickAnchor(). */ /* private */ -void KitaHTMLPart::showIDPopup( const QString& refstr ) +void KitaHTMLPart::showIDPopup(const QString& refstr) { - QString strid = refstr.mid( 5 ) - .replace( "%2B", "+" ) - .replace( "%2F", "/" ); + QString strid = refstr.mid(5) + .replace("%2B", "+") + .replace("%2F", "/"); /* popup */ - if ( m_pushrightbt ) { + if (m_pushrightbt) { int num; QString htmlstr - = Kita::DatManager::getHtmlByID( m_datURL, strid, num ); - if ( num <= 1 ) return ; - QString tmpstr = QString( "
ID:%1:[%2]
" ).arg( strid ).arg( num ); + = Kita::DatManager::getHtmlByID(m_datURL, strid, num); + if (num <= 1) return ; + QString tmpstr = QString("
ID:%1:[%2]
").arg(strid).arg(num); tmpstr += htmlstr + "

"; - showPopup( m_datURL, tmpstr ); + showPopup(m_datURL, tmpstr); startMultiPopup(); } else { - KMenu popupMenu( view() ); + KMenu popupMenu(view()); - KAction* aboneAct = new KAction( i18n( "add id to abone list" ), this ); - popupMenu.addAction( aboneAct ); + KAction* aboneAct = new KAction(i18n("add id to abone list"), this); + popupMenu.addAction(aboneAct); - QAction* action = popupMenu.exec( QCursor::pos() ); - if ( !action ) { + QAction* action = popupMenu.exec(QCursor::pos()); + if (!action) { return; } - if ( action == aboneAct ) { + if (action == aboneAct) { // add ID to abone list - if ( QMessageBox::information( view(), "Kita", - i18n( "Do you want to add '%1' to abone list ?" ).arg( strid ), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default ) - == QMessageBox::Ok ) { + if (QMessageBox::information(view(), "Kita", + i18n("Do you want to add '%1' to abone list ?").arg(strid), + QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) + == QMessageBox::Ok) { - Kita::AboneConfig::aboneIDList().append( strid ); - redrawHTMLPart( m_datURL, false ); + Kita::AboneConfig::aboneIDList().append(strid); + redrawHTMLPart(m_datURL, false); } } } @@ -1221,36 +1221,36 @@ /*---------------------------------------------------------*/ /* popup menu that is opened when user clicked be anchor. */ /* This funtcion is called in only clickAnchor(). */ /* private */ -void KitaHTMLPart::showBePopupMenu( const QString& refstr ) +void KitaHTMLPart::showBePopupMenu(const QString& refstr) { - QString strURL = "http://be.2ch.net/test/p.php?i=" + refstr.mid( 5 ) - + "&u=d:" + Kita::DatManager::threadURL( m_datURL ) + "/l50"; + QString strURL = "http://be.2ch.net/test/p.php?i=" + refstr.mid(5) + + "&u=d:" + Kita::DatManager::threadURL(m_datURL) + "/l50"; - if ( m_pushrightbt ) { + if (m_pushrightbt) { // create popup menu - KMenu popupMenu( view() ); + KMenu popupMenu(view()); QClipboard * clipboard = QApplication::clipboard(); - KAction* copyUrlAct = new KAction( i18n( "copy URL" ), this ); - popupMenu.addAction( copyUrlAct ); + KAction* copyUrlAct = new KAction(i18n("copy URL"), this); + popupMenu.addAction(copyUrlAct); - KAction* showBrowserAct = new KAction( i18n( "Open with Web Browser" ), this ); + KAction* showBrowserAct = new KAction(i18n("Open with Web Browser"), this); // show popup menu - QAction* action = popupMenu.exec( QCursor::pos() ); - if ( !action ) { + QAction* action = popupMenu.exec(QCursor::pos()); + if (!action) { return; } - if ( action == copyUrlAct ) { + if (action == copyUrlAct) { // copy - clipboard->setText( strURL, QClipboard::Clipboard ); - clipboard->setText( strURL, QClipboard::Selection ); - } else if ( action == showBrowserAct ) { - KRun::runUrl( strURL, "text/html", view() ); + clipboard->setText(strURL, QClipboard::Clipboard); + clipboard->setText(strURL, QClipboard::Selection); + } else if (action == showBrowserAct) { + KRun::runUrl(strURL, "text/html", view()); } } else { - KRun::runUrl( strURL, "text/html", 0 ); + KRun::runUrl(strURL, "text/html", 0); } } @@ -1262,7 +1262,7 @@ /* public */ bool KitaHTMLPart::isPopupVisible() { - if ( !m_popup ) return false; + if (!m_popup) return false; return m_popup->isVisible(); } @@ -1277,35 +1277,35 @@ /* for convenience */ /* public slot */ -void KitaHTMLPart::slotShowResPopup( QPoint point, int refNum, int refNum2 ) +void KitaHTMLPart::slotShowResPopup(QPoint point, int refNum, int refNum2) { - QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum2 ); - if ( innerHTML.isEmpty() ) return ; + QString innerHTML = Kita::DatManager::getHtml(m_datURL, refNum, refNum2); + if (innerHTML.isEmpty()) return ; - showPopupCore( m_datURL, innerHTML, point ); + showPopupCore(m_datURL, innerHTML, point); } /* for convenience */ /* private */ -void KitaHTMLPart::showPopup( const KUrl& url, const QString& innerHTML ) +void KitaHTMLPart::showPopup(const KUrl& url, const QString& innerHTML) { - showPopupCore( url, innerHTML, QCursor::pos() ); + showPopupCore(url, innerHTML, QCursor::pos()); } /* show popup window */ /* private */ -void KitaHTMLPart::showPopupCore( const KUrl& url, const QString& innerHTML, QPoint point ) +void KitaHTMLPart::showPopupCore(const KUrl& url, const QString& innerHTML, QPoint point) { slotDeletePopup(); m_multiPopup = false; - m_popup = new Kita::ResPopup( view() , url ); + m_popup = new Kita::ResPopup(view() , url); - connect( m_popup, SIGNAL( hideChildPopup() ), SLOT( slotHideChildPopup() ) ); + connect(m_popup, SIGNAL(hideChildPopup()), SLOT(slotHideChildPopup())); - m_popup->setText( innerHTML ); + m_popup->setText(innerHTML); m_popup->adjustSize(); - m_popup->adjustPos( point ); + m_popup->adjustPos(point); m_popup->show(); } @@ -1315,7 +1315,7 @@ bool KitaHTMLPart::startMultiPopup() { - if ( m_popup && m_popup->isVisible() ) { + if (m_popup && m_popup->isVisible()) { m_multiPopup = true; m_popup->moveMouseAbove(); } else { @@ -1329,9 +1329,9 @@ /* Is it multi-popup mode now ? */ /* private */ bool KitaHTMLPart::isMultiPopupMode() { - if ( !m_popup ) { + if (!m_popup) { m_multiPopup = false; - } else if ( m_popup->isHidden() ) { + } else if (m_popup->isHidden()) { m_multiPopup = false; } @@ -1341,24 +1341,24 @@ /* private */ void KitaHTMLPart::hidePopup() { - if ( m_popup ) { + if (m_popup) { m_popup->hide(); } m_multiPopup = false; } /* return true if this view is under mouse. */ /* private */ -bool KitaHTMLPart::isUnderMouse( int mrgwd, int mrght ) +bool KitaHTMLPart::isUnderMouse(int mrgwd, int mrght) { QPoint pos = QCursor::pos(); int cx = pos.x(), cy = pos.y(); - QPoint viewpos = view() ->mapToGlobal( QPoint( 0, 0 ) ); + QPoint viewpos = view() ->mapToGlobal(QPoint(0, 0)); int px = viewpos.x(), py = viewpos.y(); int wd = view() ->visibleWidth(), ht = view() ->visibleHeight(); - if ( ( px < cx && cx < px + wd + mrgwd ) - && ( py < cy && cy < py + ht + mrght ) ) { + if ((px < cx && cx < px + wd + mrgwd) + && (py < cy && cy < py + ht + mrght)) { return true; } @@ -1368,14 +1368,14 @@ /* private slot */ void KitaHTMLPart::slotLeave() { - if ( isMultiPopupMode() ) return ; -// if ( view() ->isHorizontalSliderPressed() ) return ;// TODO -// if ( view() ->isVerticalSliderPressed () ) return ; // TODO + if (isMultiPopupMode()) return ; +// if (view() ->isHorizontalSliderPressed()) return ;// TODO +// if (view() ->isVerticalSliderPressed ()) return ; // TODO hidePopup(); /* emit signal to have parent hide this if this is popup . */ - if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) { + if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(0, 0)) { emit hideChildPopup(); } } @@ -1390,7 +1390,7 @@ hidePopup(); /* emit signal to have parent hide this if this is popup . */ - if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( mrg, 0 ) ) { + if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(mrg, 0)) { emit hideChildPopup(); } } @@ -1406,7 +1406,7 @@ hidePopup(); /* emit signal to have parent hide this if this is popup . */ - if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, mrg ) ) { + if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(0, mrg)) { emit hideChildPopup(); } } @@ -1419,7 +1419,7 @@ hidePopup(); /* emit signal to have parent hide this if this is popup . */ - if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) { + if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(0, 0)) { emit hideChildPopup(); } } @@ -1427,7 +1427,7 @@ /*---------------------------------------------------*/ /* This slot is called when mouse moves onto the URL */ /* private slot */ -void KitaHTMLPart::slotOnURL( const QString& url ) +void KitaHTMLPart::slotOnURL(const QString& url) { /* config */ @@ -1435,37 +1435,37 @@ /*----------------------------*/ - if ( isMultiPopupMode() ) return ; + if (isMultiPopupMode()) return ; slotDeletePopup(); - if ( url.isEmpty() ) return ; - if ( url.left( 7 ) == "mailto:" ) return ; + if (url.isEmpty()) return ; + if (url.left(7) == "mailto:") return ; /* Is Kita active now ? */ - if( ViewMediator::getInstance()->isKitaActive() == false ) return; + if(ViewMediator::getInstance()->isKitaActive() == false) return; /* get reference */ QString refstr; KUrl datURL = m_datURL; - if ( url.at( 0 ) == '#' ) { - refstr = url.mid( 1 ); + if (url.at(0) == '#') { + refstr = url.mid(1); } else { - datURL = Kita::getDatURL( KUrl( m_datURL, url ) , refstr ); + datURL = Kita::getDatURL(KUrl(m_datURL, url) , refstr); } /*------------------------*/ /* id popup */ - if ( url.left( 6 ) == "#idpop" ) { - int num = Kita::DatManager::getNumByID( m_datURL, url.mid( 6 ) ); + if (url.left(6) == "#idpop") { + int num = Kita::DatManager::getNumByID(m_datURL, url.mid(6)); QString tmpstr; - if ( num >= 2 ) { - tmpstr = QString( "
ID:%1:[%2]
" ).arg( url.mid( 6 ) ).arg( num ); + if (num >= 2) { + tmpstr = QString("
ID:%1:[%2]
").arg(url.mid(6)).arg(num); } else { - tmpstr = "
" + i18n( "None" ) + "
"; + tmpstr = "
" + i18n("None") + "
"; } - showPopup( m_datURL, tmpstr ); + showPopup(m_datURL, tmpstr); return ; } @@ -1473,17 +1473,17 @@ /*------------------------*/ /* show reffered num */ - if ( refstr.left( 5 ) == "write" ) { - int no = refstr.mid( 5 ).toInt(); + if (refstr.left(5) == "write") { + int no = refstr.mid(5).toInt(); int num = 0; - Kita::DatManager::getTreeByRes( m_datURL, no, num ); + Kita::DatManager::getTreeByRes(m_datURL, no, num); QString tmpstr; - if ( num ) { - tmpstr = QString( "
No.%1 : [%2]
" ).arg( no ).arg( num ); + if (num) { + tmpstr = QString("
No.%1 : [%2]
").arg(no).arg(num); } else { - tmpstr = "
" + i18n( "None" ) + "
"; + tmpstr = "
" + i18n("None") + "
"; } - showPopup( m_datURL, tmpstr ); + showPopup(m_datURL, tmpstr); return ; } @@ -1491,10 +1491,10 @@ /*------------------------*/ /* abone */ - if ( url.left( 6 ) == "#abone" ) { - int no = url.mid( 6 ).toInt(); - QString tmpstr = Kita::DatManager::getHtml( m_datURL, no, no, false ); - showPopup( m_datURL, tmpstr ); + if (url.left(6) == "#abone") { + int no = url.mid(6).toInt(); + QString tmpstr = Kita::DatManager::getHtml(m_datURL, no, no, false); + showPopup(m_datURL, tmpstr); return ; } @@ -1505,15 +1505,15 @@ int refNum; int refNum2; - int i = refstr.indexOf( "-" ); - if ( i != -1 ) { /* >>refNum-refNum2 */ + int i = refstr.indexOf("-"); + if (i != -1) { /* >>refNum-refNum2 */ - refNum = refstr.left( i ).toInt(); - refNum2 = refstr.mid( i + 1 ).toInt(); + refNum = refstr.left(i).toInt(); + refNum2 = refstr.mid(i + 1).toInt(); - if ( refNum ) { - if ( refNum2 < refNum ) refNum2 = refNum; - if ( refNum2 - refNum > maxpopup - 1 ) refNum2 = refNum + maxpopup - 1; + if (refNum) { + if (refNum2 < refNum) refNum2 = refNum; + if (refNum2 - refNum > maxpopup - 1) refNum2 = refNum + maxpopup - 1; } } else { /* >>refNum */ @@ -1522,28 +1522,28 @@ } /* another thread ? */ - if ( datURL.host() != m_datURL.host() || datURL.path() != m_datURL.path() ) { + if (datURL.host() != m_datURL.host() || datURL.path() != m_datURL.path()) { /* get board name */ - QString boardName = Kita::BoardManager::boardName( datURL ); - if ( !boardName.isEmpty() ) innerHTML += '[' + boardName + "] "; + QString boardName = Kita::BoardManager::boardName(datURL); + if (!boardName.isEmpty()) innerHTML += '[' + boardName + "] "; /* If idx file of datURL is not read, thread name cannot be obtained. so, create DatInfo if cache exists, and read idx file in DatInfo::DatInfo(). */ - Kita::DatManager::getDatInfoPointer( datURL ); + Kita::DatManager::getDatInfoPointer(datURL); /* get thread Name */ - QString subName = Kita::DatManager::threadName( datURL ); - if ( !subName.isEmpty() ) innerHTML += subName + "

"; + QString subName = Kita::DatManager::threadName(datURL); + if (!subName.isEmpty()) innerHTML += subName + "

"; - if ( !refNum ) refNum = refNum2 = 1; + if (!refNum) refNum = refNum2 = 1; } /* get HTML and show it */ - if ( !refNum ) return ; - innerHTML += Kita::DatManager::getHtml( datURL, refNum, refNum2 ); + if (!refNum) return ; + innerHTML += Kita::DatManager::getHtml(datURL, refNum, refNum2); - if ( !innerHTML.isEmpty() ) showPopup( datURL, innerHTML ); + if (!innerHTML.isEmpty()) showPopup(datURL, innerHTML); } @@ -1552,7 +1552,7 @@ then show res popup. */ /* private */ bool KitaHTMLPart::showSelectedDigitPopup() { - if ( !hasSelection() ) return false; + if (!hasSelection()) return false; QString linkstr; int refNum; @@ -1560,10 +1560,10 @@ const QChar *chpt = selectText.unicode(); unsigned int length = selectText.length(); - if ( ( refNum = Kita::stringToPositiveNum( chpt, length ) ) != -1 ) { - QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum ); - if ( !innerHTML.isEmpty() ) { - showPopup( m_datURL, innerHTML ); + if ((refNum = Kita::stringToPositiveNum(chpt, length)) != -1) { + QString innerHTML = Kita::DatManager::getHtml(m_datURL, refNum, refNum); + if (!innerHTML.isEmpty()) { + showPopup(m_datURL, innerHTML); startMultiPopup(); return true; } Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -26,7 +26,7 @@ }; /* ID of user defined event */ -#define EVENT_GotoAnchor ( QEvent::User + 100 ) +#define EVENT_GotoAnchor (QEvent::User + 100) class KitaDomTree; class KUrl; @@ -80,26 +80,26 @@ public: - KitaHTMLPart( QWidget* parent ); + KitaHTMLPart(QWidget* parent); ~KitaHTMLPart(); - bool setup( int mode , const KUrl& url ); + bool setup(int mode , const KUrl& url); /* rendering */ - void showResponses( int startnum, int endnum ); - void parseResponses( int startnum, int endnum ); + void showResponses(int startnum, int endnum); + void parseResponses(int startnum, int endnum); void showAll(); - void updateScreen( bool showHeaderEtc, bool clock ); - void setInnerHTML( const QString& innerHTML ); + void updateScreen(bool showHeaderEtc, bool clock); + void setInnerHTML(const QString& innerHTML); /* cache */ - bool load( int centerNum ); - bool reload( int jumpNum ); + bool load(int centerNum); + bool reload(int jumpNum); /* goto anchor */ - bool gotoAnchor( const QString& anc, bool pushPosition ); + bool gotoAnchor(const QString& anc, bool pushPosition); /* search */ - bool findText( const QString &query, bool reverse ); + bool findText(const QString &query, bool reverse); /* popup */ bool isPopupVisible(); @@ -122,12 +122,12 @@ /* res popup */ void slotDeletePopup(); - void slotShowResPopup( QPoint point, int refNum, int refNum2 ); + void slotShowResPopup(QPoint point, int refNum, int refNum2); private: void clearPart(); - void redrawHTMLPart( const KUrl& datURL, bool force ); + void redrawHTMLPart(const KUrl& datURL, bool force); /* setup */ void connectSignals(); @@ -138,24 +138,24 @@ QString getCurrentIDofNode(); /* popup menu */ - void showPopupMenu( const KUrl& kurl ); + void showPopupMenu(const KUrl& kurl); /* click */ - void clickAnchor( const KUrl& urlin ); - void showWritePopupMenu( const QString& refstr ); - void showIDPopup( const QString& refstr ); - void showBePopupMenu( const QString& refstr ); + void clickAnchor(const KUrl& urlin); + void showWritePopupMenu(const QString& refstr); + void showIDPopup(const QString& refstr); + void showBePopupMenu(const QString& refstr); /* search */ void findTextInit(); /* res popup */ - void showPopup( const KUrl& url, const QString& innerHTML ); - void showPopupCore( const KUrl& url, const QString& innerHTML, QPoint point ); + void showPopup(const KUrl& url, const QString& innerHTML); + void showPopupCore(const KUrl& url, const QString& innerHTML, QPoint point); bool startMultiPopup(); bool isMultiPopupMode(); void hidePopup(); - bool isUnderMouse( int mrgwd, int mrght ); + bool isUnderMouse(int mrgwd, int mrght); bool showSelectedDigitPopup(); KitaHTMLPart(const KitaHTMLPart&); @@ -164,23 +164,23 @@ protected: /* user event */ - virtual void customEvent( QEvent * e ); + virtual void customEvent(QEvent * e); /* mouse event */ - virtual void khtmlMousePressEvent( khtml::MousePressEvent* e ); + virtual void khtmlMousePressEvent(khtml::MousePressEvent* e); private slots: /* click */ - void slotOpenURLRequest( const KUrl&, const KParts::OpenUrlArguments& ); + void slotOpenURLRequest(const KUrl&, const KParts::OpenUrlArguments&); /* res popup */ void slotLeave(); void slotVSliderReleased(); void slotHSliderReleased(); void slotHideChildPopup(); - void slotOnURL( const QString& url ); + void slotOnURL(const QString& url); signals: @@ -211,8 +211,8 @@ public: - GotoAnchorEvent( const QString& anc ) - : QEvent( QEvent::Type( EVENT_GotoAnchor ) ), m_anc( anc ) {}; + GotoAnchorEvent(const QString& anc) + : QEvent(QEvent::Type(EVENT_GotoAnchor)), m_anc(anc) {}; const QString& getAnc() const { return m_anc; } }; Modified: kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -15,37 +15,37 @@ #include -KitaHTMLView::KitaHTMLView( KHTMLPart* part, QWidget *parent ) - : KHTMLView( part, parent ) +KitaHTMLView::KitaHTMLView(KHTMLPart* part, QWidget *parent) + : KHTMLView(part, parent) {} KitaHTMLView::~KitaHTMLView() {} -void KitaHTMLView::leaveEvent( QEvent* ) +void KitaHTMLView::leaveEvent(QEvent*) { emit leave(); } /* protected */ -void KitaHTMLView::keyPressEvent( QKeyEvent* e ) +void KitaHTMLView::keyPressEvent(QKeyEvent* e) { - if ( e->key() == Qt::Key_Space || e->key() == Qt::Key_PageDown - || e->key() == Qt::Key_Down || e->key() == Qt::Key_End ) { - if ( emitPushDown() ) return ; + if (e->key() == Qt::Key_Space || e->key() == Qt::Key_PageDown + || e->key() == Qt::Key_Down || e->key() == Qt::Key_End) { + if (emitPushDown()) return ; } - KHTMLView::keyPressEvent( e ); + KHTMLView::keyPressEvent(e); } /* protected */ -void KitaHTMLView::wheelEvent( QWheelEvent * e ) +void KitaHTMLView::wheelEvent(QWheelEvent * e) { - if ( e->delta() < 0 ) { /* scroll down */ - if ( emitPushDown() ) return ; + if (e->delta() < 0) { /* scroll down */ + if (emitPushDown()) return ; } - KHTMLView::wheelEvent( e ); + KHTMLView::wheelEvent(e); } /* private */ @@ -53,7 +53,7 @@ { int y = contentsY(); - if ( y >= contentsHeight() - visibleHeight() ) { + if (y >= contentsHeight() - visibleHeight()) { emit pushDown(); /* to KitaHTMLPart in order to call slotClickTugi100 */ return true; } Modified: kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/kitaui/htmlview.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -20,12 +20,12 @@ { Q_OBJECT public: - KitaHTMLView( KHTMLPart* part, QWidget *parent ); + KitaHTMLView(KHTMLPart* part, QWidget *parent); ~KitaHTMLView(); protected: - void leaveEvent( QEvent* ); - void keyPressEvent( QKeyEvent* e ); - void wheelEvent( QWheelEvent * e ); + void leaveEvent(QEvent*); + void keyPressEvent(QKeyEvent* e); + void wheelEvent(QWheelEvent * e); private: bool emitPushDown(); Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -12,30 +12,30 @@ using namespace Kita; -ListViewItem::ListViewItem( Q3ListView *parent, Q3ListViewItem *after, +ListViewItem::ListViewItem(Q3ListView *parent, Q3ListViewItem *after, QString label1, QString label2, QString label3, QString label4, - QString label5, QString label6, QString label7, QString label8 ) - : K3ListViewItem( parent, after, label1, label2, label3, label4, label5, label6, label7, label8 ) + QString label5, QString label6, QString label7, QString label8) + : K3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { init(); } -ListViewItem::ListViewItem( Q3ListViewItem *parent, Q3ListViewItem *after, +ListViewItem::ListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, QString label1, QString label2, QString label3, QString label4, - QString label5, QString label6, QString label7, QString label8 ) - : K3ListViewItem( parent, after, label1, label2, label3, label4, label5, label6, label7, label8 ) + QString label5, QString label6, QString label7, QString label8) + : K3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { init(); } -ListViewItem::ListViewItem( Q3ListView* parent, QString label1, QString label2 ) - : K3ListViewItem( parent, label1, label2 ) +ListViewItem::ListViewItem(Q3ListView* parent, QString label1, QString label2) + : K3ListViewItem(parent, label1, label2) { init(); } -ListViewItem::ListViewItem( Q3ListViewItem* parent, QString label1, QString label2 ) - : K3ListViewItem( parent, label1, label2 ) +ListViewItem::ListViewItem(Q3ListViewItem* parent, QString label1, QString label2) + : K3ListViewItem(parent, label1, label2) { init(); } @@ -52,18 +52,18 @@ } /* public */ -void ListViewItem::setColor( QColor textColor, QColor baseColor ) +void ListViewItem::setColor(QColor textColor, QColor baseColor) { m_textPalette = textColor; m_basePalette = baseColor; } /* public */ /* virtual */ -void ListViewItem::paintCell( QPainter *p, const QColorGroup &cg, - int column, int width, int align ) +void ListViewItem::paintCell(QPainter *p, const QColorGroup &cg, + int column, int width, int align) { -/* QColorGroup colorGroup( cg ); - colorGroup.setColor( QColorGroup::Text, m_textPalette ); - colorGroup.setColor( QColorGroup::Base, m_basePalette );*/ // TODO - K3ListViewItem::paintCell( p, cg, column, width, align ); +/* QColorGroup colorGroup(cg); + colorGroup.setColor(QColorGroup::Text, m_textPalette); + colorGroup.setColor(QColorGroup::Base, m_basePalette);*/ // TODO + K3ListViewItem::paintCell(p, cg, column, width, align); } Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -22,26 +22,26 @@ public: - ListViewItem( Q3ListView *parent, Q3ListViewItem *after, + ListViewItem(Q3ListView *parent, Q3ListViewItem *after, QString, QString = QString(), QString = QString(), QString = QString(), QString = QString(), QString = QString(), - QString = QString(), QString = QString() ); + QString = QString(), QString = QString()); - ListViewItem( Q3ListViewItem *parent, Q3ListViewItem *after, + ListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, QString, QString = QString(), QString = QString(), QString = QString(), QString = QString(), QString = QString(), - QString = QString(), QString = QString() ); + QString = QString(), QString = QString()); - explicit ListViewItem( Q3ListView* parent, QString = QString(), QString = QString() ); + explicit ListViewItem(Q3ListView* parent, QString = QString(), QString = QString()); - explicit ListViewItem( Q3ListViewItem* parent, QString = QString(), QString = QString() ); + explicit ListViewItem(Q3ListViewItem* parent, QString = QString(), QString = QString()); ~ListViewItem(); - void setColor( QColor textColor, QColor baseColor ); - virtual void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ); + void setColor(QColor textColor, QColor baseColor); + virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align); private: void init(); Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -40,17 +40,17 @@ /*--------------------------------------------------------------*/ -KitaTabWidgetBase::KitaTabWidgetBase( QWidget* parent, Qt::WFlags f ) - : KTabWidget( parent, f ) +KitaTabWidgetBase::KitaTabWidgetBase(QWidget* parent, Qt::WFlags f) + : KTabWidget(parent, f) { - connect( this, SIGNAL( currentChanged ( QWidget * ) ), - SLOT( slotCurrentChanged ( QWidget * ) ) ); + connect(this, SIGNAL(currentChanged (QWidget *)), + SLOT(slotCurrentChanged (QWidget *))); setupActions(); - if ( parent ) { + if (parent) { /* setup part manager */ - m_manager = new KParts::PartManager( parent, this ); - m_manager->addManagedTopLevelWidget( parent ); + m_manager = new KParts::PartManager(parent, this); + m_manager->addManagedTopLevelWidget(parent); } else { m_manager = 0; } @@ -60,11 +60,11 @@ KitaTabWidgetBase::~KitaTabWidgetBase() { /* romove parts */ - if ( m_manager && !( m_manager->parts().isEmpty() ) ) { + if (m_manager && !(m_manager->parts().isEmpty())) { KParts::Part * part; - while ( ( part = m_manager->parts().first() ) != 0 ) { - m_manager->removePart( part ); - removePage( part->widget() ); + while ((part = m_manager->parts().first()) != 0) { + m_manager->removePart(part); + removePage(part->widget()); delete part; } } @@ -73,71 +73,71 @@ /* remove widgets which don't belong to parts */ QWidget* view = currentWidget(); - while ( count() > 0 && view ) { - removePage( view ); + while (count() > 0 && view) { + removePage(view); delete view; view = currentWidget(); } } /* public slot */ -void KitaTabWidgetBase::slotCurrentChanged( QWidget * w ) +void KitaTabWidgetBase::slotCurrentChanged(QWidget * w) { - if ( m_manager == 0 ) return ; - if ( w == 0 ) return ; + if (m_manager == 0) return ; + if (w == 0) return ; w->activateWindow(); w->setFocus(); - KParts::Part* part = findPartFromWidget( w ); - if ( part ) { - m_manager->setActivePart( part ); + KParts::Part* part = findPartFromWidget(w); + if (part) { + m_manager->setActivePart(part); } } /* close num-th tab */ /* see also customEvent */ /* public slot */ -void KitaTabWidgetBase::slotCloseTab( int num ) +void KitaTabWidgetBase::slotCloseTab(int num) { - CloseTabEvent * e = new CloseTabEvent( num ); - QApplication::postEvent( this, e ); // Qt will delete it when done + CloseTabEvent * e = new CloseTabEvent(num); + QApplication::postEvent(this, e); // Qt will delete it when done } /* Calling deleteWidget in the child part will be the cause of crash. So you need to call deleteWidget via custom event. */ /* protected */ /* virtual */ -void KitaTabWidgetBase::customEvent( QEvent * e ) +void KitaTabWidgetBase::customEvent(QEvent * e) { - if ( e->type() == EVENT_CloseTab ) { - deleteWidget ( widget( static_cast< CloseTabEvent* >( e ) ->getIndex() ) ); + if (e->type() == EVENT_CloseTab) { + deleteWidget (widget(static_cast< CloseTabEvent* >(e) ->getIndex())); } } /* protected */ /* virtual */ -void KitaTabWidgetBase::deleteWidget( QWidget* w ) +void KitaTabWidgetBase::deleteWidget(QWidget* w) { - if ( w == 0 ) return ; + if (w == 0) return ; - removePage( w ); - KParts::Part* part = findPartFromWidget( w ); - if ( part ) m_manager->removePart( part ); + removePage(w); + KParts::Part* part = findPartFromWidget(w); + if (part) m_manager->removePart(part); delete w; } /* protected */ -KParts::Part* KitaTabWidgetBase::findPartFromWidget( QWidget* w ) +KParts::Part* KitaTabWidgetBase::findPartFromWidget(QWidget* w) { - if ( w == 0 ) return 0; - if ( m_manager == 0 ) return 0; - if ( m_manager->parts().isEmpty() ) return 0; + if (w == 0) return 0; + if (m_manager == 0) return 0; + if (m_manager->parts().isEmpty()) return 0; KParts::Part *part; QList::const_iterator it = m_manager->parts().begin(); - while ( ( part = ( *it ) ) != 0 ) { - if ( part->widget() == w ) return part; + while ((part = (*it)) != 0) { + if (part->widget() == w) return part; ++it; } @@ -151,10 +151,10 @@ /* private */ void KitaTabWidgetBase::setupActions() { - actionCollection() ->associateWidget( this ); + actionCollection() ->associateWidget(this); - QString str = i18n( "Configure S&hortcuts..." ); + QString str = i18n("Configure S&hortcuts..."); KAction* tab_configkeys_action = actionCollection()->addAction("tab_configkeys"); tab_configkeys_action->setText(str); connect(tab_configkeys_action, SIGNAL(triggered()), this, SLOT(slotConfigureKeys())); @@ -198,8 +198,8 @@ void KitaTabWidgetBase::slotConfigureKeys() { QString str = "Tab Actions"; - KShortcutsDialog dlg( KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed, this ); - dlg.addCollection( actionCollection(), str ); + KShortcutsDialog dlg(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed, this); + dlg.addCollection(actionCollection(), str); dlg.configure(); } @@ -209,10 +209,10 @@ { int max = count(); int curpage = currentIndex(); - if ( max <= 1 ) return ; + if (max <= 1) return ; - if ( curpage == 0 ) setCurrentIndex( max - 1 ); - else setCurrentIndex( curpage - 1 ); + if (curpage == 0) setCurrentIndex(max - 1); + else setCurrentIndex(curpage - 1); } /* public slot */ @@ -220,70 +220,70 @@ { int max = count(); int curpage = currentIndex(); - if ( max <= 1 ) return ; + if (max <= 1) return ; - if ( curpage == max - 1 ) setCurrentIndex( 0 ); - else setCurrentIndex( curpage + 1 ); + if (curpage == max - 1) setCurrentIndex(0); + else setCurrentIndex(curpage + 1); } /* see also customEvent */ /* public slot */ void KitaTabWidgetBase::slotCloseCurrentTab() { - slotCloseTab( currentIndex() ); + slotCloseTab(currentIndex()); } /* see also customEvent */ /* public slot */ -void KitaTabWidgetBase::slotCloseOtherTab( int idx ) +void KitaTabWidgetBase::slotCloseOtherTab(int idx) { int max = count(); - if ( max == 0 ) return ; - if ( idx == -1 ) idx = currentIndex(); + if (max == 0) return ; + if (idx == -1) idx = currentIndex(); int i = 0; - while ( i < max && i != idx ) { - slotCloseTab( 0 ); + while (i < max && i != idx) { + slotCloseTab(0); i++; } i++; - while ( i < max ) { - slotCloseTab( 1 ); + while (i < max) { + slotCloseTab(1); i++; } } /* see also customEvent */ /* public slot */ -void KitaTabWidgetBase::slotCloseRightTab( int idx ) +void KitaTabWidgetBase::slotCloseRightTab(int idx) { int max = count(); - if ( max == 0 ) return ; - if ( idx == -1 ) idx = currentIndex(); + if (max == 0) return ; + if (idx == -1) idx = currentIndex(); int i, i2; i = i2 = idx + 1; - while ( i < max ) { - slotCloseTab( i2 ); + while (i < max) { + slotCloseTab(i2); i++; } } /* see also customEvent */ /* public slot */ -void KitaTabWidgetBase::slotCloseLeftTab( int idx ) +void KitaTabWidgetBase::slotCloseLeftTab(int idx) { int max = count(); - if ( max == 0 ) return ; - if ( idx == -1 ) idx = currentIndex(); + if (max == 0) return ; + if (idx == -1) idx = currentIndex(); int i = 0; - while ( i < max && i != idx ) { - slotCloseTab( 0 ); + while (i < max && i != idx) { + slotCloseTab(0); i++; } } @@ -293,12 +293,12 @@ void KitaTabWidgetBase::slotCloseAllTab() { int max = count(); - if ( max == 0 ) return ; + if (max == 0) return ; int i = 0; - while ( i < max ) { - slotCloseTab( 0 ); + while (i < max) { + slotCloseTab(0); i++; } } Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -32,10 +32,10 @@ } /* ID of user defined event */ -#define EVENT_CloseTab ( QEvent::User + 100 ) -#define EVENT_ShowDock ( QEvent::User + 101 ) -#define EVENT_FitImageToWinEvent ( QEvent::User + 102 ) -#define EVENT_CancelMoszicEvent ( QEvent::User + 103 ) +#define EVENT_CloseTab (QEvent::User + 100) +#define EVENT_ShowDock (QEvent::User + 101) +#define EVENT_FitImageToWinEvent (QEvent::User + 102) +#define EVENT_CancelMoszicEvent (QEvent::User + 103) @@ -51,18 +51,18 @@ public: - explicit KitaTabWidgetBase( QWidget* parent = 0, Qt::WFlags f = 0 ); + explicit KitaTabWidgetBase(QWidget* parent = 0, Qt::WFlags f = 0); virtual ~KitaTabWidgetBase(); public slots: - void slotCurrentChanged( QWidget* w ); - void slotCloseTab( int num ); + void slotCurrentChanged(QWidget* w); + void slotCloseTab(int num); protected: - virtual void customEvent( QEvent * e ); - virtual void deleteWidget( QWidget* w ); - KParts::Part* findPartFromWidget( QWidget* w ); + virtual void customEvent(QEvent * e); + virtual void deleteWidget(QWidget* w); + KParts::Part* findPartFromWidget(QWidget* w); /*------------------------------------*/ /* common tab actions */ @@ -77,9 +77,9 @@ void slotPrevTab(); void slotNextTab(); void slotCloseCurrentTab(); - void slotCloseOtherTab( int idx = -1 ); - void slotCloseRightTab( int idx = -1 ); - void slotCloseLeftTab( int idx = -1 ); + void slotCloseOtherTab(int idx = -1); + void slotCloseRightTab(int idx = -1); + void slotCloseLeftTab(int idx = -1); void slotCloseAllTab(); }; @@ -93,8 +93,8 @@ public: - CloseTabEvent( int idx ) - : QEvent( QEvent::Type(EVENT_CloseTab) ), m_pageindex( idx ) {} + CloseTabEvent(int idx) + : QEvent(QEvent::Type(EVENT_CloseTab)), m_pageindex(idx) {} int getIndex() const { return m_pageindex; } }; @@ -106,8 +106,8 @@ bool m_force; public: - ShowDockEvent( bool activate, bool force ) : QEvent( QEvent::Type(EVENT_ShowDock) ) - , m_activate( activate ), m_force( force ) {} + ShowDockEvent(bool activate, bool force) : QEvent(QEvent::Type(EVENT_ShowDock)) + , m_activate(activate), m_force(force) {} bool getActivate() const { return m_activate; } bool getForce() const { return m_force; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -27,7 +27,7 @@ using namespace Kita; -Access::Access( const KUrl& datURL ) : m_datURL( datURL ), m_currentJob( 0 ) +Access::Access(const KUrl& datURL) : m_datURL(datURL), m_currentJob(0) { init(); } @@ -37,7 +37,7 @@ { m_readNum = 0; m_lastLine.clear(); - m_bbstype = BoardManager::type( m_datURL ); + m_bbstype = BoardManager::type(m_datURL); m_header = "HTTP/1.1 200 "; /* dummy header */ m_dataSize = 0; m_threadData.clear(); @@ -49,38 +49,38 @@ QByteArray orgData; // get cache path. - QString cachePath = Kita::Cache::getPath( m_datURL ); - if ( cachePath.isEmpty() ) { + QString cachePath = Kita::Cache::getPath(m_datURL); + if (cachePath.isEmpty()) { return; } // read cache file. - QFile file( cachePath ); - if ( file.open( QIODevice::ReadOnly ) ) { + QFile file(cachePath); + if (file.open(QIODevice::ReadOnly)) { orgData += file.readAll(); file.close(); } // set data size. - if ( orgData.isEmpty() ) return ; + if (orgData.isEmpty()) return ; m_dataSize = orgData.length(); - switch ( m_bbstype ) { + switch (m_bbstype) { case Board_2ch: case Board_MachiBBS: /* Machi BBS's data is already parsed as 2ch dat. */ { - QString tmpData = Kita::qcpToUnicode( orgData ); - QStringList tmpList = tmpData.split( '\n' ); - emit receiveData( tmpList ); + QString tmpData = Kita::qcpToUnicode(orgData); + QStringList tmpList = tmpData.split('\n'); + emit receiveData(tmpList); } break; default: /* convert data stream into 2ch dat. and emit receiveData SIGNAL. */ - emitDatLineList( orgData ); + emitDatLineList(orgData); break; } } @@ -88,18 +88,18 @@ /* write data to cache */ /* protected */ void Access::writeCacheData() { - if ( m_invalidDataReceived ) return ; - if ( m_threadData.isEmpty() ) return ; + if (m_invalidDataReceived) return ; + if (m_threadData.isEmpty()) return ; m_dataSize += m_threadData.length(); - QString cachePath = Kita::Cache::getPath( m_datURL ); - if ( !cachePath.isEmpty() ) { - FILE * fs = fopen( QFile::encodeName( cachePath ), "a" ); - if ( !fs ) return ; + QString cachePath = Kita::Cache::getPath(m_datURL); + if (!cachePath.isEmpty()) { + FILE * fs = fopen(QFile::encodeName(cachePath), "a"); + if (!fs) return ; - fwrite( m_threadData.data(), m_threadData.length(), 1, fs ); - fclose( fs ); + fwrite(m_threadData.data(), m_threadData.length(), 1, fs); + fclose(fs); } m_threadData.clear(); /* clear baffer */ @@ -107,7 +107,7 @@ } /* update cache file */ /* public */ -bool Access::getupdate( int readNum ) +bool Access::getupdate(int readNum) { /* init */ m_readNum = readNum; @@ -118,18 +118,18 @@ /* set URL of data */ QString getURL; - switch ( m_bbstype ) { + switch (m_bbstype) { case Board_MachiBBS: - getURL = Kita::getThreadURL( m_datURL ); - if ( m_readNum > 0 ) getURL += "&START=" + QString().setNum( m_readNum + 1 ); + getURL = Kita::getThreadURL(m_datURL); + if (m_readNum > 0) getURL += "&START=" + QString().setNum(m_readNum + 1); Kita::InitParseMachiBBS(); break; case Board_JBBS: - getURL = Kita::getThreadURL( m_datURL ); - getURL.replace( "read.cgi", "rawmode.cgi" ); /* adhoc... */ - if ( m_readNum > 0 ) getURL += '/' + QString().setNum( m_readNum + 1 ) + '-'; + getURL = Kita::getThreadURL(m_datURL); + getURL.replace("read.cgi", "rawmode.cgi"); /* adhoc... */ + if (m_readNum > 0) getURL += '/' + QString().setNum(m_readNum + 1) + '-'; break; default: @@ -137,110 +137,110 @@ } /* set UserAgent */ - const QString useragent = QString( "Monazilla/1.00 (Kita/%1)" ).arg( "0.200.0" ); // TODO - KIO::SlaveConfig::self() ->setConfigData( "http", - KUrl( getURL ).host(), - "UserAgent", useragent ); + const QString useragent = QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0"); // TODO + KIO::SlaveConfig::self() ->setConfigData("http", + KUrl(getURL).host(), + "UserAgent", useragent); /* create new job */ - KIO::TransferJob* job = KIO::get( getURL ); + KIO::TransferJob* job = KIO::get(getURL); m_currentJob = job; - connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - SLOT( slotReceiveThreadData( KIO::Job*, const QByteArray& ) ) ); - connect( job, SIGNAL( result( KJob* ) ), SLOT( slotThreadResult( KJob* ) ) ); + connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)), + SLOT(slotReceiveThreadData(KIO::Job*, const QByteArray&))); + connect(job, SIGNAL(result(KJob*)), SLOT(slotThreadResult(KJob*))); // use 'HTTP-Headers' metadata. - job->addMetaData( "PropagateHttpHeader", "true" ); + job->addMetaData("PropagateHttpHeader", "true"); /* resume */ - if ( m_bbstype != Board_MachiBBS + if (m_bbstype != Board_MachiBBS && m_bbstype != Board_JBBS - && m_dataSize > 0 ) { + && m_dataSize > 0) { m_firstReceive = true; /* remove first char (i.e. \n). see also slotReceiveThreadData() */ - job->addMetaData( "resume", QString::number( m_dataSize - 1 ) ); - job->addMetaData( "AllowCompressedPage", "false" ); + job->addMetaData("resume", QString::number(m_dataSize - 1)); + job->addMetaData("AllowCompressedPage", "false"); } return true; } -void Access::slotThreadResult( KJob* job ) +void Access::slotThreadResult(KJob* job) { - KIO::TransferJob *tjob = qobject_cast( job ); - if ( !tjob ) { + KIO::TransferJob *tjob = qobject_cast(job); + if (!tjob) { return; } m_currentJob = 0; - if ( tjob->error() ) { + if (tjob->error()) { tjob->ui()->setWindow(0); tjob->ui()->showErrorMessage(); } else { - m_header = tjob->queryMetaData( "HTTP-Headers" ); + m_header = tjob->queryMetaData("HTTP-Headers"); } writeCacheData(); emit finishLoad(); } -void Access::slotReceiveThreadData( KIO::Job*, const QByteArray& data ) +void Access::slotReceiveThreadData(KIO::Job*, const QByteArray& data) { QByteArray data_tmp(data); // HACK: crash when data contains '\0'. - for ( int i=0; i< data_tmp.size(); i++ ) { - if ( data_tmp[ i ] == '\0' ) data_tmp[ i ] = ' '; + for (int i=0; i< data_tmp.size(); i++) { + if (data_tmp[ i ] == '\0') data_tmp[ i ] = ' '; } - if ( m_bbstype == Board_MachiBBS - || m_bbstype == Board_JBBS ) { + if (m_bbstype == Board_MachiBBS + || m_bbstype == Board_JBBS) { - emitDatLineList( data_tmp ); + emitDatLineList(data_tmp); return ; } - /* check if received data is invalid ( or broken ). */ - if ( ( m_dataSize > 0 && responseCode() != 206 ) - || ( m_firstReceive && data_tmp[ 0 ] != '\n' ) - || ( m_dataSize == 0 && responseCode() != 200 ) - ) m_invalidDataReceived = true; + /* check if received data is invalid (or broken). */ + if ((m_dataSize > 0 && responseCode() != 206) + || (m_firstReceive && data_tmp[ 0 ] != '\n') + || (m_dataSize == 0 && responseCode() != 200) + ) m_invalidDataReceived = true; - if ( m_invalidDataReceived ) return ; + if (m_invalidDataReceived) return ; /* If this is the first call at resumption, remove LF(\n) at head. */ - if ( m_firstReceive ) { - data_tmp = data_tmp.mid( 1 ); + if (m_firstReceive) { + data_tmp = data_tmp.mid(1); } m_firstReceive = false; - emitDatLineList( data_tmp ); + emitDatLineList(data_tmp); } /* convert data stream into 2ch dat. and emit receiveData SIGNAL. */ /* private */ -void Access::emitDatLineList( const QByteArray& dataStream ) +void Access::emitDatLineList(const QByteArray& dataStream) { QList lineList; QStringList datLineList; - if ( dataStream.isEmpty() ) return ; + if (dataStream.isEmpty()) return ; bool endIsLF = false; - if ( dataStream.at( dataStream.length() - 1 ) == '\n' ) endIsLF = true; + if (dataStream.at(dataStream.length() - 1) == '\n') endIsLF = true; /* split the stream */ m_lastLine += dataStream; - lineList = m_lastLine.split( '\n' ); + lineList = m_lastLine.split('\n'); m_lastLine.clear(); /* save the last line */ - if ( !endIsLF ) { + if (!endIsLF) { QList::iterator lastit = lineList.end(); lastit--; - if ( lastit != lineList.end() ) { + if (lastit != lineList.end()) { - m_lastLine = ( *lastit ); + m_lastLine = (*lastit); lineList.removeLast(); } } @@ -249,52 +249,52 @@ /* convert lines into 2ch dat */ int count = lineList.count(); - for ( int i = 0; i < count ; ++i ) { + for (int i = 0; i < count ; ++i) { - if ( ! lineList[ i ].isEmpty() ) { + if (! lineList[ i ].isEmpty()) { QString line, line2; QByteArray ba; int nextNum = m_readNum + 1; /* convert line */ - switch ( m_bbstype ) { + switch (m_bbstype) { case Board_MachiBBS: - line = Kita::qcpToUnicode( lineList[i] ); - line2 = Kita::ParseMachiBBSOneLine( line, nextNum ); - ba = Kita::unicodeToQcp( line2 ); + line = Kita::qcpToUnicode(lineList[i]); + line2 = Kita::ParseMachiBBSOneLine(line, nextNum); + ba = Kita::unicodeToQcp(line2); break; case Board_JBBS: - line = Kita::eucToUnicode( lineList[i] ); - line2 = Kita::ParseJBBSOneLine( line, nextNum ); - ba = Kita::unicodeToEuc( line2 ); + line = Kita::eucToUnicode(lineList[i]); + line2 = Kita::ParseJBBSOneLine(line, nextNum); + ba = Kita::unicodeToEuc(line2); break; case Board_FlashCGI: - line = Kita::qcpToUnicode( lineList[i] ); - line2 = Kita::ParseFlashCGIOneLine( line ); - ba = Kita::unicodeToQcp( line2 ); + line = Kita::qcpToUnicode(lineList[i]); + line2 = Kita::ParseFlashCGIOneLine(line); + ba = Kita::unicodeToQcp(line2); break; default: - line = line2 = Kita::qcpToUnicode( lineList[i] ); + line = line2 = Kita::qcpToUnicode(lineList[i]); ba = lineList[i]; } - if ( line2.isEmpty() ) continue; + if (line2.isEmpty()) continue; /* add abone lines */ const char aboneStr[] = "abone<><><>abone<>"; - while ( nextNum > m_readNum + 1 ) { + while (nextNum > m_readNum + 1) { datLineList += aboneStr; m_threadData += aboneStr + '\n'; ++m_readNum; } /* save line */ - if ( m_bbstype == Board_MachiBBS ) m_threadData += ba + '\n'; + if (m_bbstype == Board_MachiBBS) m_threadData += ba + '\n'; else m_threadData += lineList[ i ] + '\n'; ++m_readNum; @@ -303,51 +303,51 @@ } /* call DatInfo::slotReceiveData() */ - emit receiveData( datLineList ); + emit receiveData(datLineList); } void Access::killJob() { - if ( m_currentJob ) m_currentJob->kill(); + if (m_currentJob) m_currentJob->kill(); } void Access::stopJob() { - if ( m_currentJob ) m_currentJob->kill(); /* emit result signal */ + if (m_currentJob) m_currentJob->kill(); /* emit result signal */ } int Access::serverTime() { - if ( m_currentJob ) m_header = m_currentJob->queryMetaData( "HTTP-Headers" ); - //if ( m_header.isEmpty() ) return QDateTime::currentDateTime().toTime_t(); + if (m_currentJob) m_header = m_currentJob->queryMetaData("HTTP-Headers"); + //if (m_header.isEmpty()) return QDateTime::currentDateTime().toTime_t(); // parse HTTP headers - QStringList headerList = m_header.split( '\n' ); - QRegExp regexp( "Date: (.*)" ); - QStringList dateStrList = headerList.filter( regexp ); - if ( dateStrList.isEmpty() || regexp.indexIn( dateStrList[0] ) == -1 ) { + QStringList headerList = m_header.split('\n'); + QRegExp regexp("Date: (.*)"); + QStringList dateStrList = headerList.filter(regexp); + if (dateStrList.isEmpty() || regexp.indexIn(dateStrList[0]) == -1) { // 'Date' header is not found. use current time. return QDateTime::currentDateTime().toTime_t(); } else { - return K3RFCDate::parseDate( regexp.cap( 1 ) ); + return K3RFCDate::parseDate(regexp.cap(1)); } } int Access::responseCode() { - if ( m_currentJob ) m_header = m_currentJob->queryMetaData( "HTTP-Headers" ); - //if ( m_header.isEmpty() ) return 200; + if (m_currentJob) m_header = m_currentJob->queryMetaData("HTTP-Headers"); + //if (m_header.isEmpty()) return 200; // parse HTTP headers - QStringList headerList = m_header.split( '\n' ); - QRegExp regexp( "HTTP/1\\.[01] ([0-9]+) .*" ); - QStringList dateStrList = headerList.filter( regexp ); - if ( dateStrList.isEmpty() || regexp.indexIn( dateStrList[0] ) == -1 ) { + QStringList headerList = m_header.split('\n'); + QRegExp regexp("HTTP/1\\.[01] ([0-9]+) .*"); + QStringList dateStrList = headerList.filter(regexp); + if (dateStrList.isEmpty() || regexp.indexIn(dateStrList[0]) == -1) { // invalid response - if ( m_bbstype == Board_JBBS ) return 200; /* adhoc... */ + if (m_bbstype == Board_JBBS) return 200; /* adhoc... */ return 0; } else { - return regexp.cap( 1 ).toInt(); + return regexp.cap(1).toInt(); } } @@ -368,66 +368,66 @@ // QString OfflawAccess::get() { - QString getURL = Kita::datToOfflaw( m_datURL.url() ); - KUrl kgetURL( getURL ); - kgetURL.addQueryItem( "sid", Account::getSessionID() ); + QString getURL = Kita::datToOfflaw(m_datURL.url()); + KUrl kgetURL(getURL); + kgetURL.addQueryItem("sid", Account::getSessionID()); m_threadData.clear(); m_invalidDataReceived = false; - KIO::SlaveConfig::self() ->setConfigData( "http", - KUrl( getURL ).host(), + KIO::SlaveConfig::self() ->setConfigData("http", + KUrl(getURL).host(), "UserAgent", - QString( "Monazilla/1.00 (Kita/%1)" ).arg( "0.200.0" ) ); // TODO + QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0")); // TODO - KIO::TransferJob* job = KIO::get( kgetURL, KIO::Reload, KIO::HideProgressInfo ); + KIO::TransferJob* job = KIO::get(kgetURL, KIO::Reload, KIO::HideProgressInfo); m_currentJob = job; - connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - SLOT( slotReceiveThreadData( KIO::Job*, const QByteArray& ) ) ); - connect( job, SIGNAL( result( KJob* ) ), SLOT( slotThreadResult( KJob* ) ) ); + connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)), + SLOT(slotReceiveThreadData(KIO::Job*, const QByteArray&))); + connect(job, SIGNAL(result(KJob*)), SLOT(slotThreadResult(KJob*))); // use 'HTTP-Headers' metadata. - job->addMetaData( "PropagateHttpHeader", "true" ); + job->addMetaData("PropagateHttpHeader", "true"); return QString(); /* dummy */ } -void OfflawAccess::slotThreadResult( KIO::Job* job ) +void OfflawAccess::slotThreadResult(KIO::Job* job) { m_currentJob = 0; - if ( job->error() ) { + if (job->error()) { job->ui()->setWindow(0); job->ui()->showErrorMessage(); } else { - m_header = job->queryMetaData( "HTTP-Headers" ); + m_header = job->queryMetaData("HTTP-Headers"); } - if ( !m_invalidDataReceived && !m_threadData.isEmpty() ) { + if (!m_invalidDataReceived && !m_threadData.isEmpty()) { KUrl url = m_datURL; writeCacheData(); } emit finishLoad(); } -void OfflawAccess::slotReceiveThreadData( KIO::Job*, const QByteArray& data ) +void OfflawAccess::slotReceiveThreadData(KIO::Job*, const QByteArray& data) { - Q3CString cstr( data ); + Q3CString cstr(data); - if ( ( m_dataSize > 0 && responseCode() != 206 ) - || ( m_dataSize == 0 && responseCode() != 200 ) ) { + if ((m_dataSize > 0 && responseCode() != 206) + || (m_dataSize == 0 && responseCode() != 200)) { m_invalidDataReceived = true; } - if ( m_invalidDataReceived ) return ; + if (m_invalidDataReceived) return ; // "+OK ....../1024K\tLocation:temp/\n" - if ( m_threadData.isEmpty() && cstr[ 0 ] == '+' ) { + if (m_threadData.isEmpty() && cstr[ 0 ] == '+') { // skip first line. - int index = cstr.indexOf( '\n' ); - cstr = cstr.mid( index + 1 ); + int index = cstr.indexOf('\n'); + cstr = cstr.mid(index + 1); } - emitDatLineList( cstr ); + emitDatLineList(cstr); } #include "access.moc" Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -32,7 +32,7 @@ Q_OBJECT public: - Access( const KUrl& datURL ); + Access(const KUrl& datURL); virtual ~Access() {}; void init(); @@ -41,14 +41,14 @@ void stopJob(); int serverTime(); void getcache(); - bool getupdate( int readNum ); + bool getupdate(int readNum); int responseCode(); int dataSize() const; bool invalidDataReceived() const; protected: void writeCacheData(); - void emitDatLineList( const QByteArray& dataStream ); + void emitDatLineList(const QByteArray& dataStream); const KUrl m_datURL; KIO::Job* m_currentJob; @@ -62,12 +62,12 @@ QByteArray m_lastLine; private slots: - void slotReceiveThreadData( KIO::Job* job, const QByteArray& data ); - void slotThreadResult( KJob* job ); + void slotReceiveThreadData(KIO::Job* job, const QByteArray& data); + void slotThreadResult(KJob* job); signals: - void redirection( const QString& ); - void receiveData( const QStringList& ); + void redirection(const QString&); + void receiveData(const QStringList&); void finishLoad(); private: Access(const Access&); @@ -79,14 +79,14 @@ Q_OBJECT public: - OfflawAccess( const KUrl& datURL ) : Access( datURL ) {}; + OfflawAccess(const KUrl& datURL) : Access(datURL) {}; virtual ~OfflawAccess() {}; QString get(); private slots: - void slotReceiveThreadData( KIO::Job* job, const QByteArray& data ); - void slotThreadResult( KIO::Job* job ); + void slotReceiveThreadData(KIO::Job* job, const QByteArray& data); + void slotThreadResult(KIO::Job* job); }; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -26,44 +26,44 @@ Account* Account::getInstance() { - if ( instance == 0 ) { + if (instance == 0) { instance = new Account(); } return instance; } Account::Account() - : m_isLogged( false ) + : m_isLogged(false) {} Account::~Account() {} -bool Account::login( const QString& userID, const QString& password ) +bool Account::login(const QString& userID, const QString& password) { - return getInstance() ->loginInternal( userID, password ); + return getInstance() ->loginInternal(userID, password); } -bool Account::loginInternal( const QString& userID, const QString& password ) +bool Account::loginInternal(const QString& userID, const QString& password) { - m_data.resize( 0 ); + m_data.resize(0); - KUrl url( "https://2chv.tora3.net/futen.cgi" ); - QString postData = QString( "ID=" ) + userID + QString( "&PW=" ) + password; + KUrl url("https://2chv.tora3.net/futen.cgi"); + QString postData = QString("ID=") + userID + QString("&PW=") + password; - KIO::SlaveConfig::self() ->setConfigData( "https", + KIO::SlaveConfig::self() ->setConfigData("https", url.host(), "UserAgent", - "DOLIB/1.00" ); - m_job = KIO::http_post( url, postData.toUtf8(), false ); + "DOLIB/1.00"); + m_job = KIO::http_post(url, postData.toUtf8(), false); - connect( m_job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - SLOT( slotReceiveData( KIO::Job*, const QByteArray& ) ) ); - connect( m_job, SIGNAL( result( KIO::Job* ) ), SLOT( slotResult( KIO::Job* ) ) ); - m_job->addMetaData( "customHTTPHeader", - QString( "X-2ch-UA: Kita/%1" ).arg( "0.200.0" ) ); - m_job->addMetaData( "content-type", - "Content-Type: application/x-www-form-urlencoded" ); + connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)), + SLOT(slotReceiveData(KIO::Job*, const QByteArray&))); + connect(m_job, SIGNAL(result(KIO::Job*)), SLOT(slotResult(KIO::Job*))); + m_job->addMetaData("customHTTPHeader", + QString("X-2ch-UA: Kita/%1").arg("0.200.0")); + m_job->addMetaData("content-type", + "Content-Type: application/x-www-form-urlencoded"); QEventLoop m_eventLoop; m_eventLoop.exec(); @@ -71,30 +71,30 @@ return m_isLogged; } -void Account::slotReceiveData( KIO::Job*, const QByteArray& data ) +void Account::slotReceiveData(KIO::Job*, const QByteArray& data) { - Q3CString str( data, data.size() ); + Q3CString str(data, data.size()); m_data += str; } -void Account::slotResult( KIO::Job* job ) +void Account::slotResult(KIO::Job* job) { m_job = 0; - if ( job->error() ) { + if (job->error()) { job->ui()->setWindow(0); job->ui()->showErrorMessage(); } - QString str( m_data ); - QRegExp regexp( "SESSION-ID=(.*)" ); - if ( regexp.indexIn( str ) == -1 ) { + QString str(m_data); + QRegExp regexp("SESSION-ID=(.*)"); + if (regexp.indexIn(str) == -1) { m_sessionID.clear(); m_isLogged = false; } else { - QString value = regexp.cap( 1 ); + QString value = regexp.cap(1); - QRegExp error( "^ERROR:p+$" ); - if ( error.indexIn( value ) == -1 ) { + QRegExp error("^ERROR:p+$"); + if (error.indexIn(value) == -1) { m_isLogged = true; m_sessionID = value; } else { Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -41,18 +41,18 @@ Account(); ~Account(); void enter_loop(); - bool loginInternal( const QString& userID, const QString& password ); + bool loginInternal(const QString& userID, const QString& password); static Account* getInstance(); private slots: - void slotReceiveData( KIO::Job* job, const QByteArray& data ); - void slotResult( KIO::Job* job ); + void slotReceiveData(KIO::Job* job, const QByteArray& data); + void slotResult(KIO::Job* job); private: Account(const Account&); Account& operator=(const Account&); public: static const QString& getSessionID() { return getInstance() ->m_sessionID; } static bool isLogged() { return getInstance() ->m_isLogged; } - static bool login( const QString& userID, const QString& password ); + static bool login(const QString& userID, const QString& password); }; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -40,13 +40,13 @@ /* BoardData */ -BoardData::BoardData( const QString& boardName, +BoardData::BoardData(const QString& boardName, const QString& hostname, const QString& rootPath, const QString& delimiter, const QString& bbsPath, const QString& ext, - int boardtype ) + int boardtype) { m_readIdx = false; m_boardName = boardName; @@ -57,14 +57,14 @@ m_type = boardtype; /* set hostname and create URL of board */ - setHostName( hostname ); + setHostName(hostname); /* create default key */ - QStringList keyHosts( m_hostname ); - createKeys( keyHosts ); + QStringList keyHosts(m_hostname); + createKeys(keyHosts); /* reset SETTING.TXT */ - setSettingLoaded( false ); + setSettingLoaded(false); } BoardData::~BoardData() @@ -72,17 +72,17 @@ /* public */ -void BoardData::setHostName( const QString& hostName ) +void BoardData::setHostName(const QString& hostName) { m_hostname = hostName; /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */ m_basePath = m_hostname + m_rootPath + m_bbsPath + '/'; - switch ( m_type ) { + switch (m_type) { case Board_MachiBBS: /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */ - m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + "?BBS=" + m_bbsPath.mid( 1 ); + m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + "?BBS=" + m_bbsPath.mid(1); break; /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */ @@ -103,7 +103,7 @@ } /* public */ -void BoardData::setReadIdx( bool idx ) +void BoardData::setReadIdx(bool idx) { m_readIdx = idx; } @@ -203,10 +203,10 @@ } /* public */ -void BoardData::setSettingLoaded( bool set ) +void BoardData::setSettingLoaded(bool set) { m_settingLoaded = set; - if ( ! set ) { + if (! set) { m_defaultName.clear(); m_linenum = 0; m_msgCount = 0; @@ -215,25 +215,25 @@ } /* public */ -void BoardData::setDefaultName( const QString& newName ) +void BoardData::setDefaultName(const QString& newName) { m_defaultName = newName; } /* public */ -void BoardData::setLineNum( int newLine ) +void BoardData::setLineNum(int newLine) { m_linenum = newLine; } /* public */ -void BoardData::setMsgCount( int msgCount ) +void BoardData::setMsgCount(int msgCount) { m_msgCount = msgCount; } /* public */ -void BoardData::setTitleImgURL( const KUrl& url ) +void BoardData::setTitleImgURL(const KUrl& url) { m_titleImgURL = url; } @@ -243,7 +243,7 @@ /* keys */ /* create keys of DB */ /* public */ -void BoardData::createKeys( const QStringList& keyHostList ) +void BoardData::createKeys(const QStringList& keyHostList) { /* reset keys */ m_keyBasePathList.clear(); @@ -253,22 +253,22 @@ m_keyHostList = keyHostList; /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */ - for ( int i = 0; i < m_keyHostList.count(); ++i ) { - if ( m_keyHostList[ i ].length() > 0 ) + for (int i = 0; i < m_keyHostList.count(); ++i) { + if (m_keyHostList[ i ].length() > 0) m_keyBasePathList += m_keyHostList[ i ] + m_rootPath + m_bbsPath + '/'; } - switch ( m_type ) { + switch (m_type) { case Board_MachiBBS: /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */ - for ( int i = 0; i < m_keyHostList.count(); ++i ) + for (int i = 0; i < m_keyHostList.count(); ++i) m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter - + "?BBS=" + m_bbsPath.mid( 1 ); + + "?BBS=" + m_bbsPath.mid(1); break; /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */ default: - for ( int i = 0; i < m_keyHostList.count(); ++i ) + for (int i = 0; i < m_keyHostList.count(); ++i) m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter + m_bbsPath + '/'; break; } @@ -320,10 +320,10 @@ } /* (hostname)/(rootPath)/(bbsPath)/ */ /* public */ /* static */ -const QString BoardManager::boardURL( const KUrl& url ) +const QString BoardManager::boardURL(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = getBoardData(url); + if (bdata == 0) return QString(); return bdata->basePath(); } @@ -334,74 +334,74 @@ QStringList urlList; urlList.clear(); - for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ) - urlList += ( *it ) ->basePath(); + for (BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it) + urlList += (*it) ->basePath(); return urlList; } /* (hostname)/(rootPath) */ /* public */ /* static */ -const QString BoardManager::boardRoot( const KUrl& url ) +const QString BoardManager::boardRoot(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = getBoardData(url); + if (bdata == 0) return QString(); return bdata->hostName() + bdata->rootPath(); } /* (bbspath) */ /* public */ /* static */ -const QString BoardManager::boardPath( const KUrl& url ) +const QString BoardManager::boardPath(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = getBoardData(url); + if (bdata == 0) return QString(); return bdata->bbsPath(); } /* (ext) */ /* public */ /* static */ -const QString BoardManager::ext( const KUrl& url ) +const QString BoardManager::ext(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = getBoardData(url); + if (bdata == 0) return QString(); return bdata->ext(); } /* ID of board for writing */ /* public */ /* static */ -const QString BoardManager::boardID( const KUrl& url ) +const QString BoardManager::boardID(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = getBoardData(url); + if (bdata == 0) return QString(); - return bdata->bbsPath().mid( 1 ); /* remove "/" */ + return bdata->bbsPath().mid(1); /* remove "/" */ } /* (hostname)/(rootPath)/(bbsPath)/subject.txt */ /* public */ /* static */ -const QString BoardManager::subjectURL( const KUrl& url ) +const QString BoardManager::subjectURL(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = getBoardData(url); + if (bdata == 0) return QString(); return bdata->basePath() + "subject.txt"; } /* public */ /* static */ -const QString BoardManager::boardName( const KUrl& url ) +const QString BoardManager::boardName(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = getBoardData(url); + if (bdata == 0) return QString(); return bdata->boardName(); } /* public */ /* static */ -int BoardManager::type( const KUrl& url ) +int BoardManager::type(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return Board_Unknown; + BoardData * bdata = getBoardData(url); + if (bdata == 0) return Board_Unknown; return bdata->type(); } @@ -434,20 +434,20 @@ /* output */ Q3PtrList< Thread >& threadList, - Q3PtrList< Thread >& oldLogList ) + Q3PtrList< Thread >& oldLogList) { threadList.clear(); oldLogList.clear(); /* get all obtained threads list from cache */ - if ( url.prettyUrl() == "http://virtual/obtained/" ) { + if (url.prettyUrl() == "http://virtual/obtained/") { QStringList bbslist = allBoardURLList(); /* search all cache dirs */ - for ( QStringList::iterator it = bbslist.begin() ; it != bbslist.end(); ++it ) { + for (QStringList::iterator it = bbslist.begin() ; it != bbslist.end(); ++it) { - getCachedThreadList( ( *it ), threadList ); + getCachedThreadList((*it), threadList); } return ; @@ -455,70 +455,70 @@ /*-------------------------*/ - BoardData* bdata = getBoardData( url ); - if ( bdata == 0 ) return ; + BoardData* bdata = getBoardData(url); + if (bdata == 0) return ; /* download subject.txt */ - if ( online ) { + if (online) { /* make directory */ - QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url ); - if ( !Kita::mkdir( cacheDir ) ) return ; + QString cacheDir = Cache::baseDir() + Cache::serverDir(url) + Cache::boardDir(url); + if (!Kita::mkdir(cacheDir)) return ; - KIO::SlaveConfig::self() ->setConfigData( "http", + KIO::SlaveConfig::self() ->setConfigData("http", url.host() , "UserAgent", - QString( "Monazilla/1.00 (Kita/%1)" ).arg( "0.200.0" ) ); - QString subjectPath = Cache::getSubjectPath( url ); - KIO::NetAccess::download( subjectURL( url ), subjectPath, 0 ); + QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0")); + QString subjectPath = Cache::getSubjectPath(url); + KIO::NetAccess::download(subjectURL(url), subjectPath, 0); } /* open and read subject.txt */ - readSubjectTxt( bdata, url, threadList ); + readSubjectTxt(bdata, url, threadList); /* get old logs */ - if ( oldLogs ) { + if (oldLogs) { Q3PtrList< Thread > tmpList; tmpList.clear(); - getCachedThreadList( url, tmpList ); + getCachedThreadList(url, tmpList); - for ( unsigned i = 0; i < tmpList.count(); i++ ) { + for (unsigned i = 0; i < tmpList.count(); i++) { - if ( threadList.contains( tmpList.at( i ) ) == 0 ) oldLogList.append( tmpList.at( 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, Q3PtrList< Thread >& threadList) { - QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url ); - QDir d( cacheDir ); - if ( d.exists() ) { + QString cacheDir = Cache::baseDir() + Cache::serverDir(url) + Cache::boardDir(url); + QDir d(cacheDir); + if (d.exists()) { /* get all file names */ - QString ext = BoardManager::getBoardData( url ) ->ext(); - QString boardURL = BoardManager::getBoardData( url ) ->basePath(); + QString ext = BoardManager::getBoardData(url) ->ext(); + QString boardURL = BoardManager::getBoardData(url) ->basePath(); QStringList filter('*' + ext); QStringList flist = d.entryList(filter); - for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) { - if ( ( *it ).isEmpty() ) continue; + for (QStringList::iterator it = flist.begin(); it != flist.end(); ++it) { + if ((*it).isEmpty()) continue; - QString datURL = boardURL + "dat/" + ( *it ); + QString datURL = boardURL + "dat/" + (*it); /* read idx file */ - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == 0 ) { + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread == 0) { - thread = Kita::Thread::getByURL( datURL ); - if ( thread == 0 ) continue; - ThreadIndex::loadIndex( thread, datURL, false ); + thread = Kita::Thread::getByURL(datURL); + if (thread == 0) continue; + ThreadIndex::loadIndex(thread, datURL, false); } - if ( thread != 0 ) threadList.append( thread ); + if (thread != 0) threadList.append(thread); } } } @@ -526,88 +526,88 @@ /* 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; - if ( !bdata->readIdx() ) { + if (!bdata->readIdx()) { - QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url ); - QDir d( cacheDir ); - if ( d.exists() ) { - QString ext = BoardManager::getBoardData( url ) ->ext(); + QString cacheDir = Cache::baseDir() + Cache::serverDir(url) + Cache::boardDir(url); + QDir d(cacheDir); + if (d.exists()) { + QString ext = BoardManager::getBoardData(url) ->ext(); QStringList filter('*' + ext); - cacheList = d.entryList( filter ); + cacheList = d.entryList(filter); } } /* open subject.txt */ - QString subjectPath = Cache::getSubjectPath( url ); - QIODevice * device = KFilterDev::deviceForFile( subjectPath, "application/x-gzip" ); - if ( !device->open( QIODevice::ReadOnly ) ) return false; + QString subjectPath = Cache::getSubjectPath(url); + QIODevice * device = KFilterDev::deviceForFile(subjectPath, "application/x-gzip"); + if (!device->open(QIODevice::ReadOnly)) return false; - Q3TextStream stream( device ); + Q3TextStream stream(device); - if ( BoardManager::type( url ) == Board_JBBS ) { - if ( !m_eucJpCodec ) m_eucJpCodec = QTextCodec::codecForName("eucJP"); - stream.setCodec( m_eucJpCodec ); + if (BoardManager::type(url) == Board_JBBS) { + if (!m_eucJpCodec) m_eucJpCodec = QTextCodec::codecForName("eucJP"); + stream.setCodec(m_eucJpCodec); } else { - if ( !m_cp932Codec ) m_cp932Codec = QTextCodec::codecForName("Shift-JIS"); // FIXME - stream.setCodec( m_cp932Codec ); + if (!m_cp932Codec) m_cp932Codec = QTextCodec::codecForName("Shift-JIS"); // FIXME + stream.setCodec(m_cp932Codec); } QRegExp regexp; - switch ( BoardManager::type( url ) ) { + switch (BoardManager::type(url)) { case Board_MachiBBS: case Board_JBBS: - regexp.setPattern( "(\\d+\\.cgi),(.*)\\((\\d+)\\)" ); + regexp.setPattern("(\\d+\\.cgi),(.*)\\((\\d+)\\)"); break; default: - regexp.setPattern( "(\\d+\\.dat)<>(.*)\\((\\d+)\\)" ); + regexp.setPattern("(\\d+\\.dat)<>(.*)\\((\\d+)\\)"); break; } QString line; - while ( !( line = stream.readLine() ).isEmpty() ) { - int pos = regexp.indexIn( line ); - if ( pos != -1 ) { - QString fname = regexp.cap( 1 ); - QString subject = regexp.cap( 2 ); - QString num = regexp.cap( 3 ); + while (!(line = stream.readLine()).isEmpty()) { + int pos = regexp.indexIn(line); + if (pos != -1) { + QString fname = regexp.cap(1); + QString subject = regexp.cap(2); + QString num = regexp.cap(3); /* get pointer of Thread class */ - QString datURL = boardURL( url ) + "dat/" + fname; - Kita::Thread* thread = Kita::Thread::getByURL( datURL ); - if ( threadList.find( thread ) == -1 ) { - threadList.append( thread ); + QString datURL = boardURL(url) + "dat/" + fname; + Kita::Thread* thread = Kita::Thread::getByURL(datURL); + if (threadList.find(thread) == -1) { + threadList.append(thread); } /* set thread name */ - thread->setThreadName( subject ); + thread->setThreadName(subject); /* load index file */ - if ( !bdata->readIdx() ) { + if (!bdata->readIdx()) { - if ( cacheList.contains( fname ) ) ThreadIndex::loadIndex( thread, datURL, false ); + if (cacheList.contains(fname)) ThreadIndex::loadIndex(thread, datURL, false); } /* update res num */ int newNum = num.toInt(); - if ( thread->readNum() ) { /* cache exists */ + if (thread->readNum()) { /* cache exists */ int oldNum = thread->resNum(); - if ( newNum > oldNum ) { - Kita::ThreadIndex::setResNum( datURL, newNum ); + if (newNum > oldNum) { + Kita::ThreadIndex::setResNum(datURL, newNum); } } - thread->setResNum( newNum ); + thread->setResNum(newNum); } } device->close(); - bdata->setReadIdx( true ); /* never read idx files again */ + bdata->setReadIdx(true); /* never read idx files again */ return true; } @@ -618,8 +618,8 @@ /* reset all BoardData */ /* public */ /* static */ void BoardManager::clearBoardData() { - for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ) - delete( *it ); + for (BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it) + delete(*it); m_boardDataList.clear(); m_previousBoardData = 0; @@ -648,41 +648,41 @@ * */ /* public */ /* static */ -int BoardManager::enrollBoard( const KUrl& url, const QString& boardName, QString& oldURL, int type, bool test ) +int BoardManager::enrollBoard(const KUrl& url, const QString& boardName, QString& oldURL, int type, bool test) { QString hostname; QString rootPath; QString delimiter; QString bbsPath; QString ext; - type = parseBoardURL( url, type, hostname, rootPath, delimiter, bbsPath, ext ); + type = parseBoardURL(url, type, hostname, rootPath, delimiter, bbsPath, ext); oldURL.clear(); - if ( type == Board_Unknown ) return Board_enrollFailed; + if (type == Board_Unknown) return Board_enrollFailed; /* check if the board is enrolled or moved. */ - for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ) { + for (BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it) { - if ( ( *it ) ->boardName() == boardName - && ( *it ) ->type() == type - && ( *it ) ->bbsPath() == bbsPath ) { + if ((*it) ->boardName() == boardName + && (*it) ->type() == type + && (*it) ->bbsPath() == bbsPath) { - if ( ( *it ) ->hostName() == hostname - && ( *it ) ->rootPath() == rootPath ) { /* enrolled */ + if ((*it) ->hostName() == hostname + && (*it) ->rootPath() == rootPath) { /* enrolled */ return Board_enrollEnrolled; } else { /* moved */ - oldURL = ( *it ) ->basePath(); + oldURL = (*it) ->basePath(); return Board_enrollMoved; } } } /* test only */ - if ( test ) return Board_enrollNew; + if (test) return Board_enrollNew; /* enroll new board */ - BoardData* bdata = new BoardData( boardName, hostname, rootPath, delimiter, bbsPath, ext, type ); - m_boardDataList.append( bdata ); + BoardData* bdata = new BoardData(boardName, hostname, rootPath, delimiter, bbsPath, ext, type); + m_boardDataList.append(bdata); return Board_enrollNew; } @@ -701,7 +701,7 @@ QString& rootPath, QString& delimiter, QString& bbsPath, - QString& ext ) + QString& ext) { hostname = url.protocol() + "://" + url.host(); rootPath.clear(); @@ -710,15 +710,15 @@ ext.clear(); /* decide type */ - if ( type == Board_Unknown ) { + if (type == Board_Unknown) { - if ( url.host().contains( "machi.to" ) ) type = Board_MachiBBS; - else if ( url.host().contains( "jbbs.livedoor.jp" ) ) type = Board_JBBS; + if (url.host().contains("machi.to")) type = Board_MachiBBS; + else if (url.host().contains("jbbs.livedoor.jp")) type = Board_JBBS; else type = Board_2ch; } /* parse */ - switch ( type ) { + switch (type) { case Board_MachiBBS: /* MACHI : http:// *.machi.to/(bbsPath)/ */ @@ -730,7 +730,7 @@ case Board_JBBS: /* JBBS : http://jbbs.livedoor.jp/(bbsPath)/ */ delimiter = "/bbs/read.cgi"; - bbsPath = url.prettyUrl().remove( hostname ); + bbsPath = url.prettyUrl().remove(hostname); type = Board_JBBS; ext = ".cgi"; break; @@ -739,8 +739,8 @@ delimiter = "/test/read.cgi"; bbsPath = url.fileName(); - rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' ); - if ( rootPath.length() == 0 ) rootPath.clear(); + rootPath = url.prettyUrl().remove(hostname + '/').remove(bbsPath + '/'); + if (rootPath.length() == 0) rootPath.clear(); ext = ".dat"; break; @@ -748,53 +748,53 @@ delimiter = "/test/read.cgi"; bbsPath = url.fileName(); - rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' ); - if ( rootPath.length() == 0 ) rootPath.clear(); + rootPath = url.prettyUrl().remove(hostname + '/').remove(bbsPath + '/'); + if (rootPath.length() == 0) rootPath.clear(); ext = ".dat"; type = Board_2ch; break; } /* For example, if bbsPath = "linux/", then m_bbsPath = "/linux" */ - const QRegExp exp( "/$" ); - rootPath.remove( exp ); - bbsPath.remove( exp ); - if ( !rootPath.isEmpty() && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath; - if ( !bbsPath.isEmpty() && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath; + const QRegExp exp("/$"); + rootPath.remove(exp); + bbsPath.remove(exp); + if (!rootPath.isEmpty() && rootPath.at(0) != '/') rootPath = '/' + rootPath; + if (!bbsPath.isEmpty() && bbsPath.at(0) != '/') bbsPath = '/' + bbsPath; return type; } /* public */ /* static */ -bool BoardManager::isEnrolled( const KUrl& url ) +bool BoardManager::isEnrolled(const KUrl& url) { - if ( getBoardData( url ) == 0 ) return false; + if (getBoardData(url) == 0) return false; return true; } /* public */ /* static */ -BoardData* BoardManager::getBoardData( const KUrl& url ) +BoardData* BoardManager::getBoardData(const KUrl& url) { - if ( url.isEmpty() ) return 0; + if (url.isEmpty()) return 0; QString urlstr = url.prettyUrl(); /* cache */ - if ( m_previousBoardData != 0 && m_previousBoardURL == urlstr ) return m_previousBoardData; + if (m_previousBoardData != 0 && m_previousBoardURL == urlstr) return m_previousBoardData; - for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ) { + for (BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it) { - int count = ( *it ) ->keyBasePathList().count(); - for ( int i = 0; i < count ; ++i ) { - if ( urlstr.contains( ( *it ) ->keyBasePathList() [ i ] ) - || urlstr.contains( ( *it ) ->keyCgiBasePathList() [ i ] ) ) { + int count = (*it) ->keyBasePathList().count(); + for (int i = 0; i < count ; ++i) { + if (urlstr.contains((*it) ->keyBasePathList() [ i ]) + || urlstr.contains((*it) ->keyCgiBasePathList() [ i ])) { /* cache */ - m_previousBoardData = ( *it ); + m_previousBoardData = (*it); m_previousBoardURL = urlstr; - return ( *it ); + return (*it); } } } @@ -808,7 +808,7 @@ /* BBSHISTORY */ -/* load the bbs history file ( BBSHISTORY ), and create keys of Data Base. */ +/* load the bbs history file (BBSHISTORY), and create keys of Data Base. */ /* Before calling this, enroll the board by enrollBoard(). */ /* ex) If the host of board moved like : @@ -822,26 +822,26 @@ http://aaa.com */ /* public */ /* static */ -bool BoardManager::loadBBSHistory( const KUrl& url ) +bool BoardManager::loadBBSHistory(const KUrl& url) { - BoardData * bdata = getBoardData( url ); - if ( bdata == 0 ) return false; + BoardData * bdata = getBoardData(url); + if (bdata == 0) return false; QStringList keyHosts(bdata->hostName()); - QFile file( Cache::getBBSHistoryPath( url ) ); - if ( file.open( QIODevice::ReadOnly ) ) { + QFile file(Cache::getBBSHistoryPath(url)); + if (file.open(QIODevice::ReadOnly)) { - Q3TextStream ts( &file ); + Q3TextStream ts(&file); QString line; - while ( !ts.eof() ) { + while (!ts.eof()) { line = ts.readLine(); keyHosts += line; } - bdata->createKeys( keyHosts ); + bdata->createKeys(keyHosts); file.close(); return true; @@ -852,28 +852,28 @@ /* public */ /* static */ -bool BoardManager::moveBoard( const KUrl& fromURL, const KUrl& toURL ) +bool BoardManager::moveBoard(const KUrl& fromURL, const KUrl& toURL) { QString oldhost = fromURL.protocol() + "://" + fromURL.host(); QString newhost = toURL.protocol() + "://" + toURL.host(); - const QRegExp exp( "/$" ); + const QRegExp exp("/$"); QString oldURL = fromURL.prettyUrl(); QString newURL = toURL.prettyUrl(); - oldURL.remove( exp ); - newURL.remove( exp ); + oldURL.remove(exp); + newURL.remove(exp); oldURL += '/'; newURL += '/'; - if ( oldURL == newURL ) return false; + if (oldURL == newURL) return false; /* Is oldURL enrolled? */ - BoardData* bdata = getBoardData( oldURL ); - if ( bdata == 0 ) { + BoardData* bdata = getBoardData(oldURL); + if (bdata == 0) { /* Is newURL enrolled? */ - bdata = getBoardData( newURL ); - if ( bdata == 0 ) return false; + bdata = getBoardData(newURL); + if (bdata == 0) return false; } @@ -881,16 +881,16 @@ /* update BoardData */ /* get the path of old cache */ - bdata->setHostName( oldhost ); + bdata->setHostName(oldhost); QStringList keyHosts = bdata->keyHostList(); - keyHosts.removeOne( oldhost ); - keyHosts.prepend( oldhost ); - bdata->createKeys( keyHosts ); - QString oldCachePath = Cache::baseDir() + Cache::serverDir( bdata->basePath() ) - + Cache::boardDir( bdata->basePath() ); + keyHosts.removeOne(oldhost); + keyHosts.prepend(oldhost); + bdata->createKeys(keyHosts); + QString oldCachePath = Cache::baseDir() + Cache::serverDir(bdata->basePath()) + + Cache::boardDir(bdata->basePath()); /* update URL */ - bdata->setHostName( newhost ); + bdata->setHostName(newhost); /* update keys */ /* The order of keyHosts will be like this: @@ -902,49 +902,49 @@ */ keyHosts = bdata->keyHostList(); - keyHosts.removeOne( oldhost ); - keyHosts.prepend( oldhost ); - keyHosts.removeOne( newhost ); - keyHosts.prepend( newhost ); - bdata->createKeys( keyHosts ); + keyHosts.removeOne(oldhost); + keyHosts.prepend(oldhost); + keyHosts.removeOne(newhost); + keyHosts.prepend(newhost); + bdata->createKeys(keyHosts); /* reset BoardData */ - bdata->setReadIdx( false ); - bdata->setSettingLoaded( false ); + bdata->setReadIdx(false); + bdata->setSettingLoaded(false); /*---------------------------*/ /* move cache dir */ QDir qdir; - if ( ! qdir.exists( oldCachePath ) ) return true; + if (! qdir.exists(oldCachePath)) return true; /* mkdir new server dir */ - QString newCachePath = Cache::baseDir() + Cache::serverDir( bdata->basePath() ); - Kita::mkdir( newCachePath ); + QString newCachePath = Cache::baseDir() + Cache::serverDir(bdata->basePath()); + Kita::mkdir(newCachePath); /* backup old dir */ - newCachePath += Cache::boardDir( bdata->basePath() ); - if ( qdir.exists ( newCachePath ) ) { + newCachePath += Cache::boardDir(bdata->basePath()); + if (qdir.exists (newCachePath)) { QString bkupPath = newCachePath; - bkupPath.truncate( bkupPath.length() - 1 ); /* remove '/' */ - bkupPath += '.' + QString().setNum( QDateTime::currentDateTime().toTime_t() ); - qdir.rename( newCachePath, bkupPath ); + bkupPath.truncate(bkupPath.length() - 1); /* remove '/' */ + bkupPath += '.' + QString().setNum(QDateTime::currentDateTime().toTime_t()); + qdir.rename(newCachePath, bkupPath); } /* move cache dir */ - if ( qdir.exists( oldCachePath ) ) { - qdir.rename( oldCachePath, newCachePath ); - } else Kita::mkdir( newCachePath ); + if (qdir.exists(oldCachePath)) { + qdir.rename(oldCachePath, newCachePath); + } else Kita::mkdir(newCachePath); /* make old dir */ - if ( ! qdir.exists( oldCachePath ) ) { - Kita::mkdir( oldCachePath ); + if (! qdir.exists(oldCachePath)) { + Kita::mkdir(oldCachePath); /* create BBS_MOVED */ QString movedPath = oldCachePath + "/BBS_MOVED"; - QFile file( movedPath ); - if ( file.open( QIODevice::WriteOnly ) ) { - Q3TextStream stream( &file ); + QFile file(movedPath); + if (file.open(QIODevice::WriteOnly)) { + Q3TextStream stream(&file); stream << newURL << endl; } file.close(); @@ -953,14 +953,14 @@ /*---------------------------*/ /* update BBSHISTRY */ - QFile file( Cache::getBBSHistoryPath( bdata->basePath() ) ); - if ( file.open( QIODevice::WriteOnly ) ) { + QFile file(Cache::getBBSHistoryPath(bdata->basePath())); + if (file.open(QIODevice::WriteOnly)) { - Q3TextStream ts( &file ); + Q3TextStream ts(&file); - keyHosts.removeOne( newhost ); - for ( QStringList::iterator it = keyHosts.begin() ; it != keyHosts.end(); ++it ) { - ts << ( *it ) << endl; + keyHosts.removeOne(newhost); + for (QStringList::iterator it = keyHosts.begin() ; it != keyHosts.end(); ++it) { + ts << (*it) << endl; } file.close(); @@ -969,10 +969,10 @@ /*---------------------------*/ /* update other information */ - FavoriteThreads::replace( oldURL, newURL ); - Kita::Thread::replace( oldURL, newURL ); - KitaThreadInfo::replace( oldURL, newURL ); - Kita::FavoriteBoards::replace( oldURL, newURL ); + FavoriteThreads::replace(oldURL, newURL); + Kita::Thread::replace(oldURL, newURL); + KitaThreadInfo::replace(oldURL, newURL); + Kita::FavoriteBoards::replace(oldURL, newURL); return true; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -74,16 +74,16 @@ QStringList m_keyCgiBasePathList; public: - BoardData( const QString& boardName, const QString& hostname, + BoardData(const QString& boardName, const QString& hostname, const QString& rootPath, const QString& delimiter, - const QString& bbsPath, const QString& ext, int boardtype ); + const QString& bbsPath, const QString& ext, int boardtype); ~BoardData(); - void setHostName( const QString& hostname ); + void setHostName(const QString& hostname); /* information */ bool readIdx() const; - void setReadIdx( bool idx ); + void setReadIdx(bool idx); const QString& boardName() const; const QString& hostName() const; const QString& rootPath() const; @@ -102,14 +102,14 @@ int lineNum() const; int msgCount() const; const KUrl& titleImgURL() const; - void setSettingLoaded( bool set ); - void setDefaultName( const QString& newName ); - void setLineNum( int newLine ); - void setMsgCount( int msgCount ); - void setTitleImgURL( const KUrl& url ); + void setSettingLoaded(bool set); + void setDefaultName(const QString& newName); + void setLineNum(int newLine); + void setMsgCount(int msgCount); + void setTitleImgURL(const KUrl& url); /* keys */ - void createKeys( const QStringList& keyHostList ); + void createKeys(const QStringList& keyHostList); const QStringList& keyHostList() const; const QStringList& keyBasePathList() const; const QStringList& keyCgiBasePathList() const; @@ -135,46 +135,46 @@ BoardManager(); ~BoardManager(); - static const QString boardURL( const KUrl& url ); + static const QString boardURL(const KUrl& url); static const QStringList allBoardURLList(); - static const QString boardRoot( const KUrl& url ); - static const QString boardPath( const KUrl& url ); - static const QString ext( const KUrl& url ); - static const QString boardID( const KUrl& url ); - static const QString subjectURL( const KUrl& url ); - static const QString boardName( const KUrl& url ); - static int type( const KUrl& url ); + static const QString boardRoot(const KUrl& url); + static const QString boardPath(const KUrl& url); + static const QString ext(const KUrl& url); + static const QString boardID(const KUrl& url); + static const QString subjectURL(const KUrl& url); + static const QString boardName(const KUrl& url); + static int type(const KUrl& url); /* ThreadList */ - static void getThreadList( const KUrl& url, bool oldLogs, bool online, - Q3PtrList< Thread >& threadList, Q3PtrList< Thread >& oldLogList ); + static void getThreadList(const KUrl& url, bool oldLogs, bool online, + Q3PtrList< Thread >& threadList, Q3PtrList< Thread >& oldLogList); /* BoardData */ static void clearBoardData(); - static int enrollBoard( const KUrl& url, const QString& boardName, QString& oldURL, - int type = Board_Unknown, bool test = false ); - static bool isEnrolled( const KUrl& url ); - static BoardData* getBoardData( const KUrl& url ); + static int enrollBoard(const KUrl& url, const QString& boardName, QString& oldURL, + int type = Board_Unknown, bool test = false); + static bool isEnrolled(const KUrl& url); + static BoardData* getBoardData(const KUrl& url); /* BBSHISTORY */ - static bool loadBBSHistory( const KUrl& url ); - static bool moveBoard( const KUrl& fromURL, const KUrl& toURL ); + static bool loadBBSHistory(const KUrl& url); + static bool moveBoard(const KUrl& fromURL, const KUrl& toURL); private: /* BoardData */ - static int parseBoardURL( const KUrl& url, int type, QString& hostname, + static int parseBoardURL(const KUrl& url, int type, QString& hostname, QString& rootPath, QString& delimiter, - QString& bbsPath, QString& ext ); + QString& bbsPath, QString& ext); /* 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 */ - static BoardData* openSettingTxt( const KUrl& url ); + static BoardData* openSettingTxt(const KUrl& url); }; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -20,52 +20,52 @@ QString Cache::baseDir() { - QString dir = KGlobal::dirs() ->saveLocation( "cache", "kita" ); - if ( dir[ dir.length() - 1 ] != '/' ) + QString dir = KGlobal::dirs() ->saveLocation("cache", "kita"); + if (dir[ dir.length() - 1 ] != '/') dir += '/'; return dir; } -QString Cache::serverDir( const KUrl& url ) +QString Cache::serverDir(const KUrl& url) { /* Is board enrolled ? */ - BoardData * bdata = BoardManager::getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = BoardManager::getBoardData(url); + if (bdata == 0) return QString(); QString root = bdata->hostName() + bdata->rootPath(); - return root.remove( "http://" ).replace( '/', '_' ) + '/'; + return root.remove("http://").replace('/', '_') + '/'; } -QString Cache::boardDir( const KUrl& url ) +QString Cache::boardDir(const KUrl& url) { /* Is board enrolled ? */ - BoardData * bdata = BoardManager::getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData * bdata = BoardManager::getBoardData(url); + if (bdata == 0) return QString(); QString bbs = bdata->bbsPath(); - return bbs.mid( 1 ).replace( '/', '_' ) + '/'; + return bbs.mid(1).replace('/', '_') + '/'; } -QString Cache::getPath( const KUrl& url ) +QString Cache::getPath(const KUrl& url) { - QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isEmpty() ) return QString(); + QString path = baseDir() + serverDir(url) + boardDir(url); + if (path.isEmpty()) return QString(); - // qDebug( "%s -> %s",url.prettyUrl().ascii(),path.ascii()); + // qDebug("%s -> %s",url.prettyUrl().ascii(),path.ascii()); return path + url.fileName(); } -QString Cache::getIndexPath( const KUrl& url ) +QString Cache::getIndexPath(const KUrl& url) { - QString path = getPath( url ); - if ( path.isEmpty() ) { + QString path = getPath(url); + if (path.isEmpty()) { return QString(); } else { return path + ".idx"; @@ -78,28 +78,28 @@ /* public */ -QString Cache::getSettingPath( const KUrl& url ) +QString Cache::getSettingPath(const KUrl& url) { - QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isEmpty() ) return QString(); + QString path = baseDir() + serverDir(url) + boardDir(url); + if (path.isEmpty()) return QString(); return path + "SETTING.TXT"; } /* public */ -QString Cache::getBBSHistoryPath( const KUrl& url ) +QString Cache::getBBSHistoryPath(const KUrl& url) { - QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isEmpty() ) return QString(); + QString path = baseDir() + serverDir(url) + boardDir(url); + if (path.isEmpty()) return QString(); return path + "BBSHISTORY"; } /* public */ -QString Cache::getSubjectPath( const KUrl& url ) +QString Cache::getSubjectPath(const KUrl& url) { - QString path = baseDir() + serverDir( url ) + boardDir( url ); - if ( path.isEmpty() ) return QString(); + QString path = baseDir() + serverDir(url) + boardDir(url); + if (path.isEmpty()) return QString(); return path + "subject.txt"; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/cache.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/cache.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,14 +24,14 @@ { public: static QString baseDir(); - static QString serverDir( const KUrl& url ); - static QString boardDir( const KUrl& url ); + static QString serverDir(const KUrl& url); + static QString boardDir(const KUrl& url); - static QString getPath( const KUrl& url ); - static QString getIndexPath( const KUrl& url ); - static QString getSettingPath( const KUrl& url ); - static QString getBBSHistoryPath( const KUrl& url ); - static QString getSubjectPath( const KUrl& url ); + static QString getPath(const KUrl& url); + static QString getIndexPath(const KUrl& url); + static QString getSettingPath(const KUrl& url); + static QString getBBSHistoryPath(const KUrl& url); + static QString getSubjectPath(const KUrl& url); }; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -36,47 +36,47 @@ /*------------------------------------------------------*/ /* DatInfo stores & handles all information about *.dat */ -DatInfo::DatInfo( const KUrl& url ) : m_access ( 0 ), m_access2( 0 ) +DatInfo::DatInfo(const KUrl& url) : m_access (0), m_access2(0) { QString refstr; - m_datURL = Kita::getDatURL( url, refstr ); + m_datURL = Kita::getDatURL(url, refstr); /* get the pointer of Thread class */ - m_thread = Kita::Thread::getByURLNew( m_datURL ); - if ( m_thread == 0 ) { + m_thread = Kita::Thread::getByURLNew(m_datURL); + if (m_thread == 0) { /* create Thread */ - m_thread = Kita::Thread::getByURL( m_datURL ); - if ( m_thread == 0 ) return ; + m_thread = Kita::Thread::getByURL(m_datURL); + if (m_thread == 0) return ; /* read idx file */ - ThreadIndex::loadIndex( m_thread, m_datURL ); + ThreadIndex::loadIndex(m_thread, m_datURL); } - m_thread = Thread::getByURL( m_datURL ); + m_thread = Thread::getByURL(m_datURL); /* japanese strings */ -#if KDE_IS_VERSION( 3, 3, 0 ) - m_spacestr = Kita::utf8ToUnicode( KITAUTF8_ZENSPACE ); +#if KDE_IS_VERSION(3, 3, 0) + m_spacestr = Kita::utf8ToUnicode(KITAUTF8_ZENSPACE); #else m_spacestr = ". "; #endif - m_framestr1 = Kita::utf8ToUnicode( KITAUTF8_FRAME1 ); /* | */ - m_framestr2 = Kita::utf8ToUnicode( KITAUTF8_FRAME2 ); /* |- */ - m_framestr3 = Kita::utf8ToUnicode( KITAUTF8_FRAME3 ); /* L */ + m_framestr1 = Kita::utf8ToUnicode(KITAUTF8_FRAME1); /* | */ + m_framestr2 = Kita::utf8ToUnicode(KITAUTF8_FRAME2); /* |- */ + m_framestr3 = Kita::utf8ToUnicode(KITAUTF8_FRAME3); /* L */ /* make directory */ - QString cacheDir = Cache::baseDir() + Cache::serverDir( m_datURL ) + Cache::boardDir( m_datURL ); - if ( !Kita::mkdir( cacheDir ) ) return ; + QString cacheDir = Cache::baseDir() + Cache::serverDir(m_datURL) + Cache::boardDir(m_datURL); + if (!Kita::mkdir(cacheDir)) return ; initPrivate( true /* load cache */ - ); + ); } DatInfo::~DatInfo() { - initPrivate( false ); + initPrivate(false); } @@ -84,11 +84,11 @@ /* Usually, don't call this. */ /* public */ void DatInfo::init() { - return initPrivate( true ); + return initPrivate(true); } /* Init. If loadCache = true, load data from cache. */ /* private */ -void DatInfo::initPrivate( bool loadCache ) +void DatInfo::initPrivate(bool loadCache) { /* stop & delete dat loader */ deleteAccessJob(); @@ -100,35 +100,35 @@ /* clear ResDatVec */ m_resDatVec.clear(); - increaseResDatVec( RESDAT_DEFAULTSIZE ); + increaseResDatVec(RESDAT_DEFAULTSIZE); /* reset Abone */ resetAbonePrivate(); /* create dat loader */ - m_access = new Kita::Access( m_datURL ); + m_access = new Kita::Access(m_datURL); - connect( m_access, SIGNAL( receiveData( const QStringList& ) ), - SLOT( slotReceiveData( const QStringList& ) ) ); - connect( m_access, SIGNAL( finishLoad() ), SLOT( slotFinishLoad() ) ); + connect(m_access, SIGNAL(receiveData(const QStringList&)), + SLOT(slotReceiveData(const QStringList&))); + connect(m_access, SIGNAL(finishLoad()), SLOT(slotFinishLoad())); - if ( !loadCache ) return ; + if (!loadCache) return ; /* reset ReadNum before loading cache. */ /* ReadNum & subject are updated by Access::getcache() */ - m_thread->setReadNum( 0 ); + m_thread->setReadNum(0); /* get dat from cahce */ /* slotReceiveData() is called from Access::getcache() */ m_access->getcache(); /* save up-to-date thread information */ - ThreadIndex::saveIndex( m_thread, m_datURL ); + ThreadIndex::saveIndex(m_thread, m_datURL); } /* private */ -void DatInfo::resetResDat( RESDAT& resdat ) +void DatInfo::resetResDat(RESDAT& resdat) { resdat.num = 0; resdat.parsed = false; @@ -141,24 +141,24 @@ /* private */ -void DatInfo::increaseResDatVec( int delta ) +void DatInfo::increaseResDatVec(int delta) { int size = m_resDatVec.size(); RESDAT resdat; - resetResDat( resdat ); - m_resDatVec.resize( size + delta, resdat ); + resetResDat(resdat); + m_resDatVec.resize(size + delta, resdat); } /* delete dat loader */ /* private */ void DatInfo::deleteAccessJob() { - if ( m_access ) { + if (m_access) { m_access->killJob(); delete m_access; m_access = 0; } - if ( m_access2 ) { + if (m_access2) { m_access2->killJob(); delete m_access2; m_access2 = 0; @@ -184,20 +184,20 @@ /* When Kita::Access fineshed loading, slotFinishLoad is called, and DatInfo emits the finishLoad signal to the parent object */ /* public */ -bool DatInfo::updateCache( const QObject* parent ) +bool DatInfo::updateCache(const QObject* parent) { - if ( m_access == 0 ) return false; - if ( m_nowLoading ) return false; + if (m_access == 0) return false; + if (m_nowLoading) return false; m_nowLoading = true; - connect( this, SIGNAL( receiveData() ), - parent, SLOT( slotReceiveData() ) ); + connect(this, SIGNAL(receiveData()), + parent, SLOT(slotReceiveData())); - connect( this, SIGNAL( finishLoad() ), - parent, SLOT( slotFinishLoad() ) ); + connect(this, SIGNAL(finishLoad()), + parent, SLOT(slotFinishLoad())); - m_access->getupdate( m_thread->readNum() ); + m_access->getupdate(m_thread->readNum()); return true; } @@ -205,18 +205,18 @@ /* slot called when Kita::Access received new data */ /* private slot */ -void DatInfo::slotReceiveData( const QStringList& lineList ) +void DatInfo::slotReceiveData(const QStringList& lineList) { int rescode = m_access->responseCode(); - if ( m_access2 ) { + if (m_access2) { rescode = m_access2->responseCode(); } - if ( rescode != 200 && rescode != 206 ) return ; + if (rescode != 200 && rescode != 206) return ; /* copy lines to buffer */ int count = lineList.count(); - for ( int i = 0; i < count ; ++i ) copyOneLineToResDat( lineList[ i ] ); + for (int i = 0; i < count ; ++i) copyOneLineToResDat(lineList[ i ]); emit receiveData(); } @@ -224,44 +224,44 @@ /* copy one line to resdat. See also DatInfo::slotReceiveData() */ /* private */ -bool DatInfo::copyOneLineToResDat( const QString& line ) +bool DatInfo::copyOneLineToResDat(const QString& line) { - if ( line.isEmpty() ) return false; + if (line.isEmpty()) return false; /* update ReadNum */ const int num = m_thread->readNum() + 1; - m_thread->setReadNum( num ); + m_thread->setReadNum(num); /* If resdat vector is short, then resize the vector. */ - while ( ( int ) m_resDatVec.size() <= num ) increaseResDatVec( RESDAT_DELTA ); + while ((int) m_resDatVec.size() <= num) increaseResDatVec(RESDAT_DELTA); /* reset ResDat */ RESDAT& resdat = m_resDatVec[ num ]; - resetResDat( resdat ); + resetResDat(resdat); resdat.num = num; resdat.linestr = line; /* get subject */ - if ( num == 1 ) parseDat( num ); + if (num == 1) parseDat(num); /* search all responses which are responsed by this line. */ - if ( Kita::Config::checkResponsed() ) { + if (Kita::Config::checkResponsed()) { - if ( parseDat( num ) && !checkAbonePrivate( num ) ) { /* parse line here to get AncList */ + if (parseDat(num) && !checkAbonePrivate(num)) { /* parse line here to get AncList */ const int maxRange = 10; AncList& anclist = m_resDatVec[ num ].anclist; - for ( AncList::iterator it = anclist.begin(); it != anclist.end(); ++it ) { + for (AncList::iterator it = anclist.begin(); it != anclist.end(); ++it) { - int fromNum = ( *it ).from; - int toNum = qMin( num - 1, ( *it ).to ); - if ( toNum - fromNum + 1 > maxRange ) continue; + int fromNum = (*it).from; + int toNum = qMin(num - 1, (*it).to); + if (toNum - fromNum + 1 > maxRange) continue; - for ( int i = fromNum; i <= toNum; ++i ) { + for (int i = fromNum; i <= toNum; ++i) { - if ( !checkAbonePrivate( i ) ) m_resDatVec[ i ].isResponsed = true; + if (!checkAbonePrivate(i)) m_resDatVec[ i ].isResponsed = true; } } } @@ -276,16 +276,16 @@ void DatInfo::slotFinishLoad() { /* save thread information */ - ThreadIndex::saveIndex( m_thread, m_datURL ); + ThreadIndex::saveIndex(m_thread, m_datURL); /* re-try by offlaw.cgi */ - if ( m_thread->readNum() == 0 && m_access2 == 0 && DatManager::is2chThread( m_datURL ) ) { - if ( Account::isLogged() ) { - initPrivate( true ); - m_access2 = new OfflawAccess( m_datURL ); - connect( m_access2, SIGNAL( receiveData( const QStringList& ) ), - SLOT( slotReceiveData( const QStringList& ) ) ); - connect( m_access2, SIGNAL( finishLoad() ), SLOT( slotFinishLoad() ) ); + if (m_thread->readNum() == 0 && m_access2 == 0 && DatManager::is2chThread(m_datURL)) { + if (Account::isLogged()) { + initPrivate(true); + m_access2 = new OfflawAccess(m_datURL); + connect(m_access2, SIGNAL(receiveData(const QStringList&)), + SLOT(slotReceiveData(const QStringList&))); + connect(m_access2, SIGNAL(finishLoad()), SLOT(slotFinishLoad())); m_access2->get(); return ; } @@ -295,15 +295,15 @@ emit finishLoad(); /* disconnect signals */ - disconnect( SIGNAL( receiveData() ) ); - disconnect( SIGNAL( finishLoad() ) ); + disconnect(SIGNAL(receiveData())); + disconnect(SIGNAL(finishLoad())); } /* public */ int DatInfo::getResponseCode() { - if ( m_access == 0 ) return 0; + if (m_access == 0) return 0; return m_access->responseCode(); } @@ -312,7 +312,7 @@ /* public */ int DatInfo::getServerTime() { - if ( m_access == 0 ) return 0; + if (m_access == 0) return 0; return m_access->serverTime(); } @@ -321,9 +321,9 @@ /* public */ bool DatInfo::deleteCache() { - if ( m_nowLoading ) return false; + if (m_nowLoading) return false; - initPrivate( false ); + initPrivate(false); return true; } @@ -345,8 +345,8 @@ It will cause deadlock , because Kita::Access::stopJob() calls KitaHTMLPart::slotFinishLoad() back, then KitaHTMLPart::slotFinishLoad() calls another functions in DatInfo. */ - if ( m_access == 0 ) return ; - if ( ! m_nowLoading ) return ; + if (m_access == 0) return ; + if (! m_nowLoading) return ; m_access->stopJob(); } @@ -356,51 +356,51 @@ /* They are public */ -QString DatInfo::getDat( int num ) +QString DatInfo::getDat(int num) { - if ( !parseDat( num ) ) return QString(); + if (!parseDat(num)) return QString(); return m_resDatVec[ num ].linestr; } -QString DatInfo::getId( int num ) +QString DatInfo::getId(int num) { - if ( !parseDat( num ) ) return QString(); + if (!parseDat(num)) return QString(); return m_resDatVec[ num ].id; } /* plain strings of name */ -QString DatInfo::getPlainName( int num ) +QString DatInfo::getPlainName(int num) { - if ( !parseDat( num ) ) return QString(); + if (!parseDat(num)) return QString(); return m_resDatVec[ num ].name; } /* plain strings of title */ -QString DatInfo::getPlainTitle( int num ) +QString DatInfo::getPlainTitle(int num) { - if ( !parseDat( num ) ) return QString(); + if (!parseDat(num)) return QString(); QString titleHTML; - Kita::createTitleHTML( m_resDatVec[ num ], titleHTML ); + Kita::createTitleHTML(m_resDatVec[ num ], titleHTML); QString retStr; - Kita::DatToText( titleHTML, retStr ); + Kita::DatToText(titleHTML, retStr); return retStr; } /* plain strings of body */ -QString DatInfo::getPlainBody( int num ) +QString DatInfo::getPlainBody(int num) { - if ( !parseDat( num ) ) return QString(); + if (!parseDat(num)) return QString(); QString retStr; - Kita::DatToText( m_resDatVec[ num ].bodyHTML, retStr ); + Kita::DatToText(m_resDatVec[ num ].bodyHTML, retStr); return retStr; } @@ -414,9 +414,9 @@ return values are defined in datinfo.h. */ /* public */ -int DatInfo::getHTML( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML ) +int DatInfo::getHTML(int num, bool checkAbone, QString& titleHTML, QString& bodyHTML) { - return getHTMLPrivate( num, checkAbone, titleHTML, bodyHTML ); + return getHTMLPrivate(num, checkAbone, titleHTML, bodyHTML); } /** @@ -432,26 +432,26 @@ * @retval KITA_HTML_NORMAL The res dat is normal. * */ -int DatInfo::getHTMLPrivate( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML ) +int DatInfo::getHTMLPrivate(int num, bool checkAbone, QString& titleHTML, QString& bodyHTML) { - if ( !parseDat( num ) ) return KITA_HTML_NOTPARSED; + if (!parseDat(num)) return KITA_HTML_NOTPARSED; - bool abone = checkAbone & checkAbonePrivate( num ); + bool abone = checkAbone & checkAbonePrivate(num); RESDAT& resdat = m_resDatVec[ num ]; - if ( abone ) { - titleHTML = QString().setNum( num ) + ' ' + i18n( "Abone" ); - bodyHTML = "
"; - bodyHTML += i18n( "Abone" ) + ""; + if (abone) { + titleHTML = QString().setNum(num) + ' ' + i18n("Abone"); + bodyHTML = ""; + bodyHTML += i18n("Abone") + ""; return KITA_HTML_ABONE; - } else if ( resdat.broken ) { - titleHTML = QString().setNum( num ) + ' ' + i18n( "Broken" ); - bodyHTML = i18n( "Broken" ); + } else if (resdat.broken) { + titleHTML = QString().setNum(num) + ' ' + i18n("Broken"); + bodyHTML = i18n("Broken"); return KITA_HTML_BROKEN; } else { - createTitleHTML( resdat, titleHTML ); + createTitleHTML(resdat, titleHTML); bodyHTML = resdat.bodyHTML; return KITA_HTML_NORMAL; @@ -461,14 +461,14 @@ /* get HTML strings from startnum to endnum. return value is HTML strings */ /* public */ -QString DatInfo::getHTMLString( int startnum, int endnum, bool checkAbone ) +QString DatInfo::getHTMLString(int startnum, int endnum, bool checkAbone) { QString retHTML; - for ( int num = startnum; num <= endnum; num++ ) { + for (int num = startnum; num <= endnum; num++) { QString html; - getHTMLofOneRes( num, checkAbone, html ); + getHTMLofOneRes(num, checkAbone, html); retHTML += html; } @@ -477,20 +477,20 @@ /* return HTML strings that have ID = strid. */ /* public */ -QString DatInfo::getHtmlByID( const QString& strid, int &count ) +QString DatInfo::getHtmlByID(const QString& strid, int &count) { QString retHTML; count = 0; - for ( int i = 1; i <= m_thread->readNum(); i++ ) { + for (int i = 1; i <= m_thread->readNum(); i++) { - if ( !parseDat( i ) ) continue; + if (!parseDat(i)) continue; - if ( m_resDatVec[ i ].id == strid ) { + if (m_resDatVec[ i ].id == strid) { count ++; QString html; - getHTMLofOneRes( i, true, html ); + getHTMLofOneRes(i, true, html); retHTML += html; } } @@ -508,13 +508,13 @@ * @param[out] html * */ -void DatInfo::getHTMLofOneRes( int num, bool checkAbone, QString& html ) +void DatInfo::getHTMLofOneRes(int num, bool checkAbone, QString& html) { html.clear(); QString titleHTML, bodyHTML; - if ( getHTMLPrivate( num, checkAbone, titleHTML, bodyHTML ) == KITA_HTML_NOTPARSED ) return ; + if (getHTMLPrivate(num, checkAbone, titleHTML, bodyHTML) == KITA_HTML_NOTPARSED) return ; - if ( m_resDatVec[ num ].isResponsed ) titleHTML.replace( "" + titleHTML + "
"; html += "
" + bodyHTML + "
"; } @@ -532,9 +532,9 @@ |-->>20, and return count = 3. */ /* Note that this function checks Abone internally. */ /* public */ -QString DatInfo::getTreeByRes( const int rootnum, int& count ) +QString DatInfo::getTreeByRes(const int rootnum, int& count) { - return getTreeByResPrivate( rootnum, false, count ); + return getTreeByResPrivate(rootnum, false, count); } /*---------------------------------------*/ @@ -548,9 +548,9 @@ |-->>6, and returns count = 3. */ /* Note that this function checks Abone internally. */ /* public */ -QString DatInfo::getTreeByResReverse( const int rootnum, int& count ) +QString DatInfo::getTreeByResReverse(const int rootnum, int& count) { - return getTreeByResPrivate( rootnum, true, count ); + return getTreeByResPrivate(rootnum, true, count); } @@ -558,13 +558,13 @@ QString DatInfo::getTreeByResPrivate( const int rootnum, bool reverse, /* reverse search */ - int& count ) + int& count) { - QString tmp = QString().setNum( rootnum ); + QString tmp = QString().setNum(rootnum); QString retstr = "
>>" + tmp + "
"; - retstr += getTreeByResCore( rootnum, reverse, count, "" ); + retstr += getTreeByResCore(rootnum, reverse, count, ""); return retstr; } @@ -573,54 +573,54 @@ QString DatInfo::getTreeByResCore( const int rootnum, bool reverse, /* reverse search */ - int& count, QString prestr ) + int& count, QString prestr) { - if ( !parseDat( rootnum ) ) return QString(); - if ( checkAbonePrivate( rootnum ) ) return QString(); + if (!parseDat(rootnum)) return QString(); + if (checkAbonePrivate(rootnum)) return QString(); QString retstr; count = 0; QStringList strlists; - if ( !reverse ) { + if (!reverse) { /* collect responses that have anchor to rootnum */ - for ( int i = rootnum + 1; i <= m_thread->readNum(); i++ ) { - if ( checkAbonePrivate( i ) ) continue; - if ( checkRes( i, rootnum ) ) { + for (int i = rootnum + 1; i <= m_thread->readNum(); i++) { + if (checkAbonePrivate(i)) continue; + if (checkRes(i, rootnum)) { count ++; - strlists += QString().setNum( i ); + strlists += QString().setNum(i); } } } else { /* collect responses for which rootnum has anchors */ AncList& anclist = m_resDatVec[ rootnum ].anclist; - for ( AncList::iterator it = anclist.begin(); it != anclist.end(); ++it ) { - for ( int i = ( *it ).from; i <= qMin( rootnum - 1, ( *it ).to ) ; i++ ) { - if ( checkAbonePrivate( i ) ) continue; + for (AncList::iterator it = anclist.begin(); it != anclist.end(); ++it) { + for (int i = (*it).from; i <= qMin(rootnum - 1, (*it).to) ; i++) { + if (checkAbonePrivate(i)) continue; count ++; - strlists += QString().setNum( i ); + strlists += QString().setNum(i); } } } /* make HTML document */ - if ( count ) { + if (count) { - for ( QStringList::iterator it = strlists.begin(); it != strlists.end(); ++it ) { + for (QStringList::iterator it = strlists.begin(); it != strlists.end(); ++it) { QString tmpstr; - if ( ( *it ) == strlists.last() ) tmpstr = m_framestr3; /* 'L' */ + if ((*it) == strlists.last()) tmpstr = m_framestr3; /* 'L' */ else tmpstr = m_framestr2; /* '|-' */ - retstr += prestr + tmpstr + ">>" + ( *it ) + "
"; + retstr += prestr + tmpstr + ">>" + (*it) + "
"; /* call myself recursively */ int tmpnum; tmpstr = prestr; - if ( ( *it ) == strlists.last() ) tmpstr += m_spacestr + m_spacestr + m_spacestr; /* " " */ + if ((*it) == strlists.last()) tmpstr += m_spacestr + m_spacestr + m_spacestr; /* " " */ else tmpstr += m_framestr1 + m_spacestr; /* "| " */ - retstr += getTreeByResCore( ( *it ).toInt(), reverse, tmpnum, tmpstr ); + retstr += getTreeByResCore((*it).toInt(), reverse, tmpnum, tmpstr); count += tmpnum; } } @@ -635,16 +635,16 @@ /* For exsample, if target = 4, and No.num have an anchor >>4, or >>2-6, etc., then return true. */ /* private */ -bool DatInfo::checkRes( const int num, const int target ) +bool DatInfo::checkRes(const int num, const int target) { const int range = 20; - if ( !parseDat( num ) ) return false; + if (!parseDat(num)) return false; AncList& anclist = m_resDatVec[ num ].anclist; - for ( AncList::iterator it = anclist.begin(); it != anclist.end(); ++it ) { - if ( ( *it ).to - ( *it ).from > range ) continue; - if ( target >= ( *it ).from && target <= ( *it ).to ) return true; + for (AncList::iterator it = anclist.begin(); it != anclist.end(); ++it) { + if ((*it).to - (*it).from > range) continue; + if (target >= (*it).from && target <= (*it).to) return true; } return false; @@ -675,16 +675,16 @@ /* return number of responses that have ID = strid. */ /* Note that this function checks Abone internally. */ /* public */ -int DatInfo::getNumByID( const QString& strid ) +int DatInfo::getNumByID(const QString& strid) { int count = 0; - for ( int i = 1; i <= m_thread->readNum(); i++ ) { + for (int i = 1; i <= m_thread->readNum(); i++) { - if ( !parseDat( i ) ) continue; - if ( checkAbonePrivate( i ) ) continue; + if (!parseDat(i)) continue; + if (checkAbonePrivate(i)) continue; - if ( m_resDatVec[ i ].id == strid ) count++; + if (m_resDatVec[ i ].id == strid) count++; } return count; @@ -694,86 +694,86 @@ /* public */ int DatInfo::getDatSize() { - if ( m_access == 0 ) return 0; + if (m_access == 0) return 0; return m_access->dataSize(); } /* public */ -bool DatInfo::isResponsed( int num ) const +bool DatInfo::isResponsed(int num) const { return m_resDatVec[ num ].isResponsed; } /* public */ -bool DatInfo::isResValid( int num ) +bool DatInfo::isResValid(int num) { - return parseDat( num ); + return parseDat(num); } /* public */ bool DatInfo::isBroken() { - if ( m_broken ) return m_broken; + if (m_broken) return m_broken; - if ( m_access == 0 ) return false; + if (m_access == 0) return false; int rescode = m_access->responseCode(); bool invalid = m_access->invalidDataReceived(); /* see also Access::slotReceiveThreadData() */ - if ( invalid && ( rescode == 200 || rescode == 206 ) ) return true; + if (invalid && (rescode == 200 || rescode == 206)) return true; /* maybe "Dat Ochi" */ return false; } /* public */ -bool DatInfo::isResBroken( int num ) +bool DatInfo::isResBroken(int num) { - if ( !parseDat( num ) ) return false; + if (!parseDat(num)) return false; return m_resDatVec[ num ].broken; } /* ID = strid ? */ /* public */ -bool DatInfo::checkID( const QString& strid, int num ) +bool DatInfo::checkID(const QString& strid, int num) { - if ( !parseDat( num ) ) return false; + if (!parseDat(num)) return false; - if ( m_resDatVec[ num ].id == strid ) return true; + if (m_resDatVec[ num ].id == strid) return true; return false; } /* Are keywords included ? */ /* public */ -bool DatInfo::checkWord( QStringList& stlist, /* list of keywords */ +bool DatInfo::checkWord(QStringList& stlist, /* list of keywords */ int num, bool checkOR /* AND or OR search */ - ) + ) { - if ( !parseDat( num ) ) return false; + if (!parseDat(num)) return false; QString str_text = m_resDatVec[ num ].bodyHTML; - for ( QStringList::iterator it = stlist.begin(); it != stlist.end(); ++it ) { + for (QStringList::iterator it = stlist.begin(); it != stlist.end(); ++it) { - QRegExp regexp( ( *it ) ); -// regexp.setCaseSensitive( false ); // TODO + QRegExp regexp((*it)); +// regexp.setCaseSensitive(false); // TODO - if ( checkOR ) { /* OR */ - if ( str_text.indexOf( regexp, 0 ) != -1 ) { + if (checkOR) { /* OR */ + if (str_text.indexOf(regexp, 0) != -1) { return true; } } else { /* AND */ - if ( str_text.indexOf( regexp, 0 ) == -1 ) return false; + if (str_text.indexOf(regexp, 0) == -1) return false; } } - if ( checkOR ) return false; + if (checkOR) return false; return true; } @@ -798,58 +798,58 @@ /* private */ void DatInfo::resetAbonePrivate() { - for ( int i = 1; i < ( int ) m_resDatVec.size(); i++ ) m_resDatVec[ i ].checkAbone = false; + for (int i = 1; i < (int) m_resDatVec.size(); i++) m_resDatVec[ i ].checkAbone = false; - m_aboneByID = ( ! Kita::AboneConfig::aboneIDList().empty() ); - m_aboneByName = ( ! Kita::AboneConfig::aboneNameList().empty() ); - m_aboneByBody = ( ! Kita::AboneConfig::aboneWordList().empty() ); - m_aboneChain = ( m_aboneByID | m_aboneByName | m_aboneByBody ) & Kita::Config::aboneChain() ; + m_aboneByID = (! Kita::AboneConfig::aboneIDList().empty()); + m_aboneByName = (! Kita::AboneConfig::aboneNameList().empty()); + m_aboneByBody = (! Kita::AboneConfig::aboneWordList().empty()); + m_aboneChain = (m_aboneByID | m_aboneByName | m_aboneByBody) & Kita::Config::aboneChain() ; } /*--------------*/ /* check abone */ /* public */ -bool DatInfo::checkAbone( int num ) +bool DatInfo::checkAbone(int num) { - return checkAbonePrivate( num ); + return checkAbonePrivate(num); } /* private */ -bool DatInfo::checkAbonePrivate( int num ) +bool DatInfo::checkAbonePrivate(int num) { - if ( !parseDat( num ) ) return false; + if (!parseDat(num)) return false; - if ( m_resDatVec[ num ].checkAbone ) return m_resDatVec[ num ].abone; + if (m_resDatVec[ num ].checkAbone) return m_resDatVec[ num ].abone; m_resDatVec[ num ].checkAbone = true; bool checktmp = false; - if ( m_aboneByID ) - checktmp = checkAboneCore( m_resDatVec[ num ].id, Kita::AboneConfig::aboneIDList() ); + if (m_aboneByID) + checktmp = checkAboneCore(m_resDatVec[ num ].id, Kita::AboneConfig::aboneIDList()); - if ( !checktmp && m_aboneByName ) - checktmp = checkAboneCore( m_resDatVec[ num ].name, Kita::AboneConfig::aboneNameList() ); + if (!checktmp && m_aboneByName) + checktmp = checkAboneCore(m_resDatVec[ num ].name, Kita::AboneConfig::aboneNameList()); - if ( !checktmp && m_aboneByBody ) - checktmp = checkAboneCore( m_resDatVec[ num ].bodyHTML, Kita::AboneConfig::aboneWordList() ); + if (!checktmp && m_aboneByBody) + checktmp = checkAboneCore(m_resDatVec[ num ].bodyHTML, Kita::AboneConfig::aboneWordList()); - if ( !checktmp && m_aboneChain ) { + if (!checktmp && m_aboneChain) { AncList & anclist = m_resDatVec[ num ].anclist; - for ( AncList::iterator it = anclist.begin(); - it != anclist.end() && !checktmp ; ++it ) { + for (AncList::iterator it = anclist.begin(); + it != anclist.end() && !checktmp ; ++it) { - int refNum = ( *it ).from; - int refNum2 = ( *it ).to; + int refNum = (*it).from; + int refNum2 = (*it).to; /* I don't want to enter loop... */ - if ( refNum >= num ) continue; - if ( refNum2 >= num ) refNum2 = num - 1; + if (refNum >= num) continue; + if (refNum2 >= num) refNum2 = num - 1; - for ( int i = refNum; i <= refNum2; i++ ) { - if ( checkAbonePrivate( i ) ) { + for (int i = refNum; i <= refNum2; i++) { + if (checkAbonePrivate(i)) { checktmp = true; break; } @@ -863,15 +863,15 @@ } /* private */ -bool DatInfo::checkAboneCore( const QString& str, QStringList strlist ) +bool DatInfo::checkAboneCore(const QString& str, QStringList strlist) { - if ( strlist.count() ) { + if (strlist.count()) { int i; - for ( QStringList::iterator it = strlist.begin(); - it != strlist.end(); ++it ) { - i = str.indexOf( ( *it ) ); - if ( i != -1 ) { + for (QStringList::iterator it = strlist.begin(); + it != strlist.end(); ++it) { + i = str.indexOf((*it)); + if (i != -1) { return true; } } @@ -884,17 +884,17 @@ /* parsing function for ResDat */ /* This function parses the raw data by Kita::parseResDat() */ /* private */ -bool DatInfo::parseDat( int num ) +bool DatInfo::parseDat(int num) { - if ( num <= 0 || m_thread->readNum() < num ) return false; - if ( m_resDatVec[ num ].parsed ) return true; + if (num <= 0 || m_thread->readNum() < num) return false; + if (m_resDatVec[ num ].parsed) return true; // qDebug("parseDat %d",num); QString subject; - Kita::parseResDat( m_resDatVec[ num ], subject ); - if ( num == 1 && !subject.isEmpty() ) m_thread->setThreadName( subject ); - if ( m_resDatVec[ num ].broken ) m_broken = true; + Kita::parseResDat(m_resDatVec[ num ], subject); + if (num == 1 && !subject.isEmpty()) m_thread->setThreadName(subject); + if (m_resDatVec[ num ].broken) m_broken = true; return true; } @@ -904,7 +904,7 @@ return m_isOpened; } -void DatInfo::setIsOpened( bool isOpened ) +void DatInfo::setIsOpened(bool isOpened) { m_isOpened = isOpened; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -137,13 +137,13 @@ public: DatInfo(); - DatInfo( const KUrl& url ); + DatInfo(const KUrl& url); ~DatInfo(); void init(); const KUrl& url(); /* for caching */ - bool updateCache( const QObject* parent ); + bool updateCache(const QObject* parent); int getResponseCode(); int getServerTime(); bool deleteCache(); @@ -151,66 +151,66 @@ void stopLoading(); /* string data */ - QString getDat( int num ); - QString getId( int num ); - QString getPlainName( int num ); - QString getPlainTitle( int num ); - QString getPlainBody( int num ); + QString getDat(int num); + QString getId(int num); + QString getPlainName(int num); + QString getPlainTitle(int num); + QString getPlainBody(int num); /* HTML data */ - int getHTML( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML ); - QString getHTMLString( int startnum, int endnum, bool checkAbone = true ); - QString getHtmlByID( const QString& strid, int &count ); - QString getTreeByRes( const int rootnum, int& count ); - QString getTreeByResReverse( const int rootnum, int& count ); + int getHTML(int num, bool checkAbone, QString& titleHTML, QString& bodyHTML); + QString getHTMLString(int startnum, int endnum, bool checkAbone = true); + QString getHtmlByID(const QString& strid, int &count); + QString getTreeByRes(const int rootnum, int& count); + QString getTreeByResReverse(const int rootnum, int& count); /* numerical data */ int getResNum(); int getReadNum(); int getViewPos(); - int getNumByID( const QString& strid ); + int getNumByID(const QString& strid); int getDatSize(); /* several information */ - bool isResponsed ( int num ) const; - bool isResValid( int num ); + bool isResponsed (int num) const; + bool isResValid(int num); bool isBroken(); - bool isResBroken( int num ); - bool checkID( const QString& strid, int num ); - bool checkWord( QStringList& stlist, int num, bool checkOR ); + bool isResBroken(int num); + bool checkID(const QString& strid, int num); + bool checkWord(QStringList& stlist, int num, bool checkOR); bool isOpened(); - void setIsOpened( bool isOpened ); + void setIsOpened(bool isOpened); /* abone check */ - bool checkAbone( int num ); + bool checkAbone(int num); void resetAbone(); /*-------------------------*/ private: - void initPrivate( bool loadCache = true ); - void resetResDat( RESDAT& resdat ); - void increaseResDatVec( int delta ); + void initPrivate(bool loadCache = true); + void resetResDat(RESDAT& resdat); + void increaseResDatVec(int delta); void deleteAccessJob(); /* copy data */ - bool copyOneLineToResDat( const QString& line ); + bool copyOneLineToResDat(const QString& line); /* HTML data */ - int getHTMLPrivate( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML ); - void getHTMLofOneRes( int num, bool checkAbone, QString& html ); - QString getTreeByResPrivate( const int rootnum, bool reverse, int& count ); - QString getTreeByResCore( const int rootnum, bool reverse, int& count, QString prestr ); - bool checkRes( const int num, const int target ); + int getHTMLPrivate(int num, bool checkAbone, QString& titleHTML, QString& bodyHTML); + void getHTMLofOneRes(int num, bool checkAbone, QString& html); + QString getTreeByResPrivate(const int rootnum, bool reverse, int& count); + QString getTreeByResCore(const int rootnum, bool reverse, int& count, QString prestr); + bool checkRes(const int num, const int target); /* for abone */ void resetAbonePrivate(); - bool checkAbonePrivate( int num ); - bool checkAboneCore( const QString& str, QStringList strlist ); + bool checkAbonePrivate(int num); + bool checkAboneCore(const QString& str, QStringList strlist); /* parsing functions */ - bool parseDat( int num ); + bool parseDat(int num); DatInfo(const DatInfo&); DatInfo& operator=(const DatInfo&); @@ -218,7 +218,7 @@ private slots: - void slotReceiveData( const QStringList& lineList ); + void slotReceiveData(const QStringList& lineList); void slotFinishLoad(); signals: Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -39,12 +39,12 @@ /* create DatInfo explicitly. */ /* Usually, DatInfo is NOT created - if cache does not exist( i.e. ReadNum == 0 ). */ /* public */ -bool DatManager::createDatInfo( const KUrl& url ) + if cache does not exist(i.e. ReadNum == 0). */ /* public */ +bool DatManager::createDatInfo(const KUrl& url) { - if ( getDatInfo( url, + if (getDatInfo(url, false /* don't check the existence of cache */ - ) == 0 ) return false; + ) == 0) return false; return true; } @@ -54,9 +54,9 @@ /* !!! NOTICE !!! */ /* It is very dangerous to access to DatInfo directly. */ /* Usually, access to it through DatManager. */ /* public */ -DatInfo * DatManager::getDatInfoPointer( const KUrl& url ) +DatInfo * DatManager::getDatInfoPointer(const KUrl& url) { - return getDatInfo( url ); + return getDatInfo(url); } @@ -74,39 +74,39 @@ see also DatManager::searchDatInfo() and DatManager::createDatInfo() */ /* private */ -DatInfo* DatManager::getDatInfo( const KUrl& url, bool checkCached ) +DatInfo* DatManager::getDatInfo(const KUrl& url, bool checkCached) { /* search */ - DatInfo * datInfo = searchDatInfo( url ); - if ( datInfo != 0 ) return datInfo; + DatInfo * datInfo = searchDatInfo(url); + if (datInfo != 0) return datInfo; /* create and enroll instance */ - return enrollDatInfo( url, checkCached ); + return enrollDatInfo(url, checkCached); } /* This function just searches instance of DatInfo specified by datURL without creating instance. */ /* private */ -DatInfo* DatManager::searchDatInfo( const KUrl& url ) +DatInfo* DatManager::searchDatInfo(const KUrl& url) { - KUrl datURL = Kita::getDatURL( url ); - if ( datURL.isEmpty() ) return 0; /* This url is not enrolled in BoardManager. */ - if ( m_datInfoList.isEmpty() ) return 0; + KUrl datURL = Kita::getDatURL(url); + if (datURL.isEmpty()) return 0; /* This url is not enrolled in BoardManager. */ + if (m_datInfoList.isEmpty()) return 0; int i = 0; DatInfoList::Iterator it; DatInfo* datInfo; - for ( it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it, i++ ) { + for (it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it, i++) { - datInfo = ( *it ); + datInfo = (*it); - if ( datURL == datInfo->url() ) { + if (datURL == datInfo->url()) { /* LRU */ - if ( i ) { - m_datInfoList.remove( it ); - m_datInfoList.prepend( datInfo ); + if (i) { + m_datInfoList.remove(it); + m_datInfoList.prepend(datInfo); } return datInfo; @@ -119,31 +119,31 @@ /* create and enroll the instance of DatInfo and delete old instances. Note that DatInfo::DatInfo() opens cached data and reads it. */ /* private */ -DatInfo* DatManager::enrollDatInfo( const KUrl& url, bool checkCached ) +DatInfo* DatManager::enrollDatInfo(const KUrl& url, bool checkCached) { - KUrl datURL = Kita::getDatURL( url ); - if ( datURL.isEmpty() ) return 0; /* This url is not enrolled in BoardManager. */ + KUrl datURL = Kita::getDatURL(url); + if (datURL.isEmpty()) return 0; /* This url is not enrolled in BoardManager. */ /* create DatInfo & read cached data */ - DatInfo* datInfo = new DatInfo( datURL ); + DatInfo* datInfo = new DatInfo(datURL); /* Does cache exist ? */ /* If cache does not exist, delete DatInfo here. */ - if ( checkCached && datInfo->getReadNum() == 0 ) { + if (checkCached && datInfo->getReadNum() == 0) { delete datInfo; return 0; } - m_datInfoList.prepend( datInfo ); + m_datInfoList.prepend(datInfo); - /* delete the all old instances ( LRU algorithm )*/ - if ( m_datInfoList.count() > DMANAGER_MAXQUEUE ) { + /* delete the all old instances (LRU algorithm)*/ + if (m_datInfoList.count() > DMANAGER_MAXQUEUE) { DatInfoList::Iterator it; - for ( it = m_datInfoList.at( DMANAGER_MAXQUEUE ); it != m_datInfoList.end(); ++it ) { + for (it = m_datInfoList.at(DMANAGER_MAXQUEUE); it != m_datInfoList.end(); ++it) { - if ( ( *it ) == 0 ) continue; - DatInfo* deleteInfo = ( *it ); + if ((*it) == 0) continue; + DatInfo* deleteInfo = (*it); } } @@ -165,79 +165,79 @@ /* update cache */ /* public */ -bool DatManager::updateCache( const KUrl& url , const QObject* parent ) +bool DatManager::updateCache(const KUrl& url , const QObject* parent) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; - return datInfo->updateCache( parent ); + return datInfo->updateCache(parent); } /* public */ -int DatManager::getResponseCode( const KUrl& url ) +int DatManager::getResponseCode(const KUrl& url) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return 0; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return 0; return datInfo->getResponseCode(); } /* public */ -int DatManager::getServerTime( const KUrl& url ) +int DatManager::getServerTime(const KUrl& url) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return 0; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return 0; return datInfo->getServerTime(); } /* public */ -bool DatManager::deleteCache( const KUrl& url ) +bool DatManager::deleteCache(const KUrl& url) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == 0 ) return false; - if ( thread->readNum() == 0 ) return false; + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread == 0) return false; + if (thread->readNum() == 0) return false; /* init DatInfo */ - DatInfo * datInfo = searchDatInfo( datURL ); - if ( datInfo ) { - if ( !datInfo->deleteCache() ) return false; + DatInfo * datInfo = searchDatInfo(datURL); + if (datInfo) { + if (!datInfo->deleteCache()) return false; } /* reset readNum & veiwPos */ - thread->setReadNum( 0 ); - thread->setViewPos( 0 ); + thread->setReadNum(0); + thread->setViewPos(0); /* delete cache */ - QString cachePath = Kita::Cache::getPath( datURL ); - QString indexPath = Kita::Cache::getIndexPath( datURL ); - QFile::remove( indexPath ); - QFile::remove( cachePath ); + QString cachePath = Kita::Cache::getPath(datURL); + QString indexPath = Kita::Cache::getIndexPath(datURL); + QFile::remove(indexPath); + QFile::remove(cachePath); /* delete log from "cache" */ - KitaThreadInfo::removeThreadInfo( datURL.prettyUrl() ); + KitaThreadInfo::removeThreadInfo(datURL.prettyUrl()); return true; } /* public */ -bool DatManager::isLoadingNow( const KUrl& url ) +bool DatManager::isLoadingNow(const KUrl& url) { - DatInfo * datInfo = searchDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = searchDatInfo(url); + if (datInfo == 0) return false; return datInfo->isLoadingNow(); } /* public */ -void DatManager::stopLoading( const KUrl& url ) +void DatManager::stopLoading(const KUrl& url) { - DatInfo * datInfo = searchDatInfo( url ); - if ( datInfo == 0 ) return ; + DatInfo * datInfo = searchDatInfo(url); + if (datInfo == 0) return ; return datInfo->stopLoading(); } @@ -247,331 +247,331 @@ /* public */ -QString DatManager::getDat( const KUrl& url, int num ) +QString DatManager::getDat(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getDat( num ); + return datInfo->getDat(num); } /* public */ -QString DatManager::getId( const KUrl& url, int num ) +QString DatManager::getId(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getId( num ); + return datInfo->getId(num); } /* public */ -QString DatManager::getPlainName( const KUrl& url, int num ) +QString DatManager::getPlainName(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getPlainName( num ); + return datInfo->getPlainName(num); } /* public */ -QString DatManager::getPlainBody( const KUrl& url, int num ) +QString DatManager::getPlainBody(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getPlainBody( num ); + return datInfo->getPlainBody(num); } /* public */ -QString DatManager::getPlainTitle( const KUrl& url, int num ) +QString DatManager::getPlainTitle(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getPlainTitle( num ); + return datInfo->getPlainTitle(num); } -/* get name (i.e. subject ) of thread from URL of dat file. */ /* public */ -const QString DatManager::threadName( const KUrl& url ) +/* get name (i.e. subject) of thread from URL of dat file. */ /* public */ +const QString DatManager::threadName(const KUrl& url) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != 0 ) return thread->threadName(); + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread != 0) return thread->threadName(); return QString(); } /* public */ -const QString DatManager::threadID( const KUrl& url ) +const QString DatManager::threadID(const KUrl& url) { - KUrl datURL = Kita::getDatURL( url ); - return datURL.fileName().section( '.', 0, 0 ); + KUrl datURL = Kita::getDatURL(url); + return datURL.fileName().section('.', 0, 0); } -const QString DatManager::getCachePath( const KUrl& url ) +const QString DatManager::getCachePath(const KUrl& url) { - return Kita::Cache::getPath( url ); + return Kita::Cache::getPath(url); } -const QString DatManager::getCacheIndexPath( const KUrl& url ) +const QString DatManager::getCacheIndexPath(const KUrl& url) { - return Kita::Cache::getIndexPath( url ); + return Kita::Cache::getIndexPath(url); } /*---------------------------------------*/ /* HTML data */ /* public */ -QString DatManager::getHtml( const KUrl& url, int startnum, int endnum, bool checkAbone ) +QString DatManager::getHtml(const KUrl& url, int startnum, int endnum, bool checkAbone) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getHTMLString( startnum, endnum, checkAbone ); + return datInfo->getHTMLString(startnum, endnum, checkAbone); } /* public */ -QString DatManager::getHtmlByID( const KUrl& url, const QString& strid, int &count ) +QString DatManager::getHtmlByID(const KUrl& url, const QString& strid, int &count) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getHtmlByID( strid, count ); + return datInfo->getHtmlByID(strid, count); } /* Get HTML document of res tree.*/ /* public */ -QString DatManager::getTreeByRes( const KUrl& url, const int rootnum, int &count ) +QString DatManager::getTreeByRes(const KUrl& url, const int rootnum, int &count) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getTreeByRes( rootnum, count ); + return datInfo->getTreeByRes(rootnum, count); } /* Get HTML document of reverse res tree.*/ /* public */ -QString DatManager::getTreeByResReverse( const KUrl& url, const int rootnum, int &count ) +QString DatManager::getTreeByResReverse(const KUrl& url, const int rootnum, int &count) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return QString(); + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return QString(); - return datInfo->getTreeByResReverse( rootnum, count ); + return datInfo->getTreeByResReverse(rootnum, count); } /* public */ -int DatManager::getResNum( const KUrl& url ) +int DatManager::getResNum(const KUrl& url) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != 0 ) return thread->resNum(); + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread != 0) return thread->resNum(); return 0; } /* public */ -int DatManager::getReadNum( const KUrl& url ) +int DatManager::getReadNum(const KUrl& url) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != 0 ) return thread->readNum(); + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread != 0) return thread->readNum(); return 0; } /* public */ -int DatManager::getViewPos( const KUrl& url ) +int DatManager::getViewPos(const KUrl& url) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != 0 ) return thread->viewPos(); + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread != 0) return thread->viewPos(); return 0; } /* public */ -void DatManager::setViewPos( const KUrl& url , int num ) +void DatManager::setViewPos(const KUrl& url , int num) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread != 0 ) thread->setViewPos( num ); + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread != 0) thread->setViewPos(num); /* save idx */ - Kita::ThreadIndex::setViewPos( url, num ); + Kita::ThreadIndex::setViewPos(url, num); /* save "cache" */ - KitaThreadInfo::setReadNum( datURL.prettyUrl(), num ); + KitaThreadInfo::setReadNum(datURL.prettyUrl(), num); } /* public */ -int DatManager::getDatSize( const KUrl& url ) +int DatManager::getDatSize(const KUrl& url) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return 0; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return 0; return datInfo->getDatSize(); } /* get number of responses which have same ID. */ /* public */ -int DatManager::getNumByID( const KUrl& url, const QString& strid ) +int DatManager::getNumByID(const KUrl& url, const QString& strid) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return 0; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return 0; - return datInfo->getNumByID( strid ); + return datInfo->getNumByID(strid); } /* public */ -bool DatManager::isThreadEnrolled( const KUrl& url ) +bool DatManager::isThreadEnrolled(const KUrl& url) { - if ( Kita::getDatURL( url ).isEmpty() ) return false; + if (Kita::getDatURL(url).isEmpty()) return false; return true; } /* public */ -bool DatManager::is2chThread( const KUrl& url ) +bool DatManager::is2chThread(const KUrl& url) { - if ( BoardManager::type( url ) != Board_2ch ) return false; - if ( Kita::getDatURL( url ).isEmpty() ) return false; + if (BoardManager::type(url) != Board_2ch) return false; + if (Kita::getDatURL(url).isEmpty()) return false; - QRegExp url_2ch( ".*\\.2ch\\.net" ); - QRegExp url_bbspink( ".*\\.bbspink\\.com" ); + QRegExp url_2ch(".*\\.2ch\\.net"); + QRegExp url_bbspink(".*\\.bbspink\\.com"); - if ( url_2ch.indexIn( url.host() ) != -1 - || url_bbspink.indexIn( url.host() ) != -1 ) return true; + if (url_2ch.indexIn(url.host()) != -1 + || url_bbspink.indexIn(url.host()) != -1) return true; return false; } /* public */ -bool DatManager::isResValid( const KUrl& url, int num ) +bool DatManager::isResValid(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; - return datInfo->isResValid( num ); + return datInfo->isResValid(num); } /* public */ -bool DatManager::isBroken( const KUrl& url ) +bool DatManager::isBroken(const KUrl& url) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; return datInfo->isBroken(); } /* public */ -bool DatManager::isResBroken( const KUrl& url, int num ) +bool DatManager::isResBroken(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; - return datInfo->isResBroken( num ); + return datInfo->isResBroken(num); } /* check if ID == strid */ /* public */ -bool DatManager::checkID( const KUrl& url, const QString& strid, int num ) +bool DatManager::checkID(const KUrl& url, const QString& strid, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; - return datInfo->checkID( strid, num ); + return datInfo->checkID(strid, num); } /* check if keywords are included */ /* public */ -bool DatManager::checkWord( const KUrl& url, +bool DatManager::checkWord(const KUrl& url, QStringList& strlist, int num, bool checkOR /* AND or OR search */ - ) + ) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; - return datInfo->checkWord( strlist, num, checkOR ); + return datInfo->checkWord(strlist, num, checkOR); } /* public */ -bool DatManager::isMarked( const KUrl& url, int num ) +bool DatManager::isMarked(const KUrl& url, int num) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == 0 ) return false; + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread == 0) return false; - return thread->isMarked( num ); + return thread->isMarked(num); } /* public */ -void DatManager::setMark( const KUrl& url, int num, bool mark ) +void DatManager::setMark(const KUrl& url, int num, bool mark) { - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURLNew( datURL ); - if ( thread == 0 ) return ; + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURLNew(datURL); + if (thread == 0) return ; - if ( thread->setMark( num, mark ) ) Kita::ThreadIndex::setMarkList( url, thread->markList() ); + if (thread->setMark(num, mark)) Kita::ThreadIndex::setMarkList(url, thread->markList()); } /* public */ -bool DatManager::checkAbone( const KUrl& url, int num ) +bool DatManager::checkAbone(const KUrl& url, int num) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; - return datInfo->checkAbone( num ); + return datInfo->checkAbone(num); } /* public */ -void DatManager::resetAbone( const KUrl& url ) +void DatManager::resetAbone(const KUrl& url) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return ; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return ; datInfo->resetAbone(); } /* check if the thread is shown on the main thread tab. */ /* public */ -bool DatManager::isMainThreadOpened( const KUrl& url ) +bool DatManager::isMainThreadOpened(const KUrl& url) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return false; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return false; return datInfo->isOpened(); } -void DatManager::setMainThreadOpened( const KUrl& url, bool isOpened ) +void DatManager::setMainThreadOpened(const KUrl& url, bool isOpened) { - DatInfo * datInfo = getDatInfo( url ); - if ( datInfo == 0 ) return; + DatInfo * datInfo = getDatInfo(url); + if (datInfo == 0) return; - datInfo->setIsOpened( isOpened ); + datInfo->setIsOpened(isOpened); } @@ -579,8 +579,8 @@ /* obsolete */ /* public */ -const QString DatManager::threadURL( const KUrl& url ) +const QString DatManager::threadURL(const KUrl& url) { - return Kita::getThreadURL( url ); + return Kita::getThreadURL(url); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -31,75 +31,75 @@ public: - static bool createDatInfo( const KUrl& url ); - static DatInfo* getDatInfoPointer( const KUrl& url ); + static bool createDatInfo(const KUrl& url); + static DatInfo* getDatInfoPointer(const KUrl& url); static void deleteAllDatInfo(); /* caching */ - static bool updateCache( const KUrl& url , const QObject* parent ); - static int getResponseCode( const KUrl& url ); - static int getServerTime( const KUrl& url ); - static bool deleteCache( const KUrl& url ); - static bool isLoadingNow( const KUrl& url ); - static void stopLoading( const KUrl& url ); + static bool updateCache(const KUrl& url , const QObject* parent); + static int getResponseCode(const KUrl& url); + static int getServerTime(const KUrl& url); + static bool deleteCache(const KUrl& url); + static bool isLoadingNow(const KUrl& url); + static void stopLoading(const KUrl& url); /* string data */ - static QString getDat( const KUrl& url, int num ); - static QString getId( const KUrl& url, int num ); - static QString getPlainName( const KUrl& url, int num ); - static QString getPlainBody( const KUrl& url, int num ); - static QString getPlainTitle( const KUrl& url, int num ); + static QString getDat(const KUrl& url, int num); + static QString getId(const KUrl& url, int num); + static QString getPlainName(const KUrl& url, int num); + static QString getPlainBody(const KUrl& url, int num); + static QString getPlainTitle(const KUrl& url, int num); - static const QString threadName( const KUrl& url ); /* = subject of thread */ - static const QString threadID( const KUrl& url ); + static const QString threadName(const KUrl& url); /* = subject of thread */ + static const QString threadID(const KUrl& url); - static const QString getCachePath( const KUrl& url ); - static const QString getCacheIndexPath( const KUrl& url ); + static const QString getCachePath(const KUrl& url); + static const QString getCacheIndexPath(const KUrl& url); /* HTML data */ - static QString getHtml( const KUrl& url, int startnum, int endnum, bool checkAbone = true ); - static QString getHtmlByID( const KUrl& url, const QString& strid, int &count ); - static QString getTreeByRes( const KUrl& url, const int rootnum, int &count ); - static QString getTreeByResReverse( const KUrl& url, const int rootnum, int &count ); + static QString getHtml(const KUrl& url, int startnum, int endnum, bool checkAbone = true); + static QString getHtmlByID(const KUrl& url, const QString& strid, int &count); + static QString getTreeByRes(const KUrl& url, const int rootnum, int &count); + static QString getTreeByResReverse(const KUrl& url, const int rootnum, int &count); /* numerical data */ - static int getResNum( const KUrl& url ); - static int getReadNum( const KUrl& url ); - static int getViewPos( const KUrl& url ); - static void setViewPos( const KUrl& url, int num ); - static int getDatSize( const KUrl& url ); - static int getNumByID( const KUrl& url, const QString& strid ); + static int getResNum(const KUrl& url); + static int getReadNum(const KUrl& url); + static int getViewPos(const KUrl& url); + static void setViewPos(const KUrl& url, int num); + static int getDatSize(const KUrl& url); + static int getNumByID(const KUrl& url, const QString& strid); /* another information */ - static bool isThreadEnrolled( const KUrl& url ); - static bool is2chThread( const KUrl& url ); - static bool isResValid( const KUrl& url , int num ); - static bool isBroken( const KUrl& url ); - static bool isResBroken( const KUrl& url , int num ); - static bool checkID( const KUrl& url, const QString& strid, int num ); - static bool checkWord( const KUrl& url, QStringList& stlist, int num, bool checkOR ); - static bool isMarked( const KUrl& url, int num ); - static void setMark( const KUrl& url, int num, bool mark ); + static bool isThreadEnrolled(const KUrl& url); + static bool is2chThread(const KUrl& url); + static bool isResValid(const KUrl& url , int num); + static bool isBroken(const KUrl& url); + static bool isResBroken(const KUrl& url , int num); + static bool checkID(const KUrl& url, const QString& strid, int num); + static bool checkWord(const KUrl& url, QStringList& stlist, int num, bool checkOR); + static bool isMarked(const KUrl& url, int num); + static void setMark(const KUrl& url, int num, bool mark); /* abone check */ - static bool checkAbone( const KUrl& url, int num ); - static void resetAbone( const KUrl& url ); + static bool checkAbone(const KUrl& url, int num); + static void resetAbone(const KUrl& url); /* check if the thread is shown on the main thread tab. */ - static bool isMainThreadOpened( const KUrl& url ); - static void setMainThreadOpened( const KUrl& url, bool isOpened ); + static bool isMainThreadOpened(const KUrl& url); + static void setMainThreadOpened(const KUrl& url, bool isOpened); /* obsolete. Don't use them. */ - static const QString threadURL( const KUrl& url ); + static const QString threadURL(const KUrl& url); private: - static DatInfo* getDatInfo( const KUrl& url, bool checkCached = true ); - static DatInfo* searchDatInfo( const KUrl& url ); - static DatInfo* enrollDatInfo( const KUrl& url, bool checkCached ); + static DatInfo* getDatInfo(const KUrl& url, bool checkCached = true); + static DatInfo* searchDatInfo(const KUrl& url); + static DatInfo* enrollDatInfo(const KUrl& url, bool checkCached); }; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/event.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/event.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/event.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -11,7 +11,7 @@ #ifndef KITAEVENT_H #define KITAEVENT_H -#define EVENT_EmitFinigh ( QEvent::User + 200 ) -#define EVENT_DeleteLoader ( QEvent::User + 201 ) +#define EVENT_EmitFinigh (QEvent::User + 200) +#define EVENT_DeleteLoader (QEvent::User + 201) #endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -26,24 +26,24 @@ FavoriteBoards* FavoriteBoards::getInstance() { - if ( ! instance ) { + if (! instance) { instance = new FavoriteBoards(); } return instance; } -void FavoriteBoards::append( KUrl& url ) +void FavoriteBoards::append(KUrl& url) { - if ( ! getInstance() ->m_list.contains( url ) ) { - getInstance() ->m_list.append( url ); + if (! getInstance() ->m_list.contains(url)) { + getInstance() ->m_list.append(url); getInstance() ->notifyChange(); } } -void FavoriteBoards::remove( KUrl& url ) +void FavoriteBoards::remove(KUrl& url) { - if ( getInstance() ->m_list.contains( url ) ) { - getInstance() ->m_list.remove( url ); + if (getInstance() ->m_list.contains(url)) { + getInstance() ->m_list.remove(url); getInstance() ->notifyChange(); } } @@ -53,41 +53,41 @@ return getInstance() ->m_list; } -bool FavoriteBoards::readFromXML( QString& xml ) +bool FavoriteBoards::readFromXML(QString& xml) { FavoriteBoards * instance = FavoriteBoards::getInstance(); instance->m_list.clear(); QDomDocument document; - if ( ! document.setContent( xml, true ) ) { + if (! document.setContent(xml, true)) { return false; } QDomElement root = document.documentElement(); QDomNode node = root.firstChild(); - while ( ! node.isNull() ) { - if ( node.isElement() && - node.nodeName() == QString( "board" ) && - node.namespaceURI() == QString( "http://kita.sourceforge.jp/ns/board" ) ) { - processChildNode( node ); + while (! node.isNull()) { + if (node.isElement() && + node.nodeName() == QString("board") && + node.namespaceURI() == QString("http://kita.sourceforge.jp/ns/board")) { + processChildNode(node); } node = node.nextSibling(); } return true; } -void FavoriteBoards::processChildNode( QDomNode& node ) +void FavoriteBoards::processChildNode(QDomNode& node) { - QDomNode urlNode = node.namedItem( "url" ); - if ( ! urlNode.isElement() ) return ; + QDomNode urlNode = node.namedItem("url"); + if (! urlNode.isElement()) return ; QString urlText = urlNode.toElement().text(); - KUrl url = KUrl( urlText ); - if ( url.isValid() ) { - //FavoriteBoards::append( url ); - if ( !getInstance() ->m_list.contains( url ) ) - getInstance() ->m_list.append( url ); + KUrl url = KUrl(urlText); + if (url.isValid()) { + //FavoriteBoards::append(url); + if (!getInstance() ->m_list.contains(url)) + getInstance() ->m_list.append(url); } } @@ -95,39 +95,39 @@ { QDomDocument document; - QDomProcessingInstruction pi = document.createProcessingInstruction( "xml", "version=\"1.0\"" ); - document.appendChild( pi ); + QDomProcessingInstruction pi = document.createProcessingInstruction("xml", "version=\"1.0\""); + document.appendChild(pi); - QDomElement root = document.createElementNS( "http://kita.sourceforge.jp/ns/boardlist", "boardlist" ); - document.appendChild( root ); + QDomElement root = document.createElementNS("http://kita.sourceforge.jp/ns/boardlist", "boardlist"); + document.appendChild(root); Q3ValueList boards = FavoriteBoards::boards(); Q3ValueList::iterator it; - for ( it = boards.begin(); it != boards.end(); ++it ) { - QDomElement board = document.createElementNS( "http://kita.sourceforge.jp/ns/board", "board" ); - root.appendChild( board ); + for (it = boards.begin(); it != boards.end(); ++it) { + QDomElement board = document.createElementNS("http://kita.sourceforge.jp/ns/board", "board"); + root.appendChild(board); - QString boardURL = ( *it ).url(); - QDomElement urlElement = document.createElement( "url" ); - board.appendChild( urlElement ); - urlElement.appendChild( document.createTextNode( boardURL ) ); + QString boardURL = (*it).url(); + QDomElement urlElement = document.createElement("url"); + board.appendChild(urlElement); + urlElement.appendChild(document.createTextNode(boardURL)); - QString boardName = Kita::BoardManager::boardName( boardURL ); - QDomElement nameElement = document.createElement( "name" ); - board.appendChild( nameElement ); - nameElement.appendChild( document.createTextNode( boardName ) ); + QString boardName = Kita::BoardManager::boardName(boardURL); + QDomElement nameElement = document.createElement("name"); + board.appendChild(nameElement); + nameElement.appendChild(document.createTextNode(boardName)); } - return document.toString( 0 ); + return document.toString(0); } -void FavoriteBoards::replace( QString fromURL, QString toURL ) +void FavoriteBoards::replace(QString fromURL, QString toURL) { - if ( FavoriteBoards::getInstance() == 0 ) return ; + if (FavoriteBoards::getInstance() == 0) return ; Q3ValueList& boardList = FavoriteBoards::getInstance() ->m_list; - for ( Q3ValueList::iterator it = boardList.begin(); it != boardList.end(); ++it ) { - QString url = ( *it ).url(); - if ( url.startsWith( fromURL ) ) { - url = url.replace( 0, fromURL.length(), toURL ); + for (Q3ValueList::iterator it = boardList.begin(); it != boardList.end(); ++it) { + QString url = (*it).url(); + if (url.startsWith(fromURL)) { + url = url.replace(0, fromURL.length(), toURL); *it = url; } } Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -32,17 +32,17 @@ FavoriteBoards(); ~FavoriteBoards(); - static void processChildNode( QDomNode& node ); + static void processChildNode(QDomNode& node); private: void notifyChange(); public: static FavoriteBoards* getInstance(); - static void append( KUrl& url ); - static void remove( KUrl& url ); + static void append(KUrl& url); + static void remove(KUrl& url); static const Q3ValueList& boards(); - static bool readFromXML( QString& xml ); + static bool readFromXML(QString& xml); static QString toXML(); - static void replace( QString fromURL, QString toURL ); + static void replace(QString fromURL, QString toURL); signals: void changed(); }; Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -29,9 +29,9 @@ FavoriteThreadItem::~ FavoriteThreadItem() {} -bool FavoriteThreadItem::operator==( const FavoriteThreadItem& item ) const +bool FavoriteThreadItem::operator==(const FavoriteThreadItem& item) const { - return ( m_datURL == item.m_datURL ); + return (m_datURL == item.m_datURL); } // FavoriteThreads @@ -45,27 +45,27 @@ FavoriteThreads* FavoriteThreads::getInstance() { - if ( ! instance ) { + if (! instance) { instance = new FavoriteThreads(); } return instance; } -void FavoriteThreads::insert( const QString& datURL ) +void FavoriteThreads::insert(const QString& datURL) { - if ( ! m_threadList.contains( datURL ) ) { - m_threadList.append( datURL ); + if (! m_threadList.contains(datURL)) { + m_threadList.append(datURL); } } -void FavoriteThreads::remove( const QString& datURL ) +void FavoriteThreads::remove(const QString& datURL) { - m_threadList.remove( datURL ); + m_threadList.remove(datURL); } -bool FavoriteThreads::contains( const QString& datURL ) +bool FavoriteThreads::contains(const QString& datURL) { - if ( m_threadList.contains( datURL ) ) { + if (m_threadList.contains(datURL)) { return true; } else { return false; @@ -77,114 +77,114 @@ return m_threadList; } -bool FavoriteThreads::readFromXML( const QString& xml ) +bool FavoriteThreads::readFromXML(const QString& xml) { FavoriteThreads * instance = FavoriteThreads::getInstance(); instance->m_threadList.clear(); QDomDocument document; - if ( ! document.setContent( xml, true ) ) { + if (! document.setContent(xml, true)) { return false; } QDomElement root = document.documentElement(); QDomNode node = root.firstChild(); - while ( !node.isNull() ) { - if ( node.isElement() && - node.nodeName() == QString( "thread" ) && - node.namespaceURI() == QString( "http://kita.sourceforge.jp/ns/thread" ) ) { - processThreadNode( node ); + while (!node.isNull()) { + if (node.isElement() && + node.nodeName() == QString("thread") && + node.namespaceURI() == QString("http://kita.sourceforge.jp/ns/thread")) { + processThreadNode(node); } node = node.nextSibling(); } return true; } -void FavoriteThreads::processThreadNode( QDomNode& node ) +void FavoriteThreads::processThreadNode(QDomNode& node) { - QDomNode datURLNode = node.namedItem( "daturl" ); - QDomNode nameNode = node.namedItem( "name" ); + QDomNode datURLNode = node.namedItem("daturl"); + QDomNode nameNode = node.namedItem("name"); - if ( !datURLNode.isElement() || !nameNode.isElement() ) return ; + if (!datURLNode.isElement() || !nameNode.isElement()) return ; QString url = datURLNode.toElement().text(); QString name = nameNode.toElement().text(); - KUrl datURL = Kita::getDatURL( url ); - Kita::Thread* thread = Kita::Thread::getByURL( datURL ); - thread->setThreadName( name ); - Kita::ThreadIndex::loadIndex( thread, datURL ); + KUrl datURL = Kita::getDatURL(url); + Kita::Thread* thread = Kita::Thread::getByURL(datURL); + thread->setThreadName(name); + Kita::ThreadIndex::loadIndex(thread, datURL); - FavoriteThreads::getInstance() ->insert( datURL.prettyUrl() ); + FavoriteThreads::getInstance() ->insert(datURL.prettyUrl()); } const QString FavoriteThreads::toXML() const { QDomDocument document; - // QDomProcessingInstruction pi = document.createProcessingInstruction( "xml", "version=\"1.0\"" ); - // document.appendChild( pi ); + // QDomProcessingInstruction pi = document.createProcessingInstruction("xml", "version=\"1.0\""); + // document.appendChild(pi); - QDomElement root = document.createElementNS( "http://kita.sourceforge.jp/ns/favorites", "favorites" ); - document.appendChild( root ); + QDomElement root = document.createElementNS("http://kita.sourceforge.jp/ns/favorites", "favorites"); + document.appendChild(root); Q3ValueList::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" ); - root.appendChild( threadElement ); + for (it = threadList().begin(); it != threadList().end(); ++it) { + QString datURL = (*it).m_datURL; + QDomElement threadElement = document.createElementNS("http://kita.sourceforge.jp/ns/thread", "thread"); + root.appendChild(threadElement); - QDomElement datURLElement = document.createElement( "daturl" ); - threadElement.appendChild( datURLElement ); - datURLElement.appendChild( document.createTextNode( datURL ) ); + QDomElement datURLElement = document.createElement("daturl"); + threadElement.appendChild(datURLElement); + datURLElement.appendChild(document.createTextNode(datURL)); - QString threadName = Kita::DatManager::threadName( datURL ); - QDomElement nameElement = document.createElement( "name" ); - threadElement.appendChild( nameElement ); - nameElement.appendChild( document.createTextNode( threadName ) ); + QString threadName = Kita::DatManager::threadName(datURL); + QDomElement nameElement = document.createElement("name"); + threadElement.appendChild(nameElement); + nameElement.appendChild(document.createTextNode(threadName)); - QString resNum = QString::number( Kita::DatManager::getResNum( datURL ) ); - QDomElement resNumElement = document.createElement( "resnum" ); - threadElement.appendChild( resNumElement ); - resNumElement.appendChild( document.createTextNode( resNum ) ); + QString resNum = QString::number(Kita::DatManager::getResNum(datURL)); + QDomElement resNumElement = document.createElement("resnum"); + threadElement.appendChild(resNumElement); + resNumElement.appendChild(document.createTextNode(resNum)); // board - QDomElement board = document.createElementNS( "http://kita.sourceforge.jp/ns/board", "board" ); - threadElement.appendChild( board ); + QDomElement board = document.createElementNS("http://kita.sourceforge.jp/ns/board", "board"); + threadElement.appendChild(board); - QString boardURL = Kita::BoardManager::boardURL( datURL ); - QDomElement boardURLElement = document.createElement( "url" ); - board.appendChild( boardURLElement ); - boardURLElement.appendChild( document.createTextNode( boardURL ) ); + QString boardURL = Kita::BoardManager::boardURL(datURL); + QDomElement boardURLElement = document.createElement("url"); + board.appendChild(boardURLElement); + boardURLElement.appendChild(document.createTextNode(boardURL)); - QString boardName = Kita::BoardManager::boardName( boardURL ); - QDomElement boardNameElement = document.createElement( "name" ); - board.appendChild( boardNameElement ); - boardNameElement.appendChild( document.createTextNode( boardName ) ); + QString boardName = Kita::BoardManager::boardName(boardURL); + QDomElement boardNameElement = document.createElement("name"); + board.appendChild(boardNameElement); + boardNameElement.appendChild(document.createTextNode(boardName)); } - return document.toString( 0 ); + return document.toString(0); } -void FavoriteThreads::replace( QString fromURL, QString toURL ) +void FavoriteThreads::replace(QString fromURL, QString toURL) { - if ( FavoriteThreads::getInstance() == 0 ) return ; + if (FavoriteThreads::getInstance() == 0) return ; Q3ValueList& threadList = FavoriteThreads::getInstance() ->m_threadList; Q3ValueList::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.prepend( url ); + 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.prepend(url); it = threadList.begin(); } } } -QString FavoriteThreads::getDatURL( int i ) +QString FavoriteThreads::getDatURL(int i) { - if ( getInstance() ->m_threadList.count() > i ) { + if (getInstance() ->m_threadList.count() > i) { return getInstance() ->m_threadList[ i ].m_datURL; } else { return QString(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -28,10 +28,10 @@ public: QString m_datURL; FavoriteThreadItem(); - FavoriteThreadItem( const QString& datURL ) { m_datURL = datURL; } + FavoriteThreadItem(const QString& datURL) { m_datURL = datURL; } ~FavoriteThreadItem(); - bool operator==( const FavoriteThreadItem& item ) const; + bool operator==(const FavoriteThreadItem& item) const; }; class KDE_EXPORT FavoriteThreads @@ -43,18 +43,18 @@ ~FavoriteThreads(); const Q3ValueList threadList() const; - static void processThreadNode( QDomNode& node ); + static void processThreadNode(QDomNode& node); public: static FavoriteThreads* getInstance(); - void insert( const QString& datURL ); - void remove( const QString& datURL ); - bool contains( const QString& datURL ); + void insert(const QString& datURL); + void remove(const QString& datURL); + bool contains(const QString& datURL); const QString toXML() const; - static bool readFromXML( const QString& xml ); - static void replace( QString fromURL, QString toURL ); - static QString getDatURL( int i ); + static bool readFromXML(const QString& xml); + static void replace(QString fromURL, QString toURL); + static QString getDatURL(int i); static int count() { return getInstance() ->m_threadList.count(); } }; Modified: kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,18 +24,18 @@ { } -QString FlashCGI::buildPostStr( const QString & name, const QString & mail, const QString & body, const QString & boardID, const QString & threadID ) +QString FlashCGI::buildPostStr(const QString & name, const QString & mail, const QString & body, const QString & boardID, const QString & threadID) { QString ret; QTextCodec* codec = QTextCodec::codecForName("Shift-JIS"); int mib = codec->mibEnum(); - ( ret += "submit=" ) += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ - ( ret += "&FROM=" ) += Kita::encode_string( name, mib ); - ( ret += "&mail=" ) += Kita::encode_string( mail, mib ); - ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ); - ( ret += "&bbs=" ) += boardID; - ( ret += "&key=" ) += threadID; + (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ + (ret += "&FROM=") += Kita::encode_string(name, mib); + (ret += "&mail=") += Kita::encode_string(mail, mib); + (ret += "&MESSAGE=") += Kita::encode_string(body, mib); + (ret += "&bbs=") += boardID; + (ret += "&key=") += threadID; return ret; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/flashcgi.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -19,7 +19,7 @@ */ class KDE_EXPORT FlashCGI { public: - static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID ); + static QString buildPostStr(const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID); private: FlashCGI(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,20 +24,20 @@ { } -QString JBBS::buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime ) +QString JBBS::buildPostStr(const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime) { QString ret; QTextCodec* codec = QTextCodec::codecForName("Shift-JIS"); int mib = codec->mibEnum(); - ( ret += "submit=" ) += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ - ( ret += "&NAME=" ) += Kita::encode_string( name, mib ); - ( ret += "&MAIL=" ) += Kita::encode_string( mail, mib ); - ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ).replace( ';', "%3B" ); - ( ret += "&BBS=" ) += boardID.section( '/', 1, 1 ); - ( ret += "&DIR=" ) += boardID.section( '/', 0, 0 ); - ( ret += "&KEY=" ) += threadID; - ( ret += "&TIME=" ) += QString::number( serverTime ); + (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ + (ret += "&NAME=") += Kita::encode_string(name, mib); + (ret += "&MAIL=") += Kita::encode_string(mail, mib); + (ret += "&MESSAGE=") += Kita::encode_string(body, mib).replace(';', "%3B"); + (ret += "&BBS=") += boardID.section('/', 1, 1); + (ret += "&DIR=") += boardID.section('/', 0, 0); + (ret += "&KEY=") += threadID; + (ret += "&TIME=") += QString::number(serverTime); return ret; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/jbbs.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -19,7 +19,7 @@ */ class KDE_EXPORT JBBS { public: - static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime ); + static QString buildPostStr(const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime); private: JBBS(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/k2ch.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,34 +24,34 @@ { } -QString K2ch::buildPostStr( const QString& name, const QString& mail, +QString K2ch::buildPostStr(const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime, - const QString& sessionID ) + const QString& sessionID) { QString ret; QTextCodec* codec = QTextCodec::codecForName("Shift-JIS"); int mib = codec->mibEnum(); - ( ret += "submit=" ) += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ + (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ /* from, mail, message, bbs */ - ( ret += "&FROM=" ) += Kita::encode_string( name, mib ); - ( ret += "&mail=" ) += Kita::encode_string( mail, mib ); - ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ); - ( ret += "&bbs=" ) += boardID; - ( ret += "&hana=mogera" ); + (ret += "&FROM=") += Kita::encode_string(name, mib); + (ret += "&mail=") += Kita::encode_string(mail, mib); + (ret += "&MESSAGE=") += Kita::encode_string(body, mib); + (ret += "&bbs=") += boardID; + (ret += "&hana=mogera"); /* key */ - ( ret += "&key=" ) += threadID; + (ret += "&key=") += threadID; /* time */ - ( ret += "&time=" ) += QString::number( serverTime ); + (ret += "&time=") += QString::number(serverTime); /* login */ - if ( ! sessionID.isEmpty() ) { - ( ret += "&sid=" ) += sessionID; + if (! sessionID.isEmpty()) { + (ret += "&sid=") += sessionID; } return ret; Modified: kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/k2ch.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -19,7 +19,7 @@ */ class KDE_EXPORT K2ch { public: - static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime, const QString& sessionID ); + static QString buildPostStr(const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime, const QString& sessionID); private: K2ch(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -50,8 +50,8 @@ static QString m_machiSubject; static QString m_machiLine; - static QTextCodec * codecForHint( int encoding_hint /* not 0 ! */ ); - static QString encode( const QString& segment, int encoding_offset, int encoding_hint, bool isRawURI = false ); + static QTextCodec * codecForHint(int encoding_hint /* not 0 ! */); + static QString encode(const QString& segment, int encoding_offset, int encoding_hint, bool isRawURI = false); } @@ -60,40 +60,40 @@ /* Text codecs */ -QString Kita::qcpToUnicode( const QByteArray& str ) +QString Kita::qcpToUnicode(const QByteArray& str) { - if ( !Kita::qcpCodec ) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); + if (!Kita::qcpCodec) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); - return Kita::qcpCodec->toUnicode( str ); + return Kita::qcpCodec->toUnicode(str); } -QString Kita::utf8ToUnicode( const QByteArray& str ) +QString Kita::utf8ToUnicode(const QByteArray& str) { - if ( !Kita::utf8Codec ) Kita::utf8Codec = QTextCodec::codecForName( "utf8" ); + if (!Kita::utf8Codec) Kita::utf8Codec = QTextCodec::codecForName("utf8"); - return Kita::utf8Codec->toUnicode( str ); + return Kita::utf8Codec->toUnicode(str); } -QString Kita::eucToUnicode( const QByteArray& str ) +QString Kita::eucToUnicode(const QByteArray& str) { - if ( !Kita::eucCodec ) Kita::eucCodec = QTextCodec::codecForName( "eucJP" ); + if (!Kita::eucCodec) Kita::eucCodec = QTextCodec::codecForName("eucJP"); - return Kita::eucCodec->toUnicode( str ); + return Kita::eucCodec->toUnicode(str); } -QByteArray Kita::unicodeToQcp( const QString& str ) +QByteArray Kita::unicodeToQcp(const QString& str) { - if ( !Kita::qcpCodec ) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); - return Kita::qcpCodec->fromUnicode( str ); + if (!Kita::qcpCodec) Kita::qcpCodec = QTextCodec::codecForName("Shift-JIS"); + return Kita::qcpCodec->fromUnicode(str); } -QByteArray Kita::unicodeToEuc( const QString& str ) +QByteArray Kita::unicodeToEuc(const QString& str) { - if ( !Kita::eucCodec ) Kita::eucCodec = QTextCodec::codecForName( "eucJP" ); + if (!Kita::eucCodec) Kita::eucCodec = QTextCodec::codecForName("eucJP"); - return Kita::eucCodec->fromUnicode( str ); + return Kita::eucCodec->fromUnicode(str); } /*------------------------------------------------------------*/ @@ -103,7 +103,7 @@ /* get HTML from raw data */ -QString Kita::datToHtml( const QString& rawData, int num ) +QString Kita::datToHtml(const QString& rawData, int num) { QString retHTML, subject, titleHTML; RESDAT resdat; @@ -111,8 +111,8 @@ resdat.num = num; resdat.linestr = rawData; resdat.parsed = false; - parseResDat( resdat, subject ); - createTitleHTML( resdat, titleHTML ); + parseResDat(resdat, subject); + createTitleHTML(resdat, titleHTML); retHTML = "
" + titleHTML + "
"; retHTML += "
" + resdat.bodyHTML + "
"; @@ -141,20 +141,20 @@ const QChar *chpt = rawData.unicode(); unsigned int length = rawData.length(); - for ( unsigned int i = startPos = 0 ; i < length ; i++ ) { + for (unsigned int i = startPos = 0 ; i < length ; i++) { - switch ( chpt[ i ].unicode() ) { + switch (chpt[ i ].unicode()) { case '<': /* "
" */ - if ( chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>' ) { + if (chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>') { unsigned int i2 = i - startPos; - if ( i > 0 && chpt[ i - 1 ] == ' ' ) i2--; /* remove space before
*/ - text += rawData.mid( startPos, i2 ) + '\n'; + if (i > 0 && chpt[ i - 1 ] == ' ') i2--; /* remove space before
*/ + text += rawData.mid(startPos, i2) + '\n'; startPos = i + 4; - if ( chpt[ startPos ] == ' ' ) startPos++; /* remove space after
*/ + if (chpt[ startPos ] == ' ') startPos++; /* remove space after
*/ i = startPos - 1; } @@ -163,8 +163,8 @@ /* remove HTML tags <[^>]*> */ else { - if ( i - startPos ) text += rawData.mid( startPos, i - startPos ); - while ( chpt[ i ] != '>' && i < length ) i++; + if (i - startPos) text += rawData.mid(startPos, i - startPos); + while (chpt[ i ] != '>' && i < length) i++; startPos = i + 1; } @@ -178,10 +178,10 @@ /* special char */ { QString tmpstr; - tmpstr = parseSpecialChar( chpt + i, pos ); + tmpstr = parseSpecialChar(chpt + i, pos); - if ( !tmpstr.isEmpty() ) { - text += rawData.mid( startPos, i - startPos ) + tmpstr; + if (!tmpstr.isEmpty()) { + text += rawData.mid(startPos, i - startPos) + tmpstr; startPos = i + pos; i = startPos - 1; } @@ -191,7 +191,7 @@ } } - text += rawData.mid( startPos ); + text += rawData.mid(startPos); } @@ -207,27 +207,27 @@ const QChar *cdat, /* output */ - unsigned int& pos ) + unsigned int& pos) { QString retstr; - if ( ( pos = isEqual( cdat , ">" ) ) ) retstr = '>'; - else if ( ( pos = isEqual( cdat , "<" ) ) ) retstr = '<'; - else if ( ( pos = isEqual( cdat , " " ) ) ) retstr = ' '; - else if ( ( pos = isEqual( cdat , "&" ) ) ) retstr = '&'; - else if ( ( pos = isEqual( cdat , """ ) ) ) retstr = '"'; + if ((pos = isEqual(cdat , ">"))) retstr = '>'; + else if ((pos = isEqual(cdat , "<"))) retstr = '<'; + else if ((pos = isEqual(cdat , " "))) retstr = ' '; + else if ((pos = isEqual(cdat , "&"))) retstr = '&'; + else if ((pos = isEqual(cdat , """))) retstr = '"'; - else if ( ( pos = isEqual( cdat , "♥" ) ) ) - retstr = utf8ToUnicode( KITAUTF8_HEART ); + else if ((pos = isEqual(cdat , "♥"))) + retstr = utf8ToUnicode(KITAUTF8_HEART); - else if ( ( pos = isEqual( cdat , "♦" ) ) ) - retstr = utf8ToUnicode( KITAUTF8_DIA ); + else if ((pos = isEqual(cdat , "♦"))) + retstr = utf8ToUnicode(KITAUTF8_DIA); - else if ( ( pos = isEqual( cdat , "♣" ) ) ) - retstr = utf8ToUnicode( KITAUTF8_CLUB ); + else if ((pos = isEqual(cdat , "♣"))) + retstr = utf8ToUnicode(KITAUTF8_CLUB); - else if ( ( pos = isEqual( cdat , "♠" ) ) ) - retstr = utf8ToUnicode( KITAUTF8_SPADE ); + else if ((pos = isEqual(cdat , "♠"))) + retstr = utf8ToUnicode(KITAUTF8_SPADE); return retstr; } @@ -238,39 +238,39 @@ /* conversion of URL */ -KUrl Kita::getDatURL( const KUrl& url , QString& refstr ) +KUrl Kita::getDatURL(const KUrl& url , QString& refstr) { - return convertURL( URLMODE_DAT, url, refstr ); + return convertURL(URLMODE_DAT, url, refstr); } -KUrl Kita::getDatURL( const KUrl& url ) +KUrl Kita::getDatURL(const KUrl& url) { QString refstr; - return convertURL( URLMODE_DAT, url, refstr ); + return convertURL(URLMODE_DAT, url, refstr); } -QString Kita::getThreadURL( const KUrl& url, QString& refstr ) +QString Kita::getThreadURL(const KUrl& url, QString& refstr) { - return convertURL( URLMODE_THREAD, url, refstr ); + return convertURL(URLMODE_THREAD, url, refstr); } -QString Kita::getThreadURL( const KUrl& url ) +QString Kita::getThreadURL(const KUrl& url) { QString refstr; - return convertURL( URLMODE_THREAD, url, refstr ); + return convertURL(URLMODE_THREAD, url, refstr); } -QString Kita::getNewThreadWriteURL( const KUrl& m_datURL ) +QString Kita::getNewThreadWriteURL(const KUrl& m_datURL) { - int m_bbstype = Kita::BoardManager::type( m_datURL ); + int m_bbstype = Kita::BoardManager::type(m_datURL); QString m_bbscgi; /* set path of bbs.cgi */ - switch ( m_bbstype ) { + switch (m_bbstype) { case Kita::Board_JBBS: { - QString cgipath = Kita::BoardManager::boardRoot( m_datURL ) - + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + '/'; + QString cgipath = Kita::BoardManager::boardRoot(m_datURL) + + "/bbs/write.cgi/" + Kita::BoardManager::boardID(m_datURL) + '/'; cgipath += "new/"; @@ -280,7 +280,7 @@ break; case Kita::Board_MachiBBS: { - QString cgipath = Kita::BoardManager::boardRoot( m_datURL ) + QString cgipath = Kita::BoardManager::boardRoot(m_datURL) + "/bbs/write.cgi"; m_bbscgi = cgipath; } @@ -289,25 +289,25 @@ default: - m_bbscgi = Kita::BoardManager::boardRoot( m_datURL ) + "/test/bbs.cgi"; + m_bbscgi = Kita::BoardManager::boardRoot(m_datURL) + "/test/bbs.cgi"; } return m_bbscgi; } -QString Kita::getWriteURL( const KUrl& m_datURL ) +QString Kita::getWriteURL(const KUrl& m_datURL) { - int m_bbstype = Kita::BoardManager::type( m_datURL ); + int m_bbstype = Kita::BoardManager::type(m_datURL); QString m_bbscgi; /* set path of bbs.cgi */ - switch ( m_bbstype ) { + switch (m_bbstype) { case Kita::Board_JBBS: { - QString cgipath = Kita::BoardManager::boardRoot( m_datURL ) - + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + '/'; + QString cgipath = Kita::BoardManager::boardRoot(m_datURL) + + "/bbs/write.cgi/" + Kita::BoardManager::boardID(m_datURL) + '/'; - cgipath += Kita::DatManager::threadID( m_datURL ) + '/'; + cgipath += Kita::DatManager::threadID(m_datURL) + '/'; m_bbscgi = cgipath; } @@ -315,7 +315,7 @@ break; case Kita::Board_MachiBBS: { - QString cgipath = Kita::BoardManager::boardRoot( m_datURL ) + QString cgipath = Kita::BoardManager::boardRoot(m_datURL) + "/bbs/write.cgi"; m_bbscgi = cgipath; } @@ -324,7 +324,7 @@ default: - m_bbscgi = Kita::BoardManager::boardRoot( m_datURL ) + "/test/bbs.cgi"; + m_bbscgi = Kita::BoardManager::boardRoot(m_datURL) + "/test/bbs.cgi"; } return m_bbscgi; @@ -368,22 +368,22 @@ const KUrl& url , /* output */ - QString& refstr ) + QString& refstr) { refstr.clear(); - if ( url.isEmpty() ) return QString(); + if (url.isEmpty()) return QString(); /* cache */ - if ( m_prevConvMode == mode && m_prevConvURL == url.prettyUrl() ) { + if (m_prevConvMode == mode && m_prevConvURL == url.prettyUrl()) { refstr = m_prevConvRefstr; return m_prevConvNewURL; } /* Is board enrolled ? */ - BoardData* bdata = Kita::BoardManager::getBoardData( url ); - if ( bdata == 0 ) return QString(); + BoardData* bdata = Kita::BoardManager::getBoardData(url); + if (bdata == 0) return QString(); QString urlstr = url.prettyUrl(); @@ -391,48 +391,48 @@ QString thread; QString refBase; - if ( urlstr.contains( "/dat/" ) ) { + if (urlstr.contains("/dat/")) { /* url = (hostname)/(rootPath)/(bbsPath)/dat/(thread_ID).(ext)#(refBase) */ - thread = url.fileName().remove( bdata->ext() ); + thread = url.fileName().remove(bdata->ext()); refBase = url.ref(); - } else if ( urlstr.contains( bdata->delimiter() ) ) { + } else if (urlstr.contains(bdata->delimiter())) { QString tmpstr; - switch ( bdata->type() ) { + switch (bdata->type()) { /* machi BBS */ /* ex.) If url = http://kanto.machi.to/bbs/read.pl?BBS=kana&KEY=1096716679 , then, thread = 1096716679 */ case Board_MachiBBS: - thread = url.queryItem( "KEY" ); + thread = url.queryItem("KEY"); refBase.clear(); break; /* url = (hostname)/(rootPath)/(delimiter)/(bbsPath)/(thread_ID)/(refBase) */ default: - tmpstr = urlstr.section( bdata->delimiter() + bdata->bbsPath(), 1, 1 ); - thread = tmpstr.section( '/', 1, 1 ); - refBase = tmpstr.section( '/', 2, 2 ); + tmpstr = urlstr.section(bdata->delimiter() + bdata->bbsPath(), 1, 1); + thread = tmpstr.section('/', 1, 1); + refBase = tmpstr.section('/', 2, 2); break; } } - if ( thread.isEmpty() ) return QString(); + if (thread.isEmpty()) return QString(); - if ( !refBase.isEmpty() ) { + if (!refBase.isEmpty()) { - if ( refBase.at( 0 ) == '-' ) refstr = '1' + refBase; + if (refBase.at(0) == '-') refstr = '1' + refBase; else refstr = refBase; } /* create new URL */ QString newURL; - if ( mode == URLMODE_DAT ) newURL = bdata->basePath() + "dat/" + thread + bdata->ext(); + if (mode == URLMODE_DAT) newURL = bdata->basePath() + "dat/" + thread + bdata->ext(); else { newURL = bdata->cgiBasePath(); - switch ( bdata->type() ) { + switch (bdata->type()) { case Board_MachiBBS: newURL += "&KEY=" + thread; @@ -459,27 +459,27 @@ * http://pc5.2ch.net/linux/dat/1089905503.dat * -> http://pc5.2ch.net/test/offlaw.cgi?bbs=linux&key=1089905503 */ -QString Kita::datToOfflaw( const KUrl& datURL ) +QString Kita::datToOfflaw(const KUrl& datURL) { /* TODO: not tested. */ - KUrl url( datURL ); + KUrl url(datURL); QString root = url.host(); - QStringList list = url.fileName().split( '.' ); - if ( list.size() != 2 ) { + QStringList list = url.fileName().split('.'); + if (list.size() != 2) { return QString(); } QString datName = list[ 0 ]; - url.cd( ".." ); - if ( url.fileName() != "dat" ) { + url.cd(".."); + if (url.fileName() != "dat") { return QString(); } - url.cd( ".." ); + url.cd(".."); QString board = url.fileName(); - return QString( "http://%1/test/offlaw.cgi?raw=0.0&bbs=%2&key=%3" ).arg( root ).arg( board ).arg( datName ); + return QString("http://%1/test/offlaw.cgi?raw=0.0&bbs=%2&key=%3").arg(root).arg(board).arg(datName); } @@ -489,21 +489,21 @@ /* utilities */ /* create directory recursively */ -bool Kita::mkdir( const QString& targetPath ) +bool Kita::mkdir(const QString& targetPath) { - QDir qdir( targetPath ); - if ( !qdir.exists() ) { + QDir qdir(targetPath); + if (!qdir.exists()) { - QStringList pathList = targetPath.split( '/' ); + QStringList pathList = targetPath.split('/'); QString path; - for ( int i = 0; i < pathList.count(); ++i ) { + for (int i = 0; i < pathList.count(); ++i) { path += '/' + pathList[ i ]; qdir = path; - if ( !qdir.exists() ) { - if ( !qdir.mkdir( path ) ) return false; + if (!qdir.exists()) { + if (!qdir.mkdir(path)) return false; } } } @@ -512,26 +512,26 @@ } -QString Kita::unescape( const QString& str ) +QString Kita::unescape(const QString& str) { QString ret = str; - return ret.replace( "<", "<" ).replace( ">", ">" ).replace( "&", "&" ); + return ret.replace("<", "<").replace(">", ">").replace("&", "&"); } -uint Kita::datToSince( const KUrl& datURL ) +uint Kita::datToSince(const KUrl& datURL) { - return KUrl( datURL ).fileName().section( '.', 0, 0 ).toInt(); + return KUrl(datURL).fileName().section('.', 0, 0).toInt(); } /* if cdat == str, return str.length() */ -int Kita::isEqual( const QChar *cdat, const QString& str ) +int Kita::isEqual(const QChar *cdat, const QString& str) { int i = 0; const int size = str.size(); - while ( i < size && str.at( i ) != '\0' ) { - if ( *cdat != str.at( i ) ) return 0; + while (i < size && str.at(i) != '\0') { + if (*cdat != str.at(i)) return 0; cdat++;i++; } return i; @@ -544,18 +544,18 @@ /* For example, if cdat = "1234", then ret = 1234. If cdat = "abcd", then ret = -1. */ -int Kita::stringToPositiveNum( const QChar *cdat, const unsigned int length ) +int Kita::stringToPositiveNum(const QChar *cdat, const unsigned int length) { int ret = 0; - for ( unsigned int i = 0 ; i < length ; i++ ) { + for (unsigned int i = 0 ; i < length ; i++) { unsigned short c = cdat[ i ].unicode(); - if ( ( c < UTF16_0 || c > UTF16_9 ) && ( c < '0' || c > '9' ) ) return -1; + if ((c < UTF16_0 || c > UTF16_9) && (c < '0' || c > '9')) return -1; ret *= 10; - if ( c >= UTF16_0 ) ret += c - UTF16_0; + if (c >= UTF16_0) ret += c - UTF16_0; else ret += c - '0'; } @@ -569,14 +569,14 @@ /* internal parsing functions */ -QStringList Kita::parseSearchQuery( const QString& input ) +QStringList Kita::parseSearchQuery(const QString& input) { - QStringList tmp = input.split( ' ' ); + QStringList tmp = input.split(' '); QStringList ret_list; - QRegExp truncSpace( "\\s*$" ); + QRegExp truncSpace("\\s*$"); QStringList::iterator it = tmp.begin(); - for ( ; it != tmp.end(); ++it ) - ret_list += ( *it ).remove( truncSpace ); + for (; it != tmp.end(); ++it) + ret_list += (*it).remove(truncSpace); return ret_list; } @@ -591,7 +591,7 @@ m_machiLine.clear(); } -QString Kita::ParseMachiBBSOneLine( const QString& inputLine, int& nextNum ) +QString Kita::ParseMachiBBSOneLine(const QString& inputLine, int& nextNum) { QString ret; m_machiLine += inputLine; @@ -606,80 +606,80 @@ QString message; // Subject - QRegExp title_regexp( "(.*)" ); + QRegExp title_regexp("(.*)"); // pattern 1 (tokyo,kanagawa,...) - QRegExp regexp ( "
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*)
(.*)" ); - QRegExp regexp2( "
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*)
(.*)" ); + QRegExp regexp ("
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*)
(.*)"); + QRegExp regexp2("
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*)
(.*)"); // pattern 2 (hokkaido,...) - QRegExp regexp3( "
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*) \\[ ([^ ]*) \\]
(.*)" ); - QRegExp regexp4( "
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*) \\[ ([^ ]*) \\]
(.*)" ); + QRegExp regexp3("
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*) \\[ ([^ ]*) \\]
(.*)"); + QRegExp regexp4("
(\\d*) .* (.*) .* (..../../..).* (..:..:..) ID:([^<]*) \\[ ([^ ]*) \\]
(.*)"); /* abone */ - QRegExp regexp5( "
(\\d*) .*
.*" ); + QRegExp regexp5("
(\\d*) .*
.*"); - if ( regexp.indexIn( m_machiLine ) != -1 ) { + if (regexp.indexIn(m_machiLine) != -1) { - num = regexp.cap( 1 ).toInt(); - name = regexp.cap( 2 ); - date = regexp.cap( 3 ); - time = regexp.cap( 4 ); - id = regexp.cap( 5 ); - message = regexp.cap( 6 ); + num = regexp.cap(1).toInt(); + name = regexp.cap(2); + date = regexp.cap(3); + time = regexp.cap(4); + id = regexp.cap(5); + message = regexp.cap(6); - } else if ( regexp2.indexIn( m_machiLine ) != -1 ) { + } else if (regexp2.indexIn(m_machiLine) != -1) { - num = regexp2.cap( 1 ).toInt(); - mail = regexp2.cap( 2 ); - name = regexp2.cap( 3 ); - date = regexp2.cap( 4 ); - time = regexp2.cap( 5 ); - id = regexp2.cap( 6 ); - message = regexp2.cap( 7 ); + num = regexp2.cap(1).toInt(); + mail = regexp2.cap(2); + name = regexp2.cap(3); + date = regexp2.cap(4); + time = regexp2.cap(5); + id = regexp2.cap(6); + message = regexp2.cap(7); - } else if ( regexp3.indexIn( m_machiLine ) != -1 ) { + } else if (regexp3.indexIn(m_machiLine) != -1) { - num = regexp3.cap( 1 ).toInt(); - name = regexp3.cap( 2 ); - date = regexp3.cap( 3 ); - time = regexp3.cap( 4 ); - id = regexp3.cap( 5 ); - host = regexp3.cap( 6 ); - message = regexp3.cap( 7 ); + num = regexp3.cap(1).toInt(); + name = regexp3.cap(2); + date = regexp3.cap(3); + time = regexp3.cap(4); + id = regexp3.cap(5); + host = regexp3.cap(6); + message = regexp3.cap(7); - } else if ( regexp4.indexIn( m_machiLine ) != -1 ) { + } else if (regexp4.indexIn(m_machiLine) != -1) { - num = regexp4.cap( 1 ).toInt(); - mail = regexp4.cap( 2 ); - name = regexp4.cap( 3 ); - date = regexp4.cap( 4 ); - time = regexp4.cap( 5 ); - id = regexp4.cap( 6 ); - host = regexp4.cap( 7 ); - message = regexp4.cap( 8 ); + num = regexp4.cap(1).toInt(); + mail = regexp4.cap(2); + name = regexp4.cap(3); + date = regexp4.cap(4); + time = regexp4.cap(5); + id = regexp4.cap(6); + host = regexp4.cap(7); + message = regexp4.cap(8); - } else if ( regexp5.indexIn( m_machiLine ) != -1 ) { /* abone */ + } else if (regexp5.indexIn(m_machiLine) != -1) { /* abone */ - num = regexp5.cap( 1 ).toInt(); + num = regexp5.cap(1).toInt(); m_machiLine.clear(); - if ( num == nextNum ) return "abone<><><>abone<>"; + if (num == nextNum) return "abone<><><>abone<>"; else return QString(); - } else if ( title_regexp.indexIn( m_machiLine ) != -1 ) { /* get title */ + } else if (title_regexp.indexIn(m_machiLine) != -1) { /* get title */ - m_machiSubject = title_regexp.cap( 1 ); + m_machiSubject = title_regexp.cap(1); m_machiLine.clear(); return QString(); } else return QString(); - if ( num >= nextNum ) { + if (num >= nextNum) { - if ( num != 1 ) m_machiSubject.clear(); + if (num != 1) m_machiSubject.clear(); ret += name + "<><>" + date + ' ' + time + " ID:" + id; - if ( !host.isEmpty() ) ret += " HOST:" + host; + if (!host.isEmpty()) ret += " HOST:" + host; ret += "<>" + message + "<>" + m_machiSubject; nextNum = num; } @@ -693,11 +693,11 @@ /* for JBBS */ -QString Kita::ParseJBBSOneLine( const QString& line, int& nextNum ) +QString Kita::ParseJBBSOneLine(const QString& line, int& nextNum) { QString ret; - QStringList list = line.split( "<>" ); - if ( list.size() != 7 ) return QString(); + QStringList list = line.split("<>"); + if (list.size() != 7) return QString(); int num = list[ 0 ].toInt(); QString name = list[ 1 ]; @@ -707,15 +707,15 @@ QString subject = list[ 5 ]; QString id = list[ 6 ]; - if ( num < nextNum ) return QString(); + if (num < nextNum) return QString(); /* remove tag */ - QRegExp rex( "<[^<]*>" ); - name.remove( rex ); + QRegExp rex("<[^<]*>"); + name.remove(rex); /* remove week */ - rex = QRegExp( "\\(.*\\)" ); - date.remove( rex ); + rex = QRegExp("\\(.*\\)"); + date.remove(rex); ret += name + "<>" + mail + "<>" + date + " ID:" + id + "<>" + body + "<>" + subject; nextNum = num; @@ -728,11 +728,11 @@ /* for Flash CGI/Mini Thread */ -QString Kita::ParseFlashCGIOneLine( const QString& line ) +QString Kita::ParseFlashCGIOneLine(const QString& line) { QString ret; - QStringList list = line.split( "<>" ); - if ( list.size() != 13 ) return QString(); + QStringList list = line.split("<>"); + if (list.size() != 13) return QString(); QString name = list[ 0 ]; QString mail = list[ 1 ]; @@ -743,11 +743,11 @@ QString host = list[ 7 ]; /* remove tag */ - QRegExp rex( "<[^<]*>" ); - name.remove( rex ); + QRegExp rex("<[^<]*>"); + name.remove(rex); ret += name + "<>" + mail + "<>" + date + " ID:" + id; - if ( !host.isEmpty() ) ret += " HOST:" + host; + if (!host.isEmpty()) ret += " HOST:" + host; ret += "<>" + body + "<>" + subject; return ret; @@ -779,9 +779,9 @@ resdat.* subject */ -bool Kita::parseResDat( RESDAT& resdat, QString& subject ) +bool Kita::parseResDat(RESDAT& resdat, QString& subject) { - if ( resdat.parsed ) return true; + if (resdat.parsed) return true; resdat.parsed = true; resdat.broken = false; @@ -792,14 +792,14 @@ unsigned int length = resdat.linestr.length(); unsigned int section = 0; unsigned int sectionPos[ 5 ]; - for ( unsigned int i = 0 ; i < length ; i++ ) { + for (unsigned int i = 0 ; i < length ; i++) { /* sections are splitted by "<>" */ - if ( chpt[ i ] == '<' && chpt[ i + 1 ] == '>' ) { + if (chpt[ i ] == '<' && chpt[ i + 1 ] == '>') { section++; - if ( section >= 5 ) { + if (section >= 5) { resdat.broken = true; return true; } @@ -810,31 +810,31 @@ } /* broken data */ - if ( section != 4 ) { + if (section != 4) { resdat.broken = true; return true; } - // qDebug("[%d] %d %d %d %d",section, sectionPos[1],sectionPos[2],sectionPos[3],sectionPos[4] ); + // qDebug("[%d] %d %d %d %d",section, sectionPos[1],sectionPos[2],sectionPos[3],sectionPos[4]); /* name */ length = sectionPos[ 1 ] - 2 ; - parseName( resdat.linestr.mid( 0, length ), resdat ); + parseName(resdat.linestr.mid(0, length), resdat); /* mail */ length = sectionPos[ 2 ] - 2 - sectionPos[ 1 ]; - DatToText( resdat.linestr.mid( sectionPos[ 1 ], length ), resdat.address ); + DatToText(resdat.linestr.mid(sectionPos[ 1 ], length), resdat.address); /* date, ID, host */ length = sectionPos[ 3 ] - 2 - sectionPos[ 2 ]; - parseDateId( resdat.linestr.mid( sectionPos[ 2 ], length ), resdat ); + parseDateId(resdat.linestr.mid(sectionPos[ 2 ], length), resdat); /* body */ length = sectionPos[ 4 ] - 2 - sectionPos[ 3 ]; - parseBody( resdat.linestr.mid( sectionPos[ 3 ], length ), resdat ); + parseBody(resdat.linestr.mid(sectionPos[ 3 ], length), resdat); /* subject */ - subject = resdat.linestr.mid( sectionPos[ 4 ] ); + subject = resdat.linestr.mid(sectionPos[ 4 ]); return true; } @@ -848,30 +848,30 @@ resdat.nameHTML */ -void Kita::parseName( const QString& rawStr, RESDAT& resdat ) +void Kita::parseName(const QString& rawStr, RESDAT& resdat) { unsigned int i = 0, pos; int refNum[ 2 ]; QString linkurl, linkstr; - DatToText( rawStr, resdat.name ); + DatToText(rawStr, resdat.name); const QChar * chpt = resdat.name.unicode(); unsigned int length = resdat.name.length(); resdat.nameHTML.clear(); /* anchor */ - while ( parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) { + while (parseResAnchor(chpt + i, length - i, linkstr, refNum, pos)) { - linkurl = QString( "#%1" ).arg( refNum[ 0 ] ); - if ( refNum[ 1 ] ) linkurl += QString( "-%1" ).arg( refNum[ 1 ] ); + linkurl = QString("#%1").arg(refNum[ 0 ]); + if (refNum[ 1 ]) linkurl += QString("-%1").arg(refNum[ 1 ]); resdat.nameHTML += ""; resdat.nameHTML += linkstr; resdat.nameHTML += ""; ANCNUM anctmp; - if ( refNum[ 1 ] < refNum[ 0 ] ) refNum[ 1 ] = refNum[ 0 ]; + if (refNum[ 1 ] < refNum[ 0 ]) refNum[ 1 ] = refNum[ 0 ]; anctmp.from = refNum[ 0 ]; anctmp.to = refNum[ 1 ]; resdat.anclist += anctmp; @@ -880,10 +880,10 @@ } /* non-digits strings */ - if ( i < length ) { + if (i < length) { resdat.nameHTML += ""; - resdat.nameHTML += resdat.name.mid( i ); + resdat.nameHTML += resdat.name.mid(i); resdat.nameHTML += ""; } @@ -900,7 +900,7 @@ resdat.host */ -void Kita::parseDateId( const QString& rawStr, RESDAT& resdat ) +void Kita::parseDateId(const QString& rawStr, RESDAT& resdat) { resdat.date = rawStr; resdat.id.clear(); @@ -912,48 +912,48 @@ unsigned int pos = 0, startpos = 0; unsigned int length = rawStr.length(); - while ( chpt[ pos ] != '\0' && - !( chpt[ pos ] == 'I' && chpt[ pos + 1 ] == 'D' ) && - !( chpt[ pos ] == 'B' && chpt[ pos + 1 ] == 'E' ) ) { + while (chpt[ pos ] != '\0' && + !(chpt[ pos ] == 'I' && chpt[ pos + 1 ] == 'D') && + !(chpt[ pos ] == 'B' && chpt[ pos + 1 ] == 'E')) { pos++; } - resdat.date = rawStr.left( pos ); + resdat.date = rawStr.left(pos); /* id */ - if ( chpt[ pos ] == 'I' && chpt[ pos + 1 ] == 'D' ) { + if (chpt[ pos ] == 'I' && chpt[ pos + 1 ] == 'D') { pos += 3; startpos = pos; - while ( chpt[ pos ] != ' ' && pos++ < length ) {}; - resdat.id = rawStr.mid( startpos, pos - startpos ); + while (chpt[ pos ] != ' ' && pos++ < length) {}; + resdat.id = rawStr.mid(startpos, pos - startpos); pos++; } - // qDebug("date %s, ID %s", (const char*)resdat.date.local8Bit(), resdat.id.ascii() ); + // qDebug("date %s, ID %s", (const char*)resdat.date.local8Bit(), resdat.id.ascii()); - if ( pos >= length ) return ; + if (pos >= length) return ; /* be */ - if ( chpt[ pos ] == 'B' && chpt[ pos + 1 ] == 'E' ) { + if (chpt[ pos ] == 'B' && chpt[ pos + 1 ] == 'E') { pos += 3; startpos = pos; - while ( chpt[ pos ] != '-' && pos++ < length ) {}; - resdat.be = rawStr.mid( startpos, pos - startpos ); + while (chpt[ pos ] != '-' && pos++ < length) {}; + resdat.be = rawStr.mid(startpos, pos - startpos); pos++; - if ( pos < length && chpt[ pos ] == '#') { + if (pos < length && chpt[ pos ] == '#') { startpos = pos; - while ( chpt[ pos ] == '#' && pos++ < length ) {}; - resdat.bepointmark = rawStr.mid( startpos, pos - startpos ); + while (chpt[ pos ] == '#' && pos++ < length) {}; + resdat.bepointmark = rawStr.mid(startpos, pos - startpos); } } - if ( pos >= length ) return ; + if (pos >= length) return ; /* host */ - if ( chpt[ pos ] == 'H' && chpt[ pos + 1 ] == 'O' ) { + if (chpt[ pos ] == 'H' && chpt[ pos + 1 ] == 'O') { pos += 5; startpos = pos; - while ( chpt[ pos ] != ' ' && pos++ < length ) {}; - resdat.host = rawStr.mid( startpos, pos - startpos ); + while (chpt[ pos ] != ' ' && pos++ < length) {}; + resdat.host = rawStr.mid(startpos, pos - startpos); pos++; // qDebug("host %s", resdat.host.ascii()); } @@ -968,7 +968,7 @@ resdat.bodyHTML */ -void Kita::parseBody( const QString &rawStr, RESDAT& resdat ) +void Kita::parseBody(const QString &rawStr, RESDAT& resdat) { resdat.bodyHTML.clear(); @@ -988,27 +988,27 @@ */ int offset = 0; - if ( chpt[ 0 ] == ' ' ) offset = 1; /* remove one space after <> */ - for ( unsigned int i = startPos = offset ; i < length ; i++ ) { + if (chpt[ 0 ] == ' ') offset = 1; /* remove one space after <> */ + for (unsigned int i = startPos = offset ; i < length ; i++) { - switch ( chpt[ i ].unicode() ) { + switch (chpt[ i ].unicode()) { case '<': /* "
" */ - if ( chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>' ) { + if (chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>') { /* reset anchor chain */ ancChain = false; unsigned int i2 = i - startPos; - if ( i > 0 && chpt[ i - 1 ] == ' ' ) i2--; /* remove space before
*/ - resdat.bodyHTML += rawStr.mid( startPos, i2 ); + if (i > 0 && chpt[ i - 1 ] == ' ') i2--; /* remove space before
*/ + resdat.bodyHTML += rawStr.mid(startPos, i2); resdat.bodyHTML += "
"; startPos = i + 4; - if ( chpt[ startPos ] == ' ' ) startPos++; /* remove space after
*/ + if (chpt[ startPos ] == ' ') startPos++; /* remove space after
*/ i = startPos - 1; } @@ -1017,8 +1017,8 @@ /* remove HTML tags <[^>]*> */ else { - if ( i - startPos ) resdat.bodyHTML += rawStr.mid( startPos, i - startPos ); - while ( chpt[ i ] != '>' && i < length ) i++; + if (i - startPos) resdat.bodyHTML += rawStr.mid(startPos, i - startPos); + while (chpt[ i ] != '>' && i < length) i++; startPos = i + 1; } @@ -1029,9 +1029,9 @@ case 'h': /* "http://" or "ttp://" or "tp:" */ case 't': - if ( parseLink( chpt + i, length - i, linkstr, linkurl, pos ) ) { + if (parseLink(chpt + i, length - i, linkstr, linkurl, pos)) { - resdat.bodyHTML += rawStr.mid( startPos, i - startPos ); + resdat.bodyHTML += rawStr.mid(startPos, i - startPos); resdat.bodyHTML += ""; resdat.bodyHTML += linkstr; resdat.bodyHTML += ""; @@ -1047,8 +1047,8 @@ case '&': /* > */ - if ( chpt[ i + 1 ] == 'g' && chpt[ i + 2 ] == 't' && chpt[ i + 3 ] == ';' ) - ancChain = createResAnchor( rawStr, resdat, chpt, i, startPos ); + if (chpt[ i + 1 ] == 'g' && chpt[ i + 2 ] == 't' && chpt[ i + 3 ] == ';') + ancChain = createResAnchor(rawStr, resdat, chpt, i, startPos); break; @@ -1057,18 +1057,18 @@ /* unicode '>' */ case UTF16_BRACKET: - ancChain = createResAnchor( rawStr, resdat, chpt, i, startPos ); + ancChain = createResAnchor(rawStr, resdat, chpt, i, startPos); break; /*----------------------------------*/ default: - if ( ancChain ) ancChain = createResAnchor( rawStr, resdat, chpt, i, startPos ); + if (ancChain) ancChain = createResAnchor(rawStr, resdat, chpt, i, startPos); } } - resdat.bodyHTML += rawStr.mid( startPos ); + resdat.bodyHTML += rawStr.mid(startPos); } @@ -1106,22 +1106,22 @@ QString prefix; QString scheme; - if ( isEqual( cdat , "http://" ) ) { + if (isEqual(cdat , "http://")) { prefix = "http://"; scheme = "http://"; - } else if ( isEqual( cdat , "ttp://" ) ) { + } else if (isEqual(cdat , "ttp://")) { prefix = "ttp://"; scheme = "http://"; - } else if ( isEqual( cdat , "tp://" ) ) { + } else if (isEqual(cdat , "tp://")) { prefix = "tp://"; scheme = "http://"; - } else if ( isEqual( cdat , "https://" ) ) { + } else if (isEqual(cdat , "https://")) { prefix = "https://"; scheme = "https://"; - } else if ( isEqual( cdat , "ttps://" ) ) { + } else if (isEqual(cdat , "ttps://")) { prefix = "ttps://"; scheme = "https://"; - } else if ( isEqual( cdat , "tps://" ) ) { + } else if (isEqual(cdat , "tps://")) { prefix = "tps://"; scheme = "https://"; } else { @@ -1129,14 +1129,14 @@ } pos = prefix.length(); - while ( cdat[ pos ] >= '!' && cdat[ pos ] <= '~' && + while (cdat[ pos ] >= '!' && cdat[ pos ] <= '~' && cdat[ pos ] != ' ' && cdat[ pos ] != '<' && cdat[ pos ] != '>' - && pos < length ) { + && pos < length) { retlinkstr += cdat[ pos++ ]; } - if ( pos > length ) return false; + if (pos > length) return false; - if ( !retlinkstr.isEmpty() ) DatToText( retlinkstr, linkstr ); + if (!retlinkstr.isEmpty()) DatToText(retlinkstr, linkstr); linkurl = scheme + linkstr; linkstr = prefix + linkstr; @@ -1155,7 +1155,7 @@ linkstr = ">12-20", refNum[0] = 12, refNum[1] = 20, - pos (= length of cdat ) = 9, + pos (= length of cdat) = 9, ret = true; */ @@ -1165,19 +1165,19 @@ const QChar *cdat, const unsigned int length, /* output */ - QString& linkstr, int* refNum, unsigned int& pos ) + QString& linkstr, int* refNum, unsigned int& pos) { struct LocalFunc { - static bool isHYPHEN( unsigned short c ) + static bool isHYPHEN(unsigned short c) { /* UTF-16 */ - if ( c == '-' - || ( c >= 0x2010 && c <= 0x2015 ) - || ( c == 0x2212 ) - || ( c == 0xFF0D ) /* UTF8: 0xEFBC8D */ - ) { + if (c == '-' + || (c >= 0x2010 && c <= 0x2015) + || (c == 0x2212) + || (c == 0xFF0D) /* UTF8: 0xEFBC8D */ + ) { return true; } @@ -1188,7 +1188,7 @@ bool ret = false; int i; - if ( length == 0 ) return false; + if (length == 0) return false; linkstr.clear(); refNum[ 0 ] = 0; @@ -1196,13 +1196,13 @@ pos = 0; /* check '>' twice */ - for ( i = 0;i < 2;i++ ) { + for (i = 0;i < 2;i++) { - if ( cdat[ pos ].unicode() == UTF16_BRACKET ) { + if (cdat[ pos ].unicode() == UTF16_BRACKET) { linkstr += cdat[ pos ]; pos++; - } else if ( cdat[ pos ] == '&' && cdat[ pos + 1 ] == 'g' /* > */ - && cdat[ pos + 2 ] == 't' && cdat[ pos + 3 ] == ';' ) { + } else if (cdat[ pos ] == '&' && cdat[ pos + 1 ] == 'g' /* > */ + && cdat[ pos + 2 ] == 't' && cdat[ pos + 3 ] == ';') { linkstr += '>'; pos += 4; } @@ -1210,16 +1210,16 @@ } /* check ',' */ - if ( !pos ) { - if ( cdat[ pos ] == ',' || cdat[ pos ].unicode() == UTF16_COMMA ) { + if (!pos) { + if (cdat[ pos ] == ',' || cdat[ pos ].unicode() == UTF16_COMMA) { linkstr += ','; pos ++; } } /* check '=' */ - if ( !pos ) { - if ( cdat[ pos ] == '=' || cdat[ pos ].unicode() == UTF16_EQ ) { + if (!pos) { + if (cdat[ pos ] == '=' || cdat[ pos ].unicode() == UTF16_EQ) { linkstr += '='; pos ++; } @@ -1228,24 +1228,24 @@ /* check digits */ int hyphen = 0; - for ( i = 0 ; i < KITA_RESDIGIT + 1 && pos < length ; i++, pos++ ) { + for (i = 0 ; i < KITA_RESDIGIT + 1 && pos < length ; i++, pos++) { unsigned short c = cdat[ pos ].unicode(); - if ( ( c < UTF16_0 || c > UTF16_9 ) - && ( c < '0' || c > '9' ) - && ( !LocalFunc::isHYPHEN( c ) - || ( i == 0 && LocalFunc::isHYPHEN( c ) ) - || ( hyphen && LocalFunc::isHYPHEN( c ) ) ) - ) break; + if ((c < UTF16_0 || c > UTF16_9) + && (c < '0' || c > '9') + && (!LocalFunc::isHYPHEN(c) + || (i == 0 && LocalFunc::isHYPHEN(c)) + || (hyphen && LocalFunc::isHYPHEN(c))) + ) break; linkstr += cdat[ pos ]; - if ( LocalFunc::isHYPHEN( c ) ) { + if (LocalFunc::isHYPHEN(c)) { hyphen = 1; i = -1; } else { - if ( c >= UTF16_0 ) c = '0' + cdat[ pos ].unicode() - UTF16_0; + if (c >= UTF16_0) c = '0' + cdat[ pos ].unicode() - UTF16_0; refNum[ hyphen ] *= 10; refNum[ hyphen ] += c - '0'; } @@ -1261,8 +1261,8 @@ /* create res anchor */ /* This function is called from parseBody internally. See also parseBody. */ -bool Kita::createResAnchor( const QString &rawStr, RESDAT& resdat, - const QChar *chpt, unsigned int &i, unsigned int &startPos ) +bool Kita::createResAnchor(const QString &rawStr, RESDAT& resdat, + const QChar *chpt, unsigned int &i, unsigned int &startPos) { QString linkstr, linkurl; int refNum[ 2 ]; @@ -1270,16 +1270,16 @@ unsigned int length = rawStr.length(); /* parse anchor */ - if ( !parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) { + if (!parseResAnchor(chpt + i, length - i, linkstr, refNum, pos)) { i += pos - 1; return false; } /* create anchor */ - resdat.bodyHTML += rawStr.mid( startPos, i - startPos ); - linkurl = QString( "#%1" ).arg( refNum[ 0 ] ); - if ( refNum[ 1 ] ) linkurl += QString( "-%1" ).arg( refNum[ 1 ] ); + resdat.bodyHTML += rawStr.mid(startPos, i - startPos); + linkurl = QString("#%1").arg(refNum[ 0 ]); + if (refNum[ 1 ]) linkurl += QString("-%1").arg(refNum[ 1 ]); resdat.bodyHTML += ""; resdat.bodyHTML += linkstr; @@ -1287,7 +1287,7 @@ /* add anchor to ancList */ ANCNUM anctmp; - if ( refNum[ 1 ] < refNum[ 0 ] ) refNum[ 1 ] = refNum[ 0 ]; + if (refNum[ 1 ] < refNum[ 0 ]) refNum[ 1 ] = refNum[ 0 ]; anctmp.from = refNum[ 0 ]; anctmp.to = refNum[ 1 ]; resdat.anclist += anctmp; @@ -1306,41 +1306,41 @@ output: titleHTML */ -void Kita::createTitleHTML( RESDAT& resdat, QString& titleHTML ) +void Kita::createTitleHTML(RESDAT& resdat, QString& titleHTML) { titleHTML.clear(); - if ( !resdat.parsed ) return ; + if (!resdat.parsed) return ; bool showMailAddress = Kita::Config::showMailAddress(); bool useTableTag = Kita::Config::useStyleSheet(); - if ( m_colonstr.isEmpty() ) { - m_colonstr = utf8ToUnicode( KITAUTF8_COLON ); - m_colonnamestr = utf8ToUnicode( KITAUTF8_NAME ); + if (m_colonstr.isEmpty()) { + m_colonstr = utf8ToUnicode(KITAUTF8_COLON); + m_colonnamestr = utf8ToUnicode(KITAUTF8_NAME); } - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += "
"; /* res number */ - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; /* ID */ - if ( !resdat.id.isEmpty() ) { + if (!resdat.id.isEmpty()) { - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; } /* BE */ - if ( !resdat.be.isEmpty() ) { + if (!resdat.be.isEmpty()) { - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; } /* host */ - if ( !resdat.host.isEmpty() ) { + if (!resdat.host.isEmpty()) { - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; } - if ( useTableTag ) titleHTML += "
"; - titleHTML += ""; - titleHTML += QString().setNum( resdat.num ); + if (useTableTag) titleHTML += ""; + titleHTML += ""; + titleHTML += QString().setNum(resdat.num); titleHTML += " "; /* name & mail address */ - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; titleHTML += "" + m_colonnamestr; /* show name with mail address */ - if ( showMailAddress ) { + if (showMailAddress) { titleHTML += resdat.nameHTML; - if ( !resdat.address.isEmpty() ) titleHTML += " [" + resdat.address + ']'; + if (!resdat.address.isEmpty()) titleHTML += " [" + resdat.address + ']'; } else { /* don't show mail address */ - if ( resdat.address.isEmpty() ) { + if (resdat.address.isEmpty()) { titleHTML += ""; titleHTML += resdat.name; @@ -1358,81 +1358,81 @@ titleHTML += " "; /* date */ - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; titleHTML += m_colonstr + resdat.date; - if ( useTableTag ) titleHTML += ""; - if ( resdat.id.count( "???" ) >= 1 ) titleHTML += " ID:" + resdat.id; + if (useTableTag) titleHTML += ""; + if (resdat.id.count("???") >= 1) titleHTML += " ID:" + resdat.id; else titleHTML += " ID" + ":" + resdat.id; - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; titleHTML += " ?" + resdat.bepointmark + ""; - if ( useTableTag ) titleHTML += ""; + if (useTableTag) titleHTML += ""; titleHTML += " HOST:" + resdat.host; - if ( useTableTag ) titleHTML += "
"; + if (useTableTag) titleHTML += ""; } -QString Kita::getCategory( const QString& line ) +QString Kita::getCategory(const QString& line) { - QRegExp regexp( "

(.*)
" ); - if ( regexp.indexIn( line ) != -1 ) { - return regexp.cap( 1 ); + QRegExp regexp("

(.*)
"); + if (regexp.indexIn(line) != -1) { + return regexp.cap(1); } else { return QString(); } } -bool Kita::isBoardURL( const QString& url ) +bool Kita::isBoardURL(const QString& url) { - QRegExp url_2ch( "http://.*\\.2ch\\.net/.*" ); - QRegExp url_bbspink( "http://.*\\.bbspink\\.com/.*" ); - QRegExp url_www_2ch( "http://www\\.2ch\\.net/.*" ); - QRegExp url_machibbs( "http://.*\\.machi\\.to/.*" ); + QRegExp url_2ch("http://.*\\.2ch\\.net/.*"); + QRegExp url_bbspink("http://.*\\.bbspink\\.com/.*"); + QRegExp url_www_2ch("http://www\\.2ch\\.net/.*"); + QRegExp url_machibbs("http://.*\\.machi\\.to/.*"); - if ( url.isEmpty() ) return false; + if (url.isEmpty()) return false; - if ( url_2ch.indexIn( url ) == -1 && url_bbspink.indexIn( url ) == -1 - && url_machibbs.indexIn( url ) == -1 ) return false; - if ( url_www_2ch.indexIn( url ) != -1 ) return false; + if (url_2ch.indexIn(url) == -1 && url_bbspink.indexIn(url) == -1 + && url_machibbs.indexIn(url) == -1) return false; + if (url_www_2ch.indexIn(url) != -1) return false; return true; } -QString Kita::fontToString( const QFont& font ) +QString Kita::fontToString(const QFont& font) { - return font.family() + ' ' + QString::number( font.pointSize() ); + return font.family() + ' ' + QString::number(font.pointSize()); } // copied from kurl.cpp -static QTextCodec * Kita::codecForHint( int encoding_hint /* not 0 ! */ ) +static QTextCodec * Kita::codecForHint(int encoding_hint /* not 0 ! */) { - return QTextCodec::codecForMib( encoding_hint ); + return QTextCodec::codecForMib(encoding_hint); } // encoding_offset: // 0 encode both @ and / // 1 encode @ but not / // 2 encode neither @ or / -static QString Kita::encode( const QString& segment, int encoding_offset, int encoding_hint, bool isRawURI ) +static QString Kita::encode(const QString& segment, int encoding_offset, int encoding_hint, bool isRawURI) { const char *encode_string = "/@<>#\"&?={}|^~[]\'`\\:+%"; encode_string += encoding_offset; @@ -1442,31 +1442,31 @@ local = segment.toLocal8Bit(); else { - QTextCodec * textCodec = codecForHint( encoding_hint ); + QTextCodec * textCodec = codecForHint(encoding_hint); if (!textCodec) local = segment.toLocal8Bit(); else - local = textCodec->fromUnicode( segment ); + local = textCodec->fromUnicode(segment); } int old_length = isRawURI ? local.size() - 1 : local.length(); - if ( !old_length ) + if (!old_length) return segment.isEmpty() ? QString() : QString(""); // differentiate null and empty // a worst case approximation QChar *new_segment = new QChar[ old_length * 3 + 1 ]; int new_length = 0; - for ( int i = 0; i < old_length; i++ ) + for (int i = 0; i < old_length; i++) { // 'unsave' and 'reserved' characters // according to RFC 1738, // 2.2. URL Character Encoding Issues (pp. 3-4) // WABA: Added non-ascii unsigned char character = local[i]; - if ( (character <= 32) || (character >= 127) || - strchr(encode_string, character) ) + if ((character <= 32) || (character >= 127) || + strchr(encode_string, character)) { new_segment[ new_length++ ] = '%'; Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -35,79 +35,79 @@ /*------------------------------*/ /* text codecs */ - QString qcpToUnicode( const QByteArray& str ); - KDE_EXPORT QString utf8ToUnicode( const QByteArray& str ); - QString eucToUnicode( const QByteArray& str ); - QByteArray unicodeToQcp( const QString& str ); - QByteArray unicodeToEuc( const QString& str ); + QString qcpToUnicode(const QByteArray& str); + KDE_EXPORT QString utf8ToUnicode(const QByteArray& str); + QString eucToUnicode(const QByteArray& str); + QByteArray unicodeToQcp(const QString& str); + QByteArray unicodeToEuc(const QString& str); QString encode_string(const QString &str, int encoding_hint); /*------------------------------*/ /* conversion of DAT */ - QString datToHtml( const QString& rawData, int num ); - void DatToText( const QString &rawData, QString& text ); - QString parseSpecialChar( const QChar *cdat, unsigned int& pos ); + QString datToHtml(const QString& rawData, int num); + void DatToText(const QString &rawData, QString& text); + QString parseSpecialChar(const QChar *cdat, unsigned int& pos); /*------------------------------*/ /* conversion of URL */ - KDE_EXPORT KUrl getDatURL( const KUrl& url , QString& refstr ); - KDE_EXPORT KUrl getDatURL( const KUrl& url ); + KDE_EXPORT KUrl getDatURL(const KUrl& url , QString& refstr); + KDE_EXPORT KUrl getDatURL(const KUrl& url); - QString getThreadURL( const KUrl& url, QString& refstr ); - KDE_EXPORT QString getThreadURL( const KUrl& url ); - KDE_EXPORT QString getWriteURL( const KUrl& datURL ); - QString getNewThreadWriteURL( const KUrl& datURL ); + QString getThreadURL(const KUrl& url, QString& refstr); + KDE_EXPORT QString getThreadURL(const KUrl& url); + KDE_EXPORT QString getWriteURL(const KUrl& datURL); + QString getNewThreadWriteURL(const KUrl& datURL); - QString convertURL( int mode, const KUrl& url , QString& refstr ); + QString convertURL(int mode, const KUrl& url , QString& refstr); - QString datToOfflaw( const KUrl& datURL ); + QString datToOfflaw(const KUrl& datURL); /*------------------------------*/ /* utilities */ - bool mkdir( const QString& path ); - QString unescape( const QString& str ); - KDE_EXPORT uint datToSince( const KUrl& datURL ); - int isEqual( const QChar *cdat, const QString& str ); - KDE_EXPORT int stringToPositiveNum( const QChar *cdat, const unsigned int length ); - KDE_EXPORT QString getCategory( const QString& line ); - KDE_EXPORT bool isBoardURL( const QString& url ); - KDE_EXPORT QString fontToString( const QFont& font ); + bool mkdir(const QString& path); + QString unescape(const QString& str); + KDE_EXPORT uint datToSince(const KUrl& datURL); + int isEqual(const QChar *cdat, const QString& str); + KDE_EXPORT int stringToPositiveNum(const QChar *cdat, const unsigned int length); + KDE_EXPORT QString getCategory(const QString& line); + KDE_EXPORT bool isBoardURL(const QString& url); + KDE_EXPORT QString fontToString(const QFont& font); /*------------------------------*/ /* internal parsing functions */ - KDE_EXPORT QStringList parseSearchQuery( const QString& input ); + KDE_EXPORT QStringList parseSearchQuery(const QString& input); /* for MACHI BBS */ void InitParseMachiBBS(); - QString ParseMachiBBSOneLine( const QString& inputLine, int& nextNum ); + QString ParseMachiBBSOneLine(const QString& inputLine, int& nextNum); /* for JBBS */ - QString ParseJBBSOneLine( const QString& line, int& nextNum ); + QString ParseJBBSOneLine(const QString& line, int& nextNum); /* for Flash CGI/Mini Thread */ - QString ParseFlashCGIOneLine( const QString& line ); + QString ParseFlashCGIOneLine(const QString& line); /* for 2ch */ - bool parseResDat( RESDAT& resdat, QString& subject ); + bool parseResDat(RESDAT& resdat, QString& subject); - void parseName( const QString& rawStr, RESDAT& resdat ); - void parseDateId( const QString& rawStr, RESDAT& resdat ); - void parseBody( const QString &rawStr, RESDAT& resdat ); + void parseName(const QString& rawStr, RESDAT& resdat); + void parseDateId(const QString& rawStr, RESDAT& resdat); + void parseBody(const QString &rawStr, RESDAT& resdat); - bool parseLink( const QChar *cdat, const unsigned int length, - QString& linkstr, QString& linkurl, unsigned int& pos ); - bool parseResAnchor( const QChar *cdat, const unsigned int length, - QString& linkstr, int* refNum, unsigned int& pos ); - bool createResAnchor( const QString &rawStr, RESDAT& resdat, - const QChar *chpt, unsigned int &i, unsigned int &index ); + bool parseLink(const QChar *cdat, const unsigned int length, + QString& linkstr, QString& linkurl, unsigned int& pos); + bool parseResAnchor(const QChar *cdat, const unsigned int length, + QString& linkstr, int* refNum, unsigned int& pos); + bool createResAnchor(const QString &rawStr, RESDAT& resdat, + const QChar *chpt, unsigned int &i, unsigned int &index); - void createTitleHTML( RESDAT& resdat, QString& titletext ); + void createTitleHTML(RESDAT& resdat, QString& titletext); } #endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/machibbs.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,19 +24,19 @@ { } -QString MachiBBS::buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime ) +QString MachiBBS::buildPostStr(const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime) { QString ret; QTextCodec* codec = QTextCodec::codecForName("Shift-JIS"); int mib = codec->mibEnum(); - ( ret += "submit=" ) += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ - ( ret += "&NAME=" ) += Kita::encode_string( name, mib ); - ( ret += "&MAIL=" ) += Kita::encode_string( mail, mib ); - ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ); - ( ret += "&BBS=" ) += boardID; - ( ret += "&KEY=" ) += threadID; - ( ret += "&TIME=" ) += QString::number( serverTime ); + (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ + (ret += "&NAME=") += Kita::encode_string(name, mib); + (ret += "&MAIL=") += Kita::encode_string(mail, mib); + (ret += "&MESSAGE=") += Kita::encode_string(body, mib); + (ret += "&BBS=") += boardID; + (ret += "&KEY=") += threadID; + (ret += "&TIME=") += QString::number(serverTime); return ret; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/machibbs.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -19,7 +19,7 @@ */ class KDE_EXPORT MachiBBS { public: - static QString buildPostStr( const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime ); + static QString buildPostStr(const QString& name, const QString& mail, const QString& body, const QString& boardID, const QString& threadID, int serverTime); private: MachiBBS(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/parsemisc.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -23,14 +23,14 @@ class ParseMisc { public: - static KUrl parseURL( const KUrl& url , QString& refstr ) + static KUrl parseURL(const KUrl& url , QString& refstr) { - return Kita::getDatURL( url , refstr ); + return Kita::getDatURL(url , refstr); } - static KUrl parseURLonly( const KUrl& url ) { return Kita::getDatURL( url ); } + static KUrl parseURLonly(const KUrl& url) { return Kita::getDatURL(url); } - static QString utf8ToUnicode( const QByteArray& str ) { return Kita::utf8ToUnicode( str ); } + static QString utf8ToUnicode(const QByteArray& str) { return Kita::utf8ToUnicode(str); } }; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -17,8 +17,8 @@ Q3Dict* Thread::m_threadDict = 0; -Thread::Thread( const KUrl& datURL ) - : m_datURL( datURL ), m_threadName( 0 ) , m_resNum( 0 ), m_readNum( 0 ), m_viewPos( 0 ) +Thread::Thread(const KUrl& datURL) + : m_datURL(datURL), m_threadName(0) , m_resNum(0), m_readNum(0), m_viewPos(0) {} Thread::~Thread() @@ -36,14 +36,14 @@ } /* public */ -void Thread::setThreadName( QString threadName ) +void Thread::setThreadName(QString threadName) { /* remove space */ - QRegExp qrx( " +$" ); - threadName.remove( qrx ); + QRegExp qrx(" +$"); + threadName.remove(qrx); /* unescape */ - threadName.replace( "<", "<" ).replace( ">", ">" ).replace( "&", "&" ); + threadName.replace("<", "<").replace(">", ">").replace("&", "&"); m_threadName = threadName; } @@ -55,7 +55,7 @@ } /* public */ -void Thread::setResNum( int num ) +void Thread::setResNum(int num) { m_resNum = num; } @@ -67,10 +67,10 @@ } /* public */ -void Thread::setReadNum( int num ) +void Thread::setReadNum(int num) { m_readNum = num; - if ( m_resNum < m_readNum ) setResNum( m_readNum ); + if (m_resNum < m_readNum) setResNum(m_readNum); } /* public */ @@ -80,7 +80,7 @@ } /* public */ -void Thread::setViewPos( int num ) +void Thread::setViewPos(int num) { m_viewPos = num; } @@ -92,30 +92,30 @@ } /* public */ -void Thread::setMarkList( const Q3ValueList< int >& markList ) +void Thread::setMarkList(const Q3ValueList< int >& markList) { m_markList = markList; } /* public */ -bool Thread::isMarked( int num ) +bool Thread::isMarked(int num) { Q3ValueList< int >::iterator it; - for ( it = m_markList.begin(); it != m_markList.end(); ++it ) { - if ( ( *it ) == num ) return true; + for (it = m_markList.begin(); it != m_markList.end(); ++it) { + if ((*it) == num) return true; } return false; } /* public */ -bool Thread::setMark( int num, bool newStatus ) +bool Thread::setMark(int num, bool newStatus) { - bool status = isMarked( num ); - if ( status == newStatus ) return false; + bool status = isMarked(num); + if (status == newStatus) return false; - if ( newStatus ) m_markList += num; - else m_markList.remove( num ); + if (newStatus) m_markList += num; + else m_markList.remove(num); return true; } @@ -125,41 +125,41 @@ /* static functions */ -Thread* Thread::getByURL( const KUrl& datURL ) +Thread* Thread::getByURL(const KUrl& datURL) { - if ( m_threadDict == 0 ) { + if (m_threadDict == 0) { m_threadDict = new Q3Dict(); } - Thread* thread = m_threadDict->find( datURL.prettyUrl() ); - if ( thread ) return thread; + Thread* thread = m_threadDict->find(datURL.prettyUrl()); + if (thread) return thread; - Thread* newThread = new Thread( datURL ); - m_threadDict->insert( datURL.prettyUrl(), newThread ); + Thread* newThread = new Thread(datURL); + m_threadDict->insert(datURL.prettyUrl(), newThread); return newThread; } /* static & public */ -Thread* Thread::getByURLNew( const KUrl& datURL ) +Thread* Thread::getByURLNew(const KUrl& datURL) { - if ( m_threadDict == 0 ) return 0; + if (m_threadDict == 0) return 0; - return m_threadDict->find( datURL.prettyUrl() ); + return m_threadDict->find(datURL.prettyUrl()); } -void Thread::replace( const QString& fromURL, const QString& toURL ) +void Thread::replace(const QString& fromURL, const QString& toURL) { - if ( m_threadDict == 0 ) return ; - Q3DictIterator it( *m_threadDict ); - for ( ; it.current(); ++it ) { + if (m_threadDict == 0) return ; + Q3DictIterator it(*m_threadDict); + for (; it.current(); ++it) { QString url = it.currentKey(); Kita::Thread* thread = it.current(); - if ( url.indexOf( fromURL ) == 0 ) { - m_threadDict->remove( url ); - url = url.replace( 0, fromURL.length(), toURL ); + 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 ); + m_threadDict->insert(url, thread); it.toFirst(); } } Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/thread.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/thread.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -33,33 +33,33 @@ Q3ValueList< int > m_markList; public: - Thread( const KUrl& datURL ); + Thread(const KUrl& datURL); ~Thread(); const KUrl& datURL() const; const QString& threadName() const; - void setThreadName( QString threadName ); + void setThreadName(QString threadName); int resNum() const; - void setResNum( int num ); + void setResNum(int num); int readNum() const; - void setReadNum( int num ); + void setReadNum(int num); int viewPos() const; - void setViewPos( int viewPos ); + void setViewPos(int viewPos); const Q3ValueList< int >& markList() const; - void setMarkList( const Q3ValueList< int >& markList ); - bool isMarked( int num ); - bool setMark( int num, bool newStatus ); + void setMarkList(const Q3ValueList< int >& markList); + bool isMarked(int num); + bool setMark(int num, bool newStatus); /*----------------------*/ - static Thread* getByURL( const KUrl& datURL ); - static Thread* getByURLNew( const KUrl& datURL ); - static void replace( const QString& fromURL, const QString& toURL ); + static Thread* getByURL(const KUrl& datURL); + static Thread* getByURLNew(const KUrl& datURL); + static void replace(const QString& fromURL, const QString& toURL); }; } Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,67 +24,67 @@ using namespace Kita; -QString ThreadIndex::getSubject( const KUrl& url ) +QString ThreadIndex::getSubject(const KUrl& url) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - return getSubjectPrivate( config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + return getSubjectPrivate(config); } -void ThreadIndex::setSubject( const KUrl& url, const QString& str ) +void ThreadIndex::setSubject(const KUrl& url, const QString& str) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - setSubjectPrivate( str, config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + setSubjectPrivate(str, config); } -int ThreadIndex::getResNum( const KUrl& url ) +int ThreadIndex::getResNum(const KUrl& url) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - return getResNumPrivate( url, config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + return getResNumPrivate(url, config); } -void ThreadIndex::setResNum( const KUrl& url, int resNum ) +void ThreadIndex::setResNum(const KUrl& url, int resNum) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - setResNumPrivate( resNum, config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + setResNumPrivate(resNum, config); } -int ThreadIndex::getReadNum( const KUrl& url ) +int ThreadIndex::getReadNum(const KUrl& url) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - return getReadNumPrivate( url, config, true ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + return getReadNumPrivate(url, config, true); } -void ThreadIndex::setReadNum( const KUrl& url, int readNum ) +void ThreadIndex::setReadNum(const KUrl& url, int readNum) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - setReadNumPrivate( readNum, config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + setReadNumPrivate(readNum, config); } -int ThreadIndex::getViewPos( const KUrl& url ) +int ThreadIndex::getViewPos(const KUrl& url) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - return getViewPosPrivate( config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + return getViewPosPrivate(config); } -void ThreadIndex::setViewPos( const KUrl& url, int viewPos ) +void ThreadIndex::setViewPos(const KUrl& url, int viewPos) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - setViewPosPrivate( viewPos, config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + setViewPosPrivate(viewPos, config); } -void ThreadIndex::setMarkList( const KUrl& url, const Q3ValueList< int >& markList ) +void ThreadIndex::setMarkList(const KUrl& url, const Q3ValueList< int >& markList) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); - setMarkListPrivate( markList, config ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); + setMarkListPrivate(markList, config); } @@ -92,175 +92,175 @@ /* load thread information */ /* public */ /* static */ -void ThreadIndex::loadIndex( Kita::Thread* thread, const KUrl& url, bool checkCached ) +void ThreadIndex::loadIndex(Kita::Thread* thread, const KUrl& url, bool checkCached) { - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); /* load read number */ - int readNum = getReadNumPrivate( url, config, checkCached ); - if ( readNum == 0 ) return ; /* cache does not exist. */ - thread->setReadNum( readNum ); + int readNum = getReadNumPrivate(url, config, checkCached); + if (readNum == 0) return ; /* cache does not exist. */ + thread->setReadNum(readNum); /* load thread name */ - QString subject = getSubjectPrivate( config ); - if ( subject.isEmpty() && !thread->threadName().isEmpty() ) { + QString subject = getSubjectPrivate(config); + if (subject.isEmpty() && !thread->threadName().isEmpty()) { subject = thread->threadName(); KConfigGroup group = config.group(""); - group.writeEntry( "Subject", subject ); + group.writeEntry("Subject", subject); } - if ( subject.isEmpty() ) thread->setThreadName( "?" ); - else thread->setThreadName( subject ); + if (subject.isEmpty()) thread->setThreadName("?"); + else thread->setThreadName(subject); /* load res number */ - thread->setResNum( getResNumPrivate( url, config ) ); + thread->setResNum(getResNumPrivate(url, config)); /* load view pos */ - thread->setViewPos( getViewPosPrivate( config ) ); - if ( thread->viewPos() > thread->readNum() ) thread->setReadNum( thread->viewPos() ); + thread->setViewPos(getViewPosPrivate(config)); + if (thread->viewPos() > thread->readNum()) thread->setReadNum(thread->viewPos()); /* load mark */ - thread->setMarkList( getMarkListPrivate( config ) ); + thread->setMarkList(getMarkListPrivate(config)); } /* save thread information */ /* public */ /* static */ -void ThreadIndex::saveIndex( const Kita::Thread* thread, const KUrl& url ) +void ThreadIndex::saveIndex(const Kita::Thread* thread, const KUrl& url) { /* If readNum == 0, delete idx file */ - if ( thread->readNum() == 0 ) { + if (thread->readNum() == 0) { - QString indexPath = Kita::DatManager::getCacheIndexPath( url ); - QFile::remove( indexPath ); + QString indexPath = Kita::DatManager::getCacheIndexPath(url); + QFile::remove(indexPath); } - QString indexPath = Kita::Cache::getIndexPath( url ); - KConfig config( indexPath ); + QString indexPath = Kita::Cache::getIndexPath(url); + KConfig config(indexPath); /* save thread name */ - setSubjectPrivate( thread->threadName(), config ); + setSubjectPrivate(thread->threadName(), config); /* save res number */ - setResNumPrivate( thread->resNum(), config ); + setResNumPrivate(thread->resNum(), config); /* save read number */ - setReadNumPrivate( thread->readNum(), config ); + setReadNumPrivate(thread->readNum(), config); /* save view pos */ - setViewPosPrivate( thread->viewPos(), config ); + setViewPosPrivate(thread->viewPos(), config); /* save mark */ - setMarkListPrivate( thread->markList(), config ); + setMarkListPrivate(thread->markList(), config); /* save "cache" */ - KUrl datURL = Kita::getDatURL( url ); - int num = ( thread->viewPos() ? thread->viewPos() : thread->readNum() ); - KitaThreadInfo::setReadNum( datURL.prettyUrl(), num ); + KUrl datURL = Kita::getDatURL(url); + int num = (thread->viewPos() ? thread->viewPos() : thread->readNum()); + KitaThreadInfo::setReadNum(datURL.prettyUrl(), num); } /*------------------------------------------------------------------*/ /* private */ /* static */ -QString ThreadIndex::getSubjectPrivate( KConfig& config ) +QString ThreadIndex::getSubjectPrivate(KConfig& config) { - return config.group("").readEntry( "Subject" ); + return config.group("").readEntry("Subject"); } /* private */ /* static */ -void ThreadIndex::setSubjectPrivate( const QString& str, KConfig& config ) +void ThreadIndex::setSubjectPrivate(const QString& str, KConfig& config) { - config.group("").writeEntry( "Subject", str ); + config.group("").writeEntry("Subject", str); } /*-------*/ /* private */ /* static */ -int ThreadIndex::getResNumPrivate( const KUrl& url, KConfig& config ) +int ThreadIndex::getResNumPrivate(const KUrl& url, KConfig& config) { - int resNum = config.group("").readEntry( "ResNum", 0 ); + int resNum = config.group("").readEntry("ResNum", 0); /* use obsoleted "cache" file */ - if ( !resNum ) { - KUrl datURL = Kita::getDatURL( url ); - resNum = KitaThreadInfo::readNum( datURL.prettyUrl() ); - if ( resNum ) config.group("").writeEntry( "ResNum", resNum ); + if (!resNum) { + KUrl datURL = Kita::getDatURL(url); + resNum = KitaThreadInfo::readNum(datURL.prettyUrl()); + if (resNum) config.group("").writeEntry("ResNum", resNum); } return resNum; } /* private */ /* static */ -void ThreadIndex::setResNumPrivate( int resNum, KConfig& config ) +void ThreadIndex::setResNumPrivate(int resNum, KConfig& config) { - config.group("").writeEntry( "ResNum", resNum ); + config.group("").writeEntry("ResNum", resNum); } /*-------*/ /* private */ /* static */ -int ThreadIndex::getReadNumPrivate( const KUrl& url, KConfig& config, bool checkCached ) +int ThreadIndex::getReadNumPrivate(const KUrl& url, KConfig& config, bool checkCached) { /* If cache does not exist, return 0 */ - if ( checkCached ) { + if (checkCached) { - QString path = Kita::DatManager::getCachePath( url ); - if ( ! QFile::exists( path ) ) { + QString path = Kita::DatManager::getCachePath(url); + if (! QFile::exists(path)) { return 0; } } - int readNum = config.group("").readEntry( "ReadNum", 0 ); + int readNum = config.group("").readEntry("ReadNum", 0); - if ( !readNum ) { + if (!readNum) { /* use ViewPos instead of ReadNum. */ - readNum = config.group("").readEntry( "ViewPos", 0 ); + readNum = config.group("").readEntry("ViewPos", 0); /* use obsoleted "cache" file */ - if ( !readNum ) { - KUrl datURL = Kita::getDatURL( url ); - readNum = KitaThreadInfo::readNum( datURL.prettyUrl() ); + if (!readNum) { + KUrl datURL = Kita::getDatURL(url); + readNum = KitaThreadInfo::readNum(datURL.prettyUrl()); } - if ( readNum ) config.group("").writeEntry( "ReadNum", readNum ); + if (readNum) config.group("").writeEntry("ReadNum", readNum); } return readNum; } /* private */ /* static */ -void ThreadIndex::setReadNumPrivate( int readNum, KConfig& config ) +void ThreadIndex::setReadNumPrivate(int readNum, KConfig& config) { - config.group("").writeEntry( "ReadNum", readNum ); + config.group("").writeEntry("ReadNum", readNum); } /*-------*/ /* private */ /* static */ -int ThreadIndex::getViewPosPrivate( KConfig& config ) +int ThreadIndex::getViewPosPrivate(KConfig& config) { - return config.group("").readEntry( "ViewPos", 0 ); + return config.group("").readEntry("ViewPos", 0); } /* private */ /* static */ -void ThreadIndex::setViewPosPrivate( int viewPos, KConfig& config ) +void ThreadIndex::setViewPosPrivate(int viewPos, KConfig& config) { - config.group("").writeEntry( "ViewPos", viewPos ); + config.group("").writeEntry("ViewPos", viewPos); } /*-------*/ /* private */ /* static */ -QList< int > ThreadIndex::getMarkListPrivate( KConfig& config ) +QList< int > ThreadIndex::getMarkListPrivate(KConfig& config) { QList default_value; - return config.group("").readEntry( "Mark", 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 ); + 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-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -30,41 +30,41 @@ class KDE_EXPORT ThreadIndex { public: - static QString getSubject( const KUrl& url ); - static void setSubject( const KUrl& url, const QString& str ); + static QString getSubject(const KUrl& url); + static void setSubject(const KUrl& url, const QString& str); - static int getResNum( const KUrl& url ); - static void setResNum( const KUrl& url, int resNum ); + static int getResNum(const KUrl& url); + static void setResNum(const KUrl& url, int resNum); - static int getReadNum( const KUrl& url ); - static void setReadNum( const KUrl& url, int readNum ); + static int getReadNum(const KUrl& url); + static void setReadNum(const KUrl& url, int readNum); - static int getViewPos( const KUrl& url ); - static void setViewPos( const KUrl& url, int viewPos ); + 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 Q3ValueList< int >& markList); /*---------------------------------*/ - static void loadIndex( Kita::Thread* thread, const KUrl& url, bool checkCached = true ); - static void saveIndex( const Kita::Thread* thread, const KUrl& url ); + static void loadIndex(Kita::Thread* thread, const KUrl& url, bool checkCached = true); + static void saveIndex(const Kita::Thread* thread, const KUrl& url); private: - static QString getSubjectPrivate( KConfig& config ); - static void setSubjectPrivate( const QString& str, KConfig& config ); + static QString getSubjectPrivate(KConfig& config); + static void setSubjectPrivate(const QString& str, KConfig& config); - static int getResNumPrivate( const KUrl& url, KConfig& config ); - static void setResNumPrivate( int resNum, KConfig& config ); + static int getResNumPrivate(const KUrl& url, KConfig& config); + static void setResNumPrivate(int resNum, KConfig& config); - static int getReadNumPrivate( const KUrl& url, KConfig& config, bool checkCached ); - static void setReadNumPrivate( int readNum, KConfig& config ); + static int getReadNumPrivate(const KUrl& url, KConfig& config, bool checkCached); + static void setReadNumPrivate(int readNum, KConfig& config); - static int getViewPosPrivate( KConfig& config ); - static void setViewPosPrivate( int viewPos, KConfig& config ); + 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/libkita/threadinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -25,59 +25,59 @@ KitaThreadInfo* KitaThreadInfo::getInstance() { - if ( instance == 0 ) { + if (instance == 0) { instance = new KitaThreadInfo(); } return instance; } -int KitaThreadInfo::readNum( const QString& url ) +int KitaThreadInfo::readNum(const QString& url) { KitaThreadInfo * instance = KitaThreadInfo::getInstance(); - if ( instance->m_readDict.contains( url ) ) { + if (instance->m_readDict.contains(url)) { return instance->m_readDict[ url ]; } else { return 0; } } -void KitaThreadInfo::setReadNum( const QString& url, int num ) +void KitaThreadInfo::setReadNum(const QString& url, int num) { KitaThreadInfo * instance = KitaThreadInfo::getInstance(); - instance->m_readDict.insert( url, num ); + instance->m_readDict.insert(url, num); } -void KitaThreadInfo::replace( const QString fromURL, const QString toURL ) +void KitaThreadInfo::replace(const QString fromURL, const QString toURL) { QMap::Iterator it; KitaThreadInfo* instance = KitaThreadInfo::getInstance(); - if ( instance == 0 ) return ; + if (instance == 0) return ; - for ( it = instance->m_readDict.begin(); it != instance->m_readDict.end(); ++it ) { + for (it = instance->m_readDict.begin(); it != instance->m_readDict.end(); ++it) { QString url = it.key(); int num = it.value(); - if ( url.indexOf( fromURL ) == 0 ) { - url = url.replace( 0, fromURL.length(), toURL ); - instance->m_readDict.erase( it ); - instance->m_readDict.insert( url, num ); + if (url.indexOf(fromURL) == 0) { + url = url.replace(0, fromURL.length(), toURL); + instance->m_readDict.erase(it); + instance->m_readDict.insert(url, num); it = instance->m_readDict.begin(); // TODO ¤â¤Ã¤ÈÁᤤÊýË¡¤Ï? } } } -void KitaThreadInfo::removeThreadInfo( const QString& url ) +void KitaThreadInfo::removeThreadInfo(const QString& url) { KitaThreadInfo * instance = KitaThreadInfo::getInstance(); - instance->m_readDict.remove( url ); + instance->m_readDict.remove(url); } -QDataStream& operator<<( QDataStream& s, KitaThreadInfo& c ) +QDataStream& operator<<(QDataStream& s, KitaThreadInfo& c) { s << c.m_readDict; return s; } -QDataStream& operator>>( QDataStream& s, KitaThreadInfo& c ) +QDataStream& operator>>(QDataStream& s, KitaThreadInfo& c) { s >> c.m_readDict; return s; Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadinfo.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,12 +24,12 @@ { public: static KitaThreadInfo* getInstance(); - static void setReadNum( const QString& url, int num ); - static int readNum( const QString& url ); - static void replace( const QString fromURL, const QString toURL ); - static void removeThreadInfo( const QString& url ); - KDE_EXPORT friend QDataStream& operator<<( QDataStream& s, KitaThreadInfo& c ); - KDE_EXPORT friend QDataStream& operator>>( QDataStream& s, KitaThreadInfo& c ); + static void setReadNum(const QString& url, int num); + static int readNum(const QString& url); + static void replace(const QString fromURL, const QString toURL); + static void removeThreadInfo(const QString& url); + KDE_EXPORT friend QDataStream& operator<<(QDataStream& s, KitaThreadInfo& c); + KDE_EXPORT friend QDataStream& operator>>(QDataStream& s, KitaThreadInfo& c); private: KitaThreadInfo(); ~KitaThreadInfo(); Modified: kita/branches/KITA-KDE4/kita/src/main.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -20,49 +20,49 @@ #include "libkita/config_xt.h" static const char *description = - I18N_NOOP( "Kita - 2ch client for KDE" ); + I18N_NOOP("Kita - 2ch client for KDE"); static const char *version = "0.200.0"; // TODO -int main( int argc, char **argv ) +int main(int argc, char **argv) { // for code page 932 with NEC special characters setenv("UNICODEMAP_JP", "cp932,nec-vdc", 1); - KAboutData about( "kita", "Kita", ki18n( "Kita" ), version, ki18n( description ), - KAboutData::License_GPL, ki18n( "(C) 2003-2009 Kita Developers" ), KLocalizedString(), QByteArray(), "ikemo ¡÷ users.sourceforge.jp" ); - about.addAuthor( ki18n( "Hideki Ikemoto" ), ki18n( "maintainer, initial code" ), "ikemo ¡÷ users.sourceforge.jp" ); - about.addAuthor( ki18n( "konqueror plugin no hito" ), ki18n( "konqueror plugin, KDE part" ), "ogirin ¡÷ users.sourceforge.jp" ); - about.addAuthor( ki18n( "421" ), ki18n( "kitanavi, threadview's improvement" ) ); - about.addAuthor( ki18n( "Toshihiko Okada" ), ki18n( "improvements" ), "tossi ¡÷ users.sourceforge.jp" ); - about.addAuthor( ki18n( "75" ), ki18n( "stylesheet support" ) ); - KCmdLineArgs::init( argc, argv, &about ); + KAboutData about("kita", "Kita", ki18n("Kita"), version, ki18n(description), + KAboutData::License_GPL, ki18n("(C) 2003-2009 Kita Developers"), KLocalizedString(), QByteArray(), "ikemo ¡÷ users.sourceforge.jp"); + about.addAuthor(ki18n("Hideki Ikemoto"), ki18n("maintainer, initial code"), "ikemo ¡÷ users.sourceforge.jp"); + about.addAuthor(ki18n("konqueror plugin no hito"), ki18n("konqueror plugin, KDE part"), "ogirin ¡÷ users.sourceforge.jp"); + about.addAuthor(ki18n("421"), ki18n("kitanavi, threadview's improvement")); + about.addAuthor(ki18n("Toshihiko Okada"), ki18n("improvements"), "tossi ¡÷ users.sourceforge.jp"); + about.addAuthor(ki18n("75"), ki18n("stylesheet support")); + KCmdLineArgs::init(argc, argv, &about); KCmdLineOptions options; - options.add("+[URL]", ki18n( "Document to open." )); - options.add("boardlist ", ki18n( "board list's URL." ), "http://menu.2ch.net/bbsmenu.html"); - KCmdLineArgs::addCmdLineOptions( options ); + options.add("+[URL]", ki18n("Document to open.")); + options.add("boardlist ", ki18n("board list's URL."), "http://menu.2ch.net/bbsmenu.html"); + KCmdLineArgs::addCmdLineOptions(options); KUniqueApplication app; // register ourselves as a dcop client -// app.dcopClient() ->registerAs( app.name(), FALSE ); +// app.dcopClient() ->registerAs(app.name(), FALSE); KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); - Kita::Config::setBoardListUrl( QString( args->getOption( "boardlist" ) ) ); + Kita::Config::setBoardListUrl(QString(args->getOption("boardlist"))); // see if we are starting with session management - if ( app.isSessionRestored() ) { -// RESTORE( KitaMainWindow ) // TODO + if (app.isSessionRestored()) { +// RESTORE(KitaMainWindow) // TODO } else { // no session.. just start up normally KCmdLineArgs * args = KCmdLineArgs::parsedArgs(); - if ( args->count() == 0 ) { + if (args->count() == 0) { KitaMainWindow * widget = new KitaMainWindow; widget->show(); } else { int i = 0; - for ( ; i < args->count(); i++ ) { + for (; i < args->count(); i++) { KitaMainWindow *widget = new KitaMainWindow; widget->show(); - widget->load( args->url( i ) ); + widget->load(args->url(i)); } } args->clear(); Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -69,13 +69,13 @@ #include "prefs/prefs.h" KitaMainWindow::KitaMainWindow() - : KXmlGuiWindow( 0 ) + : KXmlGuiWindow(0) { // FIXME: merge *.po - KGlobal::locale() ->insertCatalog( "kitapart" ); + KGlobal::locale() ->insertCatalog("kitapart"); // accept dnd - setAcceptDrops( true ); + setAcceptDrops(true); // setup view, dock setupView(); @@ -88,21 +88,21 @@ // load ascii art Kita::AsciiArtConfig::self()->readConfig(); - if ( Kita::AsciiArtConfig::self()->asciiArtList().empty() ) { + if (Kita::AsciiArtConfig::self()->asciiArtList().empty()) { loadAsciiArt(); } // load abone lists Kita::AboneConfig::self()->readConfig(); - if ( Kita::AboneConfig::self()->aboneIDList().empty() ) { + if (Kita::AboneConfig::self()->aboneIDList().empty()) { loadAboneIDList(); } - if ( Kita::AboneConfig::self()->aboneNameList().empty() ) { + if (Kita::AboneConfig::self()->aboneNameList().empty()) { loadAboneNameList(); } - if ( Kita::AboneConfig::self()->aboneWordList().empty() ) { + if (Kita::AboneConfig::self()->aboneWordList().empty()) { loadAboneWordList(); } @@ -120,23 +120,23 @@ setAutoSaveSettings(); // set list font - setFont( Kita::Config::font() ); + setFont(Kita::Config::font()); // allow the view to change the statusbar and caption - connect( m_urlLine, SIGNAL( returnPressed() ), - SLOT( slotURLLine() ) ); + connect(m_urlLine, SIGNAL(returnPressed()), + SLOT(slotURLLine())); - QMenu* settingsPopup = static_cast( factory() ->container( "settings", this ) ); - connect( settingsPopup, SIGNAL( aboutToShow() ), - SLOT( settingsMenuAboutToShow() ) ); + QMenu* settingsPopup = static_cast(factory() ->container("settings", this)); + connect(settingsPopup, SIGNAL(aboutToShow()), + SLOT(settingsMenuAboutToShow())); // load favorite boards; loadFavoriteBoards(); // load boad list { - QString configPath = KStandardDirs::locateLocal( "appdata", "board_list" ); - if ( QFile::exists( configPath ) ) { + QString configPath = KStandardDirs::locateLocal("appdata", "board_list"); + if (QFile::exists(configPath)) { m_bbsTab->showBoardList(); m_bbsTab->loadOpened(); } else { @@ -150,7 +150,7 @@ // update favorite list ViewMediator::getInstance()->updateFavoriteListView(); - if ( Kita::Config::autoLogin() ) { + if (Kita::Config::autoLogin()) { login(); } } @@ -167,26 +167,26 @@ saveCache(); - saveMainWindowSettings( KGlobal::config().data()->group("MainWindow") ); + saveMainWindowSettings(KGlobal::config().data()->group("MainWindow")); Kita::Config::self()->writeConfig(); Kita::DatManager::deleteAllDatInfo(); } -void KitaMainWindow::load( const KUrl& url ) +void KitaMainWindow::load(const KUrl& url) { - setCaption( url.url() ); + setCaption(url.url()); } -void KitaMainWindow::bookmark( const QString& datURL, bool on ) +void KitaMainWindow::bookmark(const QString& datURL, bool on) { FavoriteThreads * favorite = FavoriteThreads::getInstance(); - if ( on ) { - favorite->insert( datURL ); + if (on) { + favorite->insert(datURL); } else { - favorite->remove( datURL ); + favorite->remove(datURL); } saveFavorites(); ViewMediator::getInstance()->updateFavoriteListView(); @@ -194,10 +194,10 @@ void KitaMainWindow::login() { - if ( Kita::Account::login( Kita::Config::userID(), Kita::Config::password() ) ) { - setMainStatus( i18n( "Login succeeded." ) ); + if (Kita::Account::login(Kita::Config::userID(), Kita::Config::password())) { + setMainStatus(i18n("Login succeeded.")); } else { - setMainStatus( i18n( "Login failed." ) ); + setMainStatus(i18n("Login failed.")); } } @@ -205,14 +205,14 @@ { // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor. // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.) - applyMainWindowSettings( KGlobal::config().data()->group( "MainWindow" ) ); + applyMainWindowSettings(KGlobal::config().data()->group("MainWindow")); } void KitaMainWindow::optionsShowToolbar() { // this is all very cut and paste code for showing/hiding the // toolbar - if ( m_toolbarAction->isChecked() ) { + if (m_toolbarAction->isChecked()) { toolBar() ->show(); } else { toolBar() ->hide(); @@ -223,7 +223,7 @@ { // this is all very cut and paste code for showing/hiding the // statusbar - if ( m_statusbarAction->isChecked() ) { + if (m_statusbarAction->isChecked()) { statusBar() ->show(); } else { statusBar() ->hide(); @@ -232,71 +232,71 @@ void KitaMainWindow::optionsConfigureKeys() { - KShortcutsDialog::configure( actionCollection() ); + KShortcutsDialog::configure(actionCollection()); } void KitaMainWindow::optionsConfigureToolbars() { // use the standard toolbar editor - KEditToolBar dlg( factory() ); - connect( &dlg, SIGNAL( newToolbarConfig() ), - SLOT( newToolbarConfig() ) ); + KEditToolBar dlg(factory()); + connect(&dlg, SIGNAL(newToolbarConfig()), + SLOT(newToolbarConfig())); dlg.exec(); } void KitaMainWindow::optionsPreferences() { // popup some sort of preference dialog, here - if ( KConfigDialog::showDialog( "Kita Preferences" ) ) { + if (KConfigDialog::showDialog("Kita Preferences")) { return; } - KitaPreferences* dialog = new KitaPreferences( this ); + KitaPreferences* dialog = new KitaPreferences(this); - connect( dialog, SIGNAL( fontChanged( const QFont& ) ), - SLOT( setFont( const QFont& ) ) ); + connect(dialog, SIGNAL(fontChanged(const QFont&)), + SLOT(setFont(const QFont&))); dialog->show(); } void KitaMainWindow::settingsMenuAboutToShow() { - m_toolbarAction->setChecked( toolBar() ->isVisible() ); - m_statusbarAction->setChecked( statusBar() ->isVisible() ); + m_toolbarAction->setChecked(toolBar() ->isVisible()); + m_statusbarAction->setChecked(statusBar() ->isVisible()); } -void KitaMainWindow::setFont( const QFont& font ) +void KitaMainWindow::setFont(const QFont& font) { - m_boardTab->setFont( font ); - m_bbsTab->setFont( font ); + m_boardTab->setFont(font); + m_bbsTab->setFont(font); } -void KitaMainWindow::setUrl( const KUrl& url ) +void KitaMainWindow::setUrl(const KUrl& url) { - m_urlLine->setText( url.url() ); + m_urlLine->setText(url.url()); } void KitaMainWindow::slotEditCopy() { QWidget * widget = kapp->focusWidget(); - if ( widget ) { - QKeyEvent e( QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier ); - QApplication::sendEvent( widget, &e ); + if (widget) { + QKeyEvent e(QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier); + QApplication::sendEvent(widget, &e); } } -void KitaMainWindow::setMainStatus( const QString& statusStr ) +void KitaMainWindow::setMainStatus(const QString& statusStr) { // display the text on the statusbar - statusBar() ->showMessage( statusStr ); + statusBar() ->showMessage(statusStr); } void KitaMainWindow::slotURLLine() { KUrl url = m_urlLine->text(); - KUrl datURL = Kita::getDatURL( url ); - m_threadTab->slotShowMainThread( datURL ); + KUrl datURL = Kita::getDatURL(url); + m_threadTab->slotShowMainThread(datURL); } // @@ -305,86 +305,86 @@ void KitaMainWindow::setupActions() { - KStandardAction::quit( this, SLOT( close() ), actionCollection() ); - KStandardAction::copy( this, SLOT( slotEditCopy() ), actionCollection() ); + KStandardAction::quit(this, SLOT(close()), actionCollection()); + KStandardAction::copy(this, SLOT(slotEditCopy()), actionCollection()); setStandardToolBarMenuEnabled(true); - m_toolbarAction = new KToggleAction( i18n( "&Show Toolbar" ), this ); - actionCollection()->addAction( "toolBar", m_toolbarAction ); - connect( m_toolbarAction, SIGNAL( toggled( bool ) ), - SLOT( optionsShowToolbar() ) ); + m_toolbarAction = new KToggleAction(i18n("&Show Toolbar"), this); + actionCollection()->addAction("toolBar", m_toolbarAction); + connect(m_toolbarAction, SIGNAL(toggled(bool)), + SLOT(optionsShowToolbar())); - m_statusbarAction = KStandardAction::showStatusbar( this, - SLOT( optionsShowStatusbar() ), - actionCollection() ); + m_statusbarAction = KStandardAction::showStatusbar(this, + SLOT(optionsShowStatusbar()), + actionCollection()); - m_urlLine = new KLineEdit( "", 0 ); + m_urlLine = new KLineEdit("", 0); -/* new KWidgetAction( m_urlLine, - i18n( "URL Line" ), +/* new KWidgetAction(m_urlLine, + i18n("URL Line"), 0, this, - SLOT( slotURLLine() ), - actionCollection(), "url_line_action" );*/ // TODO + SLOT(slotURLLine()), + actionCollection(), "url_line_action");*/ // TODO - KStandardAction::keyBindings( this, SLOT( optionsConfigureKeys() ), actionCollection() ); - KStandardAction::configureToolbars( this, SLOT( optionsConfigureToolbars() ), actionCollection() ); - KStandardAction::preferences( this, SLOT( optionsPreferences() ), actionCollection() ); + KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); - KAction* load_board_action = actionCollection()->addAction( "load_board_list" ); - load_board_action->setText( i18n( "Load board list" ) ); - connect( load_board_action, SIGNAL(triggered()), m_bbsTab, SLOT( updateBoardList() ) ); + KAction* load_board_action = actionCollection()->addAction("load_board_list"); + load_board_action->setText(i18n("Load board list")); + connect(load_board_action, SIGNAL(triggered()), m_bbsTab, SLOT(updateBoardList())); - KAction* login_action = actionCollection()->addAction( "login" ); - load_board_action->setText( i18n( "Login" ) ); - connect( login_action, SIGNAL(triggered()), m_bbsTab, SLOT( login() ) ); + KAction* login_action = actionCollection()->addAction("login"); + load_board_action->setText(i18n("Login")); + connect(login_action, SIGNAL(triggered()), m_bbsTab, SLOT(login())); - setXMLFile( "kitaui.rc" ); + setXMLFile("kitaui.rc"); KXmlGuiWindow::createGUI(); - factory() ->addClient( m_bbsTab ); - factory() ->addClient( m_boardTab ); - factory() ->addClient( m_threadTab ); - factory() ->addClient( m_writeTab ); + factory() ->addClient(m_bbsTab); + factory() ->addClient(m_boardTab); + factory() ->addClient(m_threadTab); + factory() ->addClient(m_writeTab); } void KitaMainWindow::setupView() { - ViewMediator::getInstance()->setMainWindow( this ); + ViewMediator::getInstance()->setMainWindow(this); - QWidget* mainWidget = new QWidget( this ); + QWidget* mainWidget = new QWidget(this); - QBoxLayout* mainLayout = new QVBoxLayout( mainWidget ); - QSplitter* hsplit = new QSplitter( mainWidget ); - mainLayout->addWidget( hsplit ); + QBoxLayout* mainLayout = new QVBoxLayout(mainWidget); + QSplitter* hsplit = new QSplitter(mainWidget); + mainLayout->addWidget(hsplit); - m_bbsTab = new KitaBBSTabWidget( hsplit ); + m_bbsTab = new KitaBBSTabWidget(hsplit); - QSplitter* vsplit = new QSplitter( Qt::Vertical, hsplit ); + QSplitter* vsplit = new QSplitter(Qt::Vertical, hsplit); - m_boardTab = new KitaBoardTabWidget( vsplit ); - ViewMediator::getInstance()->setBoardTabWidget( m_boardTab ); + m_boardTab = new KitaBoardTabWidget(vsplit); + ViewMediator::getInstance()->setBoardTabWidget(m_boardTab); - m_threadTab = new KitaThreadTabWidget( vsplit ); - ViewMediator::getInstance()->setThreadTabWidget( m_threadTab ); + m_threadTab = new KitaThreadTabWidget(vsplit); + ViewMediator::getInstance()->setThreadTabWidget(m_threadTab); - hsplit->setSizes( Q3ValueList() << 100 << 500 ); - vsplit->setSizes( Q3ValueList() << 200 << 300 ); + hsplit->setSizes(Q3ValueList() << 100 << 500); + vsplit->setSizes(Q3ValueList() << 200 << 300); - setCentralWidget( mainWidget ); + setCentralWidget(mainWidget); /* write dock */ - m_writeTab = new KitaWriteTabWidget( 0 ); - ViewMediator::getInstance()->setWriteTabWidget( m_writeTab ); + m_writeTab = new KitaWriteTabWidget(0); + ViewMediator::getInstance()->setWriteTabWidget(m_writeTab); } void KitaMainWindow::loadCache() { KitaThreadInfo * cache = KitaThreadInfo::getInstance(); - QString cacheConfigPath = KStandardDirs::locateLocal( "appdata", "cache" ); - QFile file( cacheConfigPath ); - if ( file.open( QIODevice::ReadOnly ) ) { - QDataStream stream( &file ); + QString cacheConfigPath = KStandardDirs::locateLocal("appdata", "cache"); + QFile file(cacheConfigPath); + if (file.open(QIODevice::ReadOnly)) { + QDataStream stream(&file); stream >> *cache; } } @@ -392,147 +392,147 @@ void KitaMainWindow::saveCache() { KitaThreadInfo * cache = KitaThreadInfo::getInstance(); - QString cacheConfigPath = KStandardDirs::locateLocal( "appdata", "cache" ); - QFile file( cacheConfigPath ); - if ( file.open( QIODevice::WriteOnly ) ) { - QDataStream stream( &file ); + QString cacheConfigPath = KStandardDirs::locateLocal("appdata", "cache"); + QFile file(cacheConfigPath); + if (file.open(QIODevice::WriteOnly)) { + QDataStream stream(&file); stream << *cache; } } void KitaMainWindow::loadFavorites() { - QString favoritesConfigPath = KStandardDirs::locateLocal( "appdata", "favorites.xml" ); - QFile file( favoritesConfigPath ); - if ( file.open( QIODevice::ReadOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString favoritesConfigPath = KStandardDirs::locateLocal("appdata", "favorites.xml"); + QFile file(favoritesConfigPath); + if (file.open(QIODevice::ReadOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); QString xml = stream.readAll(); - FavoriteThreads::readFromXML( xml ); + FavoriteThreads::readFromXML(xml); } } void KitaMainWindow::saveFavorites() { - QString favoritesConfigPath = KStandardDirs::locateLocal( "appdata", "favorites.xml" ); - QFile file( favoritesConfigPath ); - if ( file.open( QIODevice::WriteOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString favoritesConfigPath = KStandardDirs::locateLocal("appdata", "favorites.xml"); + QFile file(favoritesConfigPath); + if (file.open(QIODevice::WriteOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); stream << FavoriteThreads::getInstance() ->toXML(); } } void KitaMainWindow::loadFavoriteBoards() { - QString configPath = KStandardDirs::locateLocal( "appdata", "favorite_boards.xml" ); - QFile file( configPath ); - if ( file.open( QIODevice::ReadOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString configPath = KStandardDirs::locateLocal("appdata", "favorite_boards.xml"); + QFile file(configPath); + if (file.open(QIODevice::ReadOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); QString xml = stream.readAll(); - Kita::FavoriteBoards::readFromXML( xml ); + Kita::FavoriteBoards::readFromXML(xml); } } void KitaMainWindow::saveFavoriteBoards() { - QString configPath = KStandardDirs::locateLocal( "appdata", "favorite_boards.xml" ); - QFile file( configPath ); - if ( file.open( QIODevice::WriteOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString configPath = KStandardDirs::locateLocal("appdata", "favorite_boards.xml"); + QFile file(configPath); + if (file.open(QIODevice::WriteOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); stream << Kita::FavoriteBoards::toXML(); } } void KitaMainWindow::loadCompletion() { - QString configPath = KStandardDirs::locateLocal( "appdata", "completion" ); - KConfig config( configPath ); + QString configPath = KStandardDirs::locateLocal("appdata", "completion"); + KConfig config(configPath); - Kita::Config::setNameCompletionList( config.group("").readEntry( "name", QStringList() ) ); + Kita::Config::setNameCompletionList(config.group("").readEntry("name", QStringList() )); } void KitaMainWindow::loadAsciiArt() { - QString configPath = KStandardDirs::locateLocal( "appdata", "asciiart" ); - QFile file( configPath ); - if ( file.open( QIODevice::ReadOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString configPath = KStandardDirs::locateLocal("appdata", "asciiart"); + QFile file(configPath); + if (file.open(QIODevice::ReadOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); QStringList list; QString str; - while ( !( str = stream.readLine() ).isEmpty() ) { - if ( ! str.isEmpty() ) { + while (!(str = stream.readLine()).isEmpty()) { + if (! str.isEmpty()) { list << str; } } - Kita::AsciiArtConfig::setAsciiArtList( list ); + Kita::AsciiArtConfig::setAsciiArtList(list); } } void KitaMainWindow::loadAboneIDList() { - QString configPath = KStandardDirs::locateLocal( "appdata", "abone_id" ); - QFile file( configPath ); - if ( file.open( QIODevice::ReadOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString configPath = KStandardDirs::locateLocal("appdata", "abone_id"); + QFile file(configPath); + if (file.open(QIODevice::ReadOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); QStringList list; QString str; - while ( !( str = stream.readLine() ).isEmpty() ) { - if ( ! str.isEmpty() ) { + while (!(str = stream.readLine()).isEmpty()) { + if (! str.isEmpty()) { list << str; } } - Kita::AboneConfig::setAboneIDList( list ); + Kita::AboneConfig::setAboneIDList(list); } } void KitaMainWindow::loadAboneNameList() { - QString configPath = KStandardDirs::locateLocal( "appdata", "abone_name" ); - QFile file( configPath ); - if ( file.open( QIODevice::ReadOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString configPath = KStandardDirs::locateLocal("appdata", "abone_name"); + QFile file(configPath); + if (file.open(QIODevice::ReadOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); QStringList list; QString str; - while ( !( str = stream.readLine() ).isEmpty() ) { - if ( ! str.isEmpty() ) { + while (!(str = stream.readLine()).isEmpty()) { + if (! str.isEmpty()) { list << str; } } - Kita::AboneConfig::setAboneNameList( list ); + Kita::AboneConfig::setAboneNameList(list); } } void KitaMainWindow::loadAboneWordList() { - QString configPath = KStandardDirs::locateLocal( "appdata", "abone_word" ); - QFile file( configPath ); - if ( file.open( QIODevice::ReadOnly ) ) { - QTextStream stream( &file ); - stream.setCodec( "UTF-8" ); + QString configPath = KStandardDirs::locateLocal("appdata", "abone_word"); + QFile file(configPath); + if (file.open(QIODevice::ReadOnly)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); QStringList list; QString str; - while ( !( str = stream.readLine() ).isEmpty() ) { - if ( ! str.isEmpty() ) { + while (!(str = stream.readLine()).isEmpty()) { + if (! str.isEmpty()) { list << str; } } - Kita::AboneConfig::setAboneWordList( list ); + Kita::AboneConfig::setAboneWordList(list); } } Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -50,10 +50,10 @@ KitaMainWindow(); virtual ~KitaMainWindow(); - void load( const KUrl& url ); - void setMainStatus( const QString& statusStr ); - void setUrl( const KUrl& url ); - void bookmark( const QString& datURL, bool on ); + void load(const KUrl& url); + void setMainStatus(const QString& statusStr); + void setUrl(const KUrl& url); + void bookmark(const QString& datURL, bool on); private slots: void login(); @@ -64,7 +64,7 @@ void optionsConfigureToolbars(); void optionsPreferences(); void settingsMenuAboutToShow(); - void setFont( const QFont& font ); + void setFont(const QFont& font); void slotEditCopy(); void slotURLLine(); Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -16,18 +16,18 @@ using namespace Kita::Ui; -AbonePrefPage::AbonePrefPage( QWidget *parent ) - : QWidget( parent ) +AbonePrefPage::AbonePrefPage(QWidget *parent) + : QWidget(parent) { setupUi(this); - idAboneText->setText( Kita::AboneConfig::aboneIDList().join( "\n" ) ); - nameAboneText->setText( Kita::AboneConfig::aboneNameList().join( "\n" ) ); - wordAboneText->setText( Kita::AboneConfig::aboneWordList().join( "\n" ) ); + idAboneText->setText(Kita::AboneConfig::aboneIDList().join("\n")); + nameAboneText->setText(Kita::AboneConfig::aboneNameList().join("\n")); + wordAboneText->setText(Kita::AboneConfig::aboneWordList().join("\n")); - connect( idAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) ); - connect( nameAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) ); - connect( wordAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) ); + connect(idAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); + connect(nameAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); + connect(wordAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); m_changed = false; } @@ -43,18 +43,18 @@ void AbonePrefPage::apply() { - if ( m_changed ) { + if (m_changed) { QString idText = idAboneText->toPlainText(); - QStringList idList = idText.split( '\n' ); - Kita::AboneConfig::setAboneIDList( idList ); + QStringList idList = idText.split('\n'); + Kita::AboneConfig::setAboneIDList(idList); QString nameText = nameAboneText->toPlainText(); - QStringList nameList = nameText.split( '\n' ); - Kita::AboneConfig::setAboneNameList( nameList ); + QStringList nameList = nameText.split('\n'); + Kita::AboneConfig::setAboneNameList(nameList); QString wordText = wordAboneText->toPlainText(); - QStringList wordList = wordText.split( '\n' ); - Kita::AboneConfig::setAboneWordList( wordList ); + QStringList wordList = wordText.split('\n'); + Kita::AboneConfig::setAboneWordList(wordList); } m_changed = false; Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -24,7 +24,7 @@ Q_OBJECT bool m_changed; public: - AbonePrefPage( QWidget *parent = 0 ); + AbonePrefPage(QWidget *parent = 0); ~AbonePrefPage(); public slots: void apply(); Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -42,80 +42,80 @@ using namespace Kita; -KitaPreferences::KitaPreferences( QWidget* parent ) - : KConfigDialog( parent, "Kita Preferences", Kita::Config::self() ) +KitaPreferences::KitaPreferences(QWidget* parent) + : KConfigDialog(parent, "Kita Preferences", Kita::Config::self()) { - enableButtonApply( false ); - enableButton( Help, false ); + enableButtonApply(false); + enableButton(Help, false); // this is the base class for your preferences dialog. it is now // a Treelist dialog.. but there are a number of other // possibilities (including Tab, Swallow, and just Plain) - m_facePage = new Kita::Ui::FacePrefPage( 0 ); - m_facePageItem = addPage( m_facePage, i18n( "Face" ), "view_detailed" ); + m_facePage = new Kita::Ui::FacePrefPage(0); + m_facePageItem = addPage(m_facePage, i18n("Face"), "view_detailed"); - connect( m_facePage, SIGNAL( fontChanged( const QFont& ) ), - SIGNAL( fontChanged( const QFont& ) ) ); + connect(m_facePage, SIGNAL(fontChanged(const QFont&)), + SIGNAL(fontChanged(const QFont&))); - m_asciiArtPage = new Kita::Ui::AsciiArtPrefPage( 0 ); - m_asciiArtPageItem = addPage( m_asciiArtPage, i18n( "AsciiArt" ), "kita" ); + m_asciiArtPage = new Kita::Ui::AsciiArtPrefPage(0); + m_asciiArtPageItem = addPage(m_asciiArtPage, i18n("AsciiArt"), "kita"); - m_uiPage = new Kita::Ui::UIPrefPage( 0 ); - m_uiPageItem = addPage( m_uiPage, i18n( "User Interface" ), "configure" ); + m_uiPage = new Kita::Ui::UIPrefPage(0); + m_uiPageItem = addPage(m_uiPage, i18n("User Interface"), "configure"); - m_abonePage = new Kita::Ui::AbonePrefPage( 0 ); - m_abonePageItem = addPage( m_abonePage, i18n( "Abone" ), "kita" ); + m_abonePage = new Kita::Ui::AbonePrefPage(0); + m_abonePageItem = addPage(m_abonePage, i18n("Abone"), "kita"); QWidget* m_loginWidget = new QWidget; m_loginPage = new Kita::Ui::LoginPrefPage(); m_loginPage->setupUi(m_loginWidget); - m_loginPageItem = addPage( m_loginWidget, i18n( "Login" ), "connect_established" ); + m_loginPageItem = addPage(m_loginWidget, i18n("Login"), "connect_established"); QWidget* m_writeWidget = new QWidget; m_writePage = new Kita::Ui::WritePrefPage(); m_writePage->setupUi(m_writeWidget); - m_writePageItem = addPage( m_writeWidget, i18n( "Write" ), "edit" ); + m_writePageItem = addPage(m_writeWidget, i18n("Write"), "edit"); - connect( m_facePage, SIGNAL( changed() ), SLOT( slotChanged() ) ); - connect( m_asciiArtPage, SIGNAL( changed() ), SLOT( slotChanged() ) ); - connect( m_uiPage, SIGNAL( changed() ), SLOT( slotChanged() ) ); - connect( m_abonePage, SIGNAL( changed() ), SLOT( slotChanged() ) ); -// connect( m_loginPage, SIGNAL( changed() ), SLOT( slotChanged() ) ); // TODO -// connect( m_writePage, SIGNAL( changed() ), SLOT( slotChanged() ) ); // TODO + connect(m_facePage, SIGNAL(changed()), SLOT(slotChanged())); + connect(m_asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); + connect(m_uiPage, SIGNAL(changed()), SLOT(slotChanged())); + connect(m_abonePage, SIGNAL(changed()), SLOT(slotChanged())); +// connect(m_loginPage, SIGNAL(changed()), SLOT(slotChanged())); // TODO +// connect(m_writePage, SIGNAL(changed()), SLOT(slotChanged())); // TODO - connect( this, SIGNAL( currentPageChanged( KPageWidgetItem*, KPageWidgetItem* ) ), SLOT( slotCurrentPageChanged() ) ); + connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*, KPageWidgetItem*)), SLOT(slotCurrentPageChanged())); } void KitaPreferences::slotApply() { - if ( currentPage() == m_facePageItem ) { + if (currentPage() == m_facePageItem) { // face m_facePage->apply(); - } else if ( currentPage() == m_asciiArtPageItem ) { + } else if (currentPage() == m_asciiArtPageItem) { // asciiart m_asciiArtPage->apply(); - } else if ( currentPage() == m_uiPageItem ) { + } else if (currentPage() == m_uiPageItem) { // user interface m_uiPage->apply(); - } else if ( currentPage() == m_abonePageItem ) { + } else if (currentPage() == m_abonePageItem) { // abone m_abonePage->apply(); } else { // login // write } - enableButtonApply( false ); + enableButtonApply(false); } void KitaPreferences::slotDefault() { - if ( currentPage() == m_facePageItem ) { + if (currentPage() == m_facePageItem) { // face m_facePage->reset(); - } else if ( currentPage() == m_asciiArtPageItem ) { + } else if (currentPage() == m_asciiArtPageItem) { // asciiart m_asciiArtPage->reset(); - } else if ( currentPage() == m_uiPageItem ) { + } else if (currentPage() == m_uiPageItem) { // user m_uiPage->reset(); } else { @@ -124,12 +124,12 @@ // write // debug } - enableButtonApply( true ); + enableButtonApply(true); } void KitaPreferences::slotChanged() { - enableButtonApply( true ); + enableButtonApply(true); } void KitaPreferences::slotOk() @@ -144,44 +144,44 @@ void KitaPreferences::slotCurrentPageChanged() { - if ( currentPage() == m_asciiArtPageItem ) { + if (currentPage() == m_asciiArtPageItem) { // ascii art m_asciiArtPage->init(); } } -Ui::AsciiArtPrefPage::AsciiArtPrefPage( QWidget* parent ) - : QWidget( parent ) +Ui::AsciiArtPrefPage::AsciiArtPrefPage(QWidget* parent) + : QWidget(parent) { - setupUi( this ); + setupUi(this); init(); - connect( asciiArtText, SIGNAL( textChanged() ), SIGNAL( changed() ) ); + connect(asciiArtText, SIGNAL(textChanged()), SIGNAL(changed())); } void Ui::AsciiArtPrefPage::init() { - asciiArtText->setText( Kita::AsciiArtConfig::asciiArtList().join( "\n" ) ); - asciiArtText->setFont( Kita::Config::threadFont() ); + asciiArtText->setText(Kita::AsciiArtConfig::asciiArtList().join("\n")); + asciiArtText->setFont(Kita::Config::threadFont()); } void Ui::AsciiArtPrefPage::apply() { QString text = asciiArtText->toPlainText(); - QStringList list = text.split( '\n' ); + QStringList list = text.split('\n'); - Kita::AsciiArtConfig::setAsciiArtList( list ); + Kita::AsciiArtConfig::setAsciiArtList(list); } void Ui::AsciiArtPrefPage::reset() { } -Ui::UIPrefPage::UIPrefPage( QWidget* parent ) - : QWidget( parent ) +Ui::UIPrefPage::UIPrefPage(QWidget* parent) + : QWidget(parent) { - setupUi( this ); - connect( editFileAssociation, SIGNAL( leftClickedUrl() ), SLOT( slotEditFileAssociation() ) ); + setupUi(this); + connect(editFileAssociation, SIGNAL(leftClickedUrl()), SLOT(slotEditFileAssociation())); } void Ui::UIPrefPage::apply() @@ -190,32 +190,32 @@ void Ui::UIPrefPage::reset() { - kcfg_AlwaysUseTab->setChecked( true ); - kcfg_MarkTime->setValue( 24 ); - kcfg_ShowMailAddress->setChecked( false ); - kcfg_ShowNum->setValue( 100 ); - kcfg_ListSortOrder->setButton( Kita::Config::EnumListSortOrder::Mark ); - kcfg_PartMimeList->setText( "image/gif,image/jpeg,image/png,image/x-bmp" ); - kcfg_UsePart->setChecked( true ); + kcfg_AlwaysUseTab->setChecked(true); + kcfg_MarkTime->setValue(24); + kcfg_ShowMailAddress->setChecked(false); + kcfg_ShowNum->setValue(100); + kcfg_ListSortOrder->setButton(Kita::Config::EnumListSortOrder::Mark); + kcfg_PartMimeList->setText("image/gif,image/jpeg,image/png,image/x-bmp"); + kcfg_UsePart->setChecked(true); } void Ui::UIPrefPage::slotEditFileAssociation() { - KToolInvocation::kdeinitExec( "kcmshell", QStringList( "filetypes" ) ); + KToolInvocation::kdeinitExec("kcmshell", QStringList("filetypes")); } -Ui::FacePrefPage::FacePrefPage( QWidget* parent ) - : QWidget( parent ) +Ui::FacePrefPage::FacePrefPage(QWidget* parent) + : QWidget(parent) { - setupUi( this ); + setupUi(this); // font - connect( listFontButton, SIGNAL( clicked() ), SLOT( slotFontButtonClicked() ) ); + connect(listFontButton, SIGNAL(clicked()), SLOT(slotFontButtonClicked())); - connect( threadFontButton, SIGNAL( clicked() ), - SLOT( slotThreadFontButtonClicked() ) ); + connect(threadFontButton, SIGNAL(clicked()), + SLOT(slotThreadFontButtonClicked())); - connect( popupFontButton, SIGNAL( clicked() ), - SLOT( slotPopupFontButtonClicked() ) ); + connect(popupFontButton, SIGNAL(clicked()), + SLOT(slotPopupFontButtonClicked())); updateButtons(); @@ -223,89 +223,89 @@ m_threadColorChanged = false; // color - threadColorButton->setColor( Kita::Config::threadColor() ); - threadBackgroundColorButton->setColor( Kita::Config::threadBackground() ); - popupColorButton->setColor( Kita::Config::popupColor() ); - popupBackgroundColorButton->setColor( Kita::Config::popupBackground() ); + threadColorButton->setColor(Kita::Config::threadColor()); + threadBackgroundColorButton->setColor(Kita::Config::threadBackground()); + popupColorButton->setColor(Kita::Config::popupColor()); + popupBackgroundColorButton->setColor(Kita::Config::popupBackground()); - connect( threadColorButton, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( threadBackgroundColorButton, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( threadColorButton, SIGNAL( changed( const QColor& ) ), SLOT( slotColorChanged() ) ); - connect( threadBackgroundColorButton, SIGNAL( changed( const QColor& ) ), SLOT( slotColorChanged() ) ); - connect( popupColorButton, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); - connect( popupBackgroundColorButton, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) ); + connect(threadColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); + connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); + connect(threadColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); + connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); + connect(popupColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); + connect(popupBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); } void Ui::FacePrefPage::apply() { // font QFont font = listFontButton->font(); - Kita::Config::setFont( font ); - emit fontChanged( font ); + Kita::Config::setFont(font); + emit fontChanged(font); - if ( m_threadFontchanged ) { + if (m_threadFontchanged) { QFont threadFont = threadFontButton->font(); - Kita::Config::setThreadFont( threadFont ); + Kita::Config::setThreadFont(threadFont); } m_threadFontchanged = false; QFont popupFont = popupFontButton->font(); - Kita::Config::setPopupFont( popupFont ); + Kita::Config::setPopupFont(popupFont); // color - if ( m_threadColorChanged ) { - Kita::Config::setThreadColor( threadColorButton->color() ); - Kita::Config::setThreadBackground( threadBackgroundColorButton->color() ); + if (m_threadColorChanged) { + Kita::Config::setThreadColor(threadColorButton->color()); + Kita::Config::setThreadBackground(threadBackgroundColorButton->color()); } m_threadColorChanged = false; - Kita::Config::setPopupColor( popupColorButton->color() ); - Kita::Config::setPopupBackground( popupBackgroundColorButton->color() ); + Kita::Config::setPopupColor(popupColorButton->color()); + Kita::Config::setPopupBackground(popupBackgroundColorButton->color()); } void Ui::FacePrefPage::reset() { // font QFont font; - listFontButton->setText( Kita::fontToString( font ) ); - listFontButton->setFont( font ); + listFontButton->setText(Kita::fontToString(font)); + listFontButton->setFont(font); - threadFontButton->setText( Kita::fontToString( font ) ); - threadFontButton->setFont( font ); + threadFontButton->setText(Kita::fontToString(font)); + threadFontButton->setFont(font); m_threadFontchanged = true; - popupFontButton->setText( Kita::fontToString( font ) ); - popupFontButton->setFont( font ); + popupFontButton->setText(Kita::fontToString(font)); + popupFontButton->setFont(font); // color - threadColorButton->setColor( Qt::black ); - threadBackgroundColorButton->setColor( Qt::white ); - popupColorButton->setColor( Qt::black ); - popupBackgroundColorButton->setColor( Qt::yellow ); + threadColorButton->setColor(Qt::black); + threadBackgroundColorButton->setColor(Qt::white); + popupColorButton->setColor(Qt::black); + popupBackgroundColorButton->setColor(Qt::yellow); m_threadColorChanged = true; } void Ui::FacePrefPage::updateButtons() { QFont font = Kita::Config::font(); - listFontButton->setText( Kita::fontToString( font ) ); - listFontButton->setFont( font ); + listFontButton->setText(Kita::fontToString(font)); + listFontButton->setFont(font); QFont threadFont = Kita::Config::threadFont(); - threadFontButton->setText( Kita::fontToString( threadFont ) ); - threadFontButton->setFont( threadFont ); + threadFontButton->setText(Kita::fontToString(threadFont)); + threadFontButton->setFont(threadFont); QFont popupFont = Kita::Config::popupFont(); - popupFontButton->setText( Kita::fontToString( popupFont ) ); - popupFontButton->setFont( popupFont ); + popupFontButton->setText(Kita::fontToString(popupFont)); + popupFontButton->setFont(popupFont); } void Ui::FacePrefPage::slotThreadFontButtonClicked() { QFont threadFont = threadFontButton->font(); - if ( KFontDialog::getFont( threadFont, false, this ) == QDialog::Accepted ) { - threadFontButton->setText( Kita::fontToString( threadFont ) ); - threadFontButton->setFont( threadFont ); + if (KFontDialog::getFont(threadFont, false, this) == QDialog::Accepted) { + threadFontButton->setText(Kita::fontToString(threadFont)); + threadFontButton->setFont(threadFont); emit changed(); m_threadFontchanged = true; } @@ -315,9 +315,9 @@ { QFont font = listFontButton->font(); - if ( KFontDialog::getFont( font, false, this ) == QDialog::Accepted ) { - listFontButton->setText( Kita::fontToString( font ) ); - listFontButton->setFont( font ); + if (KFontDialog::getFont(font, false, this) == QDialog::Accepted) { + listFontButton->setText(Kita::fontToString(font)); + listFontButton->setFont(font); emit changed(); } } @@ -326,9 +326,9 @@ { QFont font = popupFontButton->font(); - if ( KFontDialog::getFont( font, false, this ) == QDialog::Accepted ) { - popupFontButton->setText( Kita::fontToString( font ) ); - popupFontButton->setFont( font ); + if (KFontDialog::getFont(font, false, this) == QDialog::Accepted) { + popupFontButton->setText(Kita::fontToString(font)); + popupFontButton->setFont(font); emit changed(); } } Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -43,7 +43,7 @@ Q_OBJECT public: - KitaPreferences( QWidget* parent ); + KitaPreferences(QWidget* parent); protected: virtual void slotApply(); @@ -72,7 +72,7 @@ void slotCurrentPageChanged(); signals: - void fontChanged( const QFont& ); + void fontChanged(const QFont&); }; /*class DebugPrefPage : public DebugPrefBase @@ -80,7 +80,7 @@ Q_OBJECT public: - DebugPrefPage( QWidget* parent = 0 ); + DebugPrefPage(QWidget* parent = 0); public slots: void replace(); @@ -92,7 +92,7 @@ { Q_OBJECT public: - AsciiArtPrefPage( QWidget* parent = 0 ); + AsciiArtPrefPage(QWidget* parent = 0); public slots: void init(); void apply(); @@ -106,7 +106,7 @@ { Q_OBJECT public: - UIPrefPage( QWidget* parent = 0 ); + UIPrefPage(QWidget* parent = 0); void apply(); void reset(); @@ -126,7 +126,7 @@ bool m_threadColorChanged; public: - FacePrefPage( QWidget* parent = 0 ); + FacePrefPage(QWidget* parent = 0); void apply(); void reset(); @@ -140,7 +140,7 @@ void updateButtons(); signals: - void fontChanged( const QFont& ); + void fontChanged(const QFont&); void changed(); }; } Modified: kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui.h 2009-07-10 21:05:53 UTC (rev 2384) @@ -10,12 +10,12 @@ #ifndef KITAWRITEPAGEUI_H #define KITAWRITEPAGEUI_H -void Kita::WritePrefPage::DefaultSageCheckBoxToggled( bool on ) +void Kita::WritePrefPage::DefaultSageCheckBoxToggled(bool on) { - if ( on ) { - kcfg_DefaultMail->setReadOnly( true ); + if (on) { + kcfg_DefaultMail->setReadOnly(true); } else { - kcfg_DefaultMail->setReadOnly( false ); + kcfg_DefaultMail->setReadOnly(false); } } Modified: kita/branches/KITA-KDE4/kita/src/respopup.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-09 15:42:11 UTC (rev 2383) +++ kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-10 21:05:53 UTC (rev 2384) @@ -23,20 +23,20 @@ namespace Kita { - ResPopup::ResPopup( KHTMLView* view, const KUrl& url ) - : QFrame( view, + ResPopup::ResPopup(KHTMLView* view, const KUrl& url) + : QFrame(view, Qt::FramelessWindowHint | Qt::Tool | Qt::Window | Qt::X11BypassWindowManagerHint - ) + ) { m_url = url; m_htmlPart = 0; - m_htmlPart = new KitaHTMLPart( this ); - m_htmlPart->setup( HTMLPART_MODE_POPUP , url ); - connect( m_htmlPart, SIGNAL( hideChildPopup() ), SIGNAL( hideChildPopup() ) ); + m_htmlPart = new KitaHTMLPart(this); + m_htmlPart->setup(HTMLPART_MODE_POPUP , url); + connect(m_htmlPart, SIGNAL(hideChildPopup()), SIGNAL(hideChildPopup())); } @@ -48,22 +48,22 @@ /* public */ - void ResPopup::setText( const QString& str ) + void ResPopup::setText(const QString& str) { const int maxwd = 1600; const int maxht = 1200; - QString style = QString( "body.pop {" + QString style = QString("body.pop {" " font-size: %1pt; " " font-family: %2; " " color: %3; " " background-color: %4; " " border-width: 0;" - "}" ) - .arg( Kita::Config::popupFont().pointSize() ) - .arg( Kita::Config::popupFont().family() ) - .arg( Kita::Config::popupColor().name() ) - .arg( Kita::Config::popupBackground().name() ); + "}") + .arg(Kita::Config::popupFont().pointSize()) + .arg(Kita::Config::popupFont().family()) + .arg(Kita::Config::popupColor().name()) + .arg(Kita::Config::popupBackground().name()); QString text = ""; - text += str; - text += ""; + QString text = ""; + text += str; + text += ""; - if (m_htmlPart) { - m_htmlPart->view() ->resize(maxwd, maxht); - m_htmlPart->setJScriptEnabled(false); - m_htmlPart->setJavaEnabled(false); - m_htmlPart->begin(KUrl("file:/dummy.htm")); - m_htmlPart->write(text); - m_htmlPart->end(); - m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - } + if (m_htmlPart) { + m_htmlPart->view() ->resize(maxwd, maxht); + m_htmlPart->setJScriptEnabled(false); + m_htmlPart->setJavaEnabled(false); + m_htmlPart->begin(KUrl("file:/dummy.htm")); + m_htmlPart->write(text); + m_htmlPart->end(); + m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); } +} - /* public */ - void ResPopup::adjustSize() - { - if (!m_htmlPart) return ; +/* public */ +void ResPopup::adjustSize() +{ + if (!m_htmlPart) return ; - int width = 0, xx = 0, leftmrg = 0; - int maxwidth = 0, maxheight = 0; - DOM::Node curnode = m_htmlPart->htmlDocument().body().firstChild(); + int width = 0, xx = 0, leftmrg = 0; + int maxwidth = 0, maxheight = 0; + DOM::Node curnode = m_htmlPart->htmlDocument().body().firstChild(); - for (;;) { + for (;;) { - QRect qr = curnode.getRect(); - int tmpwd = qr.right() - qr.left(); + QRect qr = curnode.getRect(); + int tmpwd = qr.right() - qr.left(); - /*----------------------------------*/ + /*----------------------------------*/ - if (curnode.nodeType() == DOM::Node::TEXT_NODE) { - if (xx == 0) xx = qr.left(); - width += tmpwd; - } + if (curnode.nodeType() == DOM::Node::TEXT_NODE) { + if (xx == 0) xx = qr.left(); + width += tmpwd; + } - /*----------------------------------*/ + /*----------------------------------*/ - else if (curnode.nodeName().string() == "div") { - if (leftmrg == 0) leftmrg = qr.left(); - width = 0; - xx = 0; - } + else if (curnode.nodeName().string() == "div") { + if (leftmrg == 0) leftmrg = qr.left(); + width = 0; + xx = 0; + } - /*----------------------------------*/ + /*----------------------------------*/ - else if (curnode.nodeName().string() == "br") { - width = 0; - xx = 0; - } + else if (curnode.nodeName().string() == "br") { + width = 0; + xx = 0; + } - /*----------------------------------*/ + /*----------------------------------*/ - if (leftmrg + xx + width > maxwidth) maxwidth = leftmrg + xx + width; - if (qr.bottom() > maxheight) maxheight = qr.bottom(); + if (leftmrg + xx + width > maxwidth) maxwidth = leftmrg + xx + width; + if (qr.bottom() > maxheight) maxheight = qr.bottom(); - /* move to the next node */ - DOM::Node next = curnode.firstChild(); + /* move to the next node */ + DOM::Node next = curnode.firstChild(); - if (next.isNull()) next = curnode.nextSibling(); + if (next.isNull()) next = curnode.nextSibling(); - while (!curnode.isNull() && next.isNull()) { - curnode = curnode.parentNode(); - if (!curnode.isNull()) next = curnode.nextSibling(); - } + while (!curnode.isNull() && next.isNull()) { + curnode = curnode.parentNode(); + if (!curnode.isNull()) next = curnode.nextSibling(); + } - curnode = next; + curnode = next; - if (curnode.isNull()) break; - } + if (curnode.isNull()) break; + } - const int mrg = 32; + const int mrg = 32; - int wd = maxwidth + mrg; - int ht = maxheight + mrg; + int wd = maxwidth + mrg; + int ht = maxheight + mrg; - m_htmlPart->view() ->resize(wd, ht); - QFrame::adjustSize(); - } + m_htmlPart->view() ->resize(wd, ht); + QFrame::adjustSize(); +} - /* public */ - void ResPopup::adjustPos(const QPoint& point) - { - QPoint pos = point; - enum{ - POS_LeftUp, - POS_RightUp, - POS_LeftDown, - POS_RightDown - }; +/* public */ +void ResPopup::adjustPos(const QPoint& point) +{ + QPoint pos = point; + enum{ + POS_LeftUp, + POS_RightUp, + POS_LeftDown, + POS_RightDown + }; - /* config */ + /* config */ - const int mrg = 16; + const int mrg = 16; - /*----------------------------*/ + /*----------------------------*/ - if (!m_htmlPart) return ; + if (!m_htmlPart) return ; - QRect qr = QApplication::desktop() ->rect(); - int sw = qr.width(), sh = qr.height(); - int wd = width(), ht = height(); - int x = pos.x(), y = pos.y(); - int idx; + QRect qr = QApplication::desktop() ->rect(); + int sw = qr.width(), sh = qr.height(); + int wd = width(), ht = height(); + int x = pos.x(), y = pos.y(); + int idx; - if ((x + mrg) + wd < sw - && (y - mrg) - ht >= 0) idx = POS_RightUp; + if ((x + mrg) + wd < sw + && (y - mrg) - ht >= 0) idx = POS_RightUp; - else if ((x - mrg) - wd >= 0 - && y - (ht + mrg) >= 0) idx = POS_LeftUp; + else if ((x - mrg) - wd >= 0 + && y - (ht + mrg) >= 0) idx = POS_LeftUp; - else if ((x + mrg) + wd < sw - && (y + mrg) + ht < sh) idx = POS_RightDown; + else if ((x + mrg) + wd < sw + && (y + mrg) + ht < sh) idx = POS_RightDown; - else if ((x - mrg) - wd >= 0 - && (y + mrg) + ht < sh) idx = POS_LeftDown; + else if ((x - mrg) - wd >= 0 + && (y + mrg) + ht < sh) idx = POS_LeftDown; - else { - int area[ 4 ]; - area[ 0 ] = (sw - x) * y; - area[ 1 ] = x * y; - area[ 2 ] = (sw - x) * (sh - y); - area[ 3 ] = x * (sh - y); + else { + int area[ 4 ]; + area[ 0 ] = (sw - x) * y; + area[ 1 ] = x * y; + area[ 2 ] = (sw - x) * (sh - y); + area[ 3 ] = x * (sh - y); - idx = 0; - for (int i = 1; i < 4; ++i) if (area[ i ] > area[ idx ]) idx = i; - } + idx = 0; + for (int i = 1; i < 4; ++i) if (area[ i ] > area[ idx ]) idx = i; + } - switch (idx) { + switch (idx) { - case POS_RightUp: - x = x + mrg; - y = (y - mrg) - ht; - break; + case POS_RightUp: + x = x + mrg; + y = (y - mrg) - ht; + break; - case POS_LeftUp: - x = (x - mrg) - wd; - y = (y - mrg) - ht; - break; + case POS_LeftUp: + x = (x - mrg) - wd; + y = (y - mrg) - ht; + break; - case POS_RightDown: - x = x + mrg; - y = y + mrg; - break; + case POS_RightDown: + x = x + mrg; + y = y + mrg; + break; - case POS_LeftDown: - x = (x - mrg) - wd; - y = y + mrg; - break; - } + case POS_LeftDown: + x = (x - mrg) - wd; + y = y + mrg; + break; + } - if (x < 0) { + if (x < 0) { - x = ht % 16; - } - if (x + wd >= sw) { + x = ht % 16; + } + if (x + wd >= sw) { - x = sw - wd - (ht % 16); + x = sw - wd - (ht % 16); - if (x < 0) { - if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - x = 0; - wd = sw; - } + if (x < 0) { + if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + x = 0; + wd = sw; } + } - if (y < 0) { - if (x <= pos.x() && pos.x() < x + wd) { - if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - ht += y; - } - y = 0; + if (y < 0) { + if (x <= pos.x() && pos.x() < x + wd) { + if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + ht += y; } - if (y + ht >= sh) { + y = 0; + } + if (y + ht >= sh) { - if (x <= pos.x() && pos.x() < x + wd) { - if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - ht = sh - y; - } else { - y = sh - ht; + if (x <= pos.x() && pos.x() < x + wd) { + if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + ht = sh - y; + } else { + y = sh - ht; - if (y < 0) { - if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - y = 0; - ht = sh; - } + if (y < 0) { + if (m_htmlPart) m_htmlPart->view() ->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + y = 0; + ht = sh; } } + } - pos.setX(x); - pos.setY(y); - move(pos); + pos.setX(x); + pos.setY(y); + move(pos); - if (m_htmlPart) m_htmlPart->view() ->resize(wd, ht); - resize(wd , ht); - } + if (m_htmlPart) m_htmlPart->view() ->resize(wd, ht); + resize(wd , ht); +} - /* move mouse pointer above the popup frame */ /* public */ - void ResPopup::moveMouseAbove() - { - /* config */ +/* move mouse pointer above the popup frame */ /* public */ +void ResPopup::moveMouseAbove() +{ + /* config */ - const int mrg = 10; + const int mrg = 10; - /*-------------------------------*/ + /*-------------------------------*/ - QPoint pos = QCursor::pos(); - int cx = pos.x(), cy = pos.y(); - int px = x(); - int py = y(); - int wd = width(); - int ht = height(); + QPoint pos = QCursor::pos(); + int cx = pos.x(), cy = pos.y(); + int px = x(); + int py = y(); + int wd = width(); + int ht = height(); - if (cx <= px) cx = px + mrg; - else if (cx >= px + wd) cx = px + wd - mrg; + if (cx <= px) cx = px + mrg; + else if (cx >= px + wd) cx = px + wd - mrg; - if (cy <= py) cy = py + mrg; - else if (cy >= py + ht) cy = py + ht - mrg; + if (cy <= py) cy = py + mrg; + else if (cy >= py + ht) cy = py + ht - mrg; - QCursor::setPos(cx, cy); - } + QCursor::setPos(cx, cy); } Modified: kita/branches/KITA-KDE4/kita/src/respopup.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/respopup.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -7,25 +7,25 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ +#ifndef KITARESPOPUP_H +#define KITARESPOPUP_H -#ifndef RESPOPUP_H -#define RESPOPUP_H - #include #include class KHTMLView; -class KitaHTMLPart; namespace Kita { + class HTMLPart; + class ResPopup : public QFrame { Q_OBJECT - KitaHTMLPart* m_htmlPart; + HTMLPart* m_htmlPart; KUrl m_url; Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 07:11:43 UTC (rev 2424) @@ -76,7 +76,7 @@ void ThreadListView::slotSearchButton() { insertSearchCombo(); - QStringList list = Kita::parseSearchQuery(SearchCombo->currentText()); + QStringList list = parseSearchQuery(SearchCombo->currentText()); if (list.isEmpty()) { clearSearch(); Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -29,7 +29,7 @@ /** @author Hideki Ikemoto */ - class ThreadListView : public QWidget, public Kita::Ui::ThreadListViewBase + class ThreadListView : public QWidget, public Ui::ThreadListViewBase { Q_OBJECT Modified: kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadlistviewitem.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -7,7 +7,6 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ - #ifndef KITATHREADLISTVIEWITEM_H #define KITATHREADLISTVIEWITEM_H @@ -34,7 +33,7 @@ namespace Kita { - /* for KitaBoardView */ + /* for BoardView */ class ThreadListViewItem : public QTableWidgetItem { public: Modified: kita/branches/KITA-KDE4/kita/src/threadproperty.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-18 07:11:43 UTC (rev 2424) @@ -561,5 +561,4 @@ - qPixmapFromMimeSource Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-18 07:11:43 UTC (rev 2424) @@ -24,11 +24,9 @@ #include "libkita/datmanager.h" #include "libkita/parsemisc.h" -/*--------------------------------------------------------------------------------*/ +using namespace Kita; - -KitaThreadTabWidget::KitaThreadTabWidget(QWidget* parent) - : KitaTabWidgetBase(parent) +ThreadTabWidget::ThreadTabWidget(QWidget* parent) : TabWidgetBase(parent) { setXMLFile("threadtabwidgetui.rc"); @@ -39,18 +37,18 @@ } -KitaThreadTabWidget::~KitaThreadTabWidget() {} +ThreadTabWidget::~ThreadTabWidget() {} /* show "Main thread" view */ /* public slots */ -void KitaThreadTabWidget::slotShowMainThread(const KUrl& url) +void ThreadTabWidget::slotShowMainThread(const KUrl& url) { QString refstr; - KUrl datURL = Kita::ParseMisc::parseURL(url, refstr); - QString threadName = Kita::DatManager::threadName(datURL); + KUrl datURL = ParseMisc::parseURL(url, refstr); + QString threadName = DatManager::threadName(datURL); int jumpNum = 0; int viewMode = VIEWMODE_MAINVIEW; - KitaThreadView* currentView = isThreadView(currentWidget()); + ThreadView* currentView = isThreadView(currentWidget()); if (currentView) viewMode = currentView->getViewMode(); if (!refstr.isEmpty()) { @@ -59,7 +57,7 @@ else jumpNum = refstr.toInt(); } - KitaThreadView* view = findMainView(datURL); + ThreadView* view = findMainView(datURL); if (view) { @@ -76,7 +74,7 @@ } } else { - KitaThreadView * newView = createView(threadName); + ThreadView * newView = createView(threadName); if (newView) { newView->showThread(datURL, jumpNum); @@ -88,16 +86,16 @@ } /* close "all" views which URL is url. */ /* public slot */ -void KitaThreadTabWidget::slotCloseThreadTab(const KUrl& url) +void ThreadTabWidget::slotCloseThreadTab(const KUrl& url) { int max = count(); if (max == 0) return ; - KUrl datURL = Kita::ParseMisc::parseURLonly(url); + KUrl datURL = ParseMisc::parseURLonly(url); int i, i2; i = i2 = 0; while (i < max) { - KitaThreadView * view = isThreadView(widget(i)); + ThreadView * view = isThreadView(widget(i)); if (view) { if (view->datURL() == datURL) { slotCloseTab(i2); @@ -110,10 +108,10 @@ -/* create KitaThreadView */ /* private */ -KitaThreadView* KitaThreadTabWidget::createView(const QString& label) +/* create ThreadView */ /* private */ +ThreadView* ThreadTabWidget::createView(const QString& label) { - KitaThreadView * view = new KitaThreadView(this); + ThreadView * view = new ThreadView(this); if (view) { addTab(view, label); } @@ -122,16 +120,16 @@ } /* private */ -KitaThreadView* KitaThreadTabWidget::findMainView(const KUrl& url) +ThreadView* ThreadTabWidget::findMainView(const KUrl& url) { - KUrl datURL = Kita::ParseMisc::parseURLonly(url); + KUrl datURL = ParseMisc::parseURLonly(url); int max = count(); if (max == 0) return 0; int i = 0; while (i < max) { - KitaThreadView * view = isThreadView(widget(i)); + ThreadView * view = isThreadView(widget(i)); if (view) { if (view->getViewMode() == VIEWMODE_MAINVIEW) { @@ -148,11 +146,11 @@ /* private */ -KitaThreadView* KitaThreadTabWidget::isThreadView(QWidget* w) +ThreadView* ThreadTabWidget::isThreadView(QWidget* w) { - KitaThreadView * view = 0; + ThreadView * view = 0; if (w) { - if (w->inherits("KitaThreadView")) view = static_cast< KitaThreadView* >(w); + if (w->inherits("ThreadView")) view = static_cast< ThreadView* >(w); } return view; @@ -160,29 +158,29 @@ /* private slots */ -void KitaThreadTabWidget::slotUpdateThreadTab(const KUrl& url) +void ThreadTabWidget::slotUpdateThreadTab(const KUrl& url) { - KUrl datURL = Kita::ParseMisc::parseURLonly(url); + KUrl datURL = ParseMisc::parseURLonly(url); - KitaThreadView * view = findMainView(datURL); + ThreadView * view = findMainView(datURL); if (view) { - QString threadName = Kita::DatManager::threadName(datURL); + QString threadName = DatManager::threadName(datURL); setTabText(indexOf(view), threadName); setTabToolTip(indexOf(view), threadName); } } -void KitaThreadTabWidget::slotFontChanged() +void ThreadTabWidget::slotFontChanged() { - QFont font = Kita::Config::threadFont(); + QFont font = Config::threadFont(); setFont(font); } /* protected */ /* virtual */ -void KitaThreadTabWidget::deleteWidget(QWidget* w) +void ThreadTabWidget::deleteWidget(QWidget* w) { - KitaTabWidgetBase::deleteWidget(w); + TabWidgetBase::deleteWidget(w); if (count() == 0) { ViewMediator::getInstance()->setMainCaption(QString()); @@ -190,7 +188,7 @@ ViewMediator::getInstance()->setMainURLLine(KUrl()); /* default view */ - KitaThreadView * threadView = createView("thread"); + ThreadView * threadView = createView("thread"); if (threadView) { setCurrentWidget(threadView); @@ -201,11 +199,11 @@ /*--------------------------------*/ -/* KitaThreadView actions */ +/* ThreadView actions */ /* private */ -void KitaThreadTabWidget::setupActions() +void ThreadTabWidget::setupActions() { KStandardAction::copy(this, SLOT(slotCopyText()), actionCollection()); @@ -254,13 +252,13 @@ -/* KitaThreadView actions */ +/* ThreadView actions */ /* copy selected text (Ctrl+C) */ /* public slot */ -void KitaThreadTabWidget::slotCopyText() +void ThreadTabWidget::slotCopyText() { QWidget * w = currentWidget(); - KitaThreadView * view = isThreadView(w); + ThreadView * view = isThreadView(w); if (view) { QClipboard * clipboard = QApplication::clipboard(); QString text = view->selectedText(); @@ -269,72 +267,72 @@ } /* public slot */ -void KitaThreadTabWidget::slotFocusSearchCombo() +void ThreadTabWidget::slotFocusSearchCombo() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->focusSearchCombo(); } /* public slot */ -void KitaThreadTabWidget::slotSearchNext() +void ThreadTabWidget::slotSearchNext() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotSearchNext(); } /* public slot */ -void KitaThreadTabWidget::slotSearchPrev() +void ThreadTabWidget::slotSearchPrev() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotSearchPrev(); } /* public slot */ -void KitaThreadTabWidget::slotGobackAnchor() +void ThreadTabWidget::slotGobackAnchor() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotGobackAnchor(); } /* public slot */ -void KitaThreadTabWidget::slotGotoHeader() +void ThreadTabWidget::slotGotoHeader() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotGotoHeader(); } /* public slot */ -void KitaThreadTabWidget::slotGotoFooter() +void ThreadTabWidget::slotGotoFooter() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotGotoFooter(); } /* public slot */ -void KitaThreadTabWidget::slotReloadButton() +void ThreadTabWidget::slotReloadButton() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotReloadButton(); } /* public slot */ -void KitaThreadTabWidget::slotStopLoading() +void ThreadTabWidget::slotStopLoading() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotStopLoading(); } /* public slot */ -void KitaThreadTabWidget::slotDeleteButtonClicked() +void ThreadTabWidget::slotDeleteButtonClicked() { - KitaThreadView * view = isThreadView(currentWidget()); + ThreadView * view = isThreadView(currentWidget()); if (view) view->slotDeleteButtonClicked(); } Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -7,60 +7,58 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ - #ifndef KITATHREADTABWIDGET_H #define KITATHREADTABWIDGET_H #include "kitaui/tabwidgetbase.h" -class KitaThreadView; +namespace Kita { + class ThreadView; -/*-----------------------------------------------*/ + class ThreadTabWidget : public TabWidgetBase + { + Q_OBJECT + public: + explicit ThreadTabWidget(QWidget* parent = 0); + ~ThreadTabWidget(); -class KitaThreadTabWidget : public KitaTabWidgetBase -{ - Q_OBJECT + public slots: + void slotShowMainThread(const KUrl& datURL); + void slotCloseThreadTab(const KUrl& url); + void slotUpdateThreadTab(const KUrl& url); -public: - explicit KitaThreadTabWidget(QWidget* parent = 0); - ~KitaThreadTabWidget(); + private: + ThreadView* createView(const QString& label); + ThreadView* findMainView(const KUrl& url); + ThreadView* isThreadView(QWidget* w); -public slots: - void slotShowMainThread(const KUrl& datURL); - void slotCloseThreadTab(const KUrl& url); - void slotUpdateThreadTab(const KUrl& url); + private slots: + void slotFontChanged(); -private: - KitaThreadView* createView(const QString& label); - KitaThreadView* findMainView(const KUrl& url); - KitaThreadView* isThreadView(QWidget* w); -private slots: - void slotFontChanged(); + protected: + virtual void deleteWidget(QWidget* w); -protected: - virtual void deleteWidget(QWidget* w); + /*------------------------------------*/ + /* ThreadView actions */ + private: + void setupActions(); - /*------------------------------------*/ - /* KitaThreadView actions */ + public slots: + void slotCopyText(); + void slotFocusSearchCombo(); + void slotSearchNext(); + void slotSearchPrev(); + void slotGobackAnchor(); + void slotGotoHeader(); + void slotGotoFooter(); + void slotReloadButton(); + void slotStopLoading(); + void slotDeleteButtonClicked(); + }; +} -private: - void setupActions(); - -public slots: - void slotCopyText(); - void slotFocusSearchCombo(); - void slotSearchNext(); - void slotSearchPrev(); - void slotGobackAnchor(); - void slotGotoHeader(); - void slotGotoFooter(); - void slotReloadButton(); - void slotStopLoading(); - void slotDeleteButtonClicked(); -}; - #endif Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-18 07:11:43 UTC (rev 2424) @@ -34,14 +34,15 @@ #define MAX_LABEL_LENGTH 60 +using namespace Kita; -KitaThreadView::KitaThreadView(KitaThreadTabWidget* parent) +ThreadView::ThreadView(ThreadTabWidget* parent) { m_parent = parent; /* copied from Base class */ setFocusPolicy(Qt::ClickFocus); - KitaThreadViewBaseLayout = new QVBoxLayout(this); + ThreadViewBaseLayout = new QVBoxLayout(this); layout2 = new QHBoxLayout(0); layout2->setSpacing(6); @@ -85,17 +86,17 @@ closeButton = new QToolButton(this); closeButton->setEnabled(false); layout2->addWidget(closeButton); - KitaThreadViewBaseLayout->addLayout(layout2); + ThreadViewBaseLayout->addLayout(layout2); threadFrame = new QFrame(this); threadFrame->setFrameShape(QFrame::StyledPanel); threadFrame->setFrameShadow(QFrame::Raised); - KitaThreadViewBaseLayout->addWidget(threadFrame); + ThreadViewBaseLayout->addWidget(threadFrame); resize(QSize(870, 480).expandedTo(minimumSizeHint())); setAttribute(Qt::WA_WState_Polished); /* copy end */ - m_threadPart = new KitaHTMLPart(threadFrame); + m_threadPart = new HTMLPart(threadFrame); QHBoxLayout* aLayout = new QHBoxLayout(threadFrame); aLayout->addWidget(m_threadPart->view()); @@ -108,7 +109,7 @@ closeButton->setIcon(SmallIcon("tab-close")); } - setAcceptDrops(true); // DND Drop eneble: 2nd stage. - enable on "KitaThreadView" widget and disable on the others(child widgets of "KitaThreadView"). + setAcceptDrops(true); // DND Drop eneble: 2nd stage. - enable on "ThreadView" widget and disable on the others(child widgets of "ThreadView"). threadFrame->setAcceptDrops(false); // don't treat Drop event on child. m_threadPart->view() ->setAcceptDrops(false); // don't treat Drop event on child. @@ -143,7 +144,7 @@ } -KitaThreadView::~KitaThreadView() +ThreadView::~ThreadView() { if (m_threadPart) { @@ -152,17 +153,17 @@ } } -const KUrl KitaThreadView::threadURL() const +const KUrl ThreadView::threadURL() const { - return Kita::getThreadURL(m_datURL); + return getThreadURL(m_datURL); } -const KUrl KitaThreadView::datURL() const +const KUrl ThreadView::datURL() const { return m_datURL; } -void KitaThreadView::slotDOMNodeActivated(const DOM::Node& node) +void ThreadView::slotDOMNodeActivated(const DOM::Node& node) { { //process Anchor tags. Anchor tags not proccessed here cause 'emit KParts::BrowserExtention::openURLRequest()' DOM::HTMLAnchorElement anchor = node; @@ -173,7 +174,7 @@ } // end of Anchor tags. } -void KitaThreadView::setSubjectLabel(const QString& boardName, const QString& threadName, const QString& boardURL) +void ThreadView::setSubjectLabel(const QString& boardName, const QString& threadName, const QString& boardURL) { QString disp; if (boardName.isEmpty()) { @@ -185,7 +186,7 @@ //disp.truncate(MAX_LABEL_LENGTH); } -void KitaThreadView::updateButton() +void ThreadView::updateButton() { writeButton->setEnabled(true); BookmarkButton->setEnabled(true); @@ -211,13 +212,13 @@ /*--------------------*/ /* write response */ /*--------------------*/ /* private slots */ -void KitaThreadView::slotWriteButtonClicked(const QString& resStr) +void ThreadView::slotWriteButtonClicked(const QString& resStr) { ViewMediator::getInstance()->showWriteView(m_datURL, resStr); } -void KitaThreadView::insertSearchCombo() +void ThreadView::insertSearchCombo() { for (int count = 0; count < SearchCombo->count(); ++count) { if (SearchCombo->itemText(count) == SearchCombo->currentText()) { @@ -228,7 +229,7 @@ SearchCombo->addItem(SearchCombo->currentText()); } -void KitaThreadView::slotPopupMenu(KXMLGUIClient* client, const QPoint& global, const KUrl& url, const QString& mimeType, mode_t mode) +void ThreadView::slotPopupMenu(KXMLGUIClient* client, const QPoint& global, const KUrl& url, const QString& mimeType, mode_t mode) { /* KActionCollection * collection = client->actionCollection(); KAction* action; @@ -236,7 +237,7 @@ emit popupMenu(client, global, url, mimeType, mode);*/ // TODO } -void KitaThreadView::setFont(const QFont& font) +void ThreadView::setFont(const QFont& font) { // m_threadPart->setStandardFont(font.family()); SearchCombo->setFont(font); @@ -247,13 +248,13 @@ } -void KitaThreadView::slotBookmarkButtonClicked(bool on) +void ThreadView::slotBookmarkButtonClicked(bool on) { ViewMediator::getInstance()->bookmark(m_datURL.prettyUrl(), on); } -void KitaThreadView::focusSearchCombo() +void ThreadView::focusSearchCombo() { if (! SearchCombo->hasFocus()) { SearchCombo->setFocus(); @@ -264,7 +265,7 @@ /* public slot */ /* virtual */ -void KitaThreadView::setFocus() +void ThreadView::setFocus() { ViewMediator::getInstance()->changeWriteTab(m_datURL); showStatusBar(QString()); @@ -279,20 +280,20 @@ /*-------*/ /* setup */ /*-------*/ -void KitaThreadView::setup(const KUrl& datURL, int mode) +void ThreadView::setup(const KUrl& datURL, int mode) { /* config. */ /*---------------------------------------*/ /* setup */ - m_datURL = Kita::getDatURL(datURL); + m_datURL = getDatURL(datURL); /* setup HTMLPart */ int partMode = HTMLPART_MODE_MAINPART; m_threadPart->setup(partMode, m_datURL); - /* mode. Mode is defined in kitathreadview.h */ + /* mode. Mode is defined in threadview.h */ m_viewmode = mode; /* reset search direction */ @@ -302,14 +303,14 @@ /*--------------------------------------------------------*/ /* Show thread */ -/* This function is called from KitaThreadTabWidget class */ +/* This function is called from ThreadTabWidget class */ /*--------------------------------------------------------*/ -void KitaThreadView::showThread(const KUrl& datURL, int num) +void ThreadView::showThread(const KUrl& datURL, int num) { /* If this widget is not parent, then do nothing. */ if (m_viewmode != VIEWMODE_MAINVIEW) return ; - if (num == 0) num = Kita::DatManager::getViewPos(datURL); + if (num == 0) num = DatManager::getViewPos(datURL); if (topLevelWidget() ->isMinimized()) topLevelWidget() ->showNormal(); topLevelWidget() ->raise(); @@ -332,20 +333,20 @@ /*---------*/ /* reload */ /*---------*/ /* public slot */ -void KitaThreadView::slotReloadButton(int jumpNum) +void ThreadView::slotReloadButton(int jumpNum) { topLevelWidget() ->raise(); activateWindow(); if (m_threadPart->reload(jumpNum)) { - showStatusBar(Kita::utf8ToUnicode(KITAUTF8_NOWRENEW)); + showStatusBar(utf8ToUnicode(KITAUTF8_NOWRENEW)); } } /*-----------------------------------*/ /* stop loading the thread */ /* public slot */ -void KitaThreadView::slotStopLoading() +void ThreadView::slotStopLoading() { /* hide popup */ if (m_threadPart->isPopupVisible()) { @@ -359,24 +360,24 @@ return ; } - Kita::DatManager::stopLoading(m_datURL); + DatManager::stopLoading(m_datURL); } /*-----------------------------------------*/ /* show the information at the statusbar. */ /*-----------------------------------------*/ -void KitaThreadView::showStatusBar(const QString &information) +void ThreadView::showStatusBar(const QString &information) { if (m_datURL.isEmpty()) return ; QString info = information; QString captionStr; QString infostr; QString errstr; - int viewPos = Kita::DatManager::getViewPos(m_datURL); - int resNum = Kita::DatManager::getResNum(m_datURL); - bool broken = Kita::DatManager::isBroken(m_datURL); - int datSize = Kita::DatManager::getDatSize(m_datURL); + int viewPos = DatManager::getViewPos(m_datURL); + int resNum = DatManager::getResNum(m_datURL); + bool broken = DatManager::isBroken(m_datURL); + int datSize = DatManager::getDatSize(m_datURL); switch (m_viewmode) { @@ -388,15 +389,15 @@ if (broken) info += " This thread is broken."; /* show status bar,caption, url */ - infostr = Kita::DatManager::threadName(m_datURL) + + infostr = DatManager::threadName(m_datURL) + QString(" [Total: %1 New: %2] %3 k").arg(resNum).arg(resNum - viewPos).arg(datSize / 1024) + info + ' ' + errstr; - captionStr = Kita::DatManager::threadName(m_datURL) + QString(" (%1)").arg(viewPos); + captionStr = DatManager::threadName(m_datURL) + QString(" (%1)").arg(viewPos); ViewMediator::getInstance()->setMainCaption(captionStr); ViewMediator::getInstance()->setMainStatus(infostr); - ViewMediator::getInstance()->setMainURLLine(Kita::getThreadURL(m_datURL)); + ViewMediator::getInstance()->setMainURLLine(getThreadURL(m_datURL)); return ; break; @@ -412,26 +413,26 @@ /*--------------------*/ /* update information */ /* public */ -void KitaThreadView::slotUpdateInfo() +void ThreadView::slotUpdateInfo() { - m_rescode = Kita::DatManager::getResponseCode(m_datURL); - m_serverTime = Kita::DatManager::getServerTime(m_datURL); + m_rescode = DatManager::getResponseCode(m_datURL); + m_serverTime = DatManager::getServerTime(m_datURL); /* uptate information */ - setSubjectLabel(Kita::BoardManager::boardName(m_datURL), - Kita::DatManager::threadName(m_datURL) + setSubjectLabel(BoardManager::boardName(m_datURL), + DatManager::threadName(m_datURL) + QString(" (%1)") - .arg(Kita::DatManager::getReadNum(m_datURL)), - Kita::BoardManager::boardURL(m_datURL)); + .arg(DatManager::getReadNum(m_datURL)), + BoardManager::boardURL(m_datURL)); updateButton(); gotoCombo->clear(); - gotoCombo->addItem(Kita::utf8ToUnicode(KITAUTF8_GOTO)); - gotoCombo->addItem(Kita::utf8ToUnicode(KITAUTF8_KOKOYON)); - for (int i = 1; i < Kita::DatManager::getReadNum(m_datURL); i += 100) { + gotoCombo->addItem(utf8ToUnicode(KITAUTF8_GOTO)); + gotoCombo->addItem(utf8ToUnicode(KITAUTF8_KOKOYON)); + for (int i = 1; i < DatManager::getReadNum(m_datURL); i += 100) { gotoCombo->addItem(QString().setNum(i) + '-'); } - gotoCombo->addItem(Kita::utf8ToUnicode(KITAUTF8_SAIGO)); + gotoCombo->addItem(utf8ToUnicode(KITAUTF8_SAIGO)); gotoCombo->adjustSize(); ViewMediator::getInstance()->updateBoardView(m_datURL); @@ -439,7 +440,7 @@ showStatusBar(""); - emit showThreadCompleted(); /* to KitaThreadPart */ + emit showThreadCompleted(); /* to ThreadPart */ } @@ -448,7 +449,7 @@ /*------------------------*/ /* search function */ /*------------------------*/ /* private slots */ -void KitaThreadView::slotSearchButton() +void ThreadView::slotSearchButton() { if (m_datURL.isEmpty()) return ; /* Nothing is shown on the screen.*/ @@ -481,11 +482,11 @@ } /* public slot */ -void KitaThreadView::slotSearchNext() { slotSearchPrivate(false); } -void KitaThreadView::slotSearchPrev() { slotSearchPrivate(true); } +void ThreadView::slotSearchNext() { slotSearchPrivate(false); } +void ThreadView::slotSearchPrev() { slotSearchPrivate(true); } /* private */ -void KitaThreadView::slotSearchPrivate(bool rev) +void ThreadView::slotSearchPrivate(bool rev) { if (m_datURL.isEmpty()) return ; /* Nothing is shown on the screen.*/ @@ -498,16 +499,16 @@ QStringList query; query += SearchCombo->currentText(); - int ResNum = Kita::DatManager::getResNum(m_datURL); + int ResNum = DatManager::getResNum(m_datURL); for (int i = 1; i <= ResNum; i++) { - if (Kita::DatManager::checkWord(m_datURL, query, i, false)) { + if (DatManager::checkWord(m_datURL, query, i, false)) { /* if this is parent, then show all responses, and search */ if (m_viewmode == VIEWMODE_MAINVIEW) m_threadPart->showAll(); insertSearchCombo(); - QStringList list = Kita::parseSearchQuery(SearchCombo->currentText()); + QStringList list = parseSearchQuery(SearchCombo->currentText()); m_threadPart->findText(SearchCombo->currentText(), rev); SearchCombo->setFocus(); @@ -519,13 +520,13 @@ } /* public slot */ -void KitaThreadView::slotGobackAnchor() { m_threadPart->slotGobackAnchor(); } -void KitaThreadView::slotGotoHeader() { m_threadPart->gotoAnchor("header", false);} -void KitaThreadView::slotGotoFooter() { m_threadPart->slotClickGotoFooter(); } +void ThreadView::slotGobackAnchor() { m_threadPart->slotGobackAnchor(); } +void ThreadView::slotGotoHeader() { m_threadPart->gotoAnchor("header", false);} +void ThreadView::slotGotoFooter() { m_threadPart->slotClickGotoFooter(); } // vim:sw=2: -void KitaThreadView::slotComboActivated(int index) +void ThreadView::slotComboActivated(int index) { if (index == gotoCombo->count() - 1) { // last @@ -540,11 +541,11 @@ } } -void KitaThreadView::slotDeleteButtonClicked() +void ThreadView::slotDeleteButtonClicked() { if (m_datURL.isEmpty()) return ; - int rescode = Kita::DatManager::getResponseCode(m_datURL); + int rescode = DatManager::getResponseCode(m_datURL); if ((rescode != 200 && rescode != 206) || FavoriteThreads::getInstance() ->contains(m_datURL.prettyUrl())) { if (QMessageBox::warning(this, @@ -554,18 +555,18 @@ != QMessageBox::Ok) return ; } - if (Kita::DatManager::deleteCache(m_datURL)) { + if (DatManager::deleteCache(m_datURL)) { m_parent->slotCloseThreadTab(m_datURL); ViewMediator::getInstance()->updateBoardView(m_datURL); } } -void KitaThreadView::slotCloseButton() +void ThreadView::slotCloseButton() { m_parent->slotCloseCurrentTab(); } -const QString KitaThreadView::selectedText() const +const QString ThreadView::selectedText() const { return m_threadPart->selectedText(); } Modified: kita/branches/KITA-KDE4/kita/src/threadview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -7,7 +7,6 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ - #ifndef KITATHREADVIEW_H #define KITATHREADVIEW_H @@ -25,14 +24,6 @@ class KComboBox; class KXMLGUIClient; -class KitaHTMLPart; -class KitaThreadTabWidget; - -namespace Kita -{ - class KitaSubjectLabel; -} - /* mode , m_viewmode uses them. */ enum { VIEWMODE_MAINVIEW, @@ -43,88 +34,98 @@ class Job; } -/** - * - * @author Hideki Ikemoto - **/ - -class KitaThreadView : public QWidget +namespace Kita { - Q_OBJECT + class HTMLPart; + class ThreadTabWidget; + class SubjectLabel; + + /** + * + * @author Hideki Ikemoto + **/ - KitaThreadTabWidget* m_parent; + class ThreadView : public QWidget + { + Q_OBJECT -public: - KitaThreadView(KitaThreadTabWidget* parent); - ~KitaThreadView(); - const KUrl threadURL() const; - const KUrl datURL() const; - const QString selectedText() const; + ThreadTabWidget* m_parent; - void setup(const KUrl& datURL, int mode); - void showStatusBar(const QString& information); - int getViewMode() { return m_viewmode; } + public: + ThreadView(ThreadTabWidget* parent); + ~ThreadView(); + const KUrl threadURL() const; + const KUrl datURL() const; + const QString selectedText() const; -public slots: - virtual void setFocus(); + void setup(const KUrl& datURL, int mode); + void showStatusBar(const QString& information); + int getViewMode() { return m_viewmode; } - void showThread(const KUrl& datURL, int num); - void setFont(const QFont& font); - void slotReloadButton(int jumpNum = 0); - void slotStopLoading(); - void focusSearchCombo(); - void slotDeleteButtonClicked(); - void slotSearchNext(); - void slotSearchPrev(); - void slotGobackAnchor(); - void slotGotoHeader(); - void slotGotoFooter(); + public slots: + virtual void setFocus(); -protected slots: - void slotDOMNodeActivated(const DOM::Node& node); - void slotPopupMenu(KXMLGUIClient*, const QPoint&, const KUrl&, const QString&, mode_t); + void showThread(const KUrl& datURL, int num); + void setFont(const QFont& font); + void slotReloadButton(int jumpNum = 0); + void slotStopLoading(); + void focusSearchCombo(); + void slotDeleteButtonClicked(); + void slotSearchNext(); + void slotSearchPrev(); + void slotGobackAnchor(); + void slotGotoHeader(); + void slotGotoFooter(); -private: - void insertSearchCombo(); - void setSubjectLabel(const QString& boardName, const QString& threadName, const QString& boardURL); - void updateButton(); + protected slots: + void slotDOMNodeActivated(const DOM::Node& node); + void slotPopupMenu(KXMLGUIClient*, const QPoint&, const KUrl&, + const QString&, mode_t); - KitaThreadView(const KitaThreadView&); - KitaThreadView& operator=(const KitaThreadView&); + private: + void insertSearchCombo(); + void setSubjectLabel(const QString& boardName, + const QString& threadName, const QString& boardURL); + void updateButton(); - int m_serverTime; - KUrl m_datURL; - KitaHTMLPart* m_threadPart; + ThreadView(const ThreadView&); + ThreadView& operator=(const ThreadView&); - bool m_revsearch; - int m_viewmode; - int m_rescode; + int m_serverTime; + KUrl m_datURL; + HTMLPart* m_threadPart; - QToolButton* writeButton; - KComboBox* SearchCombo; - QToolButton* HighLightButton; - QToolButton* BookmarkButton; - QToolButton* ReloadButton; - KComboBox* gotoCombo; - QToolButton* deleteButton; - QToolButton* closeButton; - QFrame* threadFrame; - QVBoxLayout* KitaThreadViewBaseLayout; - QHBoxLayout* layout2; - QSpacerItem* spacer2; + bool m_revsearch; + int m_viewmode; + int m_rescode; -private slots: - void slotSearchButton(); - void slotBookmarkButtonClicked(bool on); - void slotWriteButtonClicked(const QString& resstr = QString()); - void slotComboActivated(int index); - void slotUpdateInfo(); - void slotSearchPrivate(bool rev); - void slotCloseButton(); + QToolButton* writeButton; + KComboBox* SearchCombo; + QToolButton* HighLightButton; + QToolButton* BookmarkButton; + QToolButton* ReloadButton; + KComboBox* gotoCombo; + QToolButton* deleteButton; + QToolButton* closeButton; + QFrame* threadFrame; + QVBoxLayout* ThreadViewBaseLayout; + QHBoxLayout* layout2; + QSpacerItem* spacer2; -signals: - void popupMenu(KXMLGUIClient*, const QPoint&, const KUrl&, const QString&, mode_t); - void showThreadCompleted(); /* to KitaThreadPart */ -}; + private slots: + void slotSearchButton(); + void slotBookmarkButtonClicked(bool on); + void slotWriteButtonClicked(const QString& resstr = QString()); + void slotComboActivated(int index); + void slotUpdateInfo(); + void slotSearchPrivate(bool rev); + void slotCloseButton(); + signals: + void popupMenu(KXMLGUIClient*, const QPoint&, const KUrl&, + const QString&, mode_t); + void showThreadCompleted(); /* to ThreadPart */ + }; +} + #endif Modified: kita/branches/KITA-KDE4/kita/src/viewmediator.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/viewmediator.cpp 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/viewmediator.cpp 2009-07-18 07:11:43 UTC (rev 2424) @@ -19,6 +19,8 @@ #include "writetabwidget.h" #include "libkita/datmanager.h" +using namespace Kita; + ViewMediator* ViewMediator::instance = 0; ViewMediator::ViewMediator() @@ -95,7 +97,7 @@ m_mainWindow->bookmark(datURL, on); } -bool ViewMediator::isKitaActive() +bool ViewMediator::isActive() { Q_ASSERT(m_mainWindow); @@ -135,7 +137,7 @@ void ViewMediator::openURL(const KUrl& url) { // open thread. - if (Kita::DatManager::isThreadEnrolled(url)) { + if (DatManager::isThreadEnrolled(url)) { m_threadTabWidget->slotShowMainThread(url); return; } Modified: kita/branches/KITA-KDE4/kita/src/viewmediator.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/viewmediator.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/viewmediator.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -7,60 +7,67 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ -#ifndef VIEWMEDIATOR_H -#define VIEWMEDIATOR_H +#ifndef KITAVIEWMEDIATOR_H +#define KITAVIEWMEDIATOR_H class QString; class KUrl; -class KitaBoardTabWidget; -class KitaMainWindow; -class KitaThreadTabWidget; -class KitaWriteTabWidget; -class FavoriteListView; +namespace Kita { + class BoardTabWidget; + class MainWindow; + class ThreadTabWidget; + class WriteTabWidget; + class FavoriteListView; -/** - * @author Hideki Ikemoto - */ -class ViewMediator { - static ViewMediator* instance; - KitaThreadTabWidget* m_threadTabWidget; - KitaBoardTabWidget* m_boardTabWidget; - KitaWriteTabWidget* m_writeTabWidget; - KitaMainWindow* m_mainWindow; - FavoriteListView* m_favoriteListView; + /** + * @author Hideki Ikemoto + */ + class ViewMediator { + static ViewMediator* instance; + ThreadTabWidget* m_threadTabWidget; + BoardTabWidget* m_boardTabWidget; + WriteTabWidget* m_writeTabWidget; + MainWindow* m_mainWindow; + FavoriteListView* m_favoriteListView; - ViewMediator(); - ~ViewMediator(); + ViewMediator(); + ~ViewMediator(); -public: - static ViewMediator* getInstance(); + public: + static ViewMediator* getInstance(); - void setThreadTabWidget(KitaThreadTabWidget* threadTabWidget) { m_threadTabWidget = threadTabWidget; } - void setBoardTabWidget(KitaBoardTabWidget* boardTabWidget) { m_boardTabWidget = boardTabWidget; } - void setWriteTabWidget(KitaWriteTabWidget* writeTabWidget) { m_writeTabWidget = writeTabWidget; } - void setMainWindow(KitaMainWindow* mainWindow) { m_mainWindow = mainWindow; } - void setFavoriteListView(FavoriteListView* favoriteListView) { m_favoriteListView = favoriteListView; } + void setThreadTabWidget(ThreadTabWidget* threadTabWidget) + { m_threadTabWidget = threadTabWidget; } + void setBoardTabWidget(BoardTabWidget* boardTabWidget) + { m_boardTabWidget = boardTabWidget; } + void setWriteTabWidget(WriteTabWidget* writeTabWidget) + { m_writeTabWidget = writeTabWidget; } + void setMainWindow(MainWindow* mainWindow) + { m_mainWindow = mainWindow; } + void setFavoriteListView(FavoriteListView* favoriteListView) + { m_favoriteListView = favoriteListView; } - void closeThreadTab(const KUrl& url); - void showWriteView(const KUrl& url, const QString& resStr); - void openBoard(const KUrl& url); - void openThread(const KUrl& url); - void setMainStatus(const QString& statusStr); - void setMainURLLine(const KUrl& url); - void setMainCaption(const QString& str); - void bookmark(const QString& datURL, bool on); - bool isKitaActive(); - void updateBoardView(const KUrl& datURL); - void updateThreadView(const KUrl& datURL); - void changeWriteTab(const KUrl& datURL); - void updateFavoriteListView(); - void openURL(const KUrl& url); + void closeThreadTab(const KUrl& url); + void showWriteView(const KUrl& url, const QString& resStr); + void openBoard(const KUrl& url); + void openThread(const KUrl& url); + void setMainStatus(const QString& statusStr); + void setMainURLLine(const KUrl& url); + void setMainCaption(const QString& str); + void bookmark(const QString& datURL, bool on); + bool isActive(); + void updateBoardView(const KUrl& datURL); + void updateThreadView(const KUrl& datURL); + void changeWriteTab(const KUrl& datURL); + void updateFavoriteListView(); + void openURL(const KUrl& url); -private: - ViewMediator(const ViewMediator&); - ViewMediator& operator=(const ViewMediator&); -}; + private: + ViewMediator(const ViewMediator&); + ViewMediator& operator=(const ViewMediator&); + }; +} #endif Modified: kita/branches/KITA-KDE4/kita/src/writedialogbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-18 07:11:43 UTC (rev 2424) @@ -2,8 +2,8 @@ - KitaWriteDialogBase - + WriteDialogBase + 0 @@ -199,7 +199,6 @@ - qPixmapFromMimeSource ksqueezedtextlabel.h klineedit.h @@ -210,7 +209,7 @@ sageBox toggled(bool) - KitaWriteDialogBase + WriteDialogBase sageBoxToggled(bool) Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-18 07:11:43 UTC (rev 2424) @@ -21,11 +21,9 @@ #include "libkita/datmanager.h" #include "libkita/kita_misc.h" -/*--------------------------------------------------------------------------------*/ +using namespace Kita; - -KitaWriteTabWidget::KitaWriteTabWidget(QWidget* parent) - : KitaTabWidgetBase(parent) +WriteTabWidget::WriteTabWidget(QWidget* parent) : TabWidgetBase(parent) { setXMLFile("writetabwidgetui.rc"); @@ -33,11 +31,11 @@ } -KitaWriteTabWidget::~KitaWriteTabWidget() {} +WriteTabWidget::~WriteTabWidget() {} /* public slot */ -void KitaWriteTabWidget::slotShowWriteView(const KUrl& url, +void WriteTabWidget::slotShowWriteView(const KUrl& url, const QString& resStr) { openWriteView(url, resStr, QString()); @@ -45,11 +43,11 @@ /* private */ -void KitaWriteTabWidget::openWriteView(const KUrl& url, +void WriteTabWidget::openWriteView(const KUrl& url, const QString& resStr, const QString& subject) { // TODO: machiBBS kakiko support. - if (Kita::BoardManager::type(url) == Kita::Board_MachiBBS) { + if (BoardManager::type(url) == Board_MachiBBS) { // KMessageBox::sorry(this, // i18n("Can't write to machi BBS in this version."), // "<(_ _)>"); @@ -57,7 +55,7 @@ } /* view exists */ - KitaWriteView* view = findWriteView(url); + WriteView* view = findWriteView(url); if (view) { if (view->body().length()) { if (KMessageBox::warningYesNo(this, @@ -76,25 +74,25 @@ QString threadName; /* write res */ - KitaWriteView* new_dlg; - threadName = Kita::DatManager::threadName(url); - new_dlg = new KitaWriteView(this, url); + WriteView* new_dlg; + threadName = DatManager::threadName(url); + new_dlg = new WriteView(this, url); new_dlg->setMessage(resStr); addTab(new_dlg, threadName); setCurrentWidget(new_dlg); } /* private */ -KitaWriteView* KitaWriteTabWidget::findWriteView(const KUrl& url) +WriteView* WriteTabWidget::findWriteView(const KUrl& url) { - KUrl datURL = Kita::getDatURL(url); + KUrl datURL = getDatURL(url); if (datURL.isEmpty()) return 0; int max = count(); if (max == 0) return 0; for(int i=0; i < max; i++) { - KitaWriteView * view = isWriteView(widget (i)); + WriteView * view = isWriteView(widget (i)); if (view) { if (view->datURL() == datURL) return view; } @@ -105,11 +103,11 @@ /* private */ -KitaWriteView* KitaWriteTabWidget::isWriteView(QWidget* w) +WriteView* WriteTabWidget::isWriteView(QWidget* w) { - KitaWriteView * view = 0; + WriteView * view = 0; if (w) { - if (w->inherits("KitaWriteView")) view = static_cast< KitaWriteView* >(w); + if (w->inherits("WriteView")) view = static_cast< WriteView* >(w); } return view; @@ -118,10 +116,10 @@ /* when thread view is focused, this slot is called */ -/* See also KitaThreadView::setFocus. */ /* private slot */ -void KitaWriteTabWidget::slotChangeWriteTab(const KUrl& url) +/* See also ThreadView::setFocus. */ /* private slot */ +void WriteTabWidget::slotChangeWriteTab(const KUrl& url) { - KitaWriteView * view; + WriteView * view; int max = count(); if (max == 0) return ; @@ -141,9 +139,9 @@ /* protected */ /* virtual */ -void KitaWriteTabWidget::deleteWidget(QWidget* w) +void WriteTabWidget::deleteWidget(QWidget* w) { - KitaWriteView * view = isWriteView(w); + WriteView * view = isWriteView(w); if (view == 0) return ; @@ -153,16 +151,16 @@ "Do you want to close?"), "Kita") == KMessageBox::No) return; } - KitaTabWidgetBase::deleteWidget(w); + TabWidgetBase::deleteWidget(w); } /*--------------------------------*/ -/* KitaWriteTabWidget actions */ +/* WriteTabWidget actions */ /* private */ -void KitaWriteTabWidget::setupActions() +void WriteTabWidget::setupActions() { KAction* quoteclip_action = actionCollection()->addAction("writeview_quoteclip"); quoteclip_action->setText(i18n("quote clipboard")); @@ -172,9 +170,9 @@ /* public slot */ -void KitaWriteTabWidget::slotQuoteClipboard() +void WriteTabWidget::slotQuoteClipboard() { - KitaWriteView * view = isWriteView(currentWidget()); + WriteView * view = isWriteView(currentWidget()); if (view) { QClipboard * clipboard = QApplication::clipboard(); QString str = clipboard->text(QClipboard::Selection); Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -7,46 +7,45 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ - #ifndef KITAWRITETABWIDGET_H #define KITAWRITETABWIDGET_H #include "kitaui/tabwidgetbase.h" -class KitaWriteView; +namespace Kita { + class WriteView; -/*-----------------------------------------------*/ + class WriteTabWidget : public TabWidgetBase + { + Q_OBJECT + public: + explicit WriteTabWidget(QWidget* parent = 0); + ~WriteTabWidget(); + void slotShowWriteView(const KUrl& url, const QString& resStr); -class KitaWriteTabWidget : public KitaTabWidgetBase -{ - Q_OBJECT + private: + void openWriteView(const KUrl& url, const QString& resStr = QString(), + const QString& subject = QString()); + WriteView* findWriteView(const KUrl& url); + WriteView* isWriteView(QWidget* w); -public: - explicit KitaWriteTabWidget(QWidget* parent = 0); - ~KitaWriteTabWidget(); - void slotShowWriteView(const KUrl& url, const QString& resStr); + public: + void slotChangeWriteTab(const KUrl& url); -private: - void openWriteView(const KUrl& url, const QString& resStr = QString(), const QString& subject = QString()); - KitaWriteView* findWriteView(const KUrl& url); - KitaWriteView* isWriteView(QWidget* w); + protected: + virtual void deleteWidget(QWidget* w); -public: - void slotChangeWriteTab(const KUrl& url); -protected: - virtual void deleteWidget(QWidget* w); + /*------------------------------------*/ + /* WriteTabWidget actions */ + private: + void setupActions(); - /*------------------------------------*/ - /* KitaWriteTabWidget actions */ + public slots: + void slotQuoteClipboard(); + }; +} -private: - void setupActions(); - -public slots: - void slotQuoteClipboard(); -}; - #endif Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-18 07:11:43 UTC (rev 2424) @@ -31,29 +31,29 @@ #include "libkita/k2ch.h" #include "libkita/machibbs.h" -/*--------------------------------------------------------------------*/ +using namespace Kita; /* Call setMessage() to set message later. -See also KitaWriteTabWidget::slotShowWriteView(). +See also WriteTabWidget::slotShowWriteView(). Call slotPostMessage() to post the message. */ -KitaWriteView::KitaWriteView(KitaWriteTabWidget* parent, const KUrl& url) +WriteView::WriteView(WriteTabWidget* parent, const KUrl& url) : QWidget(parent) { setupUi(this); - m_datURL = Kita::getDatURL(url); - m_bbstype = Kita::BoardManager::type(m_datURL); - m_bbscgi = Kita::getWriteURL(m_datURL); + m_datURL = getDatURL(url); + m_bbstype = BoardManager::type(m_datURL); + m_bbscgi = getWriteURL(m_datURL); m_parent = parent; initUI(); } -void KitaWriteView::initUI() +void WriteView::initUI() { /* connect signals */ connect(buttonOk, SIGNAL(clicked()), @@ -72,57 +72,57 @@ qtw->setCurrentIndex(0); /* setup labels and edit lines */ - QFont font = Kita::Config::threadFont(); + QFont font = Config::threadFont(); bodyText->setFont(font); bodyText->setTabChangesFocus(true); - boardNameLabel->setText(Kita::BoardManager::boardName(m_datURL)); + boardNameLabel->setText(BoardManager::boardName(m_datURL)); // setup name field. - nameLine->setText(Kita::Config::defaultName()); - QStringList compList = Kita::Config::self()->nameCompletionList(); + nameLine->setText(Config::defaultName()); + QStringList compList = Config::self()->nameCompletionList(); nameLine->completionObject()->setItems(compList); // setup mail field & 'sage' checkbox - if (Kita::Config::defaultSage()) { + if (Config::defaultSage()) { mailLine->setText("sage"); sageBox->setChecked(true); } else { - mailLine->setText(Kita::Config::defaultMail()); + mailLine->setText(Config::defaultMail()); } m_mailswap = ""; // setup 'be' checkbox QRegExp host_2ch(".+\\.2ch\\.net"); if (host_2ch.indexIn(m_bbscgi.host()) != -1 - && Kita::Config::beMailAddress().length() > 0 - && Kita::Config::beAuthCode().length() > 0) { + && Config::beMailAddress().length() > 0 + && Config::beAuthCode().length() > 0) { beBox->setChecked(true); } /* setup AA */ faceCombo->clear(); - faceCombo->setFont(Kita::Config::threadFont()); + faceCombo->setFont(Config::threadFont()); faceCombo->addItem(""); - QStringList list = Kita::AsciiArtConfig::asciiArtList(); + QStringList list = AsciiArtConfig::asciiArtList(); QStringList::iterator it; for (it = list.begin(); it != list.end(); ++it) { faceCombo->addItem(*it); } // init thread name field. - threadNameLine->setText(Kita::DatManager::threadName(m_datURL)); + threadNameLine->setText(DatManager::threadName(m_datURL)); threadNameLine->setReadOnly(true); threadNameLine->setFrame(false); threadNameLine->setFocusPolicy(Qt::NoFocus); } -KitaWriteView::~KitaWriteView() +WriteView::~WriteView() { } /* public */ -void KitaWriteView::setMessage(const QString& bodyStr) +void WriteView::setMessage(const QString& bodyStr) { bodyText->clear(); bodyText->insertPlainText(bodyStr); @@ -131,7 +131,7 @@ /* public */ -void KitaWriteView::insertMessage(const QString& str) +void WriteView::insertMessage(const QString& str) { bodyText->insertPlainText(str); bodyText->setFocus(); @@ -139,32 +139,32 @@ /* public information */ -const KUrl KitaWriteView::datURL() const +const KUrl WriteView::datURL() const { return m_datURL; } -const QString KitaWriteView::threadName() const +const QString WriteView::threadName() const { return threadNameLine->text(); } -const QString KitaWriteView::boardID() const +const QString WriteView::boardID() const { - return Kita::BoardManager::boardID(m_datURL); + return BoardManager::boardID(m_datURL); } -const QString KitaWriteView::boardName() const +const QString WriteView::boardName() const { - return Kita::BoardManager::boardName(m_datURL); + return BoardManager::boardName(m_datURL); } /* public slot */ /* virtual */ -void KitaWriteView::setFocus() +void WriteView::setFocus() { bodyText->setFocus(); } -bool KitaWriteView::checkFields() +bool WriteView::checkFields() { if (body().length() == 0) { return false; @@ -173,16 +173,16 @@ } } -QString KitaWriteView::buildPostMessage() +QString WriteView::buildPostMessage() { QString postStr; switch (m_bbstype) { - case Kita::Board_JBBS: postStr = getJBBSPostStr(); break; + case Board_JBBS: postStr = getJBBSPostStr(); break; - case Kita::Board_FlashCGI: postStr = getFlashCGIPostStr(); break; + case Board_FlashCGI: postStr = getFlashCGIPostStr(); break; - case Kita::Board_MachiBBS: postStr = getMachiBBSPostStr(); break; + case Board_MachiBBS: postStr = getMachiBBSPostStr(); break; default: postStr = getPostStr(); break; } @@ -191,20 +191,20 @@ } /* call this slot to post the message. */ /* public slot */ -void KitaWriteView::slotPostMessage() +void WriteView::slotPostMessage() { if (!checkFields()) return; QString name = nameLine->text(); - QStringList list = Kita::Config::nameCompletionList(); + QStringList list = Config::nameCompletionList(); list.append(name); - Kita::Config::setNameCompletionList(list); + Config::setNameCompletionList(list); /* build post message */ QString postStr = buildPostMessage(); /* referrer */ - QString refStr = Kita::BoardManager::boardURL(m_datURL); + QString refStr = BoardManager::boardURL(m_datURL); m_array.clear(); @@ -213,10 +213,10 @@ job->addMetaData("referrer", refStr); /* 2ch.net cookie modify */ - if (m_bbstype == Kita::Board_2ch && beBox->isChecked()) { + if (m_bbstype == Board_2ch && beBox->isChecked()) { QString cookie = "Cookie: "; - QString BeMailAddress = Kita::Config::beMailAddress(); - QString BeAuthCode = Kita::Config::beAuthCode(); + QString BeMailAddress = Config::beMailAddress(); + QString BeAuthCode = Config::beAuthCode(); if (BeMailAddress.length() > 0 && BeAuthCode.length() > 0) { cookie += "DMDM=" + BeMailAddress + "; "; cookie += "MDMD=" + BeAuthCode + "; "; @@ -235,7 +235,7 @@ /* public slot */ -void KitaWriteView::slotCancel() +void WriteView::slotCancel() { if (body().length() == 0) { m_parent->slotCloseCurrentTab(); @@ -251,19 +251,19 @@ /* public slot */ -void KitaWriteView::slotEnableWriting(bool enable) +void WriteView::slotEnableWriting(bool enable) { buttonOk->setEnabled(enable); } /* see also slotPostMessage() */ /* private slot */ -void KitaWriteView::slotRecieveData(KIO::Job*, const QByteArray& data) +void WriteView::slotRecieveData(KIO::Job*, const QByteArray& data) { m_array.append(data.data()); } -void KitaWriteView::processPostFinished() +void WriteView::processPostFinished() { QString response; QString ckstr = QTextCodec::codecForName("utf8") ->toUnicode(KITAUTF8_WRITECOOKIE); @@ -321,18 +321,18 @@ /* This slot is called when posting is done. */ /* see also slotPostMessage() */ /* private slot */ -void KitaWriteView::slotPostFinished(KIO::Job*) +void WriteView::slotPostFinished(KIO::Job*) { processPostFinished(); } -int KitaWriteView::getWriteResNum() +int WriteView::getWriteResNum() { - return Kita::DatManager::getReadNum(m_datURL) + 1; + return DatManager::getReadNum(m_datURL) + 1; } /* private slot */ -bool KitaWriteView::slotBodyTextChanged() +bool WriteView::slotBodyTextChanged() { QString text = bodyText->toPlainText(); int lines = text.count('\n') + 1; @@ -354,15 +354,15 @@ } /* create posting message for 2ch */ /* private */ -QString KitaWriteView::getPostStr() +QString WriteView::getPostStr() { QString sessionID; - QString threadID = Kita::DatManager::threadID(m_datURL); - int serverTime = Kita::DatManager::getServerTime(m_datURL); + QString threadID = DatManager::threadID(m_datURL); + int serverTime = DatManager::getServerTime(m_datURL); /* login */ - if (Kita::DatManager::is2chThread(m_datURL) && Kita::Account::isLogged()) { - sessionID = KUrl::toPercentEncoding(Kita::Account::getSessionID()); + if (DatManager::is2chThread(m_datURL) && Account::isLogged()) { + sessionID = KUrl::toPercentEncoding(Account::getSessionID()); } return K2ch::buildPostStr(name(), mail(), @@ -371,10 +371,10 @@ sessionID); } -QString KitaWriteView::getMachiBBSPostStr() +QString WriteView::getMachiBBSPostStr() { - QString threadID = Kita::DatManager::threadID(m_datURL); - int serverTime = Kita::DatManager::getServerTime(m_datURL); + QString threadID = DatManager::threadID(m_datURL); + int serverTime = DatManager::getServerTime(m_datURL); return MachiBBS::buildPostStr(name(), mail(), body(), boardID(), @@ -383,10 +383,10 @@ /* create posting message for JBBS */ /* private */ /* private */ -QString KitaWriteView::getJBBSPostStr() +QString WriteView::getJBBSPostStr() { - QString threadID = Kita::DatManager::threadID(m_datURL); - int serverTime = Kita::DatManager::getServerTime(m_datURL); + QString threadID = DatManager::threadID(m_datURL); + int serverTime = DatManager::getServerTime(m_datURL); return JBBS::buildPostStr(name(), mail(), body(), boardID(), @@ -395,9 +395,9 @@ /* create posting message for Flash CGI */ /* private */ /* private */ -QString KitaWriteView::getFlashCGIPostStr() +QString WriteView::getFlashCGIPostStr() { - QString threadID = Kita::DatManager::threadID(m_datURL); + QString threadID = DatManager::threadID(m_datURL); QString ret; @@ -408,9 +408,9 @@ /* save post log */ /* private */ -void KitaWriteView::logPostMessage() +void WriteView::logPostMessage() { - QString threadURL = Kita::DatManager::threadURL(m_datURL); + QString threadURL = DatManager::threadURL(m_datURL); QDateTime now = QDateTime::currentDateTime(); QString logPath = KStandardDirs::locateLocal("appdata", "log.txt"); @@ -435,7 +435,7 @@ /* get result code from 2ch tag or title. */ /* private */ -int KitaWriteView::resultCode(const QString& response) const +int WriteView::resultCode(const QString& response) const { /* see also libkita/kita-utf8.h */ QString errstr = QTextCodec::codecForName("utf8") ->toUnicode(KITAUTF8_WRITEERROR); @@ -466,7 +466,7 @@ if (title.contains(ckstr)) return K2ch_Cookie; /* for Flash CGI */ - if (m_bbstype == Kita::Board_FlashCGI) { + if (m_bbstype == Board_FlashCGI) { if (title.contains("ERROR!!")) { return K2ch_Error; } else { @@ -475,7 +475,7 @@ } /* for JBBS. adhoc... */ - if (m_bbstype == Kita::Board_JBBS) { + if (m_bbstype == Board_JBBS) { // x-euc-jp & euc-jp if (response.contains("euc-jp")) { @@ -491,11 +491,11 @@ /* private */ -QString KitaWriteView::resultMessage(const QString& response) const +QString WriteView::resultMessage(const QString& response) const { QRegExp tags("(<[^<]+>|)"); - if (m_bbstype == Kita::Board_FlashCGI) { + if (m_bbstype == Board_FlashCGI) { QRegExp regexp("
(.*)
"); int pos = regexp.indexIn(response); @@ -531,7 +531,7 @@ /* private */ -QString KitaWriteView::resultTitle(const QString& response) const +QString WriteView::resultTitle(const QString& response) const { QRegExp regexp("(.*)"); int pos = regexp.indexIn(response, Qt::CaseInsensitive); Modified: kita/branches/KITA-KDE4/kita/src/writeview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-17 21:52:00 UTC (rev 2423) +++ kita/branches/KITA-KDE4/kita/src/writeview.h 2009-07-18 07:11:43 UTC (rev 2424) @@ -7,7 +7,6 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ - #ifndef KITAWRITEVIEW_H #define KITAWRITEVIEW_H @@ -18,9 +17,6 @@ #include "ui_writedialogbase.h" -class KitaPreviewPart; -class KitaWriteTabWidget; - /* result code */ enum{ K2ch_Unknown, @@ -31,93 +27,97 @@ K2ch_Cookie }; +namespace Kita { + class PreviewPart; + class WriteTabWidget; -/** - * - * Hideki Ikemoto - **/ -class KitaWriteView : public QWidget, public Ui::KitaWriteDialogBase -{ - Q_OBJECT + /** + * + * Hideki Ikemoto + **/ + class WriteView : public QWidget, public ::Ui::WriteDialogBase + { + Q_OBJECT - KitaWriteTabWidget* m_parent; + WriteTabWidget* m_parent; - QString getPostStr(); - QString getMachiBBSPostStr(); - QString getJBBSPostStr(); - QString getFlashCGIPostStr(); + QString getPostStr(); + QString getMachiBBSPostStr(); + QString getJBBSPostStr(); + QString getFlashCGIPostStr(); - KitaWriteView(const KitaWriteView&); - KitaWriteView& operator=(const KitaWriteView&); + WriteView(const WriteView&); + WriteView& operator=(const WriteView&); -protected: + protected: - QByteArray m_array; - KUrl m_bbscgi; - int m_bbstype; - KUrl m_datURL; - QString m_mailswap; + QByteArray m_array; + KUrl m_bbscgi; + int m_bbstype; + KUrl m_datURL; + QString m_mailswap; - void initUI(); - bool checkFields(); - QString buildPostMessage(); - int getWriteResNum(); - void processPostFinished(); - void logPostMessage(); - int resultCode(const QString& response) const; - QString resultMessage(const QString& response) const; - QString resultTitle(const QString& response) const; + void initUI(); + bool checkFields(); + QString buildPostMessage(); + int getWriteResNum(); + void processPostFinished(); + void logPostMessage(); + int resultCode(const QString& response) const; + QString resultMessage(const QString& response) const; + QString resultTitle(const QString& response) const; -public: - KitaWriteView(KitaWriteTabWidget* parent, const KUrl& url); - virtual ~KitaWriteView(); - void setMessage(const QString& bodyStr); - void insertMessage(const QString& str); + public: + WriteView(WriteTabWidget* parent, const KUrl& url); + virtual ~WriteView(); + void setMessage(const QString& bodyStr); + void insertMessage(const QString& str); - const KUrl datURL() const; - const QString threadName() const; - const QString boardName() const; - const QString boardID() const; - const QString name() const - { - return nameLine->text(); - } + const KUrl datURL() const; + const QString threadName() const; + const QString boardName() const; + const QString boardID() const; + const QString name() const + { + return nameLine->text(); + } - const QString mail() const - { - return mailLine->text(); - } + const QString mail() const + { + return mailLine->text(); + } - const QString body() const - { - return bodyText->toPlainText(); - } + const QString body() const + { + return bodyText->toPlainText(); + } -public slots: + public slots: - virtual void setFocus(); - void slotPostMessage(); - void slotCancel(); - void slotEnableWriting(bool enable); - void sageBoxToggled(bool on) - { - if (on) { - m_mailswap = mailLine->text(); - mailLine->setText("sage"); - mailLine->setReadOnly(true); - } else { - mailLine->setReadOnly(false); - mailLine->setText(m_mailswap); - } - } + virtual void setFocus(); + void slotPostMessage(); + void slotCancel(); + void slotEnableWriting(bool enable); + void sageBoxToggled(bool on) + { + if (on) { + m_mailswap = mailLine->text(); + mailLine->setText("sage"); + mailLine->setReadOnly(true); + } else { + mailLine->setReadOnly(false); + mailLine->setText(m_mailswap); + } + } -private slots: + private slots: - void slotRecieveData(KIO::Job*, const QByteArray&); - void slotPostFinished(KIO::Job*); + void slotRecieveData(KIO::Job*, const QByteArray&); + void slotPostFinished(KIO::Job*); -protected slots: - bool slotBodyTextChanged(); + protected slots: + bool slotBodyTextChanged(); -}; + }; +} #endif From svnnotify ¡÷ sourceforge.jp Sat Jul 18 16:54:35 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 18 Jul 2009 16:54:35 +0900 Subject: [Kita-svn] [2425] add ThreadListHeaderView Message-ID: <1247903675.712369.14372.nullmailer@users.sourceforge.jp> Revision: 2425 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2425 Author: nogu Date: 2009-07-18 16:54:35 +0900 (Sat, 18 Jul 2009) Log Message: ----------- add ThreadListHeaderView Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.h kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-18 07:54:35 UTC (rev 2425) @@ -20,6 +20,7 @@ mainwindow.cpp respopup.cpp threadlistview.cpp + threadlistheaderview.cpp threadlistviewitem.cpp threadtabwidget.cpp threadview.cpp Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 07:54:35 UTC (rev 2425) @@ -460,49 +460,6 @@ // subjectList->restoreLayout(&config, "Layout"); TODO } -bool BoardView::eventFilter(QObject* watched, QEvent* e) -{ - if (e->type() == QEvent::MouseButtonPress) { - QMouseEvent * mouseEvent = static_cast(e); - if (mouseEvent->button() == Qt::RightButton) { - KMenu popup; - for (int i = ColumnBegin; i <= ColumnEnd; i++) { - if (i != ColumnSubject - && i != ColumnMarkOrder - && i != ColumnIdOrder) { - KAction* action = new KAction(s_colAttr[ i ].itemName, this); - action->setCheckable(true); - action->setChecked(subjectList->columnWidth(i) != 0); - action->setData(QVariant(i)); - popup.addAction(action); - } - } - KAction* autoResizeAct = new KAction(i18n("Auto Resize"), this); - autoResizeAct->setCheckable(true); - autoResizeAct->setChecked(autoResize()); - popup.addAction(autoResizeAct); - - QAction* action = popup.exec(mouseEvent->globalPos()); - if (!action) { - return true; - } - if (action == autoResizeAct) { - setAutoResize(!action->isChecked()); - } else if (action->isChecked()) { - hideColumn(action->data().toInt()); - } else { - showColumn(action->data().toInt()); - } - saveHeaderOnOff(); - return true; - } else { - return false; - } - } else { - return false;//subjectList->header() ->eventFilter(watched, e);//TODO - } -} - void BoardView::saveHeaderOnOff() { QString configPath Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 07:54:35 UTC (rev 2425) @@ -57,7 +57,6 @@ void loadLayout(); void updateListViewItem(QTableWidgetItem* item, const KUrl& datURL, const QDateTime& current, int id, int order); - bool eventFilter(QObject* watched, QEvent* e); void saveHeaderOnOff(); void loadHeaderOnOff(); bool autoResize(); Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 07:54:35 UTC (rev 2425) @@ -14,6 +14,7 @@ #include +#include "threadlistheaderview.h" #include "threadlistviewitem.h" #include "viewmediator.h" #include "libkita/kita_misc.h" @@ -47,8 +48,11 @@ ReloadButton->setIcon(SmallIcon("view-refresh")); closeButton->setIcon(SmallIcon("tab-close")); + ThreadListHeaderView* header = new ThreadListHeaderView; + subjectList->setColumnCount(ColumnEnd - ColumnBegin + 1); subjectList->setContextMenuPolicy(Qt::CustomContextMenu); + subjectList->setHorizontalHeader(header); subjectList->setShowGrid(false); subjectList->setSortingEnabled(true); subjectList->verticalHeader()->setVisible(false); From svnnotify ¡÷ sourceforge.jp Sat Jul 18 17:55:03 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 18 Jul 2009 17:55:03 +0900 Subject: [Kita-svn] [2426] - add ThreadListHeaderView Message-ID: <1247907303.480107.1220.nullmailer@users.sourceforge.jp> Revision: 2426 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2426 Author: nogu Date: 2009-07-18 17:55:03 +0900 (Sat, 18 Jul 2009) Log Message: ----------- - add ThreadListHeaderView - add TrheadListView::contextMenuEvent() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.h kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp kita/branches/KITA-KDE4/kita/src/favoritelistview.h kita/branches/KITA-KDE4/kita/src/threadlistview.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.h Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp kita/branches/KITA-KDE4/kita/src/threadlistheaderview.h Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 07:54:35 UTC (rev 2425) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 08:55:03 UTC (rev 2426) @@ -13,28 +13,20 @@ #include #include #include -#include #include -#include #include -#include #include -#include #include #include "boardtabwidget.h" #include "threadlistviewitem.h" -#include "ui_threadproperty.h" #include "viewmediator.h" #include "libkita/boardmanager.h" #include "libkita/config_xt.h" #include "libkita/datmanager.h" -#include "libkita/favoritethreads.h" #include "libkita/kita_misc.h" #include "libkita/thread.h" -#include "libkita/threadindex.h" -#include "libkita/threadinfo.h" using namespace Kita; @@ -44,8 +36,6 @@ m_parent = parent; closeButton->setEnabled(true); - connect(subjectList, SIGNAL(customContextMenuRequested(const QPoint&)), - SLOT(slotContextMenuRequested(const QPoint&))); connect(subjectList, SIGNAL(returnPressed(QTableWidgetItem*)), SLOT(loadThread(QTableWidgetItem*))); connect(ReloadButton, SIGNAL(clicked()), @@ -329,106 +319,6 @@ } } -void BoardView::slotContextMenuRequested(const QPoint& point) -{ - QTableWidgetItem* item = subjectList->itemAt(point); - if (item == 0) { - return; - } - - QString datURL = subjectList->item(item->row(), ColumnDatUrl)->text(); - QString threadURL = DatManager::threadURL(datURL); - bool isFavorites = FavoriteThreads::getInstance()->contains(datURL); - - // create popup menu. - KMenu popup(0); - - KAction* openWithBrowserAct = new KAction(i18n("Open with Web Browser") , this); - popup.addAction(openWithBrowserAct); - - KAction* copyURLAct = new KAction(i18n("Copy URL"), this); - popup.addAction(copyURLAct); - - KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); - popup.addAction(copyTitleAndURLAct); - - KAction* favoritesAct; - if (isFavorites) { - favoritesAct = new KAction(i18n("Remove from Favorites"), this); - } else { - favoritesAct = new KAction(i18n("Add to Favorites"), this); - } - popup.addAction(favoritesAct); - - KAction* deleteLogAct = 0; - if (DatManager::getReadNum(datURL)) { - popup.addSeparator(); - - deleteLogAct = new KAction(i18n("Delete Log"), this); - popup.addAction(deleteLogAct); - } - popup.addSeparator(); - - KAction* propertyAct = new KAction(i18n("Property"), this); - popup.addAction(propertyAct); - - // exec popup menu. - QClipboard* clipboard = QApplication::clipboard(); - QString cliptxt; - - QAction* action = popup.exec(QCursor::pos()); - if (!action) { - return; - } - if (action == openWithBrowserAct) { - KRun::runUrl(threadURL, "text/html", this); - } else if (action == copyURLAct) { - clipboard->setText(threadURL, QClipboard::Clipboard); - clipboard->setText(threadURL, QClipboard::Selection); - } else if (action == copyTitleAndURLAct) { - cliptxt = DatManager::threadName(datURL) + '\n' + threadURL; - clipboard->setText(cliptxt , QClipboard::Clipboard); - clipboard->setText(cliptxt , QClipboard::Selection); - } else if (action == favoritesAct) { - ViewMediator::getInstance()->bookmark(datURL, !isFavorites); - } else if (action == deleteLogAct) { - deleteLog(threadURL); - } else if (action == propertyAct) { - QWidget* widget = new QWidget; - Ui::ThreadProperty* propertyWidget - = new Ui::ThreadProperty; - propertyWidget->setupUi(widget); - propertyWidget->threadURLLabel->setText(threadURL); - propertyWidget->datURLLabel->setText(datURL); - - propertyWidget->threadNameLabel-> - setText(DatManager::threadName(datURL)); - propertyWidget->cachePathLabel-> - setText(DatManager::getCachePath(datURL)); - propertyWidget->indexPathLabel-> - setText(DatManager::getCacheIndexPath(datURL)); - propertyWidget->resNumLabel-> - setText(QString::number(DatManager::getResNum(datURL))); - propertyWidget->readNumLabel-> - setText(QString::number(DatManager::getReadNum(datURL))); - propertyWidget->viewPosLabel-> - setText(QString::number(DatManager::getViewPos(datURL))); - - propertyWidget->idx_threadNameWithIndexLabel-> - setText(ThreadIndex::getSubject(datURL)); - propertyWidget->idx_resNumLabel-> - setText(QString::number(ThreadIndex::getResNum(datURL))); - propertyWidget->idx_readNumLabel-> - setText(QString::number(ThreadIndex::getReadNum(datURL))); - propertyWidget->idx_viewPosLabel-> - setText(QString::number(ThreadIndex::getViewPos(datURL))); - - propertyWidget->cache_readNumLabel-> - setText(QString::number(ThreadInfo::readNum(datURL))); - widget->show(); - } -} - void BoardView::deleteLog(const KUrl& url) { if (KMessageBox::warningYesNo(this, i18n("Do you want to delete Log ?"), Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 07:54:35 UTC (rev 2425) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 08:55:03 UTC (rev 2426) @@ -66,7 +66,6 @@ private slots: void loadThread(QTableWidgetItem* item); - void slotContextMenuRequested(const QPoint&); void slotCloseButton(); void slotSizeChange(int section, int oldSize, int newSize); Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-18 07:54:35 UTC (rev 2425) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-18 08:55:03 UTC (rev 2426) @@ -38,8 +38,6 @@ connect(subjectList, SIGNAL(cellPressed(int, int)), SLOT(loadThread(int, int))); - connect(subjectList, SIGNAL(customContextMenuRequested(const QPoint&)), - SLOT(slotContextMenuRequested(const QPoint&))); connect(ReloadButton, SIGNAL(clicked()), SLOT(reload())); @@ -119,53 +117,6 @@ } /** - * show and exec popup menu. - */ -void FavoriteListView::slotContextMenuRequested(const QPoint& point) -{ - QTableWidgetItem* item = subjectList->itemAt(point); - if (!item) { - return; - } - - KMenu popup(0); - - KAction* openWithBrowserAct = new KAction(i18n("Open with Web Browser"), this); - popup.addAction(openWithBrowserAct); - - KAction* copyURLAct = new KAction(i18n("Copy URL"), this); - popup.addAction(copyURLAct); - - KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); - popup.addAction(copyTitleAndURLAct); - - KAction* removeFromFavoritesAct = new KAction(i18n("Remove from Favorites"), this); - popup.addAction(removeFromFavoritesAct); - - QString datURL = subjectList->item(item->row(), ColumnDatUrl)->text(); - QString threadURL = DatManager::threadURL(datURL); - - QClipboard* clipboard = QApplication::clipboard(); - QString clipText; - - QAction* action = popup.exec(point); - if (!action) { - return; - } - if (action == openWithBrowserAct) { - KRun::runUrl(DatManager::threadURL(datURL), "text/html", this); - } else if (action == copyURLAct) { - clipboard->setText(threadURL); - } else if (action == copyTitleAndURLAct) { - clipText = DatManager::threadName(datURL) + '\n' + threadURL; - clipboard->setText(clipText , QClipboard::Clipboard); - clipboard->setText(clipText , QClipboard::Selection); - } else if (action == removeFromFavoritesAct) { - ViewMediator::getInstance()->bookmark(datURL, false); - } -} - -/** * */ void FavoriteListView::reload() Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.h 2009-07-18 07:54:35 UTC (rev 2425) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.h 2009-07-18 08:55:03 UTC (rev 2426) @@ -28,7 +28,6 @@ private slots: void loadThread(int row, int column); - void slotContextMenuRequested(const QPoint&); void reload(); }; } Added: kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp 2009-07-18 08:55:03 UTC (rev 2426) @@ -0,0 +1,55 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ wakaba.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "threadlistheaderview.h" + +#include "kaction.h" +#include "klocale.h" +#include "kmenu.h" + +#include "threadlistviewitem.h" + +using namespace Kita; + +ThreadListHeaderView::ThreadListHeaderView(QWidget* parent) + : QHeaderView(Qt::Horizontal, parent) +{ +} + +void ThreadListHeaderView::contextMenuEvent(QContextMenuEvent * /*event*/) +{ + KMenu popup; + for (int i = ColumnBegin; i <= ColumnEnd; i++) { + if (i != ColumnSubject && i != ColumnMarkOrder && i != ColumnIdOrder) { + KAction* action = new KAction(""/*s_colAttr[i].itemName*/, this); + action->setCheckable(true); + action->setChecked(!isSectionHidden(i)); + action->setData(QVariant(i)); + popup.addAction(action); + } + } + KAction* autoResizeAct = new KAction(i18n("Auto Resize"), this); + autoResizeAct->setCheckable(true); +// autoResizeAct->setChecked(autoResize()); TODO + popup.addAction(autoResizeAct); + + QAction* action = popup.exec(QCursor::pos()); + if (!action) { + return; + } + if (action == autoResizeAct) { + //setAutoResize(!action->isChecked());TODO + } else if (action->isChecked()) { + hideSection(action->data().toInt()); + } else { + showSection(action->data().toInt()); + } + //saveHeaderOnOff(); TODO +} Added: kita/branches/KITA-KDE4/kita/src/threadlistheaderview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistheaderview.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/threadlistheaderview.h 2009-07-18 08:55:03 UTC (rev 2426) @@ -0,0 +1,30 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ wakaba.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ +#ifndef KITATHREADLISTHEADERVIEW_H +#define KITATHREADLISTHEADERVIEW_H + +#include + +namespace Kita +{ + class ThreadListHeaderView : public QHeaderView + { + Q_OBJECT + + public: + explicit ThreadListHeaderView(QWidget* parent = 0); + + private: + void contextMenuEvent(QContextMenuEvent *event); + + }; +} + +#endif Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 07:54:35 UTC (rev 2425) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 08:55:03 UTC (rev 2426) @@ -10,14 +10,24 @@ #include "threadlistview.h" +#include +#include #include +#include +#include +#include #include #include "threadlistheaderview.h" #include "threadlistviewitem.h" +#include "ui_threadproperty.h" #include "viewmediator.h" +#include "libkita/datmanager.h" +#include "libkita/favoritethreads.h" #include "libkita/kita_misc.h" +#include "libkita/threadindex.h" +#include "libkita/threadinfo.h" using namespace Kita; @@ -51,7 +61,6 @@ ThreadListHeaderView* header = new ThreadListHeaderView; subjectList->setColumnCount(ColumnEnd - ColumnBegin + 1); - subjectList->setContextMenuPolicy(Qt::CustomContextMenu); subjectList->setHorizontalHeader(header); subjectList->setShowGrid(false); subjectList->setSortingEnabled(true); @@ -178,4 +187,104 @@ subjectList->showColumn(col); } +void ThreadListView::contextMenuEvent(QContextMenuEvent *event) +{ + QTableWidgetItem* item = subjectList->itemAt(event->pos()); + if (item == 0) { + return; + } + + QString datURL = subjectList->item(item->row(), ColumnDatUrl)->text(); + QString threadURL = DatManager::threadURL(datURL); + bool isFavorites = FavoriteThreads::getInstance()->contains(datURL); + + // create popup menu. + KMenu popup(0); + + KAction* openWithBrowserAct = new KAction(i18n("Open with Web Browser") , this); + popup.addAction(openWithBrowserAct); + + KAction* copyURLAct = new KAction(i18n("Copy URL"), this); + popup.addAction(copyURLAct); + + KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); + popup.addAction(copyTitleAndURLAct); + + KAction* favoritesAct; + if (isFavorites) { + favoritesAct = new KAction(i18n("Remove from Favorites"), this); + } else { + favoritesAct = new KAction(i18n("Add to Favorites"), this); + } + popup.addAction(favoritesAct); + + KAction* deleteLogAct = 0; + if (DatManager::getReadNum(datURL)) { + popup.addSeparator(); + + deleteLogAct = new KAction(i18n("Delete Log"), this); + popup.addAction(deleteLogAct); + } + popup.addSeparator(); + + KAction* propertyAct = new KAction(i18n("Property"), this); + popup.addAction(propertyAct); + + // exec popup menu. + QClipboard* clipboard = QApplication::clipboard(); + QString cliptxt; + + QAction* action = popup.exec(QCursor::pos()); + if (!action) { + return; + } + if (action == openWithBrowserAct) { + KRun::runUrl(threadURL, "text/html", this); + } else if (action == copyURLAct) { + clipboard->setText(threadURL, QClipboard::Clipboard); + clipboard->setText(threadURL, QClipboard::Selection); + } else if (action == copyTitleAndURLAct) { + cliptxt = DatManager::threadName(datURL) + '\n' + threadURL; + clipboard->setText(cliptxt , QClipboard::Clipboard); + clipboard->setText(cliptxt , QClipboard::Selection); + } else if (action == favoritesAct) { + ViewMediator::getInstance()->bookmark(datURL, !isFavorites); + } else if (action == deleteLogAct) { + //deleteLog(threadURL); TODO + } else if (action == propertyAct) { + QWidget* widget = new QWidget; + Ui::ThreadProperty* propertyWidget + = new Ui::ThreadProperty; + propertyWidget->setupUi(widget); + propertyWidget->threadURLLabel->setText(threadURL); + propertyWidget->datURLLabel->setText(datURL); + + propertyWidget->threadNameLabel + ->setText(DatManager::threadName(datURL)); + propertyWidget->cachePathLabel + ->setText(DatManager::getCachePath(datURL)); + propertyWidget->indexPathLabel + ->setText(DatManager::getCacheIndexPath(datURL)); + propertyWidget->resNumLabel + ->setText(QString::number(DatManager::getResNum(datURL))); + propertyWidget->readNumLabel + ->setText(QString::number(DatManager::getReadNum(datURL))); + propertyWidget->viewPosLabel + ->setText(QString::number(DatManager::getViewPos(datURL))); + + propertyWidget->idx_threadNameWithIndexLabel + ->setText(ThreadIndex::getSubject(datURL)); + propertyWidget->idx_resNumLabel + ->setText(QString::number(ThreadIndex::getResNum(datURL))); + propertyWidget->idx_readNumLabel + ->setText(QString::number(ThreadIndex::getReadNum(datURL))); + propertyWidget->idx_viewPosLabel + ->setText(QString::number(ThreadIndex::getViewPos(datURL))); + + propertyWidget->cache_readNumLabel + ->setText(QString::number(ThreadInfo::readNum(datURL))); + widget->show(); + } +} + #include "threadlistview.moc" Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-18 07:54:35 UTC (rev 2425) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-18 08:55:03 UTC (rev 2426) @@ -49,6 +49,7 @@ void clearSearch(); void hideColumn(int col); void showColumn(int col); + void contextMenuEvent(QContextMenuEvent* event); protected slots: void slotHideButton(bool on); From svnnotify ¡÷ sourceforge.jp Sat Jul 18 18:20:47 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 18 Jul 2009 18:20:47 +0900 Subject: [Kita-svn] [2427] - use clearContents() Message-ID: <1247908847.117633.3590.nullmailer@users.sourceforge.jp> Revision: 2427 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2427 Author: nogu Date: 2009-07-18 18:20:47 +0900 (Sat, 18 Jul 2009) Log Message: ----------- - use clearContents() - make a header clickable Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 08:55:03 UTC (rev 2426) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 09:20:47 UTC (rev 2427) @@ -109,7 +109,7 @@ void BoardView::loadBoard(const KUrl& url, bool online) { activateWindow(); - topLevelWidget() ->raise(); + topLevelWidget()->raise(); m_enableSizeChange = false; // reset member variables. @@ -132,11 +132,7 @@ m_boardURL, m_showOldLogs, online, threadList, oldLogList); // reset list - for (int i = 0, j = subjectList->rowCount(); i < j; i++) { - for (int k = 0, l = subjectList->columnCount(); k < l; k++) { - delete subjectList->takeItem(i, k); - } - } + subjectList->clearContents(); QDateTime current = QDateTime::currentDateTime(); int countNew = threadList.count(); Modified: kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp 2009-07-18 08:55:03 UTC (rev 2426) +++ kita/branches/KITA-KDE4/kita/src/threadlistheaderview.cpp 2009-07-18 09:20:47 UTC (rev 2427) @@ -21,6 +21,7 @@ ThreadListHeaderView::ThreadListHeaderView(QWidget* parent) : QHeaderView(Qt::Horizontal, parent) { + setClickable(true); } void ThreadListHeaderView::contextMenuEvent(QContextMenuEvent * /*event*/) From svnnotify ¡÷ sourceforge.jp Sat Jul 18 18:52:03 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 18 Jul 2009 18:52:03 +0900 Subject: [Kita-svn] [2428] QTableWidgetItem* item -> int row Message-ID: <1247910723.382272.19234.nullmailer@users.sourceforge.jp> Revision: 2428 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2428 Author: nogu Date: 2009-07-18 18:52:03 +0900 (Sat, 18 Jul 2009) Log Message: ----------- QTableWidgetItem* item -> int row Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.h Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 09:20:47 UTC (rev 2427) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 09:52:03 UTC (rev 2428) @@ -64,7 +64,7 @@ void BoardView::reloadSubject() { - if (! m_boardURL.isEmpty()) { + if (!m_boardURL.isEmpty()) { loadBoard(m_boardURL); } } @@ -90,7 +90,7 @@ void BoardView::loadThread(QTableWidgetItem* item) { - if (! item) return ; + if (!item) return ; KUrl datURL = item->text(); @@ -149,7 +149,7 @@ } int id = (i < countNew ? i + 1 : 0); int order = i + 1; - updateListViewItem(subjectList->item(i, 0), datURL, current, id, order); + updateListViewItem(i, datURL, current, id, order); } if (HideButton->isChecked()) { @@ -196,11 +196,7 @@ /* public slot */ void BoardView::slotFocusSearchCombo() { - if (! SearchCombo->hasFocus()) { - SearchCombo->setFocus(); - } else { - setFocus(); - } + SearchCombo->hasFocus() ? setFocus() : SearchCombo->setFocus(); } void BoardView::updateKindLabel() @@ -227,34 +223,37 @@ if (subjectList->item(i, ColumnDatUrl)->text() == datURL.prettyUrl()) { switch (subjectList->item(i, ColumnMarkOrder)->text().toInt()) { - case Thread_Readed : - case Thread_Read : m_readNum--; break; - case Thread_New : m_newNum--; break; - case Thread_HasUnread : m_unreadNum--; break; + case Thread_Readed: + case Thread_Read: + m_readNum--; + break; + case Thread_New: + m_newNum--; + break; + case Thread_HasUnread: + m_unreadNum--; + break; } Thread* thread = Thread::getByURLNew(datURL); - if (thread == 0) return ; + if (thread == 0) + return; int id = subjectList->item(i, ColumnId)->text().toInt(); int order = subjectList->item(i, ColumnIdOrder)->text().toInt(); - updateListViewItem(subjectList->item(i, 0), - datURL, current, id, order); + updateListViewItem(i, datURL, current, id, order); updateKindLabel(); - return ; + return; } } } - - /* if id == 0, this thread is old thread. */ /* private */ -void BoardView::updateListViewItem(QTableWidgetItem* item, - const KUrl& datURL, const QDateTime& current, int id, int order) +void BoardView::updateListViewItem(int row, const KUrl& datURL, + const QDateTime& current, int id, int order) { - int row = item->row(); QDateTime since; since.setTime_t(datToSince(datURL)); QString threadName = DatManager::threadName(datURL); @@ -328,7 +327,7 @@ void BoardView::slotSizeChange(int section, int oldSize, int newSize) { - if (! m_enableSizeChange) return ; + if (!m_enableSizeChange) return ; if (autoResize()) return ; QString configPath @@ -354,11 +353,8 @@ KConfigGroup group = config.group("Column"); for (int i = ColumnBegin; i <= ColumnEnd; i++) { - if (subjectList->columnWidth(i) != 0) { - group.writeEntry(s_colAttr[ i ].keyName, true); - } else { - group.writeEntry(s_colAttr[ i ].keyName, false); - } + group.writeEntry(s_colAttr[i].keyName, + subjectList->columnWidth(i) != 0); } } @@ -371,12 +367,8 @@ KConfigGroup group = config.group("Column"); for (int i = ColumnBegin; i <= ColumnEnd; i++) { bool isShown = group.readEntry( - s_colAttr[ i ].keyName, s_colAttr[ i ].showDefault); - if (isShown) { - showColumn(i); - } else { - hideColumn(i); - } + s_colAttr[i].keyName, s_colAttr[i].showDefault); + isShown ? showColumn(i) : hideColumn(i); } } Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 09:20:47 UTC (rev 2427) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 09:52:03 UTC (rev 2428) @@ -55,7 +55,7 @@ void updateKindLabel(); void deleteLog(const KUrl& url); void loadLayout(); - void updateListViewItem(QTableWidgetItem* item, const KUrl& datURL, + void updateListViewItem(int row, const KUrl& datURL, const QDateTime& current, int id, int order); void saveHeaderOnOff(); void loadHeaderOnOff(); From svnnotify ¡÷ sourceforge.jp Sat Jul 18 19:14:54 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 18 Jul 2009 19:14:54 +0900 Subject: [Kita-svn] [2429] disable sorting when calling setItem() Message-ID: <1247912094.747356.26259.nullmailer@users.sourceforge.jp> Revision: 2429 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2429 Author: nogu Date: 2009-07-18 19:14:54 +0900 (Sat, 18 Jul 2009) Log Message: ----------- disable sorting when calling setItem() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardview.cpp Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 09:52:03 UTC (rev 2428) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 10:14:54 UTC (rev 2429) @@ -139,6 +139,7 @@ int countOld = oldLogList.count(); int count = countNew + countOld; subjectList->setRowCount(count); + subjectList->setSortingEnabled(false); for (int i = 0; i < count; i++) { Thread* thread = i < countNew ? threadList.at(i) : oldLogList.at(i - countNew); @@ -151,6 +152,7 @@ int order = i + 1; updateListViewItem(i, datURL, current, id, order); } + subjectList->setSortingEnabled(true); if (HideButton->isChecked()) { HideButton->toggle(); @@ -262,7 +264,8 @@ int viewPos = DatManager::getViewPos(datURL); double speed = resNum / (since.secsTo(current) / (60.0 * 60.0 * 24.0)); - if (id) subjectList->item(row, ColumnId)->setText(QString::number(id)); + if (id) + subjectList->item(row, ColumnId)->setText(QString::number(id)); subjectList->item(row, ColumnIdOrder)->setText(QString::number(order)); subjectList->item(row, ColumnSubject)->setText(threadName); subjectList->item(row, ColumnResNum)->setText(QString("%1").arg(resNum, 4)); From svnnotify ¡÷ sourceforge.jp Sat Jul 18 20:02:05 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sat, 18 Jul 2009 20:02:05 +0900 Subject: [Kita-svn] [2430] fix bugs in contextMenuEvent() Message-ID: <1247914925.330837.28597.nullmailer@users.sourceforge.jp> Revision: 2430 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2430 Author: nogu Date: 2009-07-18 20:02:05 +0900 (Sat, 18 Jul 2009) Log Message: ----------- fix bugs in contextMenuEvent() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 10:14:54 UTC (rev 2429) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 11:02:05 UTC (rev 2430) @@ -82,7 +82,6 @@ m_boardList->setHeaderLabel(i18n("board name")); m_boardList->header()->setClickable(false); - m_boardList->setContextMenuPolicy(Qt::CustomContextMenu); /* default colors */ QPalette palette = m_boardList->viewport() ->palette(); @@ -92,9 +91,6 @@ connect(m_boardList, SIGNAL(itemActivated(QTreeWidgetItem*, int)), SLOT(loadBoard(QTreeWidgetItem*))); - connect(m_boardList, - SIGNAL(customContextMenuRequested(const QPoint&)), - SLOT(slotContextMenuRequested(const QPoint&))); connect(FavoriteBoards::getInstance(), SIGNAL(changed()), SLOT(refreshFavoriteBoards())); connect(SearchCombo, SIGNAL(textChanged(const QString&)), @@ -497,9 +493,11 @@ KRun::runUrl(boardURL, "text/html", 0); } -void BBSView::slotContextMenuRequested(const QPoint& point) +void BBSView::contextMenuEvent(QContextMenuEvent* e) { - QTreeWidgetItem* item = m_boardList->itemAt(point); + QPoint point = e->globalPos(); + QTreeWidgetItem* item + = m_boardList->itemAt(m_boardList->viewport()->mapFromGlobal(point)); if (item == 0) { return; } Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-18 10:14:54 UTC (rev 2429) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-18 11:02:05 UTC (rev 2430) @@ -47,6 +47,7 @@ void saveOpened(); KComboBox* SearchCombo; QTreeWidget* m_boardList; + void contextMenuEvent(QContextMenuEvent* e); protected: QVBoxLayout* BBSViewBaseLayout; @@ -55,7 +56,6 @@ private slots: void loadBoard(QTreeWidgetItem* item); - void slotContextMenuRequested(const QPoint&); void refreshFavoriteBoards(); void filter(const QString& str); void slotMenuOpenWithBrowser(); Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 10:14:54 UTC (rev 2429) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 11:02:05 UTC (rev 2430) @@ -189,7 +189,9 @@ void ThreadListView::contextMenuEvent(QContextMenuEvent *event) { - QTableWidgetItem* item = subjectList->itemAt(event->pos()); + QTableWidgetItem* item + = subjectList->itemAt(subjectList->viewport() + ->mapFromGlobal(event->globalPos())); if (item == 0) { return; } From svnnotify ¡÷ sourceforge.jp Sun Jul 19 00:09:16 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 00:09:16 +0900 Subject: [Kita-svn] [2431] - farewell to Qt3Support Message-ID: <1247929756.639787.15069.nullmailer@users.sourceforge.jp> Revision: 2431 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2431 Author: nogu Date: 2009-07-19 00:09:16 +0900 (Sun, 19 Jul 2009) Log Message: ----------- - farewell to Qt3Support - re-add rc files Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/boardtabwidgetui.rc kita/branches/KITA-KDE4/kita/src/kitaui.rc kita/branches/KITA-KDE4/kita/src/threadtabwidgetui.rc kita/branches/KITA-KDE4/kita/src/writetabwidgetui.rc Added: kita/branches/KITA-KDE4/kita/src/boardtabwidgetui.rc =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidgetui.rc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidgetui.rc 2009-07-18 15:09:16 UTC (rev 2431) @@ -0,0 +1,15 @@ + + + + &Board + + + + + + + + + + + Added: kita/branches/KITA-KDE4/kita/src/kitaui.rc =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui.rc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/kitaui.rc 2009-07-18 15:09:16 UTC (rev 2431) @@ -0,0 +1,18 @@ + + + + &File + + + + &Board + + + &Thread + + + + + + + Modified: kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-18 15:09:16 UTC (rev 2431) @@ -16,7 +16,7 @@ kde4_add_library(kitapref SHARED ${kitapref_LIB_SRCS}) -target_link_libraries(kitapref ${KDE4_KDECORE_LIBS} ${QT_QT3SUPPORT_LIBRARY} ${KDE4_KDE3SUPPORT_LIBS} kitautil) +target_link_libraries(kitapref ${KDE4_KDECORE_LIBS} kitautil ${KDE4_KDEUI_LIBS}) set_target_properties(kitapref PROPERTIES VERSION 1.0.0 SOVERSION 1) install(TARGETS kitapref ${INSTALL_TARGETS_DEFAULT_ARGS}) Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui 2009-07-18 15:09:16 UTC (rev 2431) @@ -70,5 +70,4 @@
- qPixmapFromMimeSource Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui 2009-07-18 15:09:16 UTC (rev 2431) @@ -19,7 +19,6 @@ - qPixmapFromMimeSource KTextEdit Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-18 15:09:16 UTC (rev 2431) @@ -1,299 +1,322 @@ - - - - - Kita::FacePrefBase - - - - 0 - 0 - 600 - 508 - - - - Form1 - - - - - - - Basic - - - - - - - 40 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - - 20 - 40 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - Board/Subject List - - - - - - set font - - - - - - - false - - - - - - - - - - false - - - text color - - - false - - - - - - - false - - - background color - - - false - - - - - - - false - - - - - - - - - - font - - - false - - - - - - - - - - Thread - - - - - - - - - - - - - text color - - - false - - - - - - - - - - - - - - background color - - - false - - - - - - - set font - - - - - - - font - - - false - - - - - - - - - - Popup - - - - - - set font - - - - - - - text color - - - false - - - - - - - background color - - - false - - - - - - - font - - - false - - - - - - - - - - - - - - - - - - - - - - - - - Advanced - - - - - - use stylesheet ( the setup of color/font is overwritten ). - - - - - - - false - - - - - - - - + + + Kita::FacePrefBase + + + + 0 + 0 + 600 + 508 + + + + Form1 + + + + + + 0 + + + + Basic + + + + + + Board/Subject List + + + + + + font + + + false + + + + + + + set font + + + + + + + false + + + text color + + + false + + + + + + + false + + + + + + + + + + false + + + background color + + + false + + + + + + + false + + + + + + + - - - - - qPixmapFromMimeSource - - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - ktextedit.h - - - - useStyleSheetCheckBox - toggled(bool) - styleSheetText - setEnabled(bool) - - + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + Thread + + + + + + font + + + false + + + + + + + set font + + + + + + + text color + + + false + + + + + + + + + + + + + + background color + + + false + + + + + + + + + + + + + + + + + Popup + + + + + + font + + + false + + + + + + + set font + + + + + + + text color + + + false + + + + + + + + + + + + + + background color + + + false + + + + + + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + Advanced + + + + + + use stylesheet ( the setup of color/font is overwritten ). + + + + + + + false + + + + + + + + + + + + + + + + KColorButton + QPushButton +
kcolorbutton.h
+
+ + KTextEdit + QTextEdit +
ktextedit.h
+
+
+ + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + ktextedit.h + + + + + useStyleSheetCheckBox + toggled(bool) + styleSheetText + setEnabled(bool) + + + 20 + 20 + + + 20 + 20 + + + +
Modified: kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui 2009-07-18 15:09:16 UTC (rev 2431) @@ -153,7 +153,6 @@ - qPixmapFromMimeSource klineedit.h klineedit.h Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-18 15:09:16 UTC (rev 2431) @@ -174,7 +174,7 @@ kcfg_MarkTime->setValue(24); kcfg_ShowMailAddress->setChecked(false); kcfg_ShowNum->setValue(100); - kcfg_ListSortOrder->setButton(Config::EnumListSortOrder::Mark); + //kcfg_ListSortOrder->setButton(Config::EnumListSortOrder::Mark);TODO kcfg_PartMimeList->setText("image/gif,image/jpeg,image/png,image/x-bmp"); kcfg_UsePart->setChecked(true); } Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui 2009-07-18 15:09:16 UTC (rev 2431) @@ -1,276 +1,268 @@ - - - - - Kita::UIPrefBase - - - - 0 - 0 - 646 - 534 - - - - Form1 - - + + + Kita::UIPrefBase + + + + 0 + 0 + 646 + 534 + + + + Form1 + + + + + + Use new tab when opening the thread(board). + + + + + + + + + Mark new thread to made: + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + + + + after last access + + + hour + + + within + + + 0 + + + 24 + + + 24 + + + + + + + + + Thread + + - - - Use new tab when opening the thread(board). + + + + + true - + + Display all res + + + res + + + Display + + + 1000 + + + 50 + + + 100 + + + + + + + around the last read response. + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + - - - - - Mark new thread to made: - - - false - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - within - - - hour - - - after last access - - - 24 - - - 0 - - - 24 - - - - - - - + + + this option affects from the next thread. + + + false + + - - - Thread - - - - - - this option affects from the next thread. - - - false - - - - - - - Show mail address in the thread. - - - - - - - - - Display - - - res - - - Display all res - - - true - - - 1000 - - - 50 - - - 100 - - - - - - - around the last read response. - - - false - - - - - - - - 40 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - + + + Show mail address in the thread. + + + + + + + + + When open the board + + - - - When open the board - - - - - - Show unread thread first - - - true - - - 0 - - - - - - - Show thread in numerical order - - - 1 - - - - - + + + Show unread thread first + + + true + + + 0 + + - - - Parts - - - - - - - - - Use other Part to open external link - - - true - - - - - - - If mime type include this list ( comma separated list ) - - - PartMimeList - - - - - - false - - - - - + + + Show thread in numerical order + + + 1 + + + + + + + + + Parts + + - - - Edit file association... - - + + + Use other Part to open external link + + + true + + - - - - 30 - 70 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - + + + + + + If mime type include this list ( comma separated list ) + + + false + + + PartMimeList + + - - - - qPixmapFromMimeSource - - kurllabel.h - - - - kcfg_UsePart - toggled(bool) - kcfg_PartMimeList - setEnabled(bool) - - - kcfg_UsePart - toggled(bool) - mimeListLabel - setEnabled(bool) - - + + + + + + + + + + Edit file association... + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 30 + 70 + + + + + + + + + + KUrlLabel + QLabel +
kurllabel.h
+
+
+ + kurllabel.h + + +
Modified: kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui 2009-07-18 11:02:05 UTC (rev 2430) +++ kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui 2009-07-18 15:09:16 UTC (rev 2431) @@ -115,7 +115,6 @@ - qPixmapFromMimeSource klineedit.h klineedit.h Added: kita/branches/KITA-KDE4/kita/src/threadtabwidgetui.rc =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidgetui.rc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidgetui.rc 2009-07-18 15:09:16 UTC (rev 2431) @@ -0,0 +1,22 @@ + + + + &Thread + + + + + + + + + + + + + + + + + + Added: kita/branches/KITA-KDE4/kita/src/writetabwidgetui.rc =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidgetui.rc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/writetabwidgetui.rc 2009-07-18 15:09:16 UTC (rev 2431) @@ -0,0 +1,3 @@ + + + From svnnotify ¡÷ sourceforge.jp Sun Jul 19 06:07:43 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 06:07:43 +0900 Subject: [Kita-svn] [2432] - HideButton -> hideButton Message-ID: <1247951263.389233.28169.nullmailer@users.sourceforge.jp> Revision: 2432 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2432 Author: nogu Date: 2009-07-19 06:07:43 +0900 (Sun, 19 Jul 2009) Log Message: ----------- - HideButton -> hideButton - ReloadButton -> reloadButton - SearchCombo -> searchCombo - fix a bug on searching threads - fix a bug on favorite threads - use KMessageBox instead of QMessageBox - remove BoardView::loadThread() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.h kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.cpp kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 15:09:16 UTC (rev 2431) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 21:07:43 UTC (rev 2432) @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -191,26 +190,21 @@ if ((!newBoards.isEmpty() && newBoards.count("\n") < maxNewBoard) || !oldBoards.isEmpty()) { - QMessageBox mb("kita", i18n("Do you really want to update board list?"), - QMessageBox::Information, - QMessageBox::Ok, - QMessageBox::Cancel | QMessageBox::Default | QMessageBox::Escape, - QMessageBox::No, this); - - mb.setButtonText(QMessageBox::No, i18n("Copy")); - - int ret; - while ((ret = mb.exec()) == QMessageBox::No) { + int ret = KMessageBox::warningYesNoCancel(this, + i18n("Do you really want to update board list?"), "kita", + KStandardGuiItem::yes(), KGuiItem(i18n("Copy")), + KStandardGuiItem::cancel(), + QString(), KMessageBox::Dangerous); + if (ret == KMessageBox::No) { QString str = i18n("New boards:\n\n") + newBoards + '\n' + i18n("These boards were moved:\n\n") + oldBoards; QApplication::clipboard() ->setText(str , QClipboard::Clipboard); QApplication::clipboard() ->setText(str , QClipboard::Selection); - } - - if (ret == QMessageBox::Cancel) return false; + } else if (ret == KMessageBox::Cancel) + return false; } else if (newBoards.isEmpty() && oldBoards.isEmpty()) { - QMessageBox::information(this, "Kita", i18n("no new boards")); + KMessageBox::information(this, i18n("no new boards"), "Kita"); return false; } Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 15:09:16 UTC (rev 2431) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 21:07:43 UTC (rev 2432) @@ -36,9 +36,7 @@ m_parent = parent; closeButton->setEnabled(true); - connect(subjectList, SIGNAL(returnPressed(QTableWidgetItem*)), - SLOT(loadThread(QTableWidgetItem*))); - connect(ReloadButton, SIGNAL(clicked()), + connect(reloadButton, SIGNAL(clicked()), SLOT(reloadSubject())); connect(closeButton, SIGNAL(clicked()), @@ -88,15 +86,6 @@ loadBoard(m_boardURL, false); } -void BoardView::loadThread(QTableWidgetItem* item) -{ - if (!item) return ; - - KUrl datURL = item->text(); - - ViewMediator::getInstance()->openThread(datURL); -} - enum { Thread_Old, Thread_Readed, @@ -154,8 +143,8 @@ } subjectList->setSortingEnabled(true); - if (HideButton->isChecked()) { - HideButton->toggle(); + if (hideButton->isChecked()) { + hideButton->toggle(); } ViewMediator::getInstance()->setMainURLLine(m_boardURL); @@ -198,7 +187,7 @@ /* public slot */ void BoardView::slotFocusSearchCombo() { - SearchCombo->hasFocus() ? setFocus() : SearchCombo->setFocus(); + searchCombo->hasFocus() ? setFocus() : searchCombo->setFocus(); } void BoardView::updateKindLabel() @@ -213,7 +202,7 @@ void BoardView::setFont(const QFont& font) { subjectList->setFont(font); - SearchCombo->setFont(font); + searchCombo->setFont(font); } void BoardView::slotUpdateSubject(const KUrl& url) Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 15:09:16 UTC (rev 2431) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 21:07:43 UTC (rev 2432) @@ -65,7 +65,6 @@ BoardView& operator=(const BoardView&); private slots: - void loadThread(QTableWidgetItem* item); void slotCloseButton(); void slotSizeChange(int section, int oldSize, int newSize); Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-18 15:09:16 UTC (rev 2431) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-18 21:07:43 UTC (rev 2432) @@ -38,7 +38,7 @@ connect(subjectList, SIGNAL(cellPressed(int, int)), SLOT(loadThread(int, int))); - connect(ReloadButton, SIGNAL(clicked()), + connect(reloadButton, SIGNAL(clicked()), SLOT(reload())); showColumn(ColumnBoard); @@ -54,14 +54,20 @@ m_nextHitIndex = 0; m_prevquery = QStringList(); - for (int i = 0, j = subjectList->rowCount(); i < j; i++) { - for (int k = 0, l = subjectList->columnCount(); k < l; k++) { - delete subjectList->takeItem(i, k); + subjectList->clearContents(); + + subjectList->setSortingEnabled(false); + int count = FavoriteThreads::count(); + subjectList->setRowCount(count); + for (int i = 0; i < count; i++) { + for (int j = 0, k = subjectList->columnCount(); j < k; j++) { + ThreadListViewItem* item = new ThreadListViewItem(j); + subjectList->setItem(i, j, item); } } - + subjectList->setSortingEnabled(true); // insert item. - for (int i = 0; FavoriteThreads::count() > i; i++) { + for (int i = 0; i < count; i++) { QString datURL = FavoriteThreads::getDatURL(i); QDateTime since; @@ -70,23 +76,23 @@ int viewPos = DatManager::getViewPos(datURL); int resNum = DatManager::getResNum(datURL); - subjectList->setItem(i, ColumnBoard, - new QTableWidgetItem(BoardManager::boardName(datURL))); - subjectList->setItem(i, ColumnSubject, - new QTableWidgetItem(DatManager::threadName(datURL))); - subjectList->setItem(i, ColumnReadNum, - new QTableWidgetItem(QString("%1").arg(viewPos, 4))); + subjectList->item(i, ColumnBoard) + ->setText(BoardManager::boardName(datURL)); + subjectList->item(i, ColumnSubject) + ->setText(DatManager::threadName(datURL)); + subjectList->item(i, ColumnReadNum) + ->setText(QString("%1").arg(viewPos, 4)); if (resNum > 0) { - subjectList->setItem(i, ColumnResNum, - new QTableWidgetItem(QString("%1").arg(resNum, 4))); + subjectList->item(i, ColumnResNum) + ->setText(QString("%1").arg(resNum, 4)); } if (resNum != 0 && resNum != viewPos) { - subjectList->setItem(i, ColumnUnread, new QTableWidgetItem( - QString("%1").arg(resNum - viewPos, 4))); + subjectList->item(i, ColumnUnread) + ->setText(QString("%1").arg(resNum - viewPos, 4)); } - subjectList->setItem(i, ColumnSince, - new QTableWidgetItem(since.toString("yy/MM/dd hh:mm"))); - subjectList->setItem(i, ColumnDatUrl, new QTableWidgetItem(datURL)); + subjectList->item(i, ColumnSince) + ->setText(since.toString("yy/MM/dd hh:mm")); + subjectList->item(i, ColumnDatUrl)->setText(datURL); } subjectList->sortItems(ColumnBoard); for (int i = 0, j = subjectList->columnCount(); i < j; i++) { Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-18 15:09:16 UTC (rev 2431) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-18 21:07:43 UTC (rev 2432) @@ -163,11 +163,7 @@ { FavoriteThreads * favorite = FavoriteThreads::getInstance(); - if (on) { - favorite->insert(datURL); - } else { - favorite->remove(datURL); - } + on ? favorite->insert(datURL) : favorite->remove(datURL); saveFavorites(); ViewMediator::getInstance()->updateFavoriteListView(); } @@ -317,7 +313,7 @@ connect(load_board_action, SIGNAL(triggered()), m_bbsTab, SLOT(updateBoardList())); KAction* login_action = actionCollection()->addAction("login"); - load_board_action->setText(i18n("Login")); + login_action->setText(i18n("Login")); connect(login_action, SIGNAL(triggered()), m_bbsTab, SLOT(login())); setXMLFile("kitaui.rc"); @@ -395,12 +391,13 @@ void MainWindow::saveFavorites() { - QString favoritesConfigPath = KStandardDirs::locateLocal("appdata", "favorites.xml"); + QString favoritesConfigPath + = KStandardDirs::locateLocal("appdata", "favorites.xml"); QFile file(favoritesConfigPath); if (file.open(QIODevice::WriteOnly)) { QTextStream stream(&file); stream.setCodec("UTF-8"); - stream << FavoriteThreads::getInstance() ->toXML(); + stream << FavoriteThreads::getInstance()->toXML(); } } Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 15:09:16 UTC (rev 2431) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 21:07:43 UTC (rev 2432) @@ -54,8 +54,8 @@ : QWidget(parent) { setupUi(this); - HideButton->setIcon(SmallIcon("view-filter")); - ReloadButton->setIcon(SmallIcon("view-refresh")); + hideButton->setIcon(SmallIcon("view-filter")); + reloadButton->setIcon(SmallIcon("view-refresh")); closeButton->setIcon(SmallIcon("tab-close")); ThreadListHeaderView* header = new ThreadListHeaderView; @@ -74,11 +74,11 @@ } subjectList->setHorizontalHeaderLabels(labels); - connect(SearchCombo, SIGNAL(activated(int)), + connect(searchCombo, SIGNAL(activated(int)), SLOT(slotSearchButton())); - connect(SearchCombo, SIGNAL(textChanged(const QString&)), + connect(searchCombo, SIGNAL(textChanged(const QString&)), SLOT(slotSearchButton())); - connect(HideButton, SIGNAL(toggled(bool)), + connect(hideButton, SIGNAL(toggled(bool)), SLOT(slotHideButton(bool))); connect(subjectList, SIGNAL(itemClicked(QTableWidgetItem*)), SLOT(slotItemClicked(QTableWidgetItem*))); @@ -89,13 +89,14 @@ void ThreadListView::slotSearchButton() { insertSearchCombo(); - QStringList list = parseSearchQuery(SearchCombo->currentText()); + QStringList list = parseSearchQuery(searchCombo->currentText()); if (list.isEmpty()) { clearSearch(); } else if (list != m_prevquery) { searchNew(list); - HideButton->setDown(true); + hideButton->setDown(true); + slotHideButton(true); } else { searchNext(list); } @@ -103,12 +104,12 @@ void ThreadListView::insertSearchCombo() { - for (int count = 0; count < SearchCombo->count(); ++count) { - if (SearchCombo->itemText(count) == SearchCombo->currentText()) { + for (int count = 0; count < searchCombo->count(); ++count) { + if (searchCombo->itemText(count) == searchCombo->currentText()) { return; } } - SearchCombo->addItem(SearchCombo->currentText()); + searchCombo->addItem(searchCombo->currentText()); } void ThreadListView::searchNext(const QStringList &query) @@ -160,7 +161,7 @@ void ThreadListView::slotHideButton(bool on) { for (int i = 0, j = subjectList->rowCount(); i < j; i++) { - if (on && !subjectList->item(i, ColumnIcon)->icon().isNull()) { + if (on && subjectList->item(i, ColumnIcon)->icon().isNull()) { subjectList->hideRow(i); } else { subjectList->showRow(i); @@ -198,12 +199,12 @@ QString datURL = subjectList->item(item->row(), ColumnDatUrl)->text(); QString threadURL = DatManager::threadURL(datURL); - bool isFavorites = FavoriteThreads::getInstance()->contains(datURL); // create popup menu. KMenu popup(0); - KAction* openWithBrowserAct = new KAction(i18n("Open with Web Browser") , this); + KAction* openWithBrowserAct + = new KAction(i18n("Open with Web Browser") , this); popup.addAction(openWithBrowserAct); KAction* copyURLAct = new KAction(i18n("Copy URL"), this); @@ -212,12 +213,10 @@ KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); popup.addAction(copyTitleAndURLAct); - KAction* favoritesAct; - if (isFavorites) { - favoritesAct = new KAction(i18n("Remove from Favorites"), this); - } else { - favoritesAct = new KAction(i18n("Add to Favorites"), this); - } + bool isFavorites = FavoriteThreads::getInstance()->contains(datURL); + KAction* favoritesAct = isFavorites + ? new KAction(i18n("Remove from Favorites"), this) + : new KAction(i18n("Add to Favorites"), this); popup.addAction(favoritesAct); KAction* deleteLogAct = 0; Modified: kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui 2009-07-18 15:09:16 UTC (rev 2431) +++ kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui 2009-07-18 21:07:43 UTC (rev 2432) @@ -23,7 +23,7 @@ - + 0 @@ -42,7 +42,7 @@ - + filter thread @@ -55,7 +55,7 @@ - + reload board From svnnotify ¡÷ sourceforge.jp Sun Jul 19 06:54:08 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 06:54:08 +0900 Subject: [Kita-svn] [2433] enable the function of log deletion Message-ID: <1247954048.166088.2168.nullmailer@users.sourceforge.jp> Revision: 2433 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2433 Author: nogu Date: 2009-07-19 06:54:08 +0900 (Sun, 19 Jul 2009) Log Message: ----------- enable the function of log deletion Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.h Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 21:07:43 UTC (rev 2432) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 21:54:08 UTC (rev 2433) @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -47,6 +48,8 @@ loadLayout(); loadHeaderOnOff(); + + m_deleteLogAct->setVisible(true); } /* public */ Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 21:07:43 UTC (rev 2432) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 21:54:08 UTC (rev 2433) @@ -82,6 +82,15 @@ SLOT(slotHideButton(bool))); connect(subjectList, SIGNAL(itemClicked(QTableWidgetItem*)), SLOT(slotItemClicked(QTableWidgetItem*))); + + m_openWithBrowserAct + = new KAction(i18n("Open with Web Browser") , this); + m_copyURLAct = new KAction(i18n("Copy URL"), this); + m_copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); + m_favoritesAct = new KAction(this); + m_deleteLogAct = new KAction(i18n("Delete Log"), this); + m_deleteLogAct->setVisible(false); + m_propertyAct = new KAction(i18n("Property"), this); } ThreadListView::~ThreadListView() {} @@ -190,9 +199,8 @@ void ThreadListView::contextMenuEvent(QContextMenuEvent *event) { - QTableWidgetItem* item - = subjectList->itemAt(subjectList->viewport() - ->mapFromGlobal(event->globalPos())); + QTableWidgetItem* item = subjectList->itemAt( + subjectList->viewport()->mapFromGlobal(event->globalPos())); if (item == 0) { return; } @@ -203,56 +211,43 @@ // create popup menu. KMenu popup(0); - KAction* openWithBrowserAct - = new KAction(i18n("Open with Web Browser") , this); - popup.addAction(openWithBrowserAct); + popup.addAction(m_openWithBrowserAct); + popup.addAction(m_copyURLAct); + popup.addAction(m_copyTitleAndURLAct); - KAction* copyURLAct = new KAction(i18n("Copy URL"), this); - popup.addAction(copyURLAct); - - KAction* copyTitleAndURLAct = new KAction(i18n("Copy title and URL"), this); - popup.addAction(copyTitleAndURLAct); - bool isFavorites = FavoriteThreads::getInstance()->contains(datURL); - KAction* favoritesAct = isFavorites - ? new KAction(i18n("Remove from Favorites"), this) - : new KAction(i18n("Add to Favorites"), this); - popup.addAction(favoritesAct); + m_favoritesAct->setText(isFavorites + ? i18n("Remove from Favorites") : i18n("Add to Favorites")); + popup.addAction(m_favoritesAct); - KAction* deleteLogAct = 0; if (DatManager::getReadNum(datURL)) { popup.addSeparator(); - - deleteLogAct = new KAction(i18n("Delete Log"), this); - popup.addAction(deleteLogAct); + popup.addAction(m_deleteLogAct); } popup.addSeparator(); + popup.addAction(m_propertyAct); - KAction* propertyAct = new KAction(i18n("Property"), this); - popup.addAction(propertyAct); - // exec popup menu. QClipboard* clipboard = QApplication::clipboard(); - QString cliptxt; QAction* action = popup.exec(QCursor::pos()); if (!action) { return; } - if (action == openWithBrowserAct) { + if (action == m_openWithBrowserAct) { KRun::runUrl(threadURL, "text/html", this); - } else if (action == copyURLAct) { + } else if (action == m_copyURLAct) { clipboard->setText(threadURL, QClipboard::Clipboard); clipboard->setText(threadURL, QClipboard::Selection); - } else if (action == copyTitleAndURLAct) { - cliptxt = DatManager::threadName(datURL) + '\n' + threadURL; + } else if (action == m_copyTitleAndURLAct) { + QString cliptxt = DatManager::threadName(datURL) + '\n' + threadURL; clipboard->setText(cliptxt , QClipboard::Clipboard); clipboard->setText(cliptxt , QClipboard::Selection); - } else if (action == favoritesAct) { + } else if (action == m_favoritesAct) { ViewMediator::getInstance()->bookmark(datURL, !isFavorites); - } else if (action == deleteLogAct) { - //deleteLog(threadURL); TODO - } else if (action == propertyAct) { + } else if (action == m_deleteLogAct) { + deleteLog(threadURL); + } else if (action == m_propertyAct) { QWidget* widget = new QWidget; Ui::ThreadProperty* propertyWidget = new Ui::ThreadProperty; @@ -288,4 +283,7 @@ } } +// dummy function. reimplemented in BoardView +void ThreadListView::deleteLog(const KUrl&) {} + #include "threadlistview.moc" Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-18 21:07:43 UTC (rev 2432) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.h 2009-07-18 21:54:08 UTC (rev 2433) @@ -14,6 +14,8 @@ #include "ui_threadlistviewbase.h" +class KAction; + struct ColumnAttribute { const char* labelName; /// for header's label @@ -42,6 +44,7 @@ QStringList m_prevquery; unsigned m_nextHitIndex; QList m_hitList; + KAction* m_deleteLogAct; void insertSearchCombo(); void searchNext(const QStringList& input); @@ -50,6 +53,7 @@ void hideColumn(int col); void showColumn(int col); void contextMenuEvent(QContextMenuEvent* event); + virtual void deleteLog(const KUrl& url); protected slots: void slotHideButton(bool on); @@ -58,6 +62,12 @@ private slots: void slotSearchButton(); + private: + KAction* m_openWithBrowserAct; + KAction* m_copyURLAct; + KAction* m_copyTitleAndURLAct; + KAction* m_favoritesAct; + KAction* m_propertyAct; }; } From svnnotify ¡÷ sourceforge.jp Sun Jul 19 07:01:20 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 07:01:20 +0900 Subject: [Kita-svn] [2434] cellPressed -> itemClicked Message-ID: <1247954480.587034.9938.nullmailer@users.sourceforge.jp> Revision: 2434 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2434 Author: nogu Date: 2009-07-19 07:01:20 +0900 (Sun, 19 Jul 2009) Log Message: ----------- cellPressed -> itemClicked Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp kita/branches/KITA-KDE4/kita/src/favoritelistview.h Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-18 21:54:08 UTC (rev 2433) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp 2009-07-18 22:01:20 UTC (rev 2434) @@ -36,8 +36,8 @@ { kindLabel->hide(); - connect(subjectList, SIGNAL(cellPressed(int, int)), - SLOT(loadThread(int, int))); + connect(subjectList, SIGNAL(itemClicked(QTableWidgetItem*)), + SLOT(loadThread(QTableWidgetItem*))); connect(reloadButton, SIGNAL(clicked()), SLOT(reload())); @@ -106,9 +106,8 @@ /** * */ -void FavoriteListView::loadThread(int row, int column) +void FavoriteListView::loadThread(QTableWidgetItem* item) { - QTableWidgetItem* item = subjectList->item(row, column); if (! item) return ; QString itemURL = subjectList->item(item->row(), ColumnDatUrl)->text(); Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/favoritelistview.h 2009-07-18 21:54:08 UTC (rev 2433) +++ kita/branches/KITA-KDE4/kita/src/favoritelistview.h 2009-07-18 22:01:20 UTC (rev 2434) @@ -27,7 +27,7 @@ void refresh(); private slots: - void loadThread(int row, int column); + void loadThread(QTableWidgetItem* item); void reload(); }; } From svnnotify ¡÷ sourceforge.jp Sun Jul 19 07:10:13 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 07:10:13 +0900 Subject: [Kita-svn] [2435] make searches case insensitive Message-ID: <1247955013.709988.30333.nullmailer@users.sourceforge.jp> Revision: 2435 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2435 Author: nogu Date: 2009-07-19 07:10:13 +0900 (Sun, 19 Jul 2009) Log Message: ----------- make searches case insensitive Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 22:01:20 UTC (rev 2434) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 22:10:13 UTC (rev 2435) @@ -427,7 +427,7 @@ void BBSView::refreshFavoriteBoards() { - if (! m_favorites) { + if (!m_favorites) { m_favorites = new ListViewItem(m_boardList, QStringList(i18n("Favorites"))); } @@ -596,7 +596,7 @@ for (int k = 0, l = categoryItem->childCount(); k < l; k++) { QTreeWidgetItem* boardItem = categoryItem->child(k); QString boardName = boardItem->text(0); - if (boardName.contains(str)) { + if (boardName.contains(str, Qt::CaseInsensitive)) { boardItem->setHidden(false); matched = true; } else { From svnnotify ¡÷ sourceforge.jp Sun Jul 19 07:16:30 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 07:16:30 +0900 Subject: [Kita-svn] [2436] minor changes Message-ID: <1247955390.065034.6809.nullmailer@users.sourceforge.jp> Revision: 2436 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2436 Author: nogu Date: 2009-07-19 07:16:30 +0900 (Sun, 19 Jul 2009) Log Message: ----------- minor changes Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/bbsview.h Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 22:10:13 UTC (rev 2435) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 22:16:30 UTC (rev 2436) @@ -55,28 +55,22 @@ BBSView::BBSView(QWidget *, const char *name) : m_favorites(0) { /* copied from Base class */ - BBSViewBaseLayout = new QVBoxLayout(this); + bbsViewBaseLayout = new QVBoxLayout(this); layout10 = new QHBoxLayout(0); - SearchCombo = new KComboBox(this); - QSizePolicy sizePolicy(static_cast(1), static_cast(4)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(SearchCombo->sizePolicy().hasHeightForWidth()); - SearchCombo->setSizePolicy(sizePolicy); - SearchCombo->setEditable(true); - SearchCombo->setMaxCount(10); - layout10->addWidget(SearchCombo); + searchCombo = new KComboBox(this); + searchCombo->setEditable(true); + searchCombo->setMaxCount(10); + layout10->addWidget(searchCombo); spacer2 = new QSpacerItem(467, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); layout10->addItem(spacer2); - BBSViewBaseLayout->addLayout(layout10); + bbsViewBaseLayout->addLayout(layout10); m_boardList = new QTreeWidget(this); m_boardList->setRootIsDecorated(true); - BBSViewBaseLayout->addWidget(m_boardList); + bbsViewBaseLayout->addWidget(m_boardList); resize(QSize(600, 482).expandedTo(minimumSizeHint())); - setAttribute(Qt::WA_WState_Polished); /* copy end */ m_boardList->setHeaderLabel(i18n("board name")); @@ -92,7 +86,7 @@ SLOT(loadBoard(QTreeWidgetItem*))); connect(FavoriteBoards::getInstance(), SIGNAL(changed()), SLOT(refreshFavoriteBoards())); - connect(SearchCombo, SIGNAL(textChanged(const QString&)), + connect(searchCombo, SIGNAL(textChanged(const QString&)), SLOT(filter(const QString&))); } @@ -470,7 +464,7 @@ void BBSView::setFont(const QFont& font) { m_boardList->setFont(font); - SearchCombo->setFont(font); + searchCombo->setFont(font); } /* public slot :*/ /* virtual */ Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-18 22:10:13 UTC (rev 2435) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-18 22:16:30 UTC (rev 2436) @@ -45,12 +45,12 @@ QList getCategoryList(const QString& html) const; void saveOpened(); - KComboBox* SearchCombo; + KComboBox* searchCombo; QTreeWidget* m_boardList; void contextMenuEvent(QContextMenuEvent* e); protected: - QVBoxLayout* BBSViewBaseLayout; + QVBoxLayout* bbsViewBaseLayout; QHBoxLayout* layout10; QSpacerItem* spacer2; From svnnotify ¡÷ sourceforge.jp Sun Jul 19 07:26:22 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 07:26:22 +0900 Subject: [Kita-svn] [2437] fix bugs in reading and writing to board_state.conf Message-ID: <1247955982.919649.18807.nullmailer@users.sourceforge.jp> Revision: 2437 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2437 Author: nogu Date: 2009-07-19 07:26:22 +0900 (Sun, 19 Jul 2009) Log Message: ----------- fix bugs in reading and writing to board_state.conf Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 22:16:30 UTC (rev 2436) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 22:26:22 UTC (rev 2437) @@ -184,7 +184,7 @@ if ((!newBoards.isEmpty() && newBoards.count("\n") < maxNewBoard) || !oldBoards.isEmpty()) { - int ret = KMessageBox::warningYesNoCancel(this, + int ret = KMessageBox::warningYesNoCancel(this, i18n("Do you really want to update board list?"), "kita", KStandardGuiItem::yes(), KGuiItem(i18n("Copy")), KStandardGuiItem::cancel(), @@ -549,8 +549,8 @@ QStringList openedList = config.group("").readEntry("Opened", QStringList()); - for (int i = 0, j = m_boardList->topLevelItemCount(); i < j; i++) { - QTreeWidgetItem* item = m_boardList->topLevelItem(0); + for (int i = 0, j = m_boardList->topLevelItemCount(); i < j; i++) { + QTreeWidgetItem* item = m_boardList->topLevelItem(i); QString categoryName = item->text(0); if (openedList.indexOf(categoryName) != -1) { item->setExpanded(true); @@ -561,13 +561,13 @@ void BBSView::saveOpened() { QStringList openedList; - for (int i = 0, j = m_boardList->topLevelItemCount(); i < j; i++) { - QTreeWidgetItem* item = m_boardList->topLevelItem(0); + for (int i = 0, j = m_boardList->topLevelItemCount(); i < j; i++) { + QTreeWidgetItem* item = m_boardList->topLevelItem(i); QString categoryName = item->text(0); if (item->isExpanded()) { openedList << categoryName; } - } + } QString configPath = KStandardDirs::locateLocal("appdata", "board_state.conf"); KConfig config(configPath); From svnnotify ¡÷ sourceforge.jp Sun Jul 19 07:41:39 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 07:41:39 +0900 Subject: [Kita-svn] [2438] - use KMessageBox instead of QMessageBox Message-ID: <1247956899.896158.2965.nullmailer@users.sourceforge.jp> Revision: 2438 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2438 Author: nogu Date: 2009-07-19 07:41:39 +0900 (Sun, 19 Jul 2009) Log Message: ----------- - use KMessageBox instead of QMessageBox - the name of member variables should not begin with an uppercase letter Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/threadview.cpp kita/branches/KITA-KDE4/kita/src/threadview.h Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-18 22:26:22 UTC (rev 2437) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-18 22:41:39 UTC (rev 2438) @@ -42,7 +42,7 @@ /* copied from Base class */ setFocusPolicy(Qt::ClickFocus); - ThreadViewBaseLayout = new QVBoxLayout(this); + threadViewBaseLayout = new QVBoxLayout(this); layout2 = new QHBoxLayout(0); layout2->setSpacing(6); @@ -51,27 +51,27 @@ writeButton->setEnabled(false); layout2->addWidget(writeButton); - SearchCombo = new KComboBox(this); - SearchCombo->setMinimumSize(QSize(200, 0)); - SearchCombo->setEditable(true); - SearchCombo->setMaxVisibleItems(10); - SearchCombo->setMaxCount(15); - SearchCombo->setInsertPolicy(KComboBox::InsertAtTop); - SearchCombo->setDuplicatesEnabled(false); - layout2->addWidget(SearchCombo); + searchCombo = new KComboBox(this); + searchCombo->setMinimumSize(QSize(200, 0)); + searchCombo->setEditable(true); + searchCombo->setMaxVisibleItems(10); + searchCombo->setMaxCount(15); + searchCombo->setInsertPolicy(KComboBox::InsertAtTop); + searchCombo->setDuplicatesEnabled(false); + layout2->addWidget(searchCombo); - HighLightButton = new QToolButton(this); - HighLightButton->setCheckable(true); - layout2->addWidget(HighLightButton); + highLightButton = new QToolButton(this); + highLightButton->setCheckable(true); + layout2->addWidget(highLightButton); - BookmarkButton = new QToolButton(this); - BookmarkButton->setEnabled(false); - BookmarkButton->setCheckable(true); - layout2->addWidget(BookmarkButton); + bookmarkButton = new QToolButton(this); + bookmarkButton->setEnabled(false); + bookmarkButton->setCheckable(true); + layout2->addWidget(bookmarkButton); - ReloadButton = new QToolButton(this); - ReloadButton->setEnabled(false); - layout2->addWidget(ReloadButton); + reloadButton = new QToolButton(this); + reloadButton->setEnabled(false); + layout2->addWidget(reloadButton); gotoCombo = new KComboBox(this); gotoCombo->setMinimumSize(QSize(200, 0)); @@ -86,12 +86,12 @@ closeButton = new QToolButton(this); closeButton->setEnabled(false); layout2->addWidget(closeButton); - ThreadViewBaseLayout->addLayout(layout2); + threadViewBaseLayout->addLayout(layout2); threadFrame = new QFrame(this); threadFrame->setFrameShape(QFrame::StyledPanel); threadFrame->setFrameShadow(QFrame::Raised); - ThreadViewBaseLayout->addWidget(threadFrame); + threadViewBaseLayout->addWidget(threadFrame); resize(QSize(870, 480).expandedTo(minimumSizeHint())); setAttribute(Qt::WA_WState_Polished); /* copy end */ @@ -101,9 +101,9 @@ aLayout->addWidget(m_threadPart->view()); { - HighLightButton->setIcon(SmallIcon("help-hint")); - ReloadButton->setIcon(SmallIcon("view-refresh")); - BookmarkButton->setIcon(SmallIcon("bookmark-new")); + highLightButton->setIcon(SmallIcon("help-hint")); + reloadButton->setIcon(SmallIcon("view-refresh")); + bookmarkButton->setIcon(SmallIcon("bookmark-new")); writeButton->setIcon(SmallIcon("draw-freehand")); deleteButton->setIcon(SmallIcon("trash-empty")); closeButton->setIcon(SmallIcon("tab-close")); @@ -126,11 +126,11 @@ connect(m_threadPart, SIGNAL(mousePressed()), SLOT(setFocus())); - connect(BookmarkButton, SIGNAL(toggled(bool)), + connect(bookmarkButton, SIGNAL(toggled(bool)), SLOT(slotBookmarkButtonClicked(bool))); - connect(SearchCombo, SIGNAL(activated(int)), + connect(searchCombo, SIGNAL(activated(int)), SLOT(slotSearchButton())); - connect(ReloadButton, SIGNAL(clicked()), + connect(reloadButton, SIGNAL(clicked()), SLOT(slotReloadButton())); connect(gotoCombo, SIGNAL(activated(int)), SLOT(slotComboActivated(int))); @@ -189,23 +189,23 @@ void ThreadView::updateButton() { writeButton->setEnabled(true); - BookmarkButton->setEnabled(true); - ReloadButton->setEnabled(true); + bookmarkButton->setEnabled(true); + reloadButton->setEnabled(true); deleteButton->setEnabled(true); closeButton->setEnabled(true); - if (HighLightButton->isChecked()) { - HighLightButton->toggle(); + if (highLightButton->isChecked()) { + highLightButton->toggle(); } // don't emit SIGNAL(toggled()) - disconnect(BookmarkButton, SIGNAL(toggled(bool)), this, SLOT(slotBookmarkButtonClicked(bool))); + disconnect(bookmarkButton, SIGNAL(toggled(bool)), this, SLOT(slotBookmarkButtonClicked(bool))); if (FavoriteThreads::getInstance() ->contains(m_datURL.prettyUrl())) { - BookmarkButton->setChecked(true); + bookmarkButton->setChecked(true); } else { - BookmarkButton->setChecked(false); + bookmarkButton->setChecked(false); } - connect(BookmarkButton, SIGNAL(toggled(bool)), SLOT(slotBookmarkButtonClicked(bool))); + connect(bookmarkButton, SIGNAL(toggled(bool)), SLOT(slotBookmarkButtonClicked(bool))); } @@ -220,13 +220,13 @@ void ThreadView::insertSearchCombo() { - for (int count = 0; count < SearchCombo->count(); ++count) { - if (SearchCombo->itemText(count) == SearchCombo->currentText()) { + for (int count = 0; count < searchCombo->count(); ++count) { + if (searchCombo->itemText(count) == searchCombo->currentText()) { // found return ; } } - SearchCombo->addItem(SearchCombo->currentText()); + searchCombo->addItem(searchCombo->currentText()); } void ThreadView::slotPopupMenu(KXMLGUIClient* client, const QPoint& global, const KUrl& url, const QString& mimeType, mode_t mode) @@ -240,7 +240,7 @@ void ThreadView::setFont(const QFont& font) { // m_threadPart->setStandardFont(font.family()); - SearchCombo->setFont(font); + searchCombo->setFont(font); DOM::CSSStyleDeclaration style = m_threadPart->htmlDocument().body().style(); style.setProperty("font-family", font.family(), ""); @@ -256,8 +256,8 @@ void ThreadView::focusSearchCombo() { - if (! SearchCombo->hasFocus()) { - SearchCombo->setFocus(); + if (! searchCombo->hasFocus()) { + searchCombo->setFocus(); } else { setFocus(); } @@ -355,7 +355,7 @@ } /* unforcus search combo */ - if (SearchCombo->hasFocus()) { + if (searchCombo->hasFocus()) { setFocus(); return ; } @@ -453,14 +453,14 @@ { if (m_datURL.isEmpty()) return ; /* Nothing is shown on the screen.*/ - QString str = SearchCombo->currentText(); + QString str = searchCombo->currentText(); if (str.at(0) == ':') { /* show res popup */ if (str.at(1) == 'p') { int refNum = str.mid(2).toInt(); - QPoint pos = mapToGlobal(SearchCombo->pos()); - pos.setY(pos.y() + SearchCombo->height() / 2); + QPoint pos = mapToGlobal(searchCombo->pos()); + pos.setY(pos.y() + searchCombo->height() / 2); m_threadPart->slotShowResPopup(pos , refNum, refNum); return ; } @@ -474,7 +474,7 @@ /* jump */ QString anc = str.mid(1); m_threadPart->gotoAnchor(anc, false); - SearchCombo->setFocus(); + searchCombo->setFocus(); return ; } @@ -491,14 +491,14 @@ if (m_datURL.isEmpty()) return ; /* Nothing is shown on the screen.*/ /* jump */ - QString str = SearchCombo->currentText(); + QString str = searchCombo->currentText(); if (str.isEmpty()) return ; if (str.isEmpty()) return ; if (str.at(0) == ':') return ; if (str.at(0) == '?') return ; QStringList query; - query += SearchCombo->currentText(); + query += searchCombo->currentText(); int ResNum = DatManager::getResNum(m_datURL); for (int i = 1; i <= ResNum; i++) { @@ -508,9 +508,9 @@ if (m_viewmode == VIEWMODE_MAINVIEW) m_threadPart->showAll(); insertSearchCombo(); - QStringList list = parseSearchQuery(SearchCombo->currentText()); - m_threadPart->findText(SearchCombo->currentText(), rev); - SearchCombo->setFocus(); + QStringList list = parseSearchQuery(searchCombo->currentText()); + m_threadPart->findText(searchCombo->currentText(), rev); + searchCombo->setFocus(); return ; } @@ -543,16 +543,15 @@ void ThreadView::slotDeleteButtonClicked() { - if (m_datURL.isEmpty()) return ; + if (m_datURL.isEmpty()) + return; int rescode = DatManager::getResponseCode(m_datURL); if ((rescode != 200 && rescode != 206) - || FavoriteThreads::getInstance() ->contains(m_datURL.prettyUrl())) { - if (QMessageBox::warning(this, - "Kita", - i18n("Do you want to delete Log ?"), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) - != QMessageBox::Ok) return ; + || FavoriteThreads::getInstance()->contains(m_datURL.prettyUrl())) { + if (KMessageBox::warningYesNo(this, i18n("Do you want to delete Log ?"), + "Kita") != KMessageBox::Ok) + return; } if (DatManager::deleteCache(m_datURL)) { Modified: kita/branches/KITA-KDE4/kita/src/threadview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-18 22:26:22 UTC (rev 2437) +++ kita/branches/KITA-KDE4/kita/src/threadview.h 2009-07-18 22:41:39 UTC (rev 2438) @@ -100,15 +100,15 @@ int m_rescode; QToolButton* writeButton; - KComboBox* SearchCombo; - QToolButton* HighLightButton; - QToolButton* BookmarkButton; - QToolButton* ReloadButton; + KComboBox* searchCombo; + QToolButton* highLightButton; + QToolButton* bookmarkButton; + QToolButton* reloadButton; KComboBox* gotoCombo; QToolButton* deleteButton; QToolButton* closeButton; QFrame* threadFrame; - QVBoxLayout* ThreadViewBaseLayout; + QVBoxLayout* threadViewBaseLayout; QHBoxLayout* layout2; QSpacerItem* spacer2; From svnnotify ¡÷ sourceforge.jp Sun Jul 19 08:33:09 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 08:33:09 +0900 Subject: [Kita-svn] [2439] - remove an unused parameter Message-ID: <1247959989.994831.9024.nullmailer@users.sourceforge.jp> Revision: 2439 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2439 Author: nogu Date: 2009-07-19 08:33:09 +0900 (Sun, 19 Jul 2009) Log Message: ----------- - remove an unused parameter - don't set colors - fix the position of "Favorites" Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/bbsview.h kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 22:41:39 UTC (rev 2438) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-18 23:33:09 UTC (rev 2439) @@ -52,7 +52,7 @@ /*--------------------------------------*/ -BBSView::BBSView(QWidget *, const char *name) : m_favorites(0) +BBSView::BBSView(QWidget *parent) : QWidget(parent), m_favorites(0) { /* copied from Base class */ bbsViewBaseLayout = new QVBoxLayout(this); @@ -76,12 +76,6 @@ m_boardList->setHeaderLabel(i18n("board name")); m_boardList->header()->setClickable(false); - /* default colors */ - QPalette palette = m_boardList->viewport() ->palette(); - m_textColor = palette.text(); - m_baseColor = palette.base(); - m_backColor = m_boardList->viewport()->palette().color(QPalette::Background); - connect(m_boardList, SIGNAL(itemActivated(QTreeWidgetItem*, int)), SLOT(loadBoard(QTreeWidgetItem*))); connect(FavoriteBoards::getInstance(), SIGNAL(changed()), @@ -272,21 +266,6 @@ */ void BBSView::showBoardList() { - /* color setting */ - /* - m_textColor = QColor("white"); - m_baseColor = QColor("red"); - m_backColor = QColor("yellow"); - m_altColor = QColor("blue"); - */ - /*-------------------------------------------------*/ - - /* set background color */ - QWidget *widget = m_boardList->viewport(); - QPalette palette; - palette.setColor(widget->backgroundRole(), m_backColor); - widget->setPalette(palette); - // clear list m_boardList->clear(); m_favorites = 0; @@ -303,7 +282,6 @@ KConfigGroup group = config.group(category); ListViewItem* categoryItem = new ListViewItem( m_boardList, previous, QStringList(category)); - categoryItem->setColor(m_textColor.color(), m_baseColor.color()); ListViewItem* previousBoard = 0; for (int count = 0; ; count++) { @@ -325,7 +303,6 @@ BoardManager::loadBBSHistory(boardURL); previousBoard = new ListViewItem(categoryItem, previousBoard, QStringList() << boardName << boardURL); - previousBoard->setColor(m_textColor.color(), m_baseColor.color()); } previous = categoryItem; } @@ -356,7 +333,6 @@ ListViewItem* categoryItem = new ListViewItem(m_boardList, QStringList("extboard")); - categoryItem->setColor(m_textColor.color(), m_baseColor.color()); while (!(str = stream.readLine()).isEmpty()) { if (! str.isEmpty()) { @@ -366,10 +342,8 @@ QString board_title = list[ 0 ]; QString board_url = list[ 1 ]; - ListViewItem* tmpitem = new ListViewItem(categoryItem, + new ListViewItem(categoryItem, QStringList() << board_title << board_url); - tmpitem->setColor( - m_textColor.color(), m_baseColor.color()); QString oldURL; int type = Board_Unknown; if (list.size() == 3) type = list[ 2 ].toInt(); @@ -422,10 +396,9 @@ void BBSView::refreshFavoriteBoards() { if (!m_favorites) { - m_favorites = new ListViewItem(m_boardList, + m_favorites = new ListViewItem(m_boardList, 0, QStringList(i18n("Favorites"))); } - m_favorites->setColor(m_textColor.color(), m_baseColor.color()); // remove all items. do { @@ -441,9 +414,7 @@ QString boardURL = (*it).prettyUrl(); QString boardName = BoardManager::boardName(boardURL); - ListViewItem* item = new ListViewItem(m_favorites, - QStringList() << boardName << boardURL); - item->setColor(m_textColor.color(), m_baseColor.color()); + new ListViewItem(m_favorites, QStringList() << boardName << boardURL); } } Modified: kita/branches/KITA-KDE4/kita/src/bbsview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-18 22:41:39 UTC (rev 2438) +++ kita/branches/KITA-KDE4/kita/src/bbsview.h 2009-07-18 23:33:09 UTC (rev 2439) @@ -37,11 +37,6 @@ Q_OBJECT ListViewItem* m_favorites; - /* list color */ - QBrush m_textColor; - QBrush m_baseColor; - QColor m_backColor; - QList getCategoryList(const QString& html) const; void saveOpened(); @@ -61,7 +56,7 @@ void slotMenuOpenWithBrowser(); public: - explicit BBSView(QWidget *parent, const char *name = 0); + explicit BBSView(QWidget *parent); ~BBSView(); void loadOpened(); Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp 2009-07-18 22:41:39 UTC (rev 2438) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.cpp 2009-07-18 23:33:09 UTC (rev 2439) @@ -37,12 +37,3 @@ : QTreeWidgetItem(parent, strings) { } - -/* public */ -void ListViewItem::setColor(const QColor& textColor, const QColor& baseColor) -{ - for (int i = 0, j = columnCount(); i < j; i++) { - setForeground(i, QBrush(textColor)); - setBackground(i, QBrush(baseColor)); - } -} Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-18 22:41:39 UTC (rev 2438) +++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h 2009-07-18 23:33:09 UTC (rev 2439) @@ -30,11 +30,6 @@ const QStringList& strings); ListViewItem(QTreeWidgetItem *parent, const QStringList& strings); - - void setColor(const QColor& textColor, const QColor& baseColor); - - private: - void init(); }; } From svnnotify ¡÷ sourceforge.jp Sun Jul 19 08:52:19 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 08:52:19 +0900 Subject: [Kita-svn] [2440] use qobject_cast Message-ID: <1247961139.971648.32664.nullmailer@users.sourceforge.jp> Revision: 2440 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2440 Author: nogu Date: 2009-07-19 08:52:19 +0900 (Sun, 19 Jul 2009) Log Message: ----------- use qobject_cast Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-18 23:33:09 UTC (rev 2439) +++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp 2009-07-18 23:52:19 UTC (rev 2440) @@ -109,12 +109,7 @@ /* private */ BoardView* BoardTabWidget::isSubjectView(QWidget* w) { - BoardView * view = 0; - if (w) { - if (w->inherits("BoardView")) view = static_cast(w); - } - - return view; + return qobject_cast(w); } /*--------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-18 23:33:09 UTC (rev 2439) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-18 23:52:19 UTC (rev 2440) @@ -148,12 +148,7 @@ /* private */ ThreadView* ThreadTabWidget::isThreadView(QWidget* w) { - ThreadView * view = 0; - if (w) { - if (w->inherits("ThreadView")) view = static_cast< ThreadView* >(w); - } - - return view; + return qobject_cast(w); } Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-18 23:33:09 UTC (rev 2439) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-18 23:52:19 UTC (rev 2440) @@ -105,12 +105,7 @@ /* private */ WriteView* WriteTabWidget::isWriteView(QWidget* w) { - WriteView * view = 0; - if (w) { - if (w->inherits("WriteView")) view = static_cast< WriteView* >(w); - } - - return view; + return qobject_cast(w); } From svnnotify ¡÷ sourceforge.jp Sun Jul 19 10:00:21 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 10:00:21 +0900 Subject: [Kita-svn] [2441] remove an item from a TODO list Message-ID: <1247965221.492710.28048.nullmailer@users.sourceforge.jp> Revision: 2441 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2441 Author: nogu Date: 2009-07-19 10:00:21 +0900 (Sun, 19 Jul 2009) Log Message: ----------- remove an item from a TODO list Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-18 23:52:19 UTC (rev 2440) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-19 01:00:21 UTC (rev 2441) @@ -26,7 +26,7 @@ using namespace Kita; -#define DMANAGER_MAXQUEUE 16 +static const int DMANAGER_MAXQUEUE = 16; DatInfoList DatManager::m_datInfoList; @@ -135,16 +135,14 @@ /* delete the all old instances (LRU algorithm)*/ 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); + for (int i = DMANAGER_MAXQUEUE; i < m_datInfoList.count(); i++) { + DatInfo* deleteInfo = m_datInfoList.at(i); + if (deleteInfo == 0) + continue; + m_datInfoList.removeAt(i); + i--; + delete datInfo; } -#endif } return datInfo; From svnnotify ¡÷ sourceforge.jp Sun Jul 19 17:08:52 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 17:08:52 +0900 Subject: [Kita-svn] [2442] draw the background of subjectList and m_boardList using alternating colors Message-ID: <1247990932.773253.3687.nullmailer@users.sourceforge.jp> Revision: 2442 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2442 Author: nogu Date: 2009-07-19 17:08:52 +0900 (Sun, 19 Jul 2009) Log Message: ----------- draw the background of subjectList and m_boardList using alternating colors Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-19 01:00:21 UTC (rev 2441) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-19 08:08:52 UTC (rev 2442) @@ -68,6 +68,7 @@ bbsViewBaseLayout->addLayout(layout10); m_boardList = new QTreeWidget(this); + m_boardList->setAlternatingRowColors(true); m_boardList->setRootIsDecorated(true); bbsViewBaseLayout->addWidget(m_boardList); resize(QSize(600, 482).expandedTo(minimumSizeHint())); Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-19 01:00:21 UTC (rev 2441) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-19 08:08:52 UTC (rev 2442) @@ -60,6 +60,7 @@ ThreadListHeaderView* header = new ThreadListHeaderView; + subjectList->setAlternatingRowColors(true); subjectList->setColumnCount(ColumnEnd - ColumnBegin + 1); subjectList->setHorizontalHeader(header); subjectList->setShowGrid(false); From svnnotify ¡÷ sourceforge.jp Sun Jul 19 19:22:00 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 19:22:00 +0900 Subject: [Kita-svn] [2443] minor changes Message-ID: <1247998920.455162.29068.nullmailer@users.sourceforge.jp> Revision: 2443 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2443 Author: nogu Date: 2009-07-19 19:22:00 +0900 (Sun, 19 Jul 2009) Log Message: ----------- minor changes Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-19 08:08:52 UTC (rev 2442) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-19 10:22:00 UTC (rev 2443) @@ -143,16 +143,13 @@ m_hitList.clear(); m_nextHitIndex = 0; m_prevquery = query; - for (int i = 0, j = subjectList->rowCount(); i < j; i++) { subjectList->item(i, ColumnIcon)->setIcon(QIcon()); - - QStringList::const_iterator queryIt = query.begin(); - for (; queryIt != query.end(); ++queryIt) { - if (subjectList->item(i, ColumnSubject) - ->text().contains(*queryIt, Qt::CaseInsensitive)) { + for (int k = 0, l = query.count(); k < l; k++) { + if (subjectList->item(i, ColumnSubject)->text() + .contains(query[k], Qt::CaseInsensitive)) { subjectList->item(i, ColumnIcon) - ->setIcon(QIcon(SmallIcon("edit-find"))); + ->setIcon(SmallIcon("edit-find")); m_hitList.append(subjectList->item(i, 0)); break; } From svnnotify ¡÷ sourceforge.jp Sun Jul 19 20:53:48 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 20:53:48 +0900 Subject: [Kita-svn] [2444] change icons and add connections Message-ID: <1248004428.295927.28839.nullmailer@users.sourceforge.jp> Revision: 2444 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2444 Author: nogu Date: 2009-07-19 20:53:48 +0900 (Sun, 19 Jul 2009) Log Message: ----------- change icons and add connections Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-19 10:22:00 UTC (rev 2443) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-19 11:53:48 UTC (rev 2444) @@ -14,8 +14,7 @@ using namespace Kita::Ui; -AbonePrefPage::AbonePrefPage(QWidget *parent) - : QWidget(parent) +AbonePrefPage::AbonePrefPage(QWidget *parent) : QWidget(parent) { setupUi(this); Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 10:22:00 UTC (rev 2443) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 11:53:48 UTC (rev 2444) @@ -32,29 +32,33 @@ // possibilities (including Tab, Swallow, and just Plain) m_facePage = new Ui::FacePrefPage(0); - m_facePageItem = addPage(m_facePage, i18n("Face"), "view_detailed"); + m_facePageItem = addPage(m_facePage, i18n("Face"), "view-list-details"); connect(m_facePage, SIGNAL(fontChanged(const QFont&)), SIGNAL(fontChanged(const QFont&))); m_asciiArtPage = new Ui::AsciiArtPrefPage(0); m_asciiArtPageItem = addPage(m_asciiArtPage, i18n("AsciiArt"), "kita"); + connect(this, SIGNAL(applyClicked()), m_asciiArtPage, SLOT(apply())); + connect(this, SIGNAL(okClicked()), m_asciiArtPage, SLOT(apply())); m_uiPage = new Ui::UIPrefPage(0); m_uiPageItem = addPage(m_uiPage, i18n("User Interface"), "configure"); m_abonePage = new Ui::AbonePrefPage(0); m_abonePageItem = addPage(m_abonePage, i18n("Abone"), "kita"); + connect(this, SIGNAL(applyClicked()), m_abonePage, SLOT(apply())); + connect(this, SIGNAL(okClicked()), m_abonePage, SLOT(apply())); QWidget* m_loginWidget = new QWidget; m_loginPage = new Ui::LoginPrefPage(); m_loginPage->setupUi(m_loginWidget); - m_loginPageItem = addPage(m_loginWidget, i18n("Login"), "connect_established"); + m_loginPageItem = addPage(m_loginWidget, i18n("Login"), "network-connect"); QWidget* m_writeWidget = new QWidget; m_writePage = new Ui::WritePrefPage(); m_writePage->setupUi(m_writeWidget); - m_writePageItem = addPage(m_writeWidget, i18n("Write"), "edit"); + m_writePageItem = addPage(m_writeWidget, i18n("Write"), "document-edit"); connect(m_facePage, SIGNAL(changed()), SLOT(slotChanged())); connect(m_asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); From svnnotify ¡÷ sourceforge.jp Sun Jul 19 21:31:52 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 21:31:52 +0900 Subject: [Kita-svn] [2445] use KTextEdit instead of QTextEdit Message-ID: <1248006712.047394.20511.nullmailer@users.sourceforge.jp> Revision: 2445 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2445 Author: nogu Date: 2009-07-19 21:31:52 +0900 (Sun, 19 Jul 2009) Log Message: ----------- use KTextEdit instead of QTextEdit Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui kita/branches/KITA-KDE4/kita/src/writedialogbase.ui Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui 2009-07-19 11:53:48 UTC (rev 2444) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui 2009-07-19 12:31:52 UTC (rev 2445) @@ -26,9 +26,4 @@
ktextedit.h
- - ktextedit.h - - - Modified: kita/branches/KITA-KDE4/kita/src/writedialogbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-19 11:53:48 UTC (rev 2444) +++ kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-19 12:31:52 UTC (rev 2445) @@ -127,7 +127,7 @@ - + body @@ -199,12 +199,6 @@ - - ksqueezedtextlabel.h - klineedit.h - klineedit.h - klineedit.h - sageBox @@ -213,4 +207,11 @@ sageBoxToggled(bool) + + + KTextEdit + QTextEdit +
ktextedit.h
+
+
From svnnotify ¡÷ sourceforge.jp Sun Jul 19 21:37:05 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Sun, 19 Jul 2009 21:37:05 +0900 Subject: [Kita-svn] [2446] minor changes Message-ID: <1248007025.167246.30574.nullmailer@users.sourceforge.jp> Revision: 2446 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2446 Author: nogu Date: 2009-07-19 21:37:05 +0900 (Sun, 19 Jul 2009) Log Message: ----------- minor changes Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-19 12:31:52 UTC (rev 2445) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-19 12:37:05 UTC (rev 2446) @@ -293,14 +293,8 @@ kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h ktextedit.h - useStyleSheetCheckBox Modified: kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui 2009-07-19 12:31:52 UTC (rev 2445) +++ kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui 2009-07-19 12:37:05 UTC (rev 2446) @@ -155,8 +155,5 @@ klineedit.h - klineedit.h - klineedit.h - klineedit.h Modified: kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui 2009-07-19 12:31:52 UTC (rev 2445) +++ kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui 2009-07-19 12:37:05 UTC (rev 2446) @@ -117,7 +117,6 @@ klineedit.h - klineedit.h From svnnotify ¡÷ sourceforge.jp Mon Jul 20 06:06:32 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 06:06:32 +0900 Subject: [Kita-svn] [2447] refactoring Message-ID: <1248037592.422910.1846.nullmailer@users.sourceforge.jp> Revision: 2447 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2447 Author: nogu Date: 2009-07-20 06:06:32 +0900 (Mon, 20 Jul 2009) Log Message: ----------- refactoring Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.h Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h Removed Paths: ------------- kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #include #include #include Modified: kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-19 21:06:32 UTC (rev 2447) @@ -4,15 +4,23 @@ ########### next target ############### -set(kitapref_LIB_SRCS aboneprefpage.cpp prefs.cpp) +set(kitapref_LIB_SRCS + abstractprefpage.cpp + asciiartprefpage.cpp + aboneprefpage.cpp + loginprefpage.cpp + faceprefpage.cpp + prefs.cpp + uiprefpage.cpp + writeprefpage.cpp) kde4_add_ui_files(kitapref_LIB_SRCS aboneprefbase.ui asciiartprefbase.ui faceprefbase.ui - login_page.ui + loginprefbase.ui uiprefbase.ui - write_page.ui) + writeprefbase.ui) kde4_add_library(kitapref SHARED ${kitapref_LIB_SRCS}) Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -12,15 +12,15 @@ #include "libkita/abone.h" -using namespace Kita::Ui; +using namespace Kita; -AbonePrefPage::AbonePrefPage(QWidget *parent) : QWidget(parent) +AbonePrefPage::AbonePrefPage(QWidget *parent) : AbstractPrefPage(parent) { setupUi(this); - idAboneText->setText(Kita::AboneConfig::aboneIDList().join("\n")); - nameAboneText->setText(Kita::AboneConfig::aboneNameList().join("\n")); - wordAboneText->setText(Kita::AboneConfig::aboneWordList().join("\n")); + idAboneText->setText(AboneConfig::aboneIDList().join("\n")); + nameAboneText->setText(AboneConfig::aboneNameList().join("\n")); + wordAboneText->setText(AboneConfig::aboneWordList().join("\n")); connect(idAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); connect(nameAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); @@ -29,9 +29,6 @@ m_changed = false; } -AbonePrefPage::~AbonePrefPage() -{} - void AbonePrefPage::slotTextChanged() { m_changed = true; @@ -43,18 +40,24 @@ if (m_changed) { QString idText = idAboneText->toPlainText(); QStringList idList = idText.split('\n'); - Kita::AboneConfig::setAboneIDList(idList); + AboneConfig::setAboneIDList(idList); QString nameText = nameAboneText->toPlainText(); QStringList nameList = nameText.split('\n'); - Kita::AboneConfig::setAboneNameList(nameList); + AboneConfig::setAboneNameList(nameList); QString wordText = wordAboneText->toPlainText(); QStringList wordList = wordText.split('\n'); - Kita::AboneConfig::setAboneWordList(wordList); + AboneConfig::setAboneWordList(wordList); } m_changed = false; } -#include "aboneprefpage.moc" +void AbonePrefPage::init() +{ +} + +void AbonePrefPage::reset() +{ +} Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -10,30 +10,27 @@ #ifndef KITAABONEPREFPAGE_H #define KITAABONEPREFPAGE_H +#include "abstractprefpage.h" #include "ui_aboneprefbase.h" namespace Kita { -namespace Ui -{ /** @author Hideki Ikemoto */ - class AbonePrefPage : public QWidget, public Ui::AbonePrefBase + class AbonePrefPage : public AbstractPrefPage, public Ui::AbonePrefBase { Q_OBJECT bool m_changed; public: AbonePrefPage(QWidget *parent = 0); - ~AbonePrefPage(); - public slots: void apply(); + void init(); + void reset(); + private slots: void slotTextChanged(); - signals: - void changed(); }; } -} #endif Added: kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,17 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "abstractprefpage.h" + +using namespace Kita; + +AbstractPrefPage::AbstractPrefPage(QWidget* parent) : QWidget(parent) +{ +} Added: kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,32 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITAABSTRACTPREFPAGE_H +#define KITAABSTRACTPREFPAGE_H + +#include + +namespace Kita +{ + class AbstractPrefPage : public QWidget + { + Q_OBJECT + public: + explicit AbstractPrefPage(QWidget* parent = 0); + virtual void apply() = 0; + virtual void init() = 0; + virtual void reset() = 0; + + signals: + void changed(); + }; +} + +#endif // KITAABSTRACTPREFPAGE_H Added: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,42 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "asciiartprefpage.h" + +#include "libkita/asciiart.h" +#include "libkita/config_xt.h" + +using namespace Kita; + +AsciiArtPrefPage::AsciiArtPrefPage(QWidget* parent) : AbstractPrefPage(parent) +{ + setupUi(this); + init(); + + connect(asciiArtText, SIGNAL(textChanged()), SIGNAL(changed())); +} + +void AsciiArtPrefPage::apply() +{ + QString text = asciiArtText->toPlainText(); + QStringList list = text.split('\n'); + + AsciiArtConfig::setAsciiArtList(list); +} + +void AsciiArtPrefPage::init() +{ + asciiArtText->setText(AsciiArtConfig::asciiArtList().join("\n")); + asciiArtText->setFont(Config::threadFont()); +} + +void AsciiArtPrefPage::reset() +{ +} Added: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,31 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITAASCIIARTPREFPAGE_H +#define KITAASCIIARTPREFPAGE_H + +#include "abstractprefpage.h" +#include "ui_asciiartprefbase.h" + +namespace Kita +{ + class AsciiArtPrefPage + : public AbstractPrefPage, public Ui::AsciiArtPrefBase + { + Q_OBJECT + public: + AsciiArtPrefPage(QWidget* parent = 0); + void apply(); + void init(); + void reset(); + }; +} + +#endif // KITAASCIIARTPREFPAGE_H Added: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,155 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "faceprefpage.h" + +#include + +#include "libkita/config_xt.h" +#include "libkita/kita_misc.h" + +using namespace Kita; + +FacePrefPage::FacePrefPage(QWidget* parent) : AbstractPrefPage(parent) +{ + setupUi(this); + // font + connect(listFontButton, SIGNAL(clicked()), SLOT(slotFontButtonClicked())); + + connect(threadFontButton, SIGNAL(clicked()), + SLOT(slotThreadFontButtonClicked())); + + connect(popupFontButton, SIGNAL(clicked()), + SLOT(slotPopupFontButtonClicked())); + + updateButtons(); + + m_threadFontchanged = false; + m_threadColorChanged = false; + + // color + threadColorButton->setColor(Config::threadColor()); + threadBackgroundColorButton->setColor(Config::threadBackground()); + popupColorButton->setColor(Config::popupColor()); + popupBackgroundColorButton->setColor(Config::popupBackground()); + + connect(threadColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); + connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); + connect(threadColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); + connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); + connect(popupColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); + connect(popupBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); +} + +void FacePrefPage::apply() +{ + // font + QFont font = listFontButton->font(); + Config::setFont(font); + emit fontChanged(font); + + if (m_threadFontchanged) { + QFont threadFont = threadFontButton->font(); + Config::setThreadFont(threadFont); + } + m_threadFontchanged = false; + + QFont popupFont = popupFontButton->font(); + Config::setPopupFont(popupFont); + + // color + if (m_threadColorChanged) { + Config::setThreadColor(threadColorButton->color()); + Config::setThreadBackground(threadBackgroundColorButton->color()); + } + m_threadColorChanged = false; + Config::setPopupColor(popupColorButton->color()); + Config::setPopupBackground(popupBackgroundColorButton->color()); +} + +void FacePrefPage::init() +{ +} + +void FacePrefPage::reset() +{ + // font + QFont font; + listFontButton->setText(fontToString(font)); + listFontButton->setFont(font); + + threadFontButton->setText(fontToString(font)); + threadFontButton->setFont(font); + m_threadFontchanged = true; + + popupFontButton->setText(fontToString(font)); + popupFontButton->setFont(font); + + // color + threadColorButton->setColor(Qt::black); + threadBackgroundColorButton->setColor(Qt::white); + popupColorButton->setColor(Qt::black); + popupBackgroundColorButton->setColor(Qt::yellow); + m_threadColorChanged = true; +} + +void FacePrefPage::updateButtons() +{ + QFont font = Config::font(); + listFontButton->setText(fontToString(font)); + listFontButton->setFont(font); + + QFont threadFont = Config::threadFont(); + threadFontButton->setText(fontToString(threadFont)); + threadFontButton->setFont(threadFont); + + QFont popupFont = Config::popupFont(); + popupFontButton->setText(fontToString(popupFont)); + popupFontButton->setFont(popupFont); +} + +void FacePrefPage::slotThreadFontButtonClicked() +{ + QFont threadFont = threadFontButton->font(); + + if (KFontDialog::getFont(threadFont, false, this) == QDialog::Accepted) { + threadFontButton->setText(fontToString(threadFont)); + threadFontButton->setFont(threadFont); + emit changed(); + m_threadFontchanged = true; + } +} + +void FacePrefPage::slotFontButtonClicked() +{ + QFont font = listFontButton->font(); + + if (KFontDialog::getFont(font, false, this) == QDialog::Accepted) { + listFontButton->setText(fontToString(font)); + listFontButton->setFont(font); + emit changed(); + } +} + +void FacePrefPage::slotPopupFontButtonClicked() +{ + QFont font = popupFontButton->font(); + + if (KFontDialog::getFont(font, false, this) == QDialog::Accepted) { + popupFontButton->setText(fontToString(font)); + popupFontButton->setFont(font); + emit changed(); + } +} + +void FacePrefPage::slotColorChanged() +{ + m_threadColorChanged = true; +} Added: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,46 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITAFACEPREFPAGE_H +#define KITAFACEPREFPAGE_H + +#include "abstractprefpage.h" +#include "ui_faceprefbase.h" + +namespace Kita +{ + class FacePrefPage : public AbstractPrefPage, public Ui::FacePrefBase + { + Q_OBJECT + + bool m_threadFontchanged; + bool m_threadColorChanged; + + public: + FacePrefPage(QWidget* parent = 0); + void apply(); + void init(); + void reset(); + + private slots: + void slotFontButtonClicked(); + void slotPopupFontButtonClicked(); + void slotThreadFontButtonClicked(); + void slotColorChanged(); + + private: + void updateButtons(); + + signals: + void fontChanged(const QFont&); + }; +} + +#endif // KITAFACEPREFPAGE_H Deleted: kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui 2009-07-19 21:06:32 UTC (rev 2447) @@ -1,159 +0,0 @@ - - - - - Kita::LoginPrefPage - - - - 0 - 0 - 600 - 484 - - - - Form1 - - - - - - - - - - - - User ID - - - false - - - - - - - - - - Password - - - - - - - Password - - - false - - - - - - - - - - 285 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - - - enables &auto login - - - Alt+A - - - - - - - - - - - Be mail address - - - false - - - - - - - - - - Be auth code - - - false - - - - - - - - - - - - - 40 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - - - - - - 20 - 325 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - - klineedit.h - - Copied: kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui (from rev 2446, kita/branches/KITA-KDE4/kita/src/prefs/login_page.ui) =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,159 @@ + + + + + Kita::LoginPrefBase + + + + 0 + 0 + 600 + 484 + + + + Form1 + + + + + + + + + + + + User ID + + + false + + + + + + + + + + Password + + + + + + + Password + + + false + + + + + + + + + + 285 + 20 + + + + QSizePolicy::Expanding + + + Qt::Horizontal + + + + + + + + + enables &auto login + + + Alt+A + + + + + + + + + + + Be mail address + + + false + + + + + + + + + + Be auth code + + + false + + + + + + + + + + + + + 40 + 20 + + + + QSizePolicy::Expanding + + + Qt::Horizontal + + + + + + + + + + + + 20 + 325 + + + + QSizePolicy::Expanding + + + Qt::Vertical + + + + + + + + klineedit.h + + Property changes on: kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Added: kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,31 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "loginprefpage.h" + +using namespace Kita; + +LoginPrefPage::LoginPrefPage(QWidget* parent) : AbstractPrefPage(parent) +{ + setupUi(this); + init(); +} + +void LoginPrefPage::apply() +{ +} + +void LoginPrefPage::init() +{ +} + +void LoginPrefPage::reset() +{ +} Added: kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,30 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITALOGINPREFPAGE_H +#define KITALOGINPREFPAGE_H + +#include "abstractprefpage.h" +#include "ui_loginprefbase.h" + +namespace Kita +{ + class LoginPrefPage : public AbstractPrefPage, public Ui::LoginPrefBase + { + Q_OBJECT + public: + LoginPrefPage(QWidget* parent = 0); + void apply(); + void init(); + void reset(); + }; +} + +#endif // KITALOGINPREFPAGE_H Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -10,15 +10,13 @@ #include "prefs.h" -#include -#include - #include "aboneprefpage.h" -#include "ui_login_page.h" -#include "ui_write_page.h" -#include "libkita/asciiart.h" +#include "asciiartprefpage.h" +#include "faceprefpage.h" +#include "loginprefpage.h" +#include "uiprefpage.h" +#include "writeprefpage.h" #include "libkita/config_xt.h" -#include "libkita/kita_misc.h" using namespace Kita; @@ -27,87 +25,57 @@ { enableButtonApply(false); enableButton(Help, false); + // this is the base class for your preferences dialog. it is now // a Treelist dialog.. but there are a number of other // possibilities (including Tab, Swallow, and just Plain) - - m_facePage = new Ui::FacePrefPage(0); - m_facePageItem = addPage(m_facePage, i18n("Face"), "view-list-details"); - + m_facePage = new FacePrefPage(0); + addPage(m_facePage, i18n("Face"), "view-list-details"); connect(m_facePage, SIGNAL(fontChanged(const QFont&)), SIGNAL(fontChanged(const QFont&))); - m_asciiArtPage = new Ui::AsciiArtPrefPage(0); - m_asciiArtPageItem = addPage(m_asciiArtPage, i18n("AsciiArt"), "kita"); - connect(this, SIGNAL(applyClicked()), m_asciiArtPage, SLOT(apply())); - connect(this, SIGNAL(okClicked()), m_asciiArtPage, SLOT(apply())); + m_asciiArtPage = new AsciiArtPrefPage(0); + addPage(m_asciiArtPage, i18n("AsciiArt"), "kita"); - m_uiPage = new Ui::UIPrefPage(0); - m_uiPageItem = addPage(m_uiPage, i18n("User Interface"), "configure"); + m_uiPage = new UIPrefPage(0); + addPage(m_uiPage, i18n("User Interface"), "configure"); - m_abonePage = new Ui::AbonePrefPage(0); - m_abonePageItem = addPage(m_abonePage, i18n("Abone"), "kita"); - connect(this, SIGNAL(applyClicked()), m_abonePage, SLOT(apply())); - connect(this, SIGNAL(okClicked()), m_abonePage, SLOT(apply())); + m_abonePage = new AbonePrefPage(0); + addPage(m_abonePage, i18n("Abone"), "kita"); - QWidget* m_loginWidget = new QWidget; - m_loginPage = new Ui::LoginPrefPage(); - m_loginPage->setupUi(m_loginWidget); - m_loginPageItem = addPage(m_loginWidget, i18n("Login"), "network-connect"); + m_loginPage = new LoginPrefPage(0); + addPage(m_loginPage, i18n("Login"), "network-connect"); - QWidget* m_writeWidget = new QWidget; - m_writePage = new Ui::WritePrefPage(); - m_writePage->setupUi(m_writeWidget); - m_writePageItem = addPage(m_writeWidget, i18n("Write"), "document-edit"); + m_writePage = new WritePrefPage(0); + addPage(m_writePage, i18n("Write"), "document-edit"); connect(m_facePage, SIGNAL(changed()), SLOT(slotChanged())); connect(m_asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); connect(m_uiPage, SIGNAL(changed()), SLOT(slotChanged())); connect(m_abonePage, SIGNAL(changed()), SLOT(slotChanged())); -// connect(m_loginPage, SIGNAL(changed()), SLOT(slotChanged())); // TODO -// connect(m_writePage, SIGNAL(changed()), SLOT(slotChanged())); // TODO + connect(m_loginPage, SIGNAL(changed()), SLOT(slotChanged())); + connect(m_writePage, SIGNAL(changed()), SLOT(slotChanged())); - connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*, KPageWidgetItem*)), SLOT(slotCurrentPageChanged())); + connect(this, + SIGNAL(currentPageChanged(KPageWidgetItem*, KPageWidgetItem*)), + SLOT(slotCurrentPageChanged())); + connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply())); + connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); } void Preferences::slotApply() { - if (currentPage() == m_facePageItem) { - // face - m_facePage->apply(); - } else if (currentPage() == m_asciiArtPageItem) { - // asciiart - m_asciiArtPage->apply(); - } else if (currentPage() == m_uiPageItem) { - // user interface - m_uiPage->apply(); - } else if (currentPage() == m_abonePageItem) { - // abone - m_abonePage->apply(); - } else { - // login - // write - } + AbstractPrefPage* page = qobject_cast(currentPage()); + if (page) + page->apply(); enableButtonApply(false); } void Preferences::slotDefault() { - if (currentPage() == m_facePageItem) { - // face - m_facePage->reset(); - } else if (currentPage() == m_asciiArtPageItem) { - // asciiart - m_asciiArtPage->reset(); - } else if (currentPage() == m_uiPageItem) { - // user - m_uiPage->reset(); - } else { - // abone - // login - // write - // debug - } + AbstractPrefPage* page = qobject_cast(currentPage()); + if (page) + page->reset(); enableButtonApply(true); } @@ -122,202 +90,15 @@ m_asciiArtPage->apply(); m_uiPage->apply(); m_abonePage->apply(); + m_loginPage->apply(); + m_writePage->apply(); -// KDialogBase::slotOk(); + accept(); } void Preferences::slotCurrentPageChanged() { - if (currentPage() == m_asciiArtPageItem) { - // ascii art - m_asciiArtPage->init(); - } + AbstractPrefPage* page = qobject_cast(currentPage()); + if (page) + page->init(); } - -Ui::AsciiArtPrefPage::AsciiArtPrefPage(QWidget* parent) - : QWidget(parent) -{ - setupUi(this); - init(); - - connect(asciiArtText, SIGNAL(textChanged()), SIGNAL(changed())); -} - -void Ui::AsciiArtPrefPage::init() -{ - asciiArtText->setText(AsciiArtConfig::asciiArtList().join("\n")); - asciiArtText->setFont(Config::threadFont()); -} - -void Ui::AsciiArtPrefPage::apply() -{ - QString text = asciiArtText->toPlainText(); - QStringList list = text.split('\n'); - - AsciiArtConfig::setAsciiArtList(list); -} - -void Ui::AsciiArtPrefPage::reset() -{ -} - -Ui::UIPrefPage::UIPrefPage(QWidget* parent) - : QWidget(parent) -{ - setupUi(this); - connect(editFileAssociation, SIGNAL(leftClickedUrl()), SLOT(slotEditFileAssociation())); -} - -void Ui::UIPrefPage::apply() -{ -} - -void Ui::UIPrefPage::reset() -{ - kcfg_AlwaysUseTab->setChecked(true); - kcfg_MarkTime->setValue(24); - kcfg_ShowMailAddress->setChecked(false); - kcfg_ShowNum->setValue(100); - //kcfg_ListSortOrder->setButton(Config::EnumListSortOrder::Mark);TODO - kcfg_PartMimeList->setText("image/gif,image/jpeg,image/png,image/x-bmp"); - kcfg_UsePart->setChecked(true); -} - -void Ui::UIPrefPage::slotEditFileAssociation() -{ - KToolInvocation::kdeinitExec("kcmshell", QStringList("filetypes")); -} - -Ui::FacePrefPage::FacePrefPage(QWidget* parent) - : QWidget(parent) -{ - setupUi(this); - // font - connect(listFontButton, SIGNAL(clicked()), SLOT(slotFontButtonClicked())); - - connect(threadFontButton, SIGNAL(clicked()), - SLOT(slotThreadFontButtonClicked())); - - connect(popupFontButton, SIGNAL(clicked()), - SLOT(slotPopupFontButtonClicked())); - - updateButtons(); - - m_threadFontchanged = false; - m_threadColorChanged = false; - - // color - threadColorButton->setColor(Config::threadColor()); - threadBackgroundColorButton->setColor(Config::threadBackground()); - popupColorButton->setColor(Config::popupColor()); - popupBackgroundColorButton->setColor(Config::popupBackground()); - - connect(threadColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); - connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); - connect(threadColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); - connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); - connect(popupColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); - connect(popupBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); -} - -void Ui::FacePrefPage::apply() -{ - // font - QFont font = listFontButton->font(); - Config::setFont(font); - emit fontChanged(font); - - if (m_threadFontchanged) { - QFont threadFont = threadFontButton->font(); - Config::setThreadFont(threadFont); - } - m_threadFontchanged = false; - - QFont popupFont = popupFontButton->font(); - Config::setPopupFont(popupFont); - - // color - if (m_threadColorChanged) { - Config::setThreadColor(threadColorButton->color()); - Config::setThreadBackground(threadBackgroundColorButton->color()); - } - m_threadColorChanged = false; - Config::setPopupColor(popupColorButton->color()); - Config::setPopupBackground(popupBackgroundColorButton->color()); -} - -void Ui::FacePrefPage::reset() -{ - // font - QFont font; - listFontButton->setText(fontToString(font)); - listFontButton->setFont(font); - - threadFontButton->setText(fontToString(font)); - threadFontButton->setFont(font); - m_threadFontchanged = true; - - popupFontButton->setText(fontToString(font)); - popupFontButton->setFont(font); - - // color - threadColorButton->setColor(Qt::black); - threadBackgroundColorButton->setColor(Qt::white); - popupColorButton->setColor(Qt::black); - popupBackgroundColorButton->setColor(Qt::yellow); - m_threadColorChanged = true; -} - -void Ui::FacePrefPage::updateButtons() -{ - QFont font = Config::font(); - listFontButton->setText(fontToString(font)); - listFontButton->setFont(font); - - QFont threadFont = Config::threadFont(); - threadFontButton->setText(fontToString(threadFont)); - threadFontButton->setFont(threadFont); - - QFont popupFont = Config::popupFont(); - popupFontButton->setText(fontToString(popupFont)); - popupFontButton->setFont(popupFont); -} - -void Ui::FacePrefPage::slotThreadFontButtonClicked() -{ - QFont threadFont = threadFontButton->font(); - - if (KFontDialog::getFont(threadFont, false, this) == QDialog::Accepted) { - threadFontButton->setText(fontToString(threadFont)); - threadFontButton->setFont(threadFont); - emit changed(); - m_threadFontchanged = true; - } -} - -void Ui::FacePrefPage::slotFontButtonClicked() -{ - QFont font = listFontButton->font(); - - if (KFontDialog::getFont(font, false, this) == QDialog::Accepted) { - listFontButton->setText(fontToString(font)); - listFontButton->setFont(font); - emit changed(); - } -} - -void Ui::FacePrefPage::slotPopupFontButtonClicked() -{ - QFont font = popupFontButton->font(); - - if (KFontDialog::getFont(font, false, this) == QDialog::Accepted) { - popupFontButton->setText(fontToString(font)); - popupFontButton->setFont(font); - emit changed(); - } -} - -void Ui::FacePrefPage::slotColorChanged() -{ - m_threadColorChanged = true; -} Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -13,25 +13,15 @@ #include -#include "ui_asciiartprefbase.h" -#include "ui_faceprefbase.h" -#include "ui_uiprefbase.h" - -class DebugPrefPage; - namespace Kita { - namespace Ui - { + class AbonePrefPage; + class AsciiArtPrefPage; + class FacePrefPage; + class LoginPrefPage; + class UIPrefPage; + class WritePrefPage; - class AsciiArtPrefPage; - class UIPrefPage; - class AbonePrefPage; - class LoginPrefPage; - class FacePrefPage; - class WritePrefPage; - } - class KDE_EXPORT Preferences : public KConfigDialog { Q_OBJECT @@ -39,102 +29,26 @@ public: Preferences(QWidget* parent); - protected: - virtual void slotApply(); - private: Preferences(const Preferences&); Preferences& operator=(const Preferences&); - Ui::FacePrefPage* m_facePage; - Ui::AsciiArtPrefPage* m_asciiArtPage; - Ui::UIPrefPage* m_uiPage; - Ui::AbonePrefPage* m_abonePage; - Ui::LoginPrefPage* m_loginPage; - Ui::WritePrefPage* m_writePage; - - KPageWidgetItem* m_facePageItem; - KPageWidgetItem* m_asciiArtPageItem; - KPageWidgetItem* m_uiPageItem; - KPageWidgetItem* m_abonePageItem; - KPageWidgetItem* m_loginPageItem; - KPageWidgetItem* m_writePageItem; + AbonePrefPage* m_abonePage; + AsciiArtPrefPage* m_asciiArtPage; + FacePrefPage* m_facePage; + LoginPrefPage* m_loginPage; + UIPrefPage* m_uiPage; + WritePrefPage* m_writePage; private slots: void slotChanged(); - virtual void slotOk(); - virtual void slotDefault(); + void slotApply(); + void slotOk(); + void slotDefault(); void slotCurrentPageChanged(); signals: void fontChanged(const QFont&); }; - -/*class DebugPrefPage : public DebugPrefBase -{ - Q_OBJECT - -public: - DebugPrefPage(QWidget* parent = 0); - -public slots: - void replace(); -};*/ - - class Ui::AsciiArtPrefPage : public QWidget, public Ui::AsciiArtPrefBase - { - Q_OBJECT - public: - AsciiArtPrefPage(QWidget* parent = 0); - public slots: - void init(); - void apply(); - void reset(); - - signals: - void changed(); - }; - - class Ui::UIPrefPage : public QWidget, public Ui::UIPrefBase - { - Q_OBJECT - public: - UIPrefPage(QWidget* parent = 0); - void apply(); - void reset(); - - private slots: - /// open 'file association setting dialog' - void slotEditFileAssociation(); - - signals: - void changed(); - }; - - class Ui::FacePrefPage : public QWidget, public Ui::FacePrefBase - { - Q_OBJECT - - bool m_threadFontchanged; - bool m_threadColorChanged; - - public: - FacePrefPage(QWidget* parent = 0); - void apply(); - void reset(); - - public slots: - void slotFontButtonClicked(); - void slotPopupFontButtonClicked(); - void slotThreadFontButtonClicked(); - void slotColorChanged(); - - private: - void updateButtons(); - - signals: - void fontChanged(const QFont&); - void changed(); - }; } #endif // KITAPREFS_H Added: kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,45 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "uiprefpage.h" + +#include + +using namespace Kita; + +UIPrefPage::UIPrefPage(QWidget* parent) : AbstractPrefPage(parent) +{ + setupUi(this); + connect(editFileAssociation, SIGNAL(leftClickedUrl()), SLOT(slotEditFileAssociation())); +} + +void UIPrefPage::apply() +{ +} + +void UIPrefPage::init() +{ +} + +void UIPrefPage::reset() +{ + kcfg_AlwaysUseTab->setChecked(true); + kcfg_MarkTime->setValue(24); + kcfg_ShowMailAddress->setChecked(false); + kcfg_ShowNum->setValue(100); + //kcfg_ListSortOrder->setButton(Config::EnumListSortOrder::Mark);TODO + kcfg_PartMimeList->setText("image/gif,image/jpeg,image/png,image/x-bmp"); + kcfg_UsePart->setChecked(true); +} + +void UIPrefPage::slotEditFileAssociation() +{ + KToolInvocation::kdeinitExec("kcmshell", QStringList("filetypes")); +} Added: kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,34 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITAUIPREFPAGE_H +#define KITAUIPREFPAGE_H + +#include "abstractprefpage.h" +#include "ui_uiprefbase.h" + +namespace Kita +{ + class UIPrefPage : public AbstractPrefPage, public Ui::UIPrefBase + { + Q_OBJECT + public: + UIPrefPage(QWidget* parent = 0); + void apply(); + void init(); + void reset(); + + private slots: + /// open 'file association setting dialog' + void slotEditFileAssociation(); + }; +} + +#endif // KITAUIPREFPAGE_H Deleted: kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui 2009-07-19 12:37:05 UTC (rev 2446) +++ kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui 2009-07-19 21:06:32 UTC (rev 2447) @@ -1,129 +0,0 @@ - - - - - Kita::WritePrefPage - - - - 0 - 0 - 600 - 480 - - - - Form1 - - - - - - - - Default Name - - - false - - - - - - - - - - use always - - - - - - - - 188 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - - - - - Default Mail - - - false - - - - - - - - - - sage checked - - - - - - - - 100 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - - - - 20 - 400 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - - klineedit.h - - - - kcfg_DefaultSage - toggled(bool) - Kita::WritePrefPage - DefaultSageCheckBoxToggled(bool) - - - Copied: kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui (from rev 2446, kita/branches/KITA-KDE4/kita/src/prefs/write_page.ui) =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,129 @@ + + + + + Kita::WritePrefBase + + + + 0 + 0 + 600 + 480 + + + + Form1 + + + + + + + + Default Name + + + false + + + + + + + + + + use always + + + + + + + + 188 + 20 + + + + QSizePolicy::Expanding + + + Qt::Horizontal + + + + + + + + + + + Default Mail + + + false + + + + + + + + + + sage checked + + + + + + + + 100 + 20 + + + + QSizePolicy::Expanding + + + Qt::Horizontal + + + + + + + + + + 20 + 400 + + + + QSizePolicy::Expanding + + + Qt::Vertical + + + + + + + + klineedit.h + + + + kcfg_DefaultSage + toggled(bool) + Kita::WritePrefBase + DefaultSageCheckBoxToggled(bool) + + + Property changes on: kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Added: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,31 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "writeprefpage.h" + +using namespace Kita; + +WritePrefPage::WritePrefPage(QWidget* parent) : AbstractPrefPage(parent) +{ + setupUi(this); + init(); +} + +void WritePrefPage::apply() +{ +} + +void WritePrefPage::init() +{ +} + +void WritePrefPage::reset() +{ +} Added: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h 2009-07-19 21:06:32 UTC (rev 2447) @@ -0,0 +1,30 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITAWRITEPREFPAGE_H +#define KITAWRITEPREFPAGE_H + +#include "abstractprefpage.h" +#include "ui_writeprefbase.h" + +namespace Kita +{ + class WritePrefPage : public AbstractPrefPage, public Ui::WritePrefBase + { + Q_OBJECT + public: + WritePrefPage(QWidget* parent = 0); + void apply(); + void init(); + void reset(); + }; +} + +#endif // KITAWRITEPREFPAGE_H From svnnotify ¡÷ sourceforge.jp Mon Jul 20 06:11:01 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 06:11:01 +0900 Subject: [Kita-svn] [2448] remove unnecessary #include Message-ID: <1248037861.116028.14536.nullmailer@users.sourceforge.jp> Revision: 2448 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2448 Author: nogu Date: 2009-07-20 06:11:01 +0900 (Mon, 20 Jul 2009) Log Message: ----------- remove unnecessary #include Modified Paths: -------------- 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/favoriteboards.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-19 21:06:32 UTC (rev 2447) +++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp 2009-07-19 21:11:01 UTC (rev 2448) @@ -431,5 +431,3 @@ } emitDatLineList(cstr); } - -#include "access.moc" Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-19 21:06:32 UTC (rev 2447) +++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp 2009-07-19 21:11:01 UTC (rev 2448) @@ -100,5 +100,3 @@ } m_eventLoop.exit(); } - -#include "account.moc" Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-19 21:06:32 UTC (rev 2447) +++ kita/branches/KITA-KDE4/kita/src/libkita/favoriteboards.cpp 2009-07-19 21:11:01 UTC (rev 2448) @@ -137,5 +137,3 @@ { emit changed(); } - -#include "favoriteboards.moc" Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-19 21:06:32 UTC (rev 2447) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-19 21:11:01 UTC (rev 2448) @@ -514,5 +514,3 @@ AboneConfig::setAboneWordList(list); } } - -#include "mainwindow.moc" Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-19 21:06:32 UTC (rev 2447) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-19 21:11:01 UTC (rev 2448) @@ -283,5 +283,3 @@ // dummy function. reimplemented in BoardView void ThreadListView::deleteLog(const KUrl&) {} - -#include "threadlistview.moc" From svnnotify ¡÷ sourceforge.jp Mon Jul 20 06:24:02 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 06:24:02 +0900 Subject: [Kita-svn] [2449] remove init() Message-ID: <1248038642.172230.2808.nullmailer@users.sourceforge.jp> Revision: 2449 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2449 Author: nogu Date: 2009-07-20 06:24:02 +0900 (Mon, 20 Jul 2009) Log Message: ----------- remove init() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.h kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-19 21:24:02 UTC (rev 2449) @@ -54,10 +54,6 @@ m_changed = false; } -void AbonePrefPage::init() -{ -} - void AbonePrefPage::reset() { } Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -25,7 +25,6 @@ public: AbonePrefPage(QWidget *parent = 0); void apply(); - void init(); void reset(); private slots: Modified: kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -21,7 +21,6 @@ public: explicit AbstractPrefPage(QWidget* parent = 0); virtual void apply() = 0; - virtual void init() = 0; virtual void reset() = 0; signals: Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp 2009-07-19 21:24:02 UTC (rev 2449) @@ -18,8 +18,8 @@ AsciiArtPrefPage::AsciiArtPrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); - init(); - + asciiArtText->setText(AsciiArtConfig::asciiArtList().join("\n")); + asciiArtText->setFont(Config::threadFont()); connect(asciiArtText, SIGNAL(textChanged()), SIGNAL(changed())); } @@ -31,12 +31,6 @@ AsciiArtConfig::setAsciiArtList(list); } -void AsciiArtPrefPage::init() -{ - asciiArtText->setText(AsciiArtConfig::asciiArtList().join("\n")); - asciiArtText->setFont(Config::threadFont()); -} - void AsciiArtPrefPage::reset() { } Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -23,7 +23,6 @@ public: AsciiArtPrefPage(QWidget* parent = 0); void apply(); - void init(); void reset(); }; } Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-19 21:24:02 UTC (rev 2449) @@ -40,12 +40,18 @@ popupColorButton->setColor(Config::popupColor()); popupBackgroundColorButton->setColor(Config::popupBackground()); - connect(threadColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); - connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); - connect(threadColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); - connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SLOT(slotColorChanged())); - connect(popupColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); - connect(popupBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); + connect(threadColorButton, SIGNAL(changed(const QColor&)), + SIGNAL(changed())); + connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), + SIGNAL(changed())); + connect(threadColorButton, SIGNAL(changed(const QColor&)), + SLOT(slotColorChanged())); + connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), + SLOT(slotColorChanged())); + connect(popupColorButton, SIGNAL(changed(const QColor&)), + SIGNAL(changed())); + connect(popupBackgroundColorButton, SIGNAL(changed(const QColor&)), + SIGNAL(changed())); } void FacePrefPage::apply() @@ -74,10 +80,6 @@ Config::setPopupBackground(popupBackgroundColorButton->color()); } -void FacePrefPage::init() -{ -} - void FacePrefPage::reset() { // font Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -26,7 +26,6 @@ public: FacePrefPage(QWidget* parent = 0); void apply(); - void init(); void reset(); private slots: Modified: kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp 2009-07-19 21:24:02 UTC (rev 2449) @@ -15,17 +15,12 @@ LoginPrefPage::LoginPrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); - init(); } void LoginPrefPage::apply() { } -void LoginPrefPage::init() -{ -} - void LoginPrefPage::reset() { } Modified: kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -22,7 +22,6 @@ public: LoginPrefPage(QWidget* parent = 0); void apply(); - void init(); void reset(); }; } Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 21:24:02 UTC (rev 2449) @@ -95,10 +95,3 @@ accept(); } - -void Preferences::slotCurrentPageChanged() -{ - AbstractPrefPage* page = qobject_cast(currentPage()); - if (page) - page->init(); -} Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -44,7 +44,6 @@ void slotApply(); void slotOk(); void slotDefault(); - void slotCurrentPageChanged(); signals: void fontChanged(const QFont&); Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp 2009-07-19 21:24:02 UTC (rev 2449) @@ -17,17 +17,14 @@ UIPrefPage::UIPrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); - connect(editFileAssociation, SIGNAL(leftClickedUrl()), SLOT(slotEditFileAssociation())); + connect(editFileAssociation, SIGNAL(leftClickedUrl()), + SLOT(slotEditFileAssociation())); } void UIPrefPage::apply() { } -void UIPrefPage::init() -{ -} - void UIPrefPage::reset() { kcfg_AlwaysUseTab->setChecked(true); Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -22,7 +22,6 @@ public: UIPrefPage(QWidget* parent = 0); void apply(); - void init(); void reset(); private slots: Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-19 21:24:02 UTC (rev 2449) @@ -15,17 +15,12 @@ WritePrefPage::WritePrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); - init(); } void WritePrefPage::apply() { } -void WritePrefPage::init() -{ -} - void WritePrefPage::reset() { } Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h 2009-07-19 21:11:01 UTC (rev 2448) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h 2009-07-19 21:24:02 UTC (rev 2449) @@ -22,7 +22,6 @@ public: WritePrefPage(QWidget* parent = 0); void apply(); - void init(); void reset(); }; } From svnnotify ¡÷ sourceforge.jp Mon Jul 20 06:36:49 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 06:36:49 +0900 Subject: [Kita-svn] [2450] fixuifiles Message-ID: <1248039409.631781.21307.nullmailer@users.sourceforge.jp> Revision: 2450 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2450 Author: nogu Date: 2009-07-20 06:36:49 +0900 (Mon, 20 Jul 2009) Log Message: ----------- fixuifiles Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui kita/branches/KITA-KDE4/kita/src/threadproperty.ui kita/branches/KITA-KDE4/kita/src/writedialogbase.ui Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -12,9 +12,6 @@ 480 - - Form1 - Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -9,9 +9,6 @@ 480 - - Form1 - Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -10,9 +10,6 @@ 508 - - Form1 - Modified: kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -12,9 +12,6 @@ 484 - - Form1 - @@ -77,9 +74,6 @@ enables &auto login - - Alt+A - Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -10,9 +10,6 @@ 534 - - Form1 - Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -12,9 +12,6 @@ 480 - - Form1 - Modified: kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -10,9 +10,6 @@ 483 - - Form2 - 0 Modified: kita/branches/KITA-KDE4/kita/src/threadproperty.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -12,9 +12,6 @@ 719 - - Form1 - Modified: kita/branches/KITA-KDE4/kita/src/writedialogbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-19 21:24:02 UTC (rev 2449) +++ kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-19 21:36:49 UTC (rev 2450) @@ -108,9 +108,6 @@ &sage - - Alt+S - @@ -118,9 +115,6 @@ &be - - Alt+B - From svnnotify ¡÷ sourceforge.jp Mon Jul 20 06:52:09 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 06:52:09 +0900 Subject: [Kita-svn] [2451] use KDE classes instead of Qt classes Message-ID: <1248040329.285246.13242.nullmailer@users.sourceforge.jp> Revision: 2451 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2451 Author: nogu Date: 2009-07-20 06:52:09 +0900 (Mon, 20 Jul 2009) Log Message: ----------- use KDE classes instead of Qt classes Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui kita/branches/KITA-KDE4/kita/src/writedialogbase.ui Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefbase.ui 2009-07-19 21:52:09 UTC (rev 2451) @@ -12,7 +12,7 @@ - + 0 @@ -310,4 +310,11 @@ + + + KTabWidget + QTabWidget +
ktabwidget.h
+
+
Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui 2009-07-19 21:36:49 UTC (rev 2450) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefbase.ui 2009-07-19 21:52:09 UTC (rev 2451) @@ -219,7 +219,7 @@
- + @@ -256,6 +256,11 @@ QLabel
kurllabel.h
+ + KLineEdit + QLineEdit +
klineedit.h
+
kurllabel.h Modified: kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui 2009-07-19 21:36:49 UTC (rev 2450) +++ kita/branches/KITA-KDE4/kita/src/threadlistviewbase.ui 2009-07-19 21:52:09 UTC (rev 2451) @@ -20,7 +20,7 @@ - + 0 @@ -122,4 +122,11 @@ + + + KComboBox + QComboBox +
kcombobox.h
+
+
Modified: kita/branches/KITA-KDE4/kita/src/writedialogbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-19 21:36:49 UTC (rev 2450) +++ kita/branches/KITA-KDE4/kita/src/writedialogbase.ui 2009-07-19 21:52:09 UTC (rev 2451) @@ -120,7 +120,7 @@
- + body @@ -131,7 +131,7 @@ - + @@ -207,5 +207,10 @@ QTextEdit
ktextedit.h
+ + KTabWidget + QTabWidget +
ktabwidget.h
+
From svnnotify ¡÷ sourceforge.jp Mon Jul 20 07:03:20 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 07:03:20 +0900 Subject: [Kita-svn] [2452] xmllint Message-ID: <1248041000.804345.29247.nullmailer@users.sourceforge.jp> Revision: 2452 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2452 Author: nogu Date: 2009-07-20 07:03:20 +0900 (Mon, 20 Jul 2009) Log Message: ----------- xmllint Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfg kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfg kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg Modified: kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfg 2009-07-19 21:52:09 UTC (rev 2451) +++ kita/branches/KITA-KDE4/kita/src/libkita/abone.kcfg 2009-07-19 22:03:20 UTC (rev 2452) @@ -1,5 +1,8 @@ - + Modified: kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfg 2009-07-19 21:52:09 UTC (rev 2451) +++ kita/branches/KITA-KDE4/kita/src/libkita/asciiart.kcfg 2009-07-19 22:03:20 UTC (rev 2452) @@ -1,5 +1,8 @@ - + Modified: kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-19 21:52:09 UTC (rev 2451) +++ kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-19 22:03:20 UTC (rev 2452) @@ -1,5 +1,8 @@ - + From svnnotify ¡÷ sourceforge.jp Mon Jul 20 07:13:30 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 07:13:30 +0900 Subject: [Kita-svn] [2453] fix typo Message-ID: <1248041610.103988.13037.nullmailer@users.sourceforge.jp> Revision: 2453 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2453 Author: nogu Date: 2009-07-20 07:13:30 +0900 (Mon, 20 Jul 2009) Log Message: ----------- fix typo Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-19 22:03:20 UTC (rev 2452) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.cpp 2009-07-19 22:13:30 UTC (rev 2453) @@ -41,7 +41,7 @@ TabWidgetBase::~TabWidgetBase() { - /* romove parts */ + /* remove parts */ if (m_manager && !(m_manager->parts().isEmpty())) { KParts::Part * part; while ((part = m_manager->parts().first()) != 0) { From svnnotify ¡÷ sourceforge.jp Mon Jul 20 07:19:27 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 07:19:27 +0900 Subject: [Kita-svn] [2454] remove a connection Message-ID: <1248041967.951997.24950.nullmailer@users.sourceforge.jp> Revision: 2454 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2454 Author: nogu Date: 2009-07-20 07:19:27 +0900 (Mon, 20 Jul 2009) Log Message: ----------- remove a connection Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 22:13:30 UTC (rev 2453) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-19 22:19:27 UTC (rev 2454) @@ -56,9 +56,6 @@ connect(m_loginPage, SIGNAL(changed()), SLOT(slotChanged())); connect(m_writePage, SIGNAL(changed()), SLOT(slotChanged())); - connect(this, - SIGNAL(currentPageChanged(KPageWidgetItem*, KPageWidgetItem*)), - SLOT(slotCurrentPageChanged())); connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply())); connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); } From svnnotify ¡÷ sourceforge.jp Mon Jul 20 09:44:39 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 09:44:39 +0900 Subject: [Kita-svn] [2455] make a dialog smaller Message-ID: <1248050679.074906.9148.nullmailer@users.sourceforge.jp> Revision: 2455 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2455 Author: nogu Date: 2009-07-20 09:44:38 +0900 (Mon, 20 Jul 2009) Log Message: ----------- make a dialog smaller See: http://techbase.kde.org/Projects/Usability/HIG/Dialogs Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/threadproperty.ui Modified: kita/branches/KITA-KDE4/kita/src/threadproperty.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-19 22:19:27 UTC (rev 2454) +++ kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-20 00:44:38 UTC (rev 2455) @@ -1,561 +1,359 @@ - - - - - Kita::ThreadProperty - - - - 0 - 0 - 793 - 719 - - - - - - 10 - 10 - 110 - 20 - - - - Thread URL - - - false - + + + Kita::ThreadProperty + + + + 0 + 0 + 500 + 365 + + + + + + + Thread URL + + + false + - - - - 130 - 10 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 10 - 40 - 110 - 20 - - - - Dat URL - - - false - + + + + + Dat URL + + + false + - - - - 130 - 40 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 10 - 60 - 770 - 20 - - - - QFrame::HLine - - - QFrame::Sunken - + + + + + QFrame::HLine + + + QFrame::Sunken + - - - - 10 - 80 - 150 - 17 - - - - DatManager's information - - - false - + + + + + DatManager's information + + + false + - - - - 130 - 150 - 650 - 20 - - - - - - - false - + + + + + Thread Name + + + false + - - - - 130 - 120 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 10 - 120 - 110 - 20 - - - - Thread Name - - - false - + + + + + Cache Path + + + false + - - - - 130 - 180 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 130 - 210 - 650 - 20 - - - - - - - false - + + + + + Index Path + + + false + - - - - 130 - 530 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 10 - 360 - 110 - 17 - - - - Thread Name - - - false - + + + + + ResNum + + + false + - - - - 10 - 300 - 770 - 20 - - - - QFrame::HLine - - - QFrame::Sunken - + + + + + + + + false + - - - - 130 - 560 - 650 - 20 - - - - - - - false - + + + + + ReadNum + + + false + - - - - 130 - 360 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 10 - 320 - 130 - 17 - - - - Index file's information - - - false - + + + + + ViewPos + + + false + - - - - 130 - 420 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 130 - 390 - 650 - 20 - - - - - - - false - + + + + + QFrame::HLine + + + QFrame::Sunken + - - - - 10 - 500 - 190 - 17 - - - - "cache" file's info (obsolete) - - - false - + + + + + Index file's information + + + false + - - - - 130 - 450 - 650 - 20 - - - - - - - false - + + + + + Thread Name + + + false + - - - - 10 - 470 - 770 - 20 - - - - QFrame::HLine - - - QFrame::Sunken - + + + + + + + + false + - - - - 130 - 240 - 650 - 20 - - - - - - - false - + + + + + ResNum + + + false + - - - - 130 - 270 - 650 - 20 - - - - - - - false - + + + + + + + + false + - - - - 10 - 150 - 110 - 20 - - - - Cache Path - - - false - + + + + + ReadNum + + + false + - - - - 10 - 180 - 110 - 20 - - - - Index Path - - - false - + + + + + + + + false + - - - - 10 - 270 - 110 - 17 - - - - ViewPos - - - false - + + + + + ViewPos + + + false + - - - - 10 - 390 - 110 - 17 - - - - ResNum - - - false - + + + + + + + + false + - - - - 10 - 420 - 110 - 17 - - - - ReadNum - - - false - + + + + + QFrame::HLine + + + QFrame::Sunken + - - - - 10 - 450 - 110 - 17 - - - - ViewPos - - - false - + + + + + "cache" file's info (obsolete) + + + false + - - - - 10 - 530 - 110 - 17 - - - - ResNum - - - false - + + + + + ResNum + + + false + - - - - 10 - 560 - 110 - 17 - - - - ReadNum - - - false - + + + + + + + + false + - - - - 10 - 210 - 110 - 17 - - - - ResNum - - - false - + + + + + ReadNum + + + false + - - - - 10 - 240 - 110 - 17 - - - - ReadNum - - - false - + + + + + + + + false + - - +
+
+
+ + + From svnnotify ¡÷ sourceforge.jp Mon Jul 20 09:47:34 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 09:47:34 +0900 Subject: [Kita-svn] [2456] remove unnecessary lines Message-ID: <1248050854.503222.11325.nullmailer@users.sourceforge.jp> Revision: 2456 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2456 Author: nogu Date: 2009-07-20 09:47:34 +0900 (Mon, 20 Jul 2009) Log Message: ----------- remove unnecessary lines Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/threadproperty.ui Modified: kita/branches/KITA-KDE4/kita/src/threadproperty.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-20 00:44:38 UTC (rev 2455) +++ kita/branches/KITA-KDE4/kita/src/threadproperty.ui 2009-07-20 00:47:34 UTC (rev 2456) @@ -354,6 +354,4 @@
- - From svnnotify ¡÷ sourceforge.jp Mon Jul 20 19:24:22 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 19:24:22 +0900 Subject: [Kita-svn] [2457] add load() Message-ID: <1248085462.352980.15683.nullmailer@users.sourceforge.jp> Revision: 2457 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2457 Author: nogu Date: 2009-07-20 19:24:22 +0900 (Mon, 20 Jul 2009) Log Message: ----------- add load() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.h kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h Modified: kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-20 10:24:22 UTC (rev 2457) @@ -76,19 +76,19 @@ - black + Qt::black - white + Qt::white - black + Qt::black - yellow + Qt::yellow Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -230,6 +230,7 @@ } Preferences* dialog = new Preferences(this); + dialog->load(); connect(dialog, SIGNAL(fontChanged(const QFont&)), SLOT(setFont(const QFont&))); Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -14,19 +14,14 @@ using namespace Kita; -AbonePrefPage::AbonePrefPage(QWidget *parent) : AbstractPrefPage(parent) +AbonePrefPage::AbonePrefPage(QWidget *parent) +: AbstractPrefPage(parent), m_changed(false) { setupUi(this); - - idAboneText->setText(AboneConfig::aboneIDList().join("\n")); - nameAboneText->setText(AboneConfig::aboneNameList().join("\n")); - wordAboneText->setText(AboneConfig::aboneWordList().join("\n")); - + load(); connect(idAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); connect(nameAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); connect(wordAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); - - m_changed = false; } void AbonePrefPage::slotTextChanged() @@ -54,6 +49,16 @@ m_changed = false; } +void AbonePrefPage::load() +{ + idAboneText->setText(AboneConfig::aboneIDList().join("\n")); + nameAboneText->setText(AboneConfig::aboneNameList().join("\n")); + wordAboneText->setText(AboneConfig::aboneWordList().join("\n")); +} + void AbonePrefPage::reset() { + AboneConfig::self()->useDefaults(true); + load(); + AboneConfig::self()->useDefaults(false); } Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -24,8 +24,9 @@ bool m_changed; public: AbonePrefPage(QWidget *parent = 0); - void apply(); - void reset(); + virtual void apply(); + virtual void load(); + virtual void reset(); private slots: void slotTextChanged(); Modified: kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/abstractprefpage.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -21,6 +21,7 @@ public: explicit AbstractPrefPage(QWidget* parent = 0); virtual void apply() = 0; + virtual void load() = 0; virtual void reset() = 0; signals: Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -18,8 +18,7 @@ AsciiArtPrefPage::AsciiArtPrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); - asciiArtText->setText(AsciiArtConfig::asciiArtList().join("\n")); - asciiArtText->setFont(Config::threadFont()); + load(); connect(asciiArtText, SIGNAL(textChanged()), SIGNAL(changed())); } @@ -31,6 +30,15 @@ AsciiArtConfig::setAsciiArtList(list); } +void AsciiArtPrefPage::load() +{ + asciiArtText->setText(AsciiArtConfig::asciiArtList().join("\n")); + asciiArtText->setFont(Config::threadFont()); +} + void AsciiArtPrefPage::reset() { + AsciiArtConfig::self()->useDefaults(true); + load(); + AsciiArtConfig::self()->useDefaults(false); } Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -22,8 +22,9 @@ Q_OBJECT public: AsciiArtPrefPage(QWidget* parent = 0); - void apply(); - void reset(); + virtual void apply(); + virtual void load(); + virtual void reset(); }; } Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -17,9 +17,11 @@ using namespace Kita; -FacePrefPage::FacePrefPage(QWidget* parent) : AbstractPrefPage(parent) +FacePrefPage::FacePrefPage(QWidget* parent) : AbstractPrefPage(parent), + m_threadFontChanged(false), m_threadColorChanged(false) { setupUi(this); + load(); // font connect(listFontButton, SIGNAL(clicked()), SLOT(slotFontButtonClicked())); @@ -29,17 +31,6 @@ connect(popupFontButton, SIGNAL(clicked()), SLOT(slotPopupFontButtonClicked())); - updateButtons(); - - m_threadFontchanged = false; - m_threadColorChanged = false; - - // color - threadColorButton->setColor(Config::threadColor()); - threadBackgroundColorButton->setColor(Config::threadBackground()); - popupColorButton->setColor(Config::popupColor()); - popupBackgroundColorButton->setColor(Config::popupBackground()); - connect(threadColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), @@ -61,11 +52,11 @@ Config::setFont(font); emit fontChanged(font); - if (m_threadFontchanged) { + if (m_threadFontChanged) { QFont threadFont = threadFontButton->font(); Config::setThreadFont(threadFont); } - m_threadFontchanged = false; + m_threadFontChanged = false; QFont popupFont = popupFontButton->font(); Config::setPopupFont(popupFont); @@ -80,6 +71,29 @@ Config::setPopupBackground(popupBackgroundColorButton->color()); } +void FacePrefPage::load() +{ + // font + QFont font = Config::font(); + listFontButton->setText(fontToString(font)); + listFontButton->setFont(font); + + QFont threadFont = Config::threadFont(); + threadFontButton->setText(fontToString(threadFont)); + threadFontButton->setFont(threadFont); + + QFont popupFont = Config::popupFont(); + popupFontButton->setText(fontToString(popupFont)); + popupFontButton->setFont(popupFont); + + // color + threadColorButton->setColor(Config::threadColor()); + threadBackgroundColorButton->setColor(Config::threadBackground()); + popupColorButton->setColor(Config::popupColor()); + popupBackgroundColorButton->setColor(Config::popupBackground()); + +} + void FacePrefPage::reset() { // font @@ -89,7 +103,7 @@ threadFontButton->setText(fontToString(font)); threadFontButton->setFont(font); - m_threadFontchanged = true; + m_threadFontChanged = true; popupFontButton->setText(fontToString(font)); popupFontButton->setFont(font); @@ -102,21 +116,6 @@ m_threadColorChanged = true; } -void FacePrefPage::updateButtons() -{ - QFont font = Config::font(); - listFontButton->setText(fontToString(font)); - listFontButton->setFont(font); - - QFont threadFont = Config::threadFont(); - threadFontButton->setText(fontToString(threadFont)); - threadFontButton->setFont(threadFont); - - QFont popupFont = Config::popupFont(); - popupFontButton->setText(fontToString(popupFont)); - popupFontButton->setFont(popupFont); -} - void FacePrefPage::slotThreadFontButtonClicked() { QFont threadFont = threadFontButton->font(); @@ -125,7 +124,7 @@ threadFontButton->setText(fontToString(threadFont)); threadFontButton->setFont(threadFont); emit changed(); - m_threadFontchanged = true; + m_threadFontChanged = true; } } Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -20,13 +20,14 @@ { Q_OBJECT - bool m_threadFontchanged; + bool m_threadFontChanged; bool m_threadColorChanged; public: FacePrefPage(QWidget* parent = 0); - void apply(); - void reset(); + virtual void apply(); + virtual void load(); + virtual void reset(); private slots: void slotFontButtonClicked(); @@ -34,9 +35,6 @@ void slotThreadFontButtonClicked(); void slotColorChanged(); - private: - void updateButtons(); - signals: void fontChanged(const QFont&); }; Modified: kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -15,12 +15,17 @@ LoginPrefPage::LoginPrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); + load(); } void LoginPrefPage::apply() { } +void LoginPrefPage::load() +{ +} + void LoginPrefPage::reset() { } Modified: kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/loginprefpage.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -21,8 +21,9 @@ Q_OBJECT public: LoginPrefPage(QWidget* parent = 0); - void apply(); - void reset(); + virtual void apply(); + virtual void load(); + virtual void reset(); }; } Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -29,66 +29,73 @@ // this is the base class for your preferences dialog. it is now // a Treelist dialog.. but there are a number of other // possibilities (including Tab, Swallow, and just Plain) - m_facePage = new FacePrefPage(0); - addPage(m_facePage, i18n("Face"), "view-list-details"); - connect(m_facePage, SIGNAL(fontChanged(const QFont&)), + FacePrefPage* facePage = new FacePrefPage(0); + addPage(facePage, i18n("Face"), "view-list-details"); + connect(facePage, SIGNAL(fontChanged(const QFont&)), SIGNAL(fontChanged(const QFont&))); + connect(facePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(facePage); - m_asciiArtPage = new AsciiArtPrefPage(0); - addPage(m_asciiArtPage, i18n("AsciiArt"), "kita"); + AsciiArtPrefPage* asciiArtPage = new AsciiArtPrefPage(0); + addPage(asciiArtPage, i18n("AsciiArt"), "kita"); + connect(asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(asciiArtPage); - m_uiPage = new UIPrefPage(0); - addPage(m_uiPage, i18n("User Interface"), "configure"); + UIPrefPage* uiPage = new UIPrefPage(0); + addPage(uiPage, i18n("User Interface"), "configure"); + connect(uiPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(uiPage); - m_abonePage = new AbonePrefPage(0); - addPage(m_abonePage, i18n("Abone"), "kita"); + AbonePrefPage* abonePage = new AbonePrefPage(0); + addPage(abonePage, i18n("Abone"), "kita"); + connect(abonePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(abonePage); - m_loginPage = new LoginPrefPage(0); - addPage(m_loginPage, i18n("Login"), "network-connect"); + LoginPrefPage* loginPage = new LoginPrefPage(0); + addPage(loginPage, i18n("Login"), "network-connect"); + connect(loginPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(loginPage); - m_writePage = new WritePrefPage(0); - addPage(m_writePage, i18n("Write"), "document-edit"); + WritePrefPage* writePage = new WritePrefPage(0); + addPage(writePage, i18n("Write"), "document-edit"); + connect(writePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(writePage); +} - connect(m_facePage, SIGNAL(changed()), SLOT(slotChanged())); - connect(m_asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); - connect(m_uiPage, SIGNAL(changed()), SLOT(slotChanged())); - connect(m_abonePage, SIGNAL(changed()), SLOT(slotChanged())); - connect(m_loginPage, SIGNAL(changed()), SLOT(slotChanged())); - connect(m_writePage, SIGNAL(changed()), SLOT(slotChanged())); - - connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply())); - connect(this, SIGNAL(okClicked()), this, SLOT(slotOk())); +void Preferences::load() +{ + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->load(); + } + enableButtonApply(false); } -void Preferences::slotApply() +void Preferences::apply() { - AbstractPrefPage* page = qobject_cast(currentPage()); - if (page) - page->apply(); + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->apply(); + } enableButtonApply(false); } -void Preferences::slotDefault() +void Preferences::reset() { - AbstractPrefPage* page = qobject_cast(currentPage()); - if (page) - page->reset(); - enableButtonApply(true); + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->reset(); + } } -void Preferences::slotChanged() +void Preferences::slotButtonClicked(int button) { - enableButtonApply(true); + if (button == Ok || button == Apply) { + apply(); + } else if (button == Default) { + reset(); + } + KConfigDialog::slotButtonClicked(button); } -void Preferences::slotOk() +void Preferences::slotChanged() { - m_facePage->apply(); - m_asciiArtPage->apply(); - m_uiPage->apply(); - m_abonePage->apply(); - m_loginPage->apply(); - m_writePage->apply(); - - accept(); + enableButtonApply(true); } Modified: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -11,16 +11,13 @@ #ifndef KITAPREFS_H #define KITAPREFS_H +#include + #include namespace Kita { - class AbonePrefPage; - class AsciiArtPrefPage; - class FacePrefPage; - class LoginPrefPage; - class UIPrefPage; - class WritePrefPage; + class AbstractPrefPage; class KDE_EXPORT Preferences : public KConfigDialog { @@ -28,22 +25,18 @@ public: Preferences(QWidget* parent); + void load(); private: + QList m_pageList; + void apply(); + void reset(); Preferences(const Preferences&); Preferences& operator=(const Preferences&); - AbonePrefPage* m_abonePage; - AsciiArtPrefPage* m_asciiArtPage; - FacePrefPage* m_facePage; - LoginPrefPage* m_loginPage; - UIPrefPage* m_uiPage; - WritePrefPage* m_writePage; private slots: + virtual void slotButtonClicked(int button); void slotChanged(); - void slotApply(); - void slotOk(); - void slotDefault(); signals: void fontChanged(const QFont&); Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -17,6 +17,7 @@ UIPrefPage::UIPrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); + load(); connect(editFileAssociation, SIGNAL(leftClickedUrl()), SLOT(slotEditFileAssociation())); } @@ -25,6 +26,10 @@ { } +void UIPrefPage::load() +{ +} + void UIPrefPage::reset() { kcfg_AlwaysUseTab->setChecked(true); Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -21,8 +21,9 @@ Q_OBJECT public: UIPrefPage(QWidget* parent = 0); - void apply(); - void reset(); + virtual void apply(); + virtual void load(); + virtual void reset(); private slots: /// open 'file association setting dialog' Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-20 10:24:22 UTC (rev 2457) @@ -15,12 +15,17 @@ WritePrefPage::WritePrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); + load(); } void WritePrefPage::apply() { } +void WritePrefPage::load() +{ +} + void WritePrefPage::reset() { } Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h 2009-07-20 00:47:34 UTC (rev 2456) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h 2009-07-20 10:24:22 UTC (rev 2457) @@ -21,8 +21,9 @@ Q_OBJECT public: WritePrefPage(QWidget* parent = 0); - void apply(); - void reset(); + virtual void apply(); + virtual void load(); + virtual void reset(); }; } From svnnotify ¡÷ sourceforge.jp Mon Jul 20 19:26:59 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 19:26:59 +0900 Subject: [Kita-svn] [2458] prefs.{cpp,h} -> preferences.{cpp,h} Message-ID: <1248085619.842430.18816.nullmailer@users.sourceforge.jp> Revision: 2458 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2458 Author: nogu Date: 2009-07-20 19:26:59 +0900 (Mon, 20 Jul 2009) Log Message: ----------- prefs.{cpp,h} -> preferences.{cpp,h} Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp kita/branches/KITA-KDE4/kita/src/prefs/preferences.h Removed Paths: ------------- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.h Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-20 10:26:59 UTC (rev 2458) @@ -47,7 +47,7 @@ #include "libkita/favoritethreads.h" #include "libkita/kita_misc.h" #include "libkita/threadinfo.h" -#include "prefs/prefs.h" +#include "prefs/preferences.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-20 10:26:59 UTC (rev 2458) @@ -10,7 +10,7 @@ aboneprefpage.cpp loginprefpage.cpp faceprefpage.cpp - prefs.cpp + preferences.cpp uiprefpage.cpp writeprefpage.cpp) Copied: kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp (from rev 2457, kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp) =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp 2009-07-20 10:26:59 UTC (rev 2458) @@ -0,0 +1,101 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "preferences.h" + +#include "aboneprefpage.h" +#include "asciiartprefpage.h" +#include "faceprefpage.h" +#include "loginprefpage.h" +#include "uiprefpage.h" +#include "writeprefpage.h" +#include "libkita/config_xt.h" + +using namespace Kita; + +Preferences::Preferences(QWidget* parent) + : KConfigDialog(parent, "Kita Preferences", Config::self()) +{ + enableButtonApply(false); + enableButton(Help, false); + + // this is the base class for your preferences dialog. it is now + // a Treelist dialog.. but there are a number of other + // possibilities (including Tab, Swallow, and just Plain) + FacePrefPage* facePage = new FacePrefPage(0); + addPage(facePage, i18n("Face"), "view-list-details"); + connect(facePage, SIGNAL(fontChanged(const QFont&)), + SIGNAL(fontChanged(const QFont&))); + connect(facePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(facePage); + + AsciiArtPrefPage* asciiArtPage = new AsciiArtPrefPage(0); + addPage(asciiArtPage, i18n("AsciiArt"), "kita"); + connect(asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(asciiArtPage); + + UIPrefPage* uiPage = new UIPrefPage(0); + addPage(uiPage, i18n("User Interface"), "configure"); + connect(uiPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(uiPage); + + AbonePrefPage* abonePage = new AbonePrefPage(0); + addPage(abonePage, i18n("Abone"), "kita"); + connect(abonePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(abonePage); + + LoginPrefPage* loginPage = new LoginPrefPage(0); + addPage(loginPage, i18n("Login"), "network-connect"); + connect(loginPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(loginPage); + + WritePrefPage* writePage = new WritePrefPage(0); + addPage(writePage, i18n("Write"), "document-edit"); + connect(writePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(writePage); +} + +void Preferences::load() +{ + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->load(); + } + enableButtonApply(false); +} + +void Preferences::apply() +{ + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->apply(); + } + enableButtonApply(false); +} + +void Preferences::reset() +{ + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->reset(); + } +} + +void Preferences::slotButtonClicked(int button) +{ + if (button == Ok || button == Apply) { + apply(); + } else if (button == Default) { + reset(); + } + KConfigDialog::slotButtonClicked(button); +} + +void Preferences::slotChanged() +{ + enableButtonApply(true); +} Property changes on: kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: kita/branches/KITA-KDE4/kita/src/prefs/preferences.h (from rev 2457, kita/branches/KITA-KDE4/kita/src/prefs/prefs.h) =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/preferences.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/preferences.h 2009-07-20 10:26:59 UTC (rev 2458) @@ -0,0 +1,46 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo ¡÷ users.sourceforge.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITAPREFS_H +#define KITAPREFS_H + +#include + +#include + +namespace Kita +{ + class AbstractPrefPage; + + class KDE_EXPORT Preferences : public KConfigDialog + { + Q_OBJECT + + public: + Preferences(QWidget* parent); + void load(); + + private: + QList m_pageList; + void apply(); + void reset(); + Preferences(const Preferences&); + Preferences& operator=(const Preferences&); + + private slots: + virtual void slotButtonClicked(int button); + void slotChanged(); + + signals: + void fontChanged(const QFont&); + }; +} + +#endif // KITAPREFS_H Property changes on: kita/branches/KITA-KDE4/kita/src/prefs/preferences.h ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-20 10:26:59 UTC (rev 2458) @@ -1,101 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2003 by Hideki Ikemoto * -* ikemo ¡÷ users.sourceforge.jp * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -***************************************************************************/ - -#include "prefs.h" - -#include "aboneprefpage.h" -#include "asciiartprefpage.h" -#include "faceprefpage.h" -#include "loginprefpage.h" -#include "uiprefpage.h" -#include "writeprefpage.h" -#include "libkita/config_xt.h" - -using namespace Kita; - -Preferences::Preferences(QWidget* parent) - : KConfigDialog(parent, "Kita Preferences", Config::self()) -{ - enableButtonApply(false); - enableButton(Help, false); - - // this is the base class for your preferences dialog. it is now - // a Treelist dialog.. but there are a number of other - // possibilities (including Tab, Swallow, and just Plain) - FacePrefPage* facePage = new FacePrefPage(0); - addPage(facePage, i18n("Face"), "view-list-details"); - connect(facePage, SIGNAL(fontChanged(const QFont&)), - SIGNAL(fontChanged(const QFont&))); - connect(facePage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(facePage); - - AsciiArtPrefPage* asciiArtPage = new AsciiArtPrefPage(0); - addPage(asciiArtPage, i18n("AsciiArt"), "kita"); - connect(asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(asciiArtPage); - - UIPrefPage* uiPage = new UIPrefPage(0); - addPage(uiPage, i18n("User Interface"), "configure"); - connect(uiPage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(uiPage); - - AbonePrefPage* abonePage = new AbonePrefPage(0); - addPage(abonePage, i18n("Abone"), "kita"); - connect(abonePage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(abonePage); - - LoginPrefPage* loginPage = new LoginPrefPage(0); - addPage(loginPage, i18n("Login"), "network-connect"); - connect(loginPage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(loginPage); - - WritePrefPage* writePage = new WritePrefPage(0); - addPage(writePage, i18n("Write"), "document-edit"); - connect(writePage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(writePage); -} - -void Preferences::load() -{ - for (int i = 0, j = m_pageList.count(); i < j; i++) { - m_pageList.at(i)->load(); - } - enableButtonApply(false); -} - -void Preferences::apply() -{ - for (int i = 0, j = m_pageList.count(); i < j; i++) { - m_pageList.at(i)->apply(); - } - enableButtonApply(false); -} - -void Preferences::reset() -{ - for (int i = 0, j = m_pageList.count(); i < j; i++) { - m_pageList.at(i)->reset(); - } -} - -void Preferences::slotButtonClicked(int button) -{ - if (button == Ok || button == Apply) { - apply(); - } else if (button == Default) { - reset(); - } - KConfigDialog::slotButtonClicked(button); -} - -void Preferences::slotChanged() -{ - enableButtonApply(true); -} Deleted: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-20 10:26:59 UTC (rev 2458) @@ -1,46 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2003 by Hideki Ikemoto * -* ikemo ¡÷ users.sourceforge.jp * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -***************************************************************************/ - -#ifndef KITAPREFS_H -#define KITAPREFS_H - -#include - -#include - -namespace Kita -{ - class AbstractPrefPage; - - class KDE_EXPORT Preferences : public KConfigDialog - { - Q_OBJECT - - public: - Preferences(QWidget* parent); - void load(); - - private: - QList m_pageList; - void apply(); - void reset(); - Preferences(const Preferences&); - Preferences& operator=(const Preferences&); - - private slots: - virtual void slotButtonClicked(int button); - void slotChanged(); - - signals: - void fontChanged(const QFont&); - }; -} - -#endif // KITAPREFS_H From svnnotify ¡÷ sourceforge.jp Mon Jul 20 19:37:24 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 19:37:24 +0900 Subject: [Kita-svn] [2459] revert Message-ID: <1248086244.107048.3232.nullmailer@users.sourceforge.jp> Revision: 2459 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2459 Author: nogu Date: 2009-07-20 19:37:24 +0900 (Mon, 20 Jul 2009) Log Message: ----------- revert Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg Modified: kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-20 10:26:59 UTC (rev 2458) +++ kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-20 10:37:24 UTC (rev 2459) @@ -76,19 +76,19 @@ - Qt::black + black - Qt::white + white - Qt::black + black - Qt::yellow + yellow From svnnotify ¡÷ sourceforge.jp Mon Jul 20 21:39:41 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Mon, 20 Jul 2009 21:39:41 +0900 Subject: [Kita-svn] [2460] fix bugs in a preference dialog Message-ID: <1248093581.407571.12848.nullmailer@users.sourceforge.jp> Revision: 2460 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2460 Author: nogu Date: 2009-07-20 21:39:41 +0900 (Mon, 20 Jul 2009) Log Message: ----------- fix bugs in a preference dialog Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-20 10:37:24 UTC (rev 2459) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-20 12:39:41 UTC (rev 2460) @@ -15,38 +15,28 @@ using namespace Kita; AbonePrefPage::AbonePrefPage(QWidget *parent) -: AbstractPrefPage(parent), m_changed(false) +: AbstractPrefPage(parent) { setupUi(this); load(); - connect(idAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); - connect(nameAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); - connect(wordAboneText, SIGNAL(textChanged()), SLOT(slotTextChanged())); + connect(idAboneText, SIGNAL(textChanged()), SIGNAL(changed())); + connect(nameAboneText, SIGNAL(textChanged()), SIGNAL(changed())); + connect(wordAboneText, SIGNAL(textChanged()), SIGNAL(changed())); } -void AbonePrefPage::slotTextChanged() -{ - m_changed = true; - emit changed(); -} - void AbonePrefPage::apply() { - if (m_changed) { - QString idText = idAboneText->toPlainText(); - QStringList idList = idText.split('\n'); - AboneConfig::setAboneIDList(idList); + QString idText = idAboneText->toPlainText(); + QStringList idList = idText.split('\n'); + AboneConfig::setAboneIDList(idList); - QString nameText = nameAboneText->toPlainText(); - QStringList nameList = nameText.split('\n'); - AboneConfig::setAboneNameList(nameList); + QString nameText = nameAboneText->toPlainText(); + QStringList nameList = nameText.split('\n'); + AboneConfig::setAboneNameList(nameList); - QString wordText = wordAboneText->toPlainText(); - QStringList wordList = wordText.split('\n'); - AboneConfig::setAboneWordList(wordList); - } - - m_changed = false; + QString wordText = wordAboneText->toPlainText(); + QStringList wordList = wordText.split('\n'); + AboneConfig::setAboneWordList(wordList); } void AbonePrefPage::load() Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-20 10:37:24 UTC (rev 2459) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.h 2009-07-20 12:39:41 UTC (rev 2460) @@ -21,15 +21,11 @@ class AbonePrefPage : public AbstractPrefPage, public Ui::AbonePrefBase { Q_OBJECT - bool m_changed; public: AbonePrefPage(QWidget *parent = 0); virtual void apply(); virtual void load(); virtual void reset(); - - private slots: - void slotTextChanged(); }; } Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-20 10:37:24 UTC (rev 2459) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-20 12:39:41 UTC (rev 2460) @@ -17,8 +17,7 @@ using namespace Kita; -FacePrefPage::FacePrefPage(QWidget* parent) : AbstractPrefPage(parent), - m_threadFontChanged(false), m_threadColorChanged(false) +FacePrefPage::FacePrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); load(); @@ -31,14 +30,11 @@ connect(popupFontButton, SIGNAL(clicked()), SLOT(slotPopupFontButtonClicked())); + // color connect(threadColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); - connect(threadColorButton, SIGNAL(changed(const QColor&)), - SLOT(slotColorChanged())); - connect(threadBackgroundColorButton, SIGNAL(changed(const QColor&)), - SLOT(slotColorChanged())); connect(popupColorButton, SIGNAL(changed(const QColor&)), SIGNAL(changed())); connect(popupBackgroundColorButton, SIGNAL(changed(const QColor&)), @@ -52,21 +48,15 @@ Config::setFont(font); emit fontChanged(font); - if (m_threadFontChanged) { - QFont threadFont = threadFontButton->font(); - Config::setThreadFont(threadFont); - } - m_threadFontChanged = false; + QFont threadFont = threadFontButton->font(); + Config::setThreadFont(threadFont); QFont popupFont = popupFontButton->font(); Config::setPopupFont(popupFont); // color - if (m_threadColorChanged) { - Config::setThreadColor(threadColorButton->color()); - Config::setThreadBackground(threadBackgroundColorButton->color()); - } - m_threadColorChanged = false; + Config::setThreadColor(threadColorButton->color()); + Config::setThreadBackground(threadBackgroundColorButton->color()); Config::setPopupColor(popupColorButton->color()); Config::setPopupBackground(popupBackgroundColorButton->color()); } @@ -96,24 +86,9 @@ void FacePrefPage::reset() { - // font - QFont font; - listFontButton->setText(fontToString(font)); - listFontButton->setFont(font); - - threadFontButton->setText(fontToString(font)); - threadFontButton->setFont(font); - m_threadFontChanged = true; - - popupFontButton->setText(fontToString(font)); - popupFontButton->setFont(font); - - // color - threadColorButton->setColor(Qt::black); - threadBackgroundColorButton->setColor(Qt::white); - popupColorButton->setColor(Qt::black); - popupBackgroundColorButton->setColor(Qt::yellow); - m_threadColorChanged = true; + Config::self()->useDefaults(true); + load(); + Config::self()->useDefaults(false); } void FacePrefPage::slotThreadFontButtonClicked() @@ -124,7 +99,6 @@ threadFontButton->setText(fontToString(threadFont)); threadFontButton->setFont(threadFont); emit changed(); - m_threadFontChanged = true; } } @@ -149,8 +123,3 @@ emit changed(); } } - -void FacePrefPage::slotColorChanged() -{ - m_threadColorChanged = true; -} Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h 2009-07-20 10:37:24 UTC (rev 2459) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.h 2009-07-20 12:39:41 UTC (rev 2460) @@ -19,10 +19,6 @@ class FacePrefPage : public AbstractPrefPage, public Ui::FacePrefBase { Q_OBJECT - - bool m_threadFontChanged; - bool m_threadColorChanged; - public: FacePrefPage(QWidget* parent = 0); virtual void apply(); @@ -33,7 +29,6 @@ void slotFontButtonClicked(); void slotPopupFontButtonClicked(); void slotThreadFontButtonClicked(); - void slotColorChanged(); signals: void fontChanged(const QFont&); Modified: kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp 2009-07-20 10:37:24 UTC (rev 2459) +++ kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp 2009-07-20 12:39:41 UTC (rev 2460) @@ -91,6 +91,7 @@ apply(); } else if (button == Default) { reset(); + return; } KConfigDialog::slotButtonClicked(button); } From svnnotify ¡÷ sourceforge.jp Tue Jul 21 23:17:40 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Tue, 21 Jul 2009 23:17:40 +0900 Subject: [Kita-svn] [2461] use const instead of #define Message-ID: <1248185860.167836.21776.nullmailer@users.sourceforge.jp> Revision: 2461 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2461 Author: nogu Date: 2009-07-21 23:17:39 +0900 (Tue, 21 Jul 2009) Log Message: ----------- use const instead of #define Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/const.h kita/branches/KITA-KDE4/kita/src/htmlpart.h kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/event.h kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h kita/branches/KITA-KDE4/kita/src/threadview.cpp Modified: kita/branches/KITA-KDE4/kita/src/const.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/const.h 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/const.h 2009-07-21 14:17:39 UTC (rev 2461) @@ -1,30 +1,30 @@ #ifndef KITACONST_H #define KITACONST_H -#define DEFAULT_STYLESHEET \ - "body,\n" \ - "body.pop {\n" \ - "}\n" \ - "a.coloredLink:link\n" \ - "{\n" \ - " color: magenta;" \ - "}\n" \ - "div.res_title,\n" \ - "div.pop_res_title {\n" \ - " white-space: nowrap;\n" \ - " padding-bottom: .2em;\n" \ - "}\n" \ - "span.name_noaddr {\n" \ - " color: green;\n" \ - "}\n" \ - "div.res_body,\n" \ - "div.pop_res_body {\n" \ - " margin-left: 3.5em;\n" \ - " padding-bottom: 1.8em;\n" \ - "}\n" \ - "div.kokoyon {\n" \ - " background-color: #CCCCCC;\n" \ - " text-align: center;\n" \ - "}\n" \ - "\n" +const char DEFAULT_STYLESHEET[] = + "body,\n" + "body.pop {\n" + "}\n" + "a.coloredLink:link\n" + "{\n" + " color: magenta;" + "}\n" + "div.res_title,\n" + "div.pop_res_title {\n" + " white-space: nowrap;\n" + " padding-bottom: .2em;\n" + "}\n" + "span.name_noaddr {\n" + " color: green;\n" + "}\n" + "div.res_body,\n" + "div.pop_res_body {\n" + " margin-left: 3.5em;\n" + " padding-bottom: 1.8em;\n" + "}\n" + "div.kokoyon {\n" + " background-color: #CCCCCC;\n" + " text-align: center;\n" + "}\n" + "\n"; #endif Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.h 2009-07-21 14:17:39 UTC (rev 2461) @@ -24,7 +24,7 @@ }; /* ID of user defined event */ -#define EVENT_GotoAnchor (QEvent::User + 100) +const int EVENT_GotoAnchor = QEvent::User + 100; class KUrl; Modified: kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/kitaui/tabwidgetbase.h 2009-07-21 14:17:39 UTC (rev 2461) @@ -29,10 +29,10 @@ } /* ID of user defined event */ -#define EVENT_CloseTab (QEvent::User + 100) -#define EVENT_ShowDock (QEvent::User + 101) -#define EVENT_FitImageToWinEvent (QEvent::User + 102) -#define EVENT_CancelMoszicEvent (QEvent::User + 103) +const int EVENT_CloseTab = QEvent::User + 100; +const int EVENT_ShowDock = QEvent::User + 101; +const int EVENT_FitImageToWinEvent = QEvent::User + 102; +const int EVENT_CancelMoszicEvent = QEvent::User + 103; namespace Kita { Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-21 14:17:39 UTC (rev 2461) @@ -28,8 +28,8 @@ using namespace Kita; -#define RESDAT_DEFAULTSIZE 10 -#define RESDAT_DELTA 1000 +static const int RESDAT_DEFAULTSIZE = 10; +static const int RESDAT_DELTA = 1000; /*------------------------------------------------------*/ Modified: kita/branches/KITA-KDE4/kita/src/libkita/event.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/event.h 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/libkita/event.h 2009-07-21 14:17:39 UTC (rev 2461) @@ -10,7 +10,7 @@ #ifndef KITAEVENT_H #define KITAEVENT_H -#define EVENT_EmitFinigh (QEvent::User + 200) -#define EVENT_DeleteLoader (QEvent::User + 201) +const int EVENT_EmitFinigh = QEvent::User + 200; +const int EVENT_DeleteLoader = QEvent::User + 201; #endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita-utf16.h 2009-07-21 14:17:39 UTC (rev 2461) @@ -11,10 +11,10 @@ #define KITAUTF16_H /* UTF-16 */ -#define UTF16_BRACKET 0xFF1E /* > */ -#define UTF16_0 0xFF10 /* 0 */ -#define UTF16_9 0xFF19 /* 9 */ -#define UTF16_EQ 0xFF1D /* = */ -#define UTF16_COMMA 0xFF0C /* , */ +const int UTF16_BRACKET = 0xFF1E; /* > */ +const int UTF16_0 = 0xFF10; /* 0 */ +const int UTF16_9 = 0xFF19; /* 9 */ +const int UTF16_EQ = 0xFF1D; /* = */ +const int UTF16_COMMA = 0xFF0C; /* , */ #endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita-utf8.h 2009-07-21 14:17:39 UTC (rev 2461) @@ -11,35 +11,35 @@ #define KITAUTF8_H /* UTF-8 japanese strings */ -#define KITAUTF8_ZENSPACE "¡¡" -#define KITAUTF8_EXTRACT "Ãê½Ð" -#define KITAUTF8_NOWRENEW " ¹¹¿·Ã桦¡¦¡¦" -#define KITAUTF8_NOWEXPAND " Ÿ³«Ã桦¡¦¡¦" -#define KITAUTF8_INCACHE "¥­¥ã¥Ã¥·¥åºÑ" -#define KITAUTF8_KOKOYON "¤³¤³¤Þ¤ÇÆɤó¤À" -#define KITAUTF8_KOKOYON2 "¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¤³¤³¤Þ¤ÇÆɤó¤À¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡" -#define KITAUTF8_TEMPLATE "¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¥Æ¥ó¥×¥ì¡¼¥È¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡" -#define KITAUTF8_COLON "¡§" -#define KITAUTF8_BTITLE "ÈÄ´ÇÈÄ" -#define KITAUTF8_NAME "̾Á°¡§" -#define KITAUTF8_SAIGO "ºÇ¸å" -#define KITAUTF8_KOWARE "¤³¤³¤Ï²õ¤ì¤Æ¤¤¤Þ¤¹¡£" -#define KITAUTF8_ABONE "¤¢¤Ü¡¼¤ó" -#define KITAUTF8_GOTO "°ÜÆ°" -#define KITAUTF8_FRAME1 "¨¢" -#define KITAUTF8_FRAME2 "¨§" -#define KITAUTF8_FRAME3 "¨¦" +const char KITAUTF8_ZENSPACE[] = "¡¡"; +const char KITAUTF8_EXTRACT[] = "Ãê½Ð"; +const char KITAUTF8_NOWRENEW[] = " ¹¹¿·Ã桦¡¦¡¦"; +const char KITAUTF8_NOWEXPAND[] = " Ÿ³«Ã桦¡¦¡¦"; +const char KITAUTF8_INCACHE[] = "¥­¥ã¥Ã¥·¥åºÑ"; +const char KITAUTF8_KOKOYON[] = "¤³¤³¤Þ¤ÇÆɤó¤À"; +const char KITAUTF8_KOKOYON2[] = "¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¤³¤³¤Þ¤ÇÆɤó¤À¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡"; +const char KITAUTF8_TEMPLATE[] = "¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¥Æ¥ó¥×¥ì¡¼¥È¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡"; +const char KITAUTF8_COLON[] = "¡§"; +const char KITAUTF8_BTITLE[] = "ÈÄ´ÇÈÄ"; +const char KITAUTF8_NAME[] = "̾Á°¡§"; +const char KITAUTF8_SAIGO[] = "ºÇ¸å"; +const char KITAUTF8_KOWARE[] = "¤³¤³¤Ï²õ¤ì¤Æ¤¤¤Þ¤¹¡£"; +const char KITAUTF8_ABONE[] = "¤¢¤Ü¡¼¤ó"; +const char KITAUTF8_GOTO[] = "°ÜÆ°"; +const char KITAUTF8_FRAME1[] = "¨¢"; +const char KITAUTF8_FRAME2[] = "¨§"; +const char KITAUTF8_FRAME3[] = "¨¦"; -#define KITAUTF8_HEART "?" -#define KITAUTF8_DIA "?" -#define KITAUTF8_CLUB "?" -#define KITAUTF8_SPADE "?" +const char KITAUTF8_HEART[] = "?"; +const char KITAUTF8_DIA[] = "?"; +const char KITAUTF8_CLUB[] = "?"; +const char KITAUTF8_SPADE[] = "?"; /* for writing */ -#define KITAUTF8_WRITEERROR "£Å£Ò£Ò£Ï£Ò" -#define KITAUTF8_WRITETRUE "½ñ¤­¤³¤ß¤Þ¤·¤¿" -#define KITAUTF8_WRITECOOKIE "½ñ¤­¹þ¤ß³Îǧ" -#define KITAUTF8_WRITECOOKIEMSG "Åê¹Æ³Îǧ\n¡¦Åê¹Æ¼Ô¤Ï¡¢Åê¹Æ¤Ë´Ø¤·¤ÆȯÀ¸¤¹¤ëÀÕǤ¤¬Á´¤ÆÅê¹Æ¼Ô¤Ëµ¢¤¹¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n¡¦Åê¹Æ¼Ô¤Ï¡¢ÏÃÂê¤È̵´Ø·¸¤Ê¹­¹ð¤ÎÅê¹Æ¤Ë´Ø¤·¤Æ¡¢Áê±þ¤ÎÈñÍѤò»Ùʧ¤¦¤³¤È¤ò¾µÂú¤·¤Þ¤¹\n¡¦Åê¹Æ¼Ô¤Ï¡¢Åê¹Æ¤µ¤ì¤¿ÆâÍƵڤӤ³¤ì¤Ë´Þ¤Þ¤ì¤ëÃÎŪºâ»º¸¢¡¢¡ÊÃøºî¸¢Ë¡Âè21¾ò¤Ê¤¤¤·Âè28¾ò¤Ëµ¬Äꤵ¤ì¤ë¸¢Íø¤â´Þ¤à¡Ë¤½¤Î¾¤Î¸¢Íø¤Ë¤Ä¤­¡ÊÂè»°¼Ô¤ËÂФ·¤ÆºÆµöÂú¤¹¤ë¸¢Íø¤ò´Þ¤ß¤Þ¤¹¡£¡Ë¡¢·Ç¼¨Èı¿±Ä¼Ô¤ËÂФ·¡¢Ìµ½þ¤Ç¾ùÅϤ¹¤ë¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£¤¿¤À¤·¡¢·Ç¼¨Èı¿±Ä¼Ô¤Ï¡¢Åê¹Æ¼Ô¤ËÂФ·¤ÆÆüËܹñÆâ³°¤Ë¤ª¤¤¤Æ̵½þ¤ÇÈóÆÈÀêŪ¤ËÊ£À½¡¢¸ø½°Á÷¿®¡¢ÈÒÉÛµÚ¤ÓËÝÌõ¤¹¤ë¸¢Íø¤òÅê¹Æ¼Ô¤ËµöÂú¤·¤Þ¤¹¡£¤Þ¤¿¡¢Åê¹Æ¼Ô¤Ï·Ç¼¨Èı¿±Ä¼Ô¤¬»ØÄꤹ¤ëÂè»°¼Ô¤ËÂФ·¤Æ¡¢°ìÀڤθ¢Íø¡ÊÂè»°¼Ô¤ËÂФ·¤ÆºÆµöÂú¤¹¤ë¸¢Íø¤ò´Þ¤ß¤Þ¤¹¡Ë¤òµöÂú¤·¤Ê¤¤¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n¡¦Åê¹Æ¼Ô¤Ï¡¢·Ç¼¨Èı¿±Ä¼Ô¤¢¤ë¤¤¤Ï¤½¤Î»ØÄꤹ¤ë¼Ô¤ËÂФ·¤Æ¡¢Ãøºî¼Ô¿Í³Ê¸¢¤ò°ìÀڹԻȤ·¤Ê¤¤¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n\nÁ´ÀÕǤ¤òÉ餦¤³¤È¤ò¾µÂú¤·¤Æ½ñ¤­¹þ¤ß¤Þ¤¹¤«\n" -#define KITAUTF8_WRITENEWTHREAD "½ñ¤­¹þ¤ß¤Ë´Ø¤·¤ÆÍÍ¡¹¤Ê¥í¥°¾ðÊ󤬵­Ï¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n¸ø½øÎɯ¤ËÈ¿¤·¤¿¤ê¡¢Â¾¿Í¤ËÌÂÏǤò¤«¤±¤ë½ñ¤­¹þ¤ß¤Ï¹µ¤¨¤Æ²¼¤µ¤¤" +const char KITAUTF8_WRITEERROR[] = "£Å£Ò£Ò£Ï£Ò"; +const char KITAUTF8_WRITETRUE[] = "½ñ¤­¤³¤ß¤Þ¤·¤¿"; +const char KITAUTF8_WRITECOOKIE[] = "½ñ¤­¹þ¤ß³Îǧ"; +const char KITAUTF8_WRITECOOKIEMSG[] = "Åê¹Æ³Îǧ\n¡¦Åê¹Æ¼Ô¤Ï¡¢Åê¹Æ¤Ë´Ø¤·¤ÆȯÀ¸¤¹¤ëÀÕǤ¤¬Á´¤ÆÅê¹Æ¼Ô¤Ëµ¢¤¹¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n¡¦Åê¹Æ¼Ô¤Ï¡¢ÏÃÂê¤È̵´Ø·¸¤Ê¹­¹ð¤ÎÅê¹Æ¤Ë´Ø¤·¤Æ¡¢Áê±þ¤ÎÈñÍѤò»Ùʧ¤¦¤³¤È¤ò¾µÂú¤·¤Þ¤¹\n¡¦Åê¹Æ¼Ô¤Ï¡¢Åê¹Æ¤µ¤ì¤¿ÆâÍƵڤӤ³¤ì¤Ë´Þ¤Þ¤ì¤ëÃÎŪºâ»º¸¢¡¢¡ÊÃøºî¸¢Ë¡Âè21¾ò¤Ê¤¤¤·Âè28¾ò¤Ëµ¬Äꤵ¤ì¤ë¸¢Íø¤â´Þ¤à¡Ë¤½¤Î¾¤Î¸¢Íø¤Ë¤Ä¤­¡ÊÂè»°¼Ô¤ËÂФ·¤ÆºÆµöÂú¤¹¤ë¸¢Íø¤ò´Þ¤ß¤Þ¤¹¡£¡Ë¡¢·Ç¼¨Èı¿±Ä¼Ô¤ËÂФ·¡¢Ìµ½þ¤Ç¾ùÅϤ¹¤ë¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£¤¿¤À¤·¡¢·Ç¼¨Èı¿±Ä¼Ô¤Ï¡¢Åê¹Æ¼Ô¤ËÂФ·¤ÆÆüËܹñÆâ³°¤Ë¤ª¤¤¤Æ̵½þ¤ÇÈóÆÈÀêŪ¤ËÊ£À½¡¢¸ø½°Á÷¿®¡¢ÈÒÉÛµÚ¤ÓËÝÌõ¤¹¤ë¸¢Íø¤òÅê¹Æ¼Ô¤ËµöÂú¤·¤Þ¤¹¡£¤Þ¤¿¡¢Åê¹Æ¼Ô¤Ï·Ç¼¨Èı¿±Ä¼Ô¤¬»ØÄꤹ¤ëÂè»°¼Ô¤ËÂФ·¤Æ¡¢°ìÀڤθ¢Íø¡ÊÂè»°¼Ô¤ËÂФ·¤ÆºÆµöÂú¤¹¤ë¸¢Íø¤ò´Þ¤ß¤Þ¤¹¡Ë¤òµöÂú¤·¤Ê¤¤¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n¡¦Åê¹Æ¼Ô¤Ï¡¢·Ç¼¨Èı¿±Ä¼Ô¤¢¤ë¤¤¤Ï¤½¤Î»ØÄꤹ¤ë¼Ô¤ËÂФ·¤Æ¡¢Ãøºî¼Ô¿Í³Ê¸¢¤ò°ìÀڹԻȤ·¤Ê¤¤¤³¤È¤ò¾µÂú¤·¤Þ¤¹¡£\n\nÁ´ÀÕǤ¤òÉ餦¤³¤È¤ò¾µÂú¤·¤Æ½ñ¤­¹þ¤ß¤Þ¤¹¤«\n"; +const char KITAUTF8_WRITENEWTHREAD[] = "½ñ¤­¹þ¤ß¤Ë´Ø¤·¤ÆÍÍ¡¹¤Ê¥í¥°¾ðÊ󤬵­Ï¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n¸ø½øÎɯ¤ËÈ¿¤·¤¿¤ê¡¢Â¾¿Í¤ËÌÂÏǤò¤«¤±¤ë½ñ¤­¹þ¤ß¤Ï¹µ¤¨¤Æ²¼¤µ¤¤"; #endif Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-21 14:17:39 UTC (rev 2461) @@ -24,7 +24,7 @@ #include "kita-utf8.h" #include "kita-utf16.h" -#define KITA_RESDIGIT 4 +static const int KITA_RESDIGIT = 4; using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.h 2009-07-21 14:17:39 UTC (rev 2461) @@ -10,8 +10,6 @@ #ifndef KITATHREADINDEX_H #define KITATHREADINDEX_H -#define USE_INDEX - #include #include Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-20 12:39:41 UTC (rev 2460) +++ kita/branches/KITA-KDE4/kita/src/threadview.cpp 2009-07-21 14:17:39 UTC (rev 2461) @@ -32,7 +32,7 @@ #include "libkita/kita_misc.h" #include "libkita/kita-utf8.h" -#define MAX_LABEL_LENGTH 60 +static const int MAX_LABEL_LENGTH = 60; using namespace Kita; From svnnotify ¡÷ sourceforge.jp Wed Jul 22 22:41:41 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 22 Jul 2009 22:41:41 +0900 Subject: [Kita-svn] [2462] empty lines should be ignored Message-ID: <1248270101.659715.20907.nullmailer@users.sourceforge.jp> Revision: 2462 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2462 Author: nogu Date: 2009-07-22 22:41:41 +0900 (Wed, 22 Jul 2009) Log Message: ----------- empty lines should be ignored Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp Modified: kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-21 14:17:39 UTC (rev 2461) +++ kita/branches/KITA-KDE4/kita/src/prefs/aboneprefpage.cpp 2009-07-22 13:41:41 UTC (rev 2462) @@ -27,15 +27,15 @@ void AbonePrefPage::apply() { QString idText = idAboneText->toPlainText(); - QStringList idList = idText.split('\n'); + QStringList idList = idText.split('\n', QString::SkipEmptyParts); AboneConfig::setAboneIDList(idList); QString nameText = nameAboneText->toPlainText(); - QStringList nameList = nameText.split('\n'); + QStringList nameList = nameText.split('\n', QString::SkipEmptyParts); AboneConfig::setAboneNameList(nameList); QString wordText = wordAboneText->toPlainText(); - QStringList wordList = wordText.split('\n'); + QStringList wordList = wordText.split('\n', QString::SkipEmptyParts); AboneConfig::setAboneWordList(wordList); } From svnnotify ¡÷ sourceforge.jp Wed Jul 22 22:45:50 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Wed, 22 Jul 2009 22:45:50 +0900 Subject: [Kita-svn] [2463] empty() -> isEmpty() Message-ID: <1248270350.171285.26359.nullmailer@users.sourceforge.jp> Revision: 2463 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2463 Author: nogu Date: 2009-07-22 22:45:50 +0900 (Wed, 22 Jul 2009) Log Message: ----------- empty() -> isEmpty() Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-22 13:41:41 UTC (rev 2462) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-22 13:45:50 UTC (rev 2463) @@ -480,7 +480,7 @@ /* public slot */ void HTMLPart::slotGobackAnchor() { - if (m_anchorStack.empty()) return ; + if (m_anchorStack.isEmpty()) return ; QString anc = m_anchorStack.last(); m_anchorStack.pop_back(); @@ -698,7 +698,7 @@ showppm = true; // back - if (!m_anchorStack.empty()) { + if (!m_anchorStack.isEmpty()) { backSubMenu = new KMenu(view()); int i = m_anchorStack.size(); Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-22 13:41:41 UTC (rev 2462) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-22 13:45:50 UTC (rev 2463) @@ -797,10 +797,11 @@ { for (int i = 1; i < (int) m_resDatVec.size(); i++) m_resDatVec[ i ].checkAbone = false; - m_aboneByID = (!AboneConfig::aboneIDList().empty()); - m_aboneByName = (!AboneConfig::aboneNameList().empty()); - m_aboneByBody = (!AboneConfig::aboneWordList().empty()); - m_aboneChain = (m_aboneByID | m_aboneByName | m_aboneByBody) & Config::aboneChain() ; + m_aboneByID = (!AboneConfig::aboneIDList().isEmpty()); + m_aboneByName = (!AboneConfig::aboneNameList().isEmpty()); + m_aboneByBody = (!AboneConfig::aboneWordList().isEmpty()); + m_aboneChain = (m_aboneByID | m_aboneByName | m_aboneByBody) + & Config::aboneChain() ; } Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-22 13:41:41 UTC (rev 2462) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-22 13:45:50 UTC (rev 2463) @@ -70,21 +70,21 @@ // load ascii art AsciiArtConfig::self()->readConfig(); - if (AsciiArtConfig::self()->asciiArtList().empty()) { + if (AsciiArtConfig::self()->asciiArtList().isEmpty()) { loadAsciiArt(); } // load abone lists AboneConfig::self()->readConfig(); - if (AboneConfig::self()->aboneIDList().empty()) { + if (AboneConfig::self()->aboneIDList().isEmpty()) { loadAboneIDList(); } - if (AboneConfig::self()->aboneNameList().empty()) { + if (AboneConfig::self()->aboneNameList().isEmpty()) { loadAboneNameList(); } - if (AboneConfig::self()->aboneWordList().empty()) { + if (AboneConfig::self()->aboneWordList().isEmpty()) { loadAboneWordList(); } From svnnotify ¡÷ sourceforge.jp Thu Jul 23 06:44:40 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 23 Jul 2009 06:44:40 +0900 Subject: [Kita-svn] [2464] implement WriteConfig Message-ID: <1248299080.381135.15572.nullmailer@users.sourceforge.jp> Revision: 2464 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2464 Author: nogu Date: 2009-07-23 06:44:40 +0900 (Thu, 23 Jul 2009) Log Message: ----------- implement WriteConfig Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h kita/branches/KITA-KDE4/kita/src/writeview.cpp Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc Modified: kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt 2009-07-22 13:45:50 UTC (rev 2463) +++ kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt 2009-07-22 21:44:40 UTC (rev 2464) @@ -26,7 +26,11 @@ threadinfo.h threadindex.cpp) -kde4_add_kcfg_files(kita_LIB_SRCS abone.kcfgc asciiart.kcfgc config_xt.kcfgc) +kde4_add_kcfg_files(kita_LIB_SRCS + abone.kcfgc + asciiart.kcfgc + config_xt.kcfgc + write.kcfgc) kde4_add_library(kitautil SHARED ${kita_LIB_SRCS}) Modified: kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-22 13:45:50 UTC (rev 2463) +++ kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-22 21:44:40 UTC (rev 2464) @@ -109,21 +109,6 @@ - - - - - - - false - - - - - - - - Added: kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg 2009-07-22 21:44:40 UTC (rev 2464) @@ -0,0 +1,23 @@ + + + + + + + + + + false + + + + + + + true + + + Added: kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc 2009-07-22 21:44:40 UTC (rev 2464) @@ -0,0 +1,6 @@ +File=write.kcfg +ClassName=WriteConfig +NameSpace=Kita +Singleton=true +Mutators=true +Visibility=KDE_EXPORT Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui 2009-07-22 13:45:50 UTC (rev 2463) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefbase.ui 2009-07-22 21:44:40 UTC (rev 2464) @@ -115,12 +115,4 @@ klineedit.h - - - kcfg_DefaultSage - toggled(bool) - Kita::WritePrefBase - DefaultSageCheckBoxToggled(bool) - - Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-22 13:45:50 UTC (rev 2463) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-22 21:44:40 UTC (rev 2464) @@ -10,22 +10,44 @@ #include "writeprefpage.h" +#include "libkita/write.h" + using namespace Kita; WritePrefPage::WritePrefPage(QWidget* parent) : AbstractPrefPage(parent) { setupUi(this); load(); + connect(kcfg_DefaultSage, SIGNAL(toggled(bool)), SLOT(slotToggled(bool))); } void WritePrefPage::apply() { + WriteConfig::setDefaultName(kcfg_DefaultName->text()); + WriteConfig::setDefaultNameUseAlways( + kcfg_DefaultNameUseAlways->isChecked()); + WriteConfig::setDefaultMail(kcfg_DefaultMail->text()); + WriteConfig::setDefaultSage(kcfg_DefaultSage->isChecked()); } void WritePrefPage::load() { + kcfg_DefaultName->setText(WriteConfig::defaultName()); + kcfg_DefaultNameUseAlways->setChecked(WriteConfig::defaultNameUseAlways()); + kcfg_DefaultMail->setText(WriteConfig::defaultMail()); + bool isSage = WriteConfig::defaultSage(); + kcfg_DefaultMail->setReadOnly(isSage); + kcfg_DefaultSage->setChecked(isSage); } void WritePrefPage::reset() { + WriteConfig::self()->useDefaults(true); + load(); + WriteConfig::self()->useDefaults(false); } + +void WritePrefPage::slotToggled(bool on) +{ + kcfg_DefaultMail->setReadOnly(on); +} Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h 2009-07-22 13:45:50 UTC (rev 2463) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.h 2009-07-22 21:44:40 UTC (rev 2464) @@ -24,6 +24,8 @@ virtual void apply(); virtual void load(); virtual void reset(); + private slots: + void slotToggled(bool on); }; } Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-22 13:45:50 UTC (rev 2463) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-22 21:44:40 UTC (rev 2464) @@ -30,6 +30,7 @@ #include "libkita/kita-utf8.h" #include "libkita/k2ch.h" #include "libkita/machibbs.h" +#include "libkita/write.h" using namespace Kita; @@ -79,16 +80,16 @@ boardNameLabel->setText(BoardManager::boardName(m_datURL)); // setup name field. - nameLine->setText(Config::defaultName()); + nameLine->setText(WriteConfig::defaultName()); QStringList compList = Config::self()->nameCompletionList(); nameLine->completionObject()->setItems(compList); // setup mail field & 'sage' checkbox - if (Config::defaultSage()) { + if (WriteConfig::defaultSage()) { mailLine->setText("sage"); sageBox->setChecked(true); } else { - mailLine->setText(Config::defaultMail()); + mailLine->setText(WriteConfig::defaultMail()); } m_mailswap = ""; From svnnotify ¡÷ sourceforge.jp Thu Jul 23 21:58:22 2009 From: svnnotify ¡÷ sourceforge.jp (svnnotify ¡÷ sourceforge.jp) Date: Thu, 23 Jul 2009 21:58:22 +0900 Subject: [Kita-svn] [2465] - Config -> GlobalConfig, config_xt.{h, kcfg{, c}} -> globalconfig.{h , {kcfg{, c}} Message-ID: <1248353902.208057.5155.nullmailer@users.sourceforge.jp> Revision: 2465 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2465 Author: nogu Date: 2009-07-23 21:58:22 +0900 (Thu, 23 Jul 2009) Log Message: ----------- - Config -> GlobalConfig, config_xt.{h,kcfg{,c}} -> globalconfig.{h,{kcfg{,c}} - Write -> WriteConfig, write.{h,kcfg{,c}} -> writeconfig.{h,{kcfg{,c}} - add ColorConfig - KConfigDialog -> KPageDialog - remove tmpln to avoid a warning Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/main.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.h kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp kita/branches/KITA-KDE4/kita/src/prefs/preferences.h kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp kita/branches/KITA-KDE4/kita/src/respopup.cpp kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/writeview.cpp Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfg kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfg kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfg kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfgc Removed Paths: ------------- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -36,8 +36,8 @@ #include "viewmediator.h" #include "kitaui/listviewitem.h" #include "libkita/boardmanager.h" -#include "libkita/config_xt.h" #include "libkita/favoriteboards.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" using namespace Kita; @@ -94,7 +94,7 @@ * download board list, parse, and write to "board_list" * * @see updateBoardList() - * @see Config::boardListURL() + * @see GlobalConfig::boardListURL() */ bool BBSView::downloadBoardList() { @@ -103,7 +103,7 @@ QList newURLs; QString tmpFile; - QString url = Config::boardListUrl(); + QString url = GlobalConfig::boardListUrl(); if (! KIO::NetAccess::download(url, tmpFile, 0)) { return false; } Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -24,8 +24,8 @@ #include "threadlistviewitem.h" #include "viewmediator.h" #include "libkita/boardmanager.h" -#include "libkita/config_xt.h" #include "libkita/datmanager.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" #include "libkita/thread.h" @@ -151,11 +151,11 @@ } ViewMediator::getInstance()->setMainURLLine(m_boardURL); - switch (Config::listSortOrder()) { - case Config::EnumListSortOrder::Mark: + switch (GlobalConfig::listSortOrder()) { + case GlobalConfig::EnumListSortOrder::Mark: subjectList->sortItems(ColumnMark); break; - case Config::EnumListSortOrder::ID: + case GlobalConfig::EnumListSortOrder::ID: subjectList->sortItems(ColumnId); break; default: @@ -289,7 +289,7 @@ subjectList->item(row, ColumnMarkOrder) ->setText(QString::number((viewPos > 1000) ? Thread_Readed : Thread_Read)); - } else if (since.secsTo(current) < 3600 * Config::markTime()) { + } else if (since.secsTo(current) < 3600 * GlobalConfig::markTime()) { /* new thread */ subjectList->item(row, ColumnMark) ->setIcon(QIcon(SmallIcon("newthread"))); Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -31,8 +31,9 @@ #include "kitaui/htmlview.h" #include "libkita/abone.h" #include "libkita/boardmanager.h" -#include "libkita/config_xt.h" +#include "libkita/colorconfig.h" #include "libkita/datmanager.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" using namespace Kita; @@ -162,10 +163,10 @@ { /* style */ QString style = QString("body { font-size: %1pt; font-family: \"%2\"; color: %3; background-color: %4; }") - .arg(Config::threadFont().pointSize()) - .arg(Config::threadFont().family()) - .arg(Config::threadColor().name()) - .arg(Config::threadBackground().name()); + .arg(GlobalConfig::threadFont().pointSize()) + .arg(GlobalConfig::threadFont().family()) + .arg(ColorConfig::thread().name()) + .arg(ColorConfig::threadBackground().name()); QString text = "