diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/spaste | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/spaste')
-rw-r--r-- | src/modules/spaste/controller.cpp | 28 | ||||
-rw-r--r-- | src/modules/spaste/controller.h | 19 | ||||
-rw-r--r-- | src/modules/spaste/libkvispaste.cpp | 20 | ||||
-rw-r--r-- | src/modules/spaste/libkvispaste.h | 2 |
4 files changed, 35 insertions, 34 deletions
diff --git a/src/modules/spaste/controller.cpp b/src/modules/spaste/controller.cpp index 5a132dbd..a98c8b24 100644 --- a/src/modules/spaste/controller.cpp +++ b/src/modules/spaste/controller.cpp @@ -26,9 +26,9 @@ #include "kvi_app.h" #include "kvi_options.h" -#include <qtimer.h> -#include <qstringlist.h> -#include <qclipboard.h> +#include <tqtimer.h> +#include <tqstringlist.h> +#include <tqclipboard.h> extern KviPointerList<SPasteController> * g_pControllerList; @@ -37,7 +37,7 @@ SPasteController::SPasteController(KviWindow * w,int id) { g_pControllerList->append(this); //m_pWindow = w; - m_pTimer = new QTimer(this); + m_pTimer = new TQTimer(this); } SPasteController::~SPasteController() @@ -57,13 +57,13 @@ SPasteController::~SPasteController() delete m_pClipBuff; } -bool SPasteController::pasteFileInit(QString &fileName) +bool SPasteController::pasteFileInit(TQString &fileName) { if(m_pClipBuff)return false; // can't paste a file while pasting the clipboard if(m_pFile)return false; // can't paste two files at a time - m_pFile = new QFile(fileName); + m_pFile = new TQFile(fileName); if(!m_pFile->open(IO_ReadOnly))return false; - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(pasteFile())); + connect(m_pTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(pasteFile())); m_pTimer->start(KVI_OPTION_UINT(KviOption_uintPasteDelay)); return true; } @@ -71,15 +71,15 @@ bool SPasteController::pasteFileInit(QString &fileName) bool SPasteController::pasteClipboardInit(void) { if(m_pFile)return false; // can't paste clipboard while pasting a file - QString tmp(g_pApp->clipboard()->text()); + TQString tmp(g_pApp->clipboard()->text()); if(m_pClipBuff) { - (*m_pClipBuff) += QStringList::split("\n",tmp,true); + (*m_pClipBuff) += TQStringList::split("\n",tmp,true); } else { - m_pClipBuff = new QStringList(QStringList::split("\n",tmp,true)); + m_pClipBuff = new TQStringList(TQStringList::split("\n",tmp,true)); m_clipBuffIterator = m_pClipBuff->begin(); } - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(pasteClipboard())); + connect(m_pTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(pasteClipboard())); m_pTimer->start(KVI_OPTION_UINT(KviOption_uintPasteDelay)); return true; } @@ -87,11 +87,11 @@ bool SPasteController::pasteClipboardInit(void) void SPasteController::pasteFile(void) { #ifndef COMPILE_USE_QT4 - QString line; + TQString line; if(m_pFile->readLine(line,999) != -1) { if(line.isEmpty()) - line = QChar(KVI_TEXT_RESET); + line = TQChar(KVI_TEXT_RESET); if( (!g_pApp->windowExists(m_pWindow)) || m_pWindow->console()->isNotConnected() ) { m_pFile->close(); @@ -111,7 +111,7 @@ void SPasteController::pasteClipboard(void) if((!g_pApp->windowExists(m_pWindow)) || m_pWindow->console()->isNotConnected() ) delete this; else { - if((*m_clipBuffIterator).isEmpty())(*m_clipBuffIterator) = QChar(KVI_TEXT_RESET); + if((*m_clipBuffIterator).isEmpty())(*m_clipBuffIterator) = TQChar(KVI_TEXT_RESET); m_pWindow->ownMessage((*m_clipBuffIterator).ascii()); // <-- not good :/ ++m_clipBuffIterator; } diff --git a/src/modules/spaste/controller.h b/src/modules/spaste/controller.h index 55aeeaab..a89608ec 100644 --- a/src/modules/spaste/controller.h +++ b/src/modules/spaste/controller.h @@ -25,19 +25,20 @@ #include "kvi_window.h" #include "kvi_string.h" -#include <qobject.h> -#include <qstringlist.h> -#include <qfile.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqfile.h> -class SPasteController : public QObject +class SPasteController : public TQObject { Q_OBJECT + TQ_OBJECT public: SPasteController(KviWindow * w,int id); ~SPasteController(); //bool pasteFileInit(KviStr * fileName); - bool pasteFileInit(QString &fileName); + bool pasteFileInit(TQString &fileName); bool pasteClipboardInit(void); int getId(void){return m_pId;}; KviWindow * window(void){return m_pWindow;}; @@ -47,12 +48,12 @@ protected slots: void pasteClipboard(void); private: - QStringList *m_pClipBuff; - QFile *m_pFile; + TQStringList *m_pClipBuff; + TQFile *m_pFile; int m_pId; KviWindow *m_pWindow; - QTimer *m_pTimer; - QStringList::Iterator m_clipBuffIterator; + TQTimer *m_pTimer; + TQStringList::Iterator m_clipBuffIterator; }; #endif //SPASTE_CONTROLLER_H diff --git a/src/modules/spaste/libkvispaste.cpp b/src/modules/spaste/libkvispaste.cpp index 6b310324..d22fbb70 100644 --- a/src/modules/spaste/libkvispaste.cpp +++ b/src/modules/spaste/libkvispaste.cpp @@ -34,8 +34,8 @@ #include "kvi_options.h" #include "kvi_out.h" -#include <qfile.h> -#include <qclipboard.h> +#include <tqfile.h> +#include <tqclipboard.h> #ifndef COMPILE_ON_WINDOWS #include <unistd.h> @@ -53,7 +53,7 @@ static SPasteController * spaste_find_controller(KviWindow * w) return 0; } -static KviWindow * spaste_kvs_find_window(QString &win, KviKvsModuleCommandCall * c) +static KviWindow * spaste_kvs_find_window(TQString &win, KviKvsModuleCommandCall * c) { KviWindow * w; if(!win.isEmpty())w = g_pApp->findWindow(win); @@ -63,7 +63,7 @@ static KviWindow * spaste_kvs_find_window(QString &win, KviKvsModuleCommandCall c->warning(__tr("Window with ID '%Q' not found"),&win); return 0; } - if((w->type() == KVI_WINDOW_TYPE_CHANNEL) || (w->type() == KVI_WINDOW_TYPE_QUERY) || (w->type() == KVI_WINDOW_TYPE_DCCCHAT))return w; + if((w->type() == KVI_WINDOW_TYPE_CHANNEL) || (w->type() == KVI_WINDOW_TYPE_TQUERY) || (w->type() == KVI_WINDOW_TYPE_DCCCHAT))return w; c->warning(__tr2qs("The specified window (%Q) is not a channel/query/DCC chat"),&win); return 0; } @@ -94,7 +94,7 @@ static KviWindow * spaste_kvs_find_window(QString &win, KviKvsModuleCommandCall static bool spaste_kvs_cmd_file(KviKvsModuleCommandCall * c) { - QString szFile,szWindow; + TQString szFile,szWindow; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("file name",KVS_PT_STRING,0,szFile) KVSM_PARAMETER("window",KVS_PT_STRING,KVS_PF_OPTIONAL,szWindow) @@ -109,7 +109,7 @@ static bool spaste_kvs_cmd_file(KviKvsModuleCommandCall * c) return false; } - QFile tmp(szFile); + TQFile tmp(szFile); if(!tmp.open(IO_ReadOnly)) { c->warning(__tr2qs("I can't open that file")); return false; @@ -152,7 +152,7 @@ static bool spaste_kvs_cmd_file(KviKvsModuleCommandCall * c) static bool spaste_kvs_cmd_clipboard(KviKvsModuleCommandCall * c) { - QString szWindow; + TQString szWindow; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("window",KVS_PT_STRING,KVS_PF_OPTIONAL,szWindow) KVSM_PARAMETERS_END(c) @@ -212,9 +212,9 @@ static bool spaste_kvs_cmd_stop(KviKvsModuleCommandCall * c) if(!iId) //Delete all spaste's from the current window { - if((c->window()->type() != KVI_WINDOW_TYPE_CHANNEL) && (c->window()->type() != KVI_WINDOW_TYPE_QUERY) && (c->window()->type() != KVI_WINDOW_TYPE_DCCCHAT)) + if((c->window()->type() != KVI_WINDOW_TYPE_CHANNEL) && (c->window()->type() != KVI_WINDOW_TYPE_TQUERY) && (c->window()->type() != KVI_WINDOW_TYPE_DCCCHAT)) { - QString szWinId = c->window()->id(); + TQString szWinId = c->window()->id(); c->warning(__tr2qs("The specified window (%Q) is not a channel/query/dcc"),&szWinId); return false; } else { @@ -267,7 +267,7 @@ static bool spaste_kvs_cmd_list(KviKvsModuleCommandCall * c) while( (item = it.current()) != 0) { ++it; - QString szWinId = item->window()->id(); + TQString szWinId = item->window()->id(); c->window()->output(KVI_OUT_NONE,__tr2qs("Slow-paste ID:%d Window:%Q"),item->getId(),&szWinId); } return true; diff --git a/src/modules/spaste/libkvispaste.h b/src/modules/spaste/libkvispaste.h index 53724c2d..aa9b3ed6 100644 --- a/src/modules/spaste/libkvispaste.h +++ b/src/modules/spaste/libkvispaste.h @@ -4,7 +4,7 @@ #include "kvi_window.h" typedef struct _SPasteThreadData { - QString * strData; + TQString * strData; KviWindow * win; } SPasteThreadData; |