diff options
Diffstat (limited to 'kpilot/kpilot/pilotDaemon.cc')
-rw-r--r-- | kpilot/kpilot/pilotDaemon.cc | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/kpilot/kpilot/pilotDaemon.cc b/kpilot/kpilot/pilotDaemon.cc index 6eea2f7e..6541365d 100644 --- a/kpilot/kpilot/pilotDaemon.cc +++ b/kpilot/kpilot/pilotDaemon.cc @@ -33,9 +33,9 @@ #include <stdlib.h> -#include <qtimer.h> -#include <qtooltip.h> -#include <qpixmap.h> +#include <tqtimer.h> +#include <tqtooltip.h> +#include <tqpixmap.h> #include <kuniqueapplication.h> #include <kaboutapplication.h> @@ -89,13 +89,13 @@ PilotDaemonTray::PilotDaemonTray(PilotDaemon * p) : setAcceptDrops(true); } -/* virtual */ void PilotDaemonTray::dragEnterEvent(QDragEnterEvent * e) +/* virtual */ void PilotDaemonTray::dragEnterEvent(TQDragEnterEvent * e) { FUNCTIONSETUP; e->accept(KURLDrag::canDecode(e)); } -/* virtual */ void PilotDaemonTray::dropEvent(QDropEvent * e) +/* virtual */ void PilotDaemonTray::dropEvent(TQDropEvent * e) { FUNCTIONSETUP; @@ -103,7 +103,7 @@ PilotDaemonTray::PilotDaemonTray(PilotDaemon * p) : KURLDrag::decode(e, list); - QStringList files; + TQStringList files; for(KURL::List::ConstIterator it = list.begin(); it != list.end(); ++it) { if ((*it).isLocalFile()) @@ -113,7 +113,7 @@ PilotDaemonTray::PilotDaemonTray(PilotDaemon * p) : daemon->addInstallFiles(files); } -/* virtual */ void PilotDaemonTray::mousePressEvent(QMouseEvent * e) +/* virtual */ void PilotDaemonTray::mousePressEvent(TQMouseEvent * e) { FUNCTIONSETUP; @@ -134,7 +134,7 @@ PilotDaemonTray::PilotDaemonTray(PilotDaemon * p) : } } -/* virtual */ void PilotDaemonTray::closeEvent(QCloseEvent *) +/* virtual */ void PilotDaemonTray::closeEvent(TQCloseEvent *) { FUNCTIONSETUP; daemon->quitNow(); @@ -150,18 +150,18 @@ void PilotDaemonTray::setupWidget() icons[NotListening] = loadIcon( CSL1("nosync") ); slotShowNotListening(); - QTimer::singleShot(2000,this,SLOT(slotShowNormal())); + TQTimer::singleShot(2000,this,TQT_SLOT(slotShowNormal())); KPopupMenu *menu = contextMenu(); menuKPilotItem = menu->insertItem(i18n("Start &KPilot"), daemon, - SLOT(slotRunKPilot())); + TQT_SLOT(slotRunKPilot())); menuConfigureConduitsItem = menu->insertItem(i18n("&Configure KPilot..."), - daemon, SLOT(slotRunConfig())); + daemon, TQT_SLOT(slotRunConfig())); menu->insertSeparator(); fSyncTypeMenu = new KPopupMenu(menu,"sync_type_menu"); - QString once = i18n("Appended to names of sync types to indicate the sync will happen just one time"," (once)"); + TQString once = i18n("Appended to names of sync types to indicate the sync will happen just one time"," (once)"); #define MI(a) fSyncTypeMenu->insertItem( \ SyncAction::SyncMode::name(SyncAction::SyncMode::a) + once, \ (int)(SyncAction::SyncMode::a)); @@ -181,7 +181,7 @@ void PilotDaemonTray::setupWidget() fSyncTypeMenu->setCheckable(true); fSyncTypeMenu->setItemChecked(0,true); #undef MI - connect(fSyncTypeMenu,SIGNAL(activated(int)),daemon,SLOT(requestSync(int))); + connect(fSyncTypeMenu,TQT_SIGNAL(activated(int)),daemon,TQT_SLOT(requestSync(int))); menu->insertItem(i18n("Next &Sync"),fSyncTypeMenu); KHelpMenu *help = new KHelpMenu(menu,aboutData); @@ -257,12 +257,12 @@ void PilotDaemonTray::startHotSync() changeIcon(Busy); if (!fBlinkTimer) { - fBlinkTimer = new QTimer(this,"blink timer"); + fBlinkTimer = new TQTimer(this,"blink timer"); } if (fBlinkTimer) { - connect(fBlinkTimer,SIGNAL(timeout()), - this,SLOT(slotBusyTimer())); + connect(fBlinkTimer,TQT_SIGNAL(timeout()), + this,TQT_SLOT(slotBusyTimer())); fBlinkTimer->start(750,false); } } @@ -290,7 +290,7 @@ PilotDaemon::PilotDaemon() : fLogStub(new LoggerDCOP_stub("kpilot", "LogIface")), fLogFileStub(new LoggerDCOP_stub("kpilotDaemon", "LogIface")), fKPilotStub(new KPilotDCOP_stub("kpilot", "KPilotIface")), - fTempDevice(QString::null) + fTempDevice(TQString::null) { FUNCTIONSETUP; @@ -305,8 +305,8 @@ PilotDaemon::PilotDaemon() : fInstaller = new FileInstaller; fLogFile = new LogFile; - connect(fInstaller, SIGNAL(filesChanged()), - this, SLOT(slotFilesChanged())); + connect(fInstaller, TQT_SIGNAL(filesChanged()), + this, TQT_SLOT(slotFilesChanged())); fNextSyncType.setMode( KPilotSettings::syncType() ); @@ -328,7 +328,7 @@ PilotDaemon::~PilotDaemon() (void) PilotDatabase::instanceCount(); } -void PilotDaemon::addInstallFiles(const QStringList &l) +void PilotDaemon::addInstallFiles(const TQStringList &l) { FUNCTIONSETUP; @@ -406,7 +406,7 @@ void PilotDaemon::showTray() updateTrayStatus(); } -/* DCOP ASYNC */ void PilotDaemon::setTempDevice(QString d) +/* DCOP ASYNC */ void PilotDaemon::setTempDevice(TQString d) { if ( !d.isEmpty() ){ fTempDevice = d; @@ -509,7 +509,7 @@ void PilotDaemon::showTray() } updateTrayStatus(); - logProgress(QString::null,0); + logProgress(TQString::null,0); } /* DCOP */ void PilotDaemon::stopListening() @@ -528,11 +528,11 @@ void PilotDaemon::showTray() fPilotLink->reset(); } -/* DCOP */ QString PilotDaemon::statusString() +/* DCOP */ TQString PilotDaemon::statusString() { FUNCTIONSETUP; - QString s = CSL1("PilotDaemon="); + TQString s = CSL1("PilotDaemon="); s.append(shortStatusString()); s.append(CSL1("; NextSync=")); @@ -548,9 +548,9 @@ void PilotDaemon::showTray() return s; } -/* DCOP */ QString PilotDaemon::shortStatusString() +/* DCOP */ TQString PilotDaemon::shortStatusString() { - QString s; + TQString s; switch (status()) { @@ -594,16 +594,16 @@ bool PilotDaemon::setupPilotLink() return false; } - QObject::connect(fPilotLink, SIGNAL(deviceReady(KPilotLink*)), - this, SLOT(startHotSync(KPilotLink*))); + TQObject::connect(fPilotLink, TQT_SIGNAL(deviceReady(KPilotLink*)), + this, TQT_SLOT(startHotSync(KPilotLink*))); // connect the signals emitted by the pilotDeviceLink - QObject::connect(fPilotLink, SIGNAL(logError(const QString &)), - this, SLOT(logError(const QString &))); - QObject::connect(fPilotLink, SIGNAL(logMessage(const QString &)), - this, SLOT(logMessage(const QString &))); - QObject::connect(fPilotLink, - SIGNAL(logProgress(const QString &,int)), - this, SLOT(logProgress(const QString &,int))); + TQObject::connect(fPilotLink, TQT_SIGNAL(logError(const TQString &)), + this, TQT_SLOT(logError(const TQString &))); + TQObject::connect(fPilotLink, TQT_SIGNAL(logMessage(const TQString &)), + this, TQT_SLOT(logMessage(const TQString &))); + TQObject::connect(fPilotLink, + TQT_SIGNAL(logProgress(const TQString &,int)), + this, TQT_SLOT(logProgress(const TQString &,int))); return true; @@ -631,7 +631,7 @@ bool PilotDaemon::setupPilotLink() fPostSyncAction |= Quit; break; } - emitDCOPSignal( "kpilotDaemonStatusChanged()", QByteArray() ); + emitDCOPSignal( "kpilotDaemonStatusChanged()", TQByteArray() ); } /* DCOP ASYNC */ void PilotDaemon::requestRegularSyncNext() @@ -671,7 +671,7 @@ bool PilotDaemon::setupPilotLink() i18n("Please press the HotSync button.")); } -/* DCOP ASYNC */ void PilotDaemon::requestSyncType(QString s) +/* DCOP ASYNC */ void PilotDaemon::requestSyncType(TQString s) { FUNCTIONSETUP; @@ -712,36 +712,36 @@ bool PilotDaemon::setupPilotLink() /** * DCOP Functions reporting some status data, e.g. for the kontact plugin. */ -QDateTime PilotDaemon::lastSyncDate() +TQDateTime PilotDaemon::lastSyncDate() { return KPilotSettings::lastSyncTime(); } -static QDict<QString> *conduitNameMap = 0L; +static TQDict<TQString> *conduitNameMap = 0L; static void fillConduitNameMap() { if ( !conduitNameMap ) { - conduitNameMap = new QDict<QString>; + conduitNameMap = new TQDict<TQString>; conduitNameMap->setAutoDelete(true); } conduitNameMap->clear(); - QStringList l = KPilotSettings::installedConduits(); + TQStringList l = KPilotSettings::installedConduits(); // Fill with internal settings. if ( l.find( CSL1("internal_fileinstall") ) != l.end() ) { conduitNameMap->insert( CSL1("internal_fileinstall"), - new QString(i18n("File Installer")) ); + new TQString(i18n("File Installer")) ); } - QStringList::ConstIterator end = l.end(); - for (QStringList::ConstIterator i = l.begin(); i != end; ++i) + TQStringList::ConstIterator end = l.end(); + for (TQStringList::ConstIterator i = l.begin(); i != end; ++i) { if (!conduitNameMap->find(*i)) { - QString readableName = CSL1("<unknown>"); + TQString readableName = CSL1("<unknown>"); KSharedPtr < KService > o = KService::serviceByDesktopName(*i); if (!o) { @@ -751,28 +751,28 @@ static void fillConduitNameMap() { readableName = o->name(); } - conduitNameMap->insert( *i, new QString(readableName) ); + conduitNameMap->insert( *i, new TQString(readableName) ); } } } -QStringList PilotDaemon::configuredConduitList() +TQStringList PilotDaemon::configuredConduitList() { fillConduitNameMap(); - QStringList keys; + TQStringList keys; - QDictIterator<QString> it(*conduitNameMap); + TQDictIterator<TQString> it(*conduitNameMap); for ( ; *it; ++it) { keys << it.currentKey(); } keys.sort(); - QStringList::ConstIterator end = keys.end(); - QStringList result; - for (QStringList::ConstIterator i = keys.begin(); i != end; ++i) + TQStringList::ConstIterator end = keys.end(); + TQStringList result; + for (TQStringList::ConstIterator i = keys.begin(); i != end; ++i) { result << *(conduitNameMap->find(*i)); } @@ -780,16 +780,16 @@ QStringList PilotDaemon::configuredConduitList() return result; } -QString PilotDaemon::logFileName() +TQString PilotDaemon::logFileName() { return KPilotSettings::logFileName(); } -QString PilotDaemon::userName() +TQString PilotDaemon::userName() { return KPilotSettings::userName(); } -QString PilotDaemon::pilotDevice() +TQString PilotDaemon::pilotDevice() { return KPilotSettings::pilotDevice(); } @@ -814,8 +814,8 @@ static KDesktopLockStatus isKDesktopLockRunning() return DCOPError; } - QByteArray data,returnValue; - QCString returnType; + TQByteArray data,returnValue; + TQCString returnType; if (!dcopptr->call("kdesktop","KScreensaverIface","isBlanked()", data,returnType,returnValue,true)) @@ -829,7 +829,7 @@ static KDesktopLockStatus isKDesktopLockRunning() if (returnType == "bool") { bool b; - QDataStream reply(returnValue,IO_ReadOnly); + TQDataStream reply(returnValue,IO_ReadOnly); reply >> b; return (b ? Locked : NotLocked); } @@ -918,7 +918,7 @@ static bool isSyncPossible(ActionQueue *fSyncStack, static void queueInstaller(ActionQueue *fSyncStack, KPilotLink *pilotLink, FileInstaller *fInstaller, - const QStringList &c) + const TQStringList &c) { if (c.findIndex(CSL1("internal_fileinstall")) >= 0) { @@ -935,13 +935,13 @@ static void queueEditors(ActionQueue *fSyncStack, KPilotLink *pilotLink) } static void queueConduits(ActionQueue *fSyncStack, - const QStringList &conduits, + const TQStringList &conduits, SyncAction::SyncMode e) { if (conduits.count() > 0) { fSyncStack->queueConduits(conduits,e); - // QString s = i18n("Conduit flags: "); + // TQString s = i18n("Conduit flags: "); // s.append(ConduitProxy::flagsForMode(e).join(CSL1(" "))); // logMessage(s); } @@ -992,8 +992,8 @@ bool PilotDaemon::shouldBackup() FUNCTIONSETUP; bool pcchanged=false; // If last PC to sync was a different one (implies full sync, normally) - QStringList conduits ; // list of conduits to run - QString s; // a generic string for stuff + TQStringList conduits ; // list of conduits to run + TQString s; // a generic string for stuff #ifdef DEBUG DEBUGKPILOT << fname @@ -1107,23 +1107,23 @@ bool PilotDaemon::shouldBackup() launch: fSyncStack->queueCleanup(); - QObject::connect(fSyncStack, SIGNAL(logError(const QString &)), - this, SLOT(logError(const QString &))); - QObject::connect(fSyncStack, SIGNAL(logMessage(const QString &)), - this, SLOT(logMessage(const QString &))); - QObject::connect(fSyncStack, - SIGNAL(logProgress(const QString &,int)), - this, SLOT(logProgress(const QString &,int))); + TQObject::connect(fSyncStack, TQT_SIGNAL(logError(const TQString &)), + this, TQT_SLOT(logError(const TQString &))); + TQObject::connect(fSyncStack, TQT_SIGNAL(logMessage(const TQString &)), + this, TQT_SLOT(logMessage(const TQString &))); + TQObject::connect(fSyncStack, + TQT_SIGNAL(logProgress(const TQString &,int)), + this, TQT_SLOT(logProgress(const TQString &,int))); - QObject::connect(fSyncStack, SIGNAL(syncDone(SyncAction *)), - this, SLOT(endHotSync())); + TQObject::connect(fSyncStack, TQT_SIGNAL(syncDone(SyncAction *)), + this, TQT_SLOT(endHotSync())); - QTimer::singleShot(0,fSyncStack,SLOT(execConduit())); + TQTimer::singleShot(0,fSyncStack,TQT_SLOT(execConduit())); updateTrayStatus(); } -/* slot */ void PilotDaemon::logMessage(const QString & s) +/* slot */ void PilotDaemon::logMessage(const TQString & s) { FUNCTIONSETUPL(2); @@ -1132,7 +1132,7 @@ launch: updateTrayStatus(s); } -/* slot */ void PilotDaemon::logError(const QString & s) +/* slot */ void PilotDaemon::logError(const TQString & s) { FUNCTIONSETUP; @@ -1141,7 +1141,7 @@ launch: updateTrayStatus(s); } -/* slot */ void PilotDaemon::logProgress(const QString & s, int i) +/* slot */ void PilotDaemon::logProgress(const TQString & s, int i) { FUNCTIONSETUPL(2); @@ -1167,7 +1167,7 @@ launch: getLogger().logEndSync(); getFileLogger().logEndSync(); getKPilot().daemonStatus(KPilotDCOP::EndOfHotSync); - KPilotSettings::setLastSyncTime(QDateTime::currentDateTime()); + KPilotSettings::setLastSyncTime(TQDateTime::currentDateTime()); KPilotSettings::self()->writeConfig(); fDaemonStatus = HOTSYNC_END; @@ -1183,7 +1183,7 @@ launch: } else { - QTimer::singleShot(10000,fPilotLink,SLOT(reset())); + TQTimer::singleShot(10000,fPilotLink,TQT_SLOT(reset())); } fPostSyncAction = None; @@ -1204,12 +1204,12 @@ void PilotDaemon::slotRunKPilot() { FUNCTIONSETUP; - QString kpilotError; - QCString kpilotDCOP; + TQString kpilotError; + TQCString kpilotDCOP; int kpilotPID; if (KApplication::startServiceByDesktopName(CSL1("kpilot"), - QString::null, &kpilotError, &kpilotDCOP, &kpilotPID + TQString::null, &kpilotError, &kpilotDCOP, &kpilotPID #if (KDE_VERSION >= 220) // Startup notification added in 2.2 , "" @@ -1251,8 +1251,8 @@ void PilotDaemon::slotRunConfig() if ( client->isApplicationRegistered( "kpilot" ) ) { - client->send("kpilot", "kpilot-mainwindow#1", "raise()",QString::null); - client->send("kpilot", "KPilotIface", "configure()", QString::null); + client->send("kpilot", "kpilot-mainwindow#1", "raise()",TQString::null); + client->send("kpilot", "KPilotIface", "configure()", TQString::null); } else { @@ -1264,23 +1264,23 @@ void PilotDaemon::slotRunConfig() } } -void PilotDaemon::updateTrayStatus(const QString &s) +void PilotDaemon::updateTrayStatus(const TQString &s) { if (!fTray) return; - QString tipText = CSL1("<qt>"); + TQString tipText = CSL1("<qt>"); tipText.append( s ); tipText.append( CSL1(" ") ); tipText.append( i18n("Next sync is %1.") .arg( fNextSyncType.name() ) ); tipText.append( CSL1("</qt>") ); - QToolTip::remove(fTray); - QToolTip::add(fTray,tipText); - emitDCOPSignal( "kpilotDaemonStatusChanged()", QByteArray() ); + TQToolTip::remove(fTray); + TQToolTip::add(fTray,tipText); + emitDCOPSignal( "kpilotDaemonStatusChanged()", TQByteArray() ); // emit the same dcop signal but including the information needed by Kontact to update its kpilot summary widget - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << lastSyncDate(); arg << shortStatusString(); arg << configuredConduitList(); @@ -1288,7 +1288,7 @@ void PilotDaemon::updateTrayStatus(const QString &s) arg << userName(); arg << pilotDevice(); arg << killDaemonOnExit(); - emitDCOPSignal( "kpilotDaemonStatusDetails(QDateTime,QString,QStringList,QString,QString,QString,bool)", data ); + emitDCOPSignal( "kpilotDaemonStatusDetails(TQDateTime,TQString,TQStringList,TQString,TQString,TQString,bool)", data ); } static KCmdLineOptions daemonoptions[] = { @@ -1342,12 +1342,12 @@ int main(int argc, char **argv) // tell the running kpilotDaemon to use // this device now DCOPClient d; - QString dev(p->getOption("device")); - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQString dev(p->getOption("device")); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << dev; if (d.attach()){ - d.send("kpilotDaemon", "KPilotDaemonIface", "setTempDevice(QString)", data ); + d.send("kpilotDaemon", "KPilotDaemonIface", "setTempDevice(TQString)", data ); d.detach(); } } |