diff options
Diffstat (limited to 'src/kvirc/kernel/kvi_app.cpp')
-rw-r--r-- | src/kvirc/kernel/kvi_app.cpp | 330 |
1 files changed, 165 insertions, 165 deletions
diff --git a/src/kvirc/kernel/kvi_app.cpp b/src/kvirc/kernel/kvi_app.cpp index 2e66d2ba..3b2944ba 100644 --- a/src/kvirc/kernel/kvi_app.cpp +++ b/src/kvirc/kernel/kvi_app.cpp @@ -86,18 +86,18 @@ #include "kvi_sourcesdate.h" #include "kvi_tal_popupmenu.h" -#include <qsplitter.h> -#include <qstringlist.h> +#include <tqsplitter.h> +#include <tqstringlist.h> #include "kvi_pointerhashtable.h" -#include <qmime.h> +#include <tqmime.h> #ifdef COMPILE_USE_QT4 - #include <q3mimefactory.h> + #include <tq3mimefactory.h> #endif #include "kvi_tal_listbox.h" -#include <qclipboard.h> -#include <qmessagebox.h> -#include <qtextcodec.h> -#include <qmetaobject.h> +#include <tqclipboard.h> +#include <tqmessagebox.h> +#include <tqtextcodec.h> +#include <tqmetaobject.h> #ifdef COMPILE_SSL_SUPPORT #include "kvi_ssl.h" @@ -105,14 +105,14 @@ #ifdef COMPILE_USE_QT4 #ifdef COMPILE_ON_WINDOWS -#include <QPluginLoader> +#include <TQPluginLoader> #endif #endif #ifdef COMPILE_USE_QT4 - #include <QTextDocument> + #include <TQTextDocument> #else - #include <qstylesheet.h> + #include <tqstylesheet.h> #endif KVIRC_API KviApp * g_pApp = 0; // global application pointer @@ -126,8 +126,8 @@ KVIRC_API KviProxyDataBase * g_pProxyDataBase = 0; KVIRC_API KviColorWindow * g_pColorWindow = 0; KVIRC_API KviTextIconWindow * g_pTextIconWindow = 0; KVIRC_API KviTalPopupMenu * g_pInputPopup = 0; -KVIRC_API QStringList * g_pRecentTopicList = 0; -//KVIRC_API QStringList * g_pBookmarkList = 0; +KVIRC_API TQStringList * g_pRecentTopicList = 0; +//KVIRC_API TQStringList * g_pBookmarkList = 0; KVIRC_API KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict = 0; KVIRC_API KviMediaManager * g_pMediaManager = 0; //KVIRC_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase = 0; @@ -147,8 +147,8 @@ KVIRC_API KviSplashScreen * g_pSplashScreen = 0; // Loaded and destroyed by KviIconManager -QPixmap * g_pUserChanStatePixmap = 0; -QPixmap * g_pActivityMeterPixmap = 0; +TQPixmap * g_pUserChanStatePixmap = 0; +TQPixmap * g_pActivityMeterPixmap = 0; #ifdef COMPILE_PSEUDO_TRANSPARENCY @@ -158,16 +158,16 @@ QPixmap * g_pActivityMeterPixmap = 0; #include <netwm.h> #include <kimageeffect.h> #include <dcopclient.h> - #include <qdatastream.h> - #include <qcstring.h> + #include <tqdatastream.h> + #include <tqcstring.h> KSharedPixmap * g_pKdeDesktopBackground = 0; // the shared pixmap that we get from KWin #endif - #include <qimage.h> + #include <tqimage.h> - KVIRC_API QPixmap * g_pShadedParentGlobalDesktopBackground = 0; // the pixmap that we use for MdiManager - KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground = 0; // the pixmap that we use for MdiChild + KVIRC_API TQPixmap * g_pShadedParentGlobalDesktopBackground = 0; // the pixmap that we use for MdiManager + KVIRC_API TQPixmap * g_pShadedChildGlobalDesktopBackground = 0; // the pixmap that we use for MdiChild #endif #ifdef COMPILE_CRYPT_SUPPORT @@ -180,7 +180,7 @@ KviApp::KviApp(int &argc,char ** argv) { // Ok...everything begins here g_pApp = this; - m_szConfigFile = QString::null; + m_szConfigFile = TQString(); m_bCreateConfig = false; m_bShowSplashScreen = true; m_bUpdateGuiPending = false; @@ -226,9 +226,9 @@ void KviApp::setup() #ifdef COMPILE_USE_QT4 #ifdef COMPILE_ON_WINDOWS //need to load image plugins:( - QString szPluginsDir; + TQString szPluginsDir; getGlobalKvircDirectory(szPluginsDir,None,"qt-plugins/"); - setLibraryPaths(QStringList(szPluginsDir)); + tqsetLibraryPaths(TQStringList(szPluginsDir)); //KviMessageBox::information(libraryPaths().join(";")); //debug("%1",loader.isLoaded()); #endif @@ -237,7 +237,7 @@ void KviApp::setup() // check if we want to permanently disable the splash screen // we do it once for every version: the user should see the new splash screens at least once - QString szSplashDisableFile; + TQString szSplashDisableFile; getLocalKvircDirectory(szSplashDisableFile,Pics,"disable-splash." KVI_VERSION); if(KviFileUtils::fileExists(szSplashDisableFile)) @@ -252,11 +252,11 @@ void KviApp::setup() // Make sure that the C strings are translated to utf8 // This is a fallback solution anyway: we should use the appropriate // encoding every time. - QTextCodec::setCodecForCStrings(KviLocale::codecForName("UTF-8")); + TQTextCodec::setCodecForCStrings(KviLocale::codecForName("UTF-8")); // Set the default help files search path - QStringList list; - QString tmp; + TQStringList list; + TQString tmp; getLocalKvircDirectory(tmp,Help); // localized help/lang or help if help/lang doesn't exist list.append(tmp); getLocalKvircDirectory(tmp,HelpEN); // help/en @@ -272,7 +272,7 @@ void KviApp::setup() #ifdef COMPILE_USE_QT4 Q3MimeSourceFactory::defaultFactory()->setFilePath(list); #else - QMimeSourceFactory::defaultFactory()->setFilePath(list); + TQMimeSourceFactory::defaultFactory()->setFilePath(list); #endif KVI_SPLASH_SET_PROGRESS(1) @@ -395,8 +395,8 @@ void KviApp::setup() KVI_SPLASH_SET_PROGRESS(80) // load the recent data lists - g_pRecentTopicList = new QStringList(); - //g_pBookmarkList = new QStringList(); + g_pRecentTopicList = new TQStringList(); + //g_pBookmarkList = new TQStringList(); loadRecentEntries(); KVI_SPLASH_SET_PROGRESS(81) @@ -476,14 +476,14 @@ void KviApp::setup() KviDoubleBuffer::init(); #ifdef COMPILE_USE_QT4 - QString szStylesheetFile; + TQString szStylesheetFile; getGlobalKvircDirectory(szStylesheetFile,Config,"style.css"); if(KviFileUtils::fileExists(szStylesheetFile)) { - QString szStyleData; + TQString szStyleData; KviFileUtils::readFile(szStylesheetFile,szStyleData); - szStyleData.replace("global://",m_szGlobalKvircDir); - szStyleData.replace("local://",m_szLocalKvircDir); + szStyleData.tqreplace("global://",m_szGlobalKvircDir); + szStyleData.tqreplace("local://",m_szLocalKvircDir); setStyleSheet(szStyleData); } #endif @@ -656,12 +656,12 @@ int KviApp::getGloballyUniqueId() typedef struct _NotifierMessageSupaDupaParameterStruct { KviWindow * pWindow; - QString szIcon; - QString szMessage; + TQString szIcon; + TQString szMessage; unsigned int uMessageLifetime; // 0 means no hide } NotifierMessageSupaDupaParameterStruct; -void KviApp::notifierMessage(KviWindow * pWnd,int iIconId,const QString &szMsg,unsigned int uMessageLifetime) +void KviApp::notifierMessage(KviWindow * pWnd,int iIconId,const TQString &szMsg,unsigned int uMessageLifetime) { KviModule * m = g_pModuleManager->getModule("notifier"); if(!m)return; @@ -675,15 +675,15 @@ void KviApp::notifierMessage(KviWindow * pWnd,int iIconId,const QString &szMsg,u m->ctrl("notifier::message",(void *)&s); } -QTextCodec * KviApp::defaultTextCodec() +TQTextCodec * KviApp::defaultTextCodec() { - QTextCodec * c = 0; + TQTextCodec * c = 0; if(!KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding).isEmpty()) { c = KviLocale::codecForName(KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding).latin1()); if(c)return c; } - c = QTextCodec::codecForLocale(); + c = TQTextCodec::codecForLocale(); if(c)return c; c = KviLocale::codecForName("UTF-8"); if(!c)debug("KviApp::defaultTextCodec(): cannot find a suitable text codec for locale :/"); @@ -692,26 +692,26 @@ QTextCodec * KviApp::defaultTextCodec() void KviApp::contextSensitiveHelp() { - // this stuff doesn't work with Qt 4.x + // this stuff doesn't work with TQt 4.x #ifndef COMPILE_USE_QT4 // the F1 Key has been pressed - // try to pass it to the active widget or one of its parents - QWidget * w = g_pApp->focusWidget(); + // try to pass it to the active widget or one of its tqparents + TQWidget * w = g_pApp->tqfocusWidget(); while(w) { - //QVariant v = w->property("contextSensitiveHelp"); <-- this prints a lot of warnings: this is a QT BUG - QMetaObject * o = w->metaObject(); + //TQVariant v = w->property("contextSensitiveHelp"); <-- this prints a lot of warnings: this is a QT BUG + TQMetaObject * o = w->tqmetaObject(); if(o) { - int i = o->findProperty("contextSensitiveHelp",true); + int i = o->tqfindProperty("contextSensitiveHelp",true); if(i != -1) { - QVariant v = w->property("contextSensitiveHelp"); + TQVariant v = w->property("contextSensitiveHelp"); if(v.isValid() && v.toBool()) return; // done! } } - w = w->parentWidget(); + w = w->tqparentWidget(); } // no way // FIXME: just show up simple plain online help @@ -720,7 +720,7 @@ void KviApp::contextSensitiveHelp() } -void KviApp::collectGarbage(QObject * garbage) +void KviApp::collectGarbage(TQObject * garbage) { // if(!g_pGarbageCollector)debug("Ops... no garbage collector ?"); g_pGarbageCollector->collect(garbage); @@ -728,17 +728,17 @@ void KviApp::collectGarbage(QObject * garbage) void KviApp::loadDefaultScript() { - QString cmd; + TQString cmd; getGlobalKvircDirectory(cmd,KviApp::DefScript,"default.kvs"); cmd.prepend("parse \""); cmd.append("\""); #ifdef COMPILE_ON_WINDOWS - cmd.replace("\\","\\\\"); + cmd.tqreplace("\\","\\\\"); #endif KviKvsScript::run(cmd,g_pFrame->firstConsole()); // now line up the toolbars (they may get messed while loading the script) #ifndef COMPILE_USE_QT4 - g_pFrame->lineUpDockWindows(); // missing on Qt 4.x + g_pFrame->lineUpDockWindows(); // missing on TQt 4.x #endif } @@ -793,7 +793,7 @@ void KviApp::checkSuggestRestoreDefaultScript() bSuggestedOnce = true; - switch(QMessageBox::question(0,__tr2qs("Installation problems ?"), + switch(TQMessageBox::question(0,__tr2qs("Installation problems ?"), __tr2qs("<b>Ooops...</b><br><br>" \ "<b>There are some reasons that make me think that your KVIrc installation is incomplete.</b><br><br>" \ "I might be wrong, but you seem to miss some of the features that the default KVIrc script provides." \ @@ -831,9 +831,9 @@ void KviApp::checkSuggestRestoreDefaultScript() void KviApp::restoreDefaultScript() { - if(QMessageBox::warning(0,__tr2qs("Restore Default Script - KVIrc"), + if(TQMessageBox::warning(0,__tr2qs("Restore Default Script - KVIrc"), __tr2qs("You are about to restore the default script.<br>This will erase any script changes you have made.<br>Do you wish to proceed?"), - QMessageBox::Yes,QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) != QMessageBox::Yes)return; + TQMessageBox::Yes,TQMessageBox::No|TQMessageBox::Default|TQMessageBox::Escape) != TQMessageBox::Yes)return; KviKvs::clearAliases(); KviKvs::clearAppEvents(); @@ -895,16 +895,16 @@ void KviApp::destroySplashScreen() } -QString KviApp::getClipboardText() +TQString KviApp::getClipboardText() { /* - QString buffer; -#if QT_VERSION >= 300 + TQString buffer; +#if [[[TQT_VERSION IS DEPRECATED]]] >= 300 bool bOldMode = clipboard()->selectionModeEnabled(); clipboard()->setSelectionMode(false); #endif buffer = clipboard()->text(); -#if QT_VERSION >= 300 +#if [[[TQT_VERSION IS DEPRECATED]]] >= 300 if(buffer.isEmpty()) { // lookup the global clipboard @@ -916,8 +916,8 @@ QString KviApp::getClipboardText() return buffer; */ - QString buffer = clipboard()->text(QClipboard::Clipboard); - if(buffer.isEmpty())return clipboard()->text(QClipboard::Selection); + TQString buffer = tqclipboard()->text(TQClipboard::Clipboard); + if(buffer.isEmpty())return tqclipboard()->text(TQClipboard::Selection); return buffer; } @@ -927,10 +927,10 @@ void KviApp::getClipboardText(KviStr &buffer) buffer = getClipboardText(); } -void KviApp::setClipboardText(const QString &str) +void KviApp::setClipboardText(const TQString &str) { /* -#if QT_VERSION >= 300 +#if [[[TQT_VERSION IS DEPRECATED]]] >= 300 if(clipboard()->supportsSelection()) { bool bOldMode = clipboard()->selectionModeEnabled(); @@ -942,17 +942,17 @@ void KviApp::setClipboardText(const QString &str) } else { #endif clipboard()->setText(str); -#if QT_VERSION >= 300 +#if [[[TQT_VERSION IS DEPRECATED]]] >= 300 } #endif*/ - clipboard()->setText(str,QClipboard::Clipboard); - clipboard()->setText(str,QClipboard::Selection); + tqclipboard()->setText(str,TQClipboard::Clipboard); + tqclipboard()->setText(str,TQClipboard::Selection); } void KviApp::setClipboardText(const KviStr &str) { debug("WARNING : KviApp::setClipboardText(const KviStr &) is deprecated!"); - setClipboardText(QString(str.ptr())); + setClipboardText(TQString(str.ptr())); } void KviApp::setAvatarFromOptions() @@ -970,7 +970,7 @@ void KviApp::setAvatarFromOptions() } -void KviApp::setAvatarOnFileReceived(KviConsole * pConsole,const QString &szRemoteUrl,const QString &szNick,const QString &szUser,const QString &szHost) +void KviApp::setAvatarOnFileReceived(KviConsole * pConsole,const TQString &szRemoteUrl,const TQString &szNick,const TQString &szUser,const TQString &szHost) { if(!m_pPendingAvatarChanges) { @@ -993,7 +993,7 @@ void KviApp::setAvatarOnFileReceived(KviConsole * pConsole,const QString &szRemo m_pPendingAvatarChanges->append(p); } -KviPendingAvatarChange * KviApp::findPendingAvatarChange(KviConsole * pConsole,const QString &szNick,const QString &szRemoteUrl) +KviPendingAvatarChange * KviApp::findPendingAvatarChange(KviConsole * pConsole,const TQString &szNick,const TQString &szRemoteUrl) { if(!m_pPendingAvatarChanges)return 0; @@ -1013,7 +1013,7 @@ KviPendingAvatarChange * KviApp::findPendingAvatarChange(KviConsole * pConsole,c return 0; } -void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,const QString &szLocalFileName,const QString &szNick,const QString &szError,bool bQuiet) +void KviApp::fileDownloadTerminated(bool bSuccess,const TQString &szRemoteUrl,const TQString &szLocalFileName,const TQString &szNick,const TQString &szError,bool bQuiet) { KviPendingAvatarChange * p; @@ -1030,7 +1030,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con { if(!g_pActiveWindow)return; if(g_pActiveWindow->hasAttention())return; - QString szMsg; + TQString szMsg; int iIconId; if(!bSuccess) { @@ -1038,7 +1038,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con if(szNick.isEmpty()) szMsg = __tr2qs("File download failed"); else - szMsg = __tr2qs("File download from %1 failed").arg(szNick); + szMsg = __tr2qs("File download from %1 failed").tqarg(szNick); szMsg += ": "; szMsg += szError; szMsg += " ("; @@ -1049,15 +1049,15 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con if(szNick.isEmpty()) szMsg = __tr2qs("File download successfully complete"); else - szMsg = __tr2qs("File download from %1 successfully complete").arg(szNick); + szMsg = __tr2qs("File download from %1 successfully complete").tqarg(szNick); szMsg += " ("; szMsg += szLocalFileName; szMsg += ")"; } #ifdef COMPILE_USE_QT4 - notifierMessage(0,iIconId,Qt::escape(szMsg),30); + notifierMessage(0,iIconId,TQt::escape(szMsg),30); #else - notifierMessage(0,iIconId,QStyleSheet::escape(szMsg),30); + notifierMessage(0,iIconId,TQStyleSheet::escape(szMsg),30); #endif } return; @@ -1068,7 +1068,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con if(windowExists(p->pConsole)) { p->pConsole->setAvatar(p->szNick,p->szUser,p->szHost, - szLocalFileName,KviQString::equalCIN("http://",szRemoteUrl,7) ? szRemoteUrl : QString::null); + szLocalFileName,KviTQString::equalCIN("http://",szRemoteUrl,7) ? szRemoteUrl : TQString()); } } else { if((!_OUTPUT_MUTE) && (!bQuiet)) @@ -1102,7 +1102,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con delete g_pKdeDesktopBackground; g_pKdeDesktopBackground = 0; // this signal shouldn't be connected ,but well.. let's make sure - disconnect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); + disconnect(this,TQT_SIGNAL(backgroundChanged(int)),this,TQT_SLOT(kdeRootPixmapChanged(int))); } g_pKdeDesktopBackground = 0; @@ -1117,10 +1117,10 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con #endif rinfo.activate(); - QString name = QString("DESKTOP%1").arg(rinfo.currentDesktop()); + TQString name = TQString("DESKTOP%1").tqarg(rinfo.currentDesktop()); g_pKdeDesktopBackground = new KSharedPixmap(); - connect(g_pKdeDesktopBackground,SIGNAL(done(bool)),this,SLOT(kdeRootPixmapDownloadComplete(bool))); + connect(g_pKdeDesktopBackground,TQT_SIGNAL(done(bool)),this,TQT_SLOT(kdeRootPixmapDownloadComplete(bool))); if(!(g_pKdeDesktopBackground->isAvailable(name))) { @@ -1131,17 +1131,17 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con // Send a request to kdesktop.... DCOPClient *client = kapp->dcopClient(); if(!client->isAttached())client->attach(); - QByteArray data; - QDataStream args(data,IO_WriteOnly); + TQByteArray data; + TQDataStream args(data,IO_WriteOnly); args << 1; client->send("kdesktop","KBackgroundIface","setExport(int)",data); m_bUpdatePseudoTransparencyPending = true; // Now wait a while and try again.... - QTimer::singleShot(500,this,SLOT(updatePseudoTransparency())); + TQTimer::singleShot(500,this,TQT_SLOT(updatePseudoTransparency())); return; } - if(!g_pKdeDesktopBackground->loadFromShared(QString("DESKTOP%1").arg(rinfo.currentDesktop()))) + if(!g_pKdeDesktopBackground->loadFromShared(TQString("DESKTOP%1").tqarg(rinfo.currentDesktop()))) { debug("Can't load the KDE root background image..."); delete g_pKdeDesktopBackground; @@ -1162,7 +1162,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con g_pKdeDesktopBackground = 0; } // forget the backgroundChanged signal (will do nothing if it is not connected) - disconnect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); + disconnect(this,TQT_SIGNAL(backgroundChanged(int)),this,TQT_SLOT(kdeRootPixmapChanged(int))); #endif //COMPILE_KDE_SUPPORT if(g_pShadedParentGlobalDesktopBackground) { @@ -1180,7 +1180,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con { if(m_bUpdatePseudoTransparencyPending)return; m_bUpdatePseudoTransparencyPending = true; - QTimer::singleShot(0,this,SLOT(updatePseudoTransparency())); + TQTimer::singleShot(0,this,TQT_SLOT(updatePseudoTransparency())); } #ifdef COMPILE_KDE_SUPPORT @@ -1198,7 +1198,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con // (C) 2000 Josef Weidendorfer <weidendo@in.tum.de> // - QImage& kimageeffect_fade(QImage &img,float val,const QColor &color) + TQImage& kimageeffect_fade(TQImage &img,float val,const TQColor &color) { if(img.width() == 0 || img.height() == 0)return img; @@ -1212,7 +1212,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con int green = color.green(); int blue = color.blue(); - QRgb col; + TQRgb col; int r, g, b, cr, cg, cb; if (img.depth() <= 8) @@ -1221,31 +1221,31 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con for(int i=0; i<img.numColors(); i++) { col = img.color(i); - cr = qRed(col); cg = qGreen(col); cb = qBlue(col); + cr = tqRed(col); cg = tqGreen(col); cb = tqBlue(col); if (cr > red)r = cr - tbl[cr - red]; else r = cr + tbl[red - cr]; if (cg > green)g = cg - tbl[cg - green]; else g = cg + tbl[green - cg]; if (cb > blue)b = cb - tbl[cb - blue]; else b = cb + tbl[blue - cb]; - img.setColor(i, qRgb(r, g, b)); + img.setColor(i, tqRgb(r, g, b)); } } else { // truecolor for(int y=0; y<img.height(); y++) { - QRgb *data = (QRgb *) img.scanLine(y); + TQRgb *data = (TQRgb *) img.scanLine(y); for (int x=0; x<img.width(); x++) { col = *data; - cr = qRed(col); cg = qGreen(col); cb = qBlue(col); + cr = tqRed(col); cg = tqGreen(col); cb = tqBlue(col); if (cr > red)r = cr - tbl[cr - red]; else r = cr + tbl[red - cr]; if (cg > green)g = cg - tbl[cg - green]; else g = cg + tbl[green - cg]; if (cb > blue)b = cb - tbl[cb - blue]; else b = cb + tbl[blue - cb]; - *data++ = qRgb(r, g, b); + *data++ = tqRgb(r, g, b); } } } @@ -1254,14 +1254,14 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,con #endif //!COMPILE_KDE_SUPPORT - void KviApp::createGlobalBackgrounds(QPixmap * pix) + void KviApp::createGlobalBackgrounds(TQPixmap * pix) { // create shaded copies... if(g_pShadedParentGlobalDesktopBackground)delete g_pShadedParentGlobalDesktopBackground; if(g_pShadedChildGlobalDesktopBackground)delete g_pShadedChildGlobalDesktopBackground; - g_pShadedParentGlobalDesktopBackground = new QPixmap(); - g_pShadedChildGlobalDesktopBackground = new QPixmap(); - QImage img = pix->convertToImage(); + g_pShadedParentGlobalDesktopBackground = new TQPixmap(); + g_pShadedChildGlobalDesktopBackground = new TQPixmap(); + TQImage img = pix->convertToImage(); // play with the fade factors KVI_OPTION_UINT(KviOption_uintGlobalTransparencyParentFadeFactor) %= 100; if(KVI_OPTION_UINT(KviOption_uintGlobalTransparencyParentFadeFactor) > 0) @@ -1309,9 +1309,9 @@ void KviApp::kdeRootPixmapDownloadComplete(bool bSuccess) // create shaded copies... createGlobalBackgrounds(g_pKdeDesktopBackground); // make sure that this signal is not connected twice - disconnect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); + disconnect(this,TQT_SIGNAL(backgroundChanged(int)),this,TQT_SLOT(kdeRootPixmapChanged(int))); // connect it - connect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); + connect(this,TQT_SIGNAL(backgroundChanged(int)),this,TQT_SLOT(kdeRootPixmapChanged(int))); } delete g_pKdeDesktopBackground; g_pKdeDesktopBackground = 0; @@ -1354,7 +1354,7 @@ void KviApp::triggerUpdateGui() { if(m_bUpdateGuiPending)return; m_bUpdateGuiPending = true; - QTimer::singleShot(0,this,SLOT(updateGui())); + TQTimer::singleShot(0,this,TQT_SLOT(updateGui())); } void KviApp::updateGui() @@ -1368,22 +1368,22 @@ void KviApp::updateApplicationFont() if(KVI_OPTION_BOOL(KviOption_boolUseGlobalApplicationFont)) { if(font() != KVI_OPTION_FONT(KviOption_fontApplication)) - setFont(KVI_OPTION_FONT(KviOption_fontApplication),true); + tqsetFont(KVI_OPTION_FONT(KviOption_fontApplication),true); } // FIXME: #warning "And what if this option is turned off ?...a reboot only" } void KviApp::loadRecentEntries() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_RECENT); KviConfig cfg(tmp,KviConfig::Read); - *g_pRecentTopicList = cfg.readStringListEntry("RecentTopicList",QStringList()); - //*g_pBookmarkList = cfg.readStringListEntry("Bookmarks",QStringList()); + *g_pRecentTopicList = cfg.readStringListEntry("RecentTopicList",TQStringList()); + //*g_pBookmarkList = cfg.readStringListEntry("Bookmarks",TQStringList()); } void KviApp::saveRecentEntries() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_RECENT); KviConfig cfg(tmp,KviConfig::Write); cfg.writeEntry("RecentTopicList",*g_pRecentTopicList); @@ -1392,7 +1392,7 @@ void KviApp::saveRecentEntries() void KviApp::saveAvatarCache() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_AVATARCACHE); KviAvatarCache::instance()->save(tmp); } @@ -1400,14 +1400,14 @@ void KviApp::saveAvatarCache() void KviApp::saveToolBars() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_CUSTOMTOOLBARS); KviCustomToolBarManager::instance()->save(tmp); } void KviApp::savePopups() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_POPUPS); KviKvs::savePopups(tmp); } @@ -1416,7 +1416,7 @@ void KviApp::saveInputHistory() { if(!KVI_OPTION_BOOL(KviOption_boolDisableInputHistory)) { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_INPUTHISTORY); g_pInputHistory->save(tmp); } @@ -1425,14 +1425,14 @@ void KviApp::saveInputHistory() void KviApp::saveAliases() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_ALIASES); KviKvs::saveAliases(tmp); } void KviApp::saveScriptAddons() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_SCRIPTADDONS); KviKvs::saveScriptAddons(tmp); } @@ -1444,21 +1444,21 @@ void KviApp::saveTextIcons() void KviApp::saveAppEvents() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_EVENTS); KviKvs::saveAppEvents(tmp); } void KviApp::saveRawEvents() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_RAWEVENTS); KviKvs::saveRawEvents(tmp); } void KviApp::saveMediaTypes() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_MEDIATYPES); g_pMediaManager->lock(); g_pMediaManager->save(tmp); @@ -1467,56 +1467,56 @@ void KviApp::saveMediaTypes() void KviApp::saveIrcServerDataBase() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_SERVERDB); g_pIrcServerDataBase->save(tmp); } void KviApp::saveProxyDataBase() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_PROXYDB); g_pProxyDataBase->save(tmp); } void KviApp::saveRegisteredUsers() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_REGUSERDB); g_pRegisteredUserDataBase->save(tmp); } void KviApp::saveRegisteredChannels() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_REGCHANDB); g_pRegisteredChannelDataBase->save(tmp); } void KviApp::saveNickServ() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_NICKSERVDATABASE); g_pNickServRuleSet->save(tmp); } void KviApp::saveSharedFiles() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_SHAREDFILES); g_pSharedFilesManager->save(tmp); } void KviApp::saveActions() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_USERACTIONS); KviActionManager::instance()->save(tmp); } void KviApp::saveIdentities() { - QString tmp; + TQString tmp; getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_IDENTITIES); KviUserIdentityManager::instance()->save(tmp); } @@ -1556,7 +1556,7 @@ void KviApp::autoConnectToServers() { for(KviIrcServer * s = l->first();s;s = l->next()) { - QString szCommand = "server -u \"id:"; + TQString szCommand = "server -u \"id:"; if(s->id().isEmpty())s->generateUniqueId(); szCommand += s->id(); szCommand += "\""; @@ -1570,7 +1570,7 @@ void KviApp::autoConnectToServers() { for(KviIrcServerDataBaseRecord * r = lr->first();r;r = lr->next()) { - QString szCommandx = "server -u \"net:"; + TQString szCommandx = "server -u \"net:"; szCommandx += r->network()->name(); szCommandx += "\""; KviKvsScript::run(szCommandx,activeConsole()); @@ -1588,7 +1588,7 @@ void KviApp::createFrame() if(m_szExecAfterStartup.hasData()) { - // FIXME , this should be a QString + // FIXME , this should be a TQString KviKvsScript::run(m_szExecAfterStartup.ptr(),g_pFrame->firstConsole()); m_szExecAfterStartup = ""; } @@ -1652,7 +1652,7 @@ unsigned int KviApp::windowCount() return g_pGlobalWindowDict->count(); } -KviConsole * KviApp::findConsole(QString &server,QString &nick) +KviConsole * KviApp::findConsole(TQString &server,TQString &nick) { KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); @@ -1664,12 +1664,12 @@ KviConsole * KviApp::findConsole(QString &server,QString &nick) { if(!server.isEmpty()) { - if(KviQString::equalCI(server, + if(KviTQString::equalCI(server, ((KviConsole *)it.current())->connection()->currentServerName())) { if(!nick.isEmpty()) { - if(KviQString::equalCI(nick, + if(KviTQString::equalCI(nick, ((KviConsole *)it.current())->connection()->currentNickName())) return ((KviConsole *)it.current()); } else return ((KviConsole *)it.current()); @@ -1677,7 +1677,7 @@ KviConsole * KviApp::findConsole(QString &server,QString &nick) } else { if(!nick.isEmpty()) { - if(KviQString::equalCI(nick, + if(KviTQString::equalCI(nick, ((KviConsole *)it.current())->connection()->currentNickName())) return ((KviConsole *)it.current()); } @@ -1692,8 +1692,8 @@ KviConsole * KviApp::findConsole(QString &server,QString &nick) KviConsole * KviApp::findConsole(KviStr &server,KviStr &nick) { // DEPRECATED: TO BE KILLED (if nobody is using it) - QString s = server.ptr(); - QString n = nick.ptr(); + TQString s = server.ptr(); + TQString n = nick.ptr(); return findConsole(s,n); } @@ -1785,16 +1785,16 @@ KviConsole * KviApp::topmostConnectedConsole() KviWindow * KviApp::findWindow(const char * windowId) { - return g_pGlobalWindowDict->find(windowId); + return g_pGlobalWindowDict->tqfind(windowId); } -KviWindow * KviApp::findWindowByCaption(const QString &windowCaption,int iContextId) +KviWindow * KviApp::findWindowByCaption(const TQString &windowCaption,int iContextId) { KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); while(it.current()) { - if(KviQString::equalCI(windowCaption,it.current()->plainTextCaption()) && + if(KviTQString::equalCI(windowCaption,it.current()->plainTextCaption()) && (iContextId==-1 || it.current()->context()->id() == iContextId)) return it.current(); ++it; @@ -1827,13 +1827,13 @@ KviConsole * KviApp::activeConsole() /////////////////// RECENT STUFF LISTS & POPUPS HANDLING // Helper for KviApp::addRecent*() -static void merge_to_stringlist_option(const QString &item,int iOption,int iMaxEntries) +static void merge_to_stringlist_option(const TQString &item,int iOption,int iMaxEntries) { - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(iOption).begin(); + for(TQStringList::Iterator it = KVI_OPTION_STRINGLIST(iOption).begin(); it != KVI_OPTION_STRINGLIST(iOption).end(); ++it) { // Do a case-insensitive search (for nicknames, servers, and channels) - if(!QString::compare(item.lower(),(*it).lower())) + if(!TQString::compare(item.lower(),(*it).lower())) { // In the recent list, remove and put as first so more recent items // are always first @@ -1848,7 +1848,7 @@ static void merge_to_stringlist_option(const QString &item,int iOption,int iMaxE KVI_OPTION_STRINGLIST(iOption).prepend(item); } -void KviApp::addRecentUrl(const QString& text) +void KviApp::addRecentUrl(const TQString& text) { merge_to_stringlist_option(text,KviOption_stringlistRecentIrcUrls,50); emit(recentUrlsChanged()); @@ -1856,27 +1856,27 @@ void KviApp::addRecentUrl(const QString& text) void KviApp::addRecentNickname(const char * newNick) { - QString nk(newNick); + TQString nk(newNick); merge_to_stringlist_option(nk,KviOption_stringlistRecentNicknames,KVI_MAX_RECENT_NICKNAMES); } -void KviApp::addRecentNickname(const QString& newNick) +void KviApp::addRecentNickname(const TQString& newNick) { merge_to_stringlist_option(newNick,KviOption_stringlistRecentNicknames,KVI_MAX_RECENT_NICKNAMES); } -void KviApp::addRecentChannel(const QString& szChan,const QString& net) +void KviApp::addRecentChannel(const TQString& szChan,const TQString& net) { if(!m_pRecentChannelsDict) buildRecentChannels(); - QStringList* pList=m_pRecentChannelsDict->find(net.utf8().data()); + TQStringList* pList=m_pRecentChannelsDict->tqfind(net.utf8().data()); if(pList) { - if(!pList->contains(szChan)) pList->append(szChan); + if(!pList->tqcontains(szChan)) pList->append(szChan); } else { - pList=new QStringList(szChan); + pList=new TQStringList(szChan); m_pRecentChannelsDict->insert(net.utf8().data(),pList); } } @@ -1885,11 +1885,11 @@ void KviApp::buildRecentChannels() { if(m_pRecentChannelsDict) delete m_pRecentChannelsDict; - m_pRecentChannelsDict = new KviPointerHashTable<const char *,QStringList>; + m_pRecentChannelsDict = new KviPointerHashTable<const char *,TQStringList>; m_pRecentChannelsDict->setAutoDelete(TRUE); - QString szChan,szNet; + TQString szChan,szNet; for ( - QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).begin(); + TQStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).end(); ++it ) @@ -1900,14 +1900,14 @@ void KviApp::buildRecentChannels() szNet = (*it).section( KVI_RECENT_CHANNELS_SEPARATOR, 1 ); if(!szNet.isEmpty()) { - QStringList* pList=m_pRecentChannelsDict->find(szNet.utf8().data()); + TQStringList* pList=m_pRecentChannelsDict->tqfind(szNet.utf8().data()); if(pList) { - if(!pList->contains(szChan)) pList->append(szChan); + if(!pList->tqcontains(szChan)) pList->append(szChan); } else { - pList=new QStringList(szChan); + pList=new TQStringList(szChan); m_pRecentChannelsDict->insert(szNet.utf8().data(),pList); } } @@ -1918,12 +1918,12 @@ void KviApp::buildRecentChannels() void KviApp::saveRecentChannels() { if(!m_pRecentChannelsDict) return; - QString szTmp; + TQString szTmp; KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).clear(); - KviPointerHashTableIterator<const char *,QStringList> it( *m_pRecentChannelsDict ); + KviPointerHashTableIterator<const char *,TQStringList> it( *m_pRecentChannelsDict ); for( ; it.current(); ++it ) { - for ( QStringList::Iterator it_str = it.current()->begin(); it_str != it.current()->end(); ++it_str ) { + for ( TQStringList::Iterator it_str = it.current()->begin(); it_str != it.current()->end(); ++it_str ) { szTmp=*it_str; szTmp.append(KVI_RECENT_CHANNELS_SEPARATOR); szTmp.append(it.currentKey()); @@ -1932,14 +1932,14 @@ void KviApp::saveRecentChannels() } } -QStringList* KviApp::getRecentChannels(const QString& net) +TQStringList* KviApp::getRecentChannels(const TQString& net) { if(!m_pRecentChannelsDict) buildRecentChannels(); - return m_pRecentChannelsDict->find(net.utf8().data()); + return m_pRecentChannelsDict->tqfind(net.utf8().data()); } -void KviApp::addRecentServer(const QString& server) +void KviApp::addRecentServer(const TQString& server) { merge_to_stringlist_option(server,KviOption_stringlistRecentServers,KVI_MAX_RECENT_SERVERS); } @@ -1948,7 +1948,7 @@ void KviApp::fillRecentServersPopup(KviTalPopupMenu * m) { // FIXME: #warning "MAYBE DISABLE THE SERVERS THAT WE ARE ALREADY CONNECTED TO ?" m->clear(); - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).end(); ++it) + for(TQStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).end(); ++it) { m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)),*it); } @@ -1959,14 +1959,14 @@ void KviApp::fillRecentNicknamesPopup(KviTalPopupMenu * m,KviConsole * pConsole) m->clear(); int id; bool bAlreadyFound = false; - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentNicknames).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentNicknames).end(); ++it) + for(TQStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentNicknames).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentNicknames).end(); ++it) { id = m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NICK)),*it); if(!pConsole->isConnected())m->setItemEnabled(id,false); else { if(!bAlreadyFound) { - bool bIsCurrent = KviQString::equalCS(pConsole->connection()->currentNickName(),*it); + bool bIsCurrent = KviTQString::equalCS(pConsole->connection()->currentNickName(),*it); m->setItemEnabled(id,!bIsCurrent); if(bIsCurrent)bAlreadyFound = true; } @@ -1978,10 +1978,10 @@ void KviApp::fillRecentChannelsPopup(KviTalPopupMenu * m,KviConsole * pConsole) { m->clear(); int id; - QStringList* pList=getRecentChannels(pConsole->currentNetworkName()); + TQStringList* pList=getRecentChannels(pConsole->currentNetworkName()); if(pList) { - for(QStringList::Iterator it = pList->begin(); it != pList->end(); ++it) + for(TQStringList::Iterator it = pList->begin(); it != pList->end(); ++it) { id = m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),*it); if(!pConsole->isConnected())m->setItemEnabled(id,false); @@ -1997,7 +1997,7 @@ void KviApp::fillRecentChannelsPopup(KviTalPopupMenu * m,KviConsole * pConsole) void KviApp::fillRecentServersListBox(KviTalListBox * l) { l->clear(); - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).end(); ++it) + for(TQStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).end(); ++it) l->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)),*it); } */ @@ -2017,7 +2017,7 @@ bool KviApp::playFile(const char * filename,KviStr &error,KviWindow * w) if(szCommandline.hasData()) { KviKvsVariantList l; - l.append(new KviKvsVariant(QString(filename))); + l.append(new KviKvsVariant(TQString(filename))); if(!KviKvsScript::run(szCommandline.ptr(),w ? w : g_pActiveWindow,&l)) { @@ -2050,11 +2050,11 @@ void KviApp::heartbeat(kvi_time_t tNow) KviDoubleBuffer::heartbeat(); } -void KviApp::timerEvent(QTimerEvent *e) +void KviApp::timerEvent(TQTimerEvent *e) { if(e->timerId() != m_iHeartbeatTimerId) { - QObject::timerEvent(e); + TQT_BASE_OBJECT_NAME::timerEvent(e); return; } @@ -2065,7 +2065,7 @@ void KviApp::timerEvent(QTimerEvent *e) heartbeat(tNow); } -// qvariant.h uses this , and it is included by the qt generated moc file for Qt >= 3.0.0 +// qvariant.h uses this , and it is included by the qt generated tqmoc file for TQt >= 3.0.0 #ifdef Bool #undef Bool #endif |