diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 00:37:32 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 00:37:32 +0000 |
commit | f6f9c296c3f9d39a8c3d0ee64a542a47f450be28 (patch) | |
tree | d38fce8091ce66977004a5cb115768c7810aee30 /kpilot/kpilot.cc | |
parent | e340db64991a06761aa6395ffe760b53e4c1dfbc (diff) | |
download | kpilot-f6f9c296c3f9d39a8c3d0ee64a542a47f450be28.tar.gz kpilot-f6f9c296c3f9d39a8c3d0ee64a542a47f450be28.zip |
TQt4 port kpilot
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpilot@1238903 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpilot/kpilot.cc')
-rw-r--r-- | kpilot/kpilot.cc | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/kpilot/kpilot.cc b/kpilot/kpilot.cc index 0af1258..91d8d31 100644 --- a/kpilot/kpilot.cc +++ b/kpilot/kpilot.cc @@ -104,7 +104,7 @@ KPilotInstaller::KPilotInstaller() : fQuitAfterCopyComplete(false), fManagingWidget(0L), fDaemonWasRunning(true), - fAppStatus(Startup), + fApptqStatus(Startup), fFileInstallWidget(0L), fLogWidget(0L) { @@ -143,7 +143,7 @@ void KPilotInstaller::startDaemonIfNeeded() { FUNCTIONSETUP; - fAppStatus=WaitingForDaemon; + fApptqStatus=WaitingForDaemon; TQString daemonError; TQCString daemonDCOP; @@ -169,7 +169,7 @@ void KPilotInstaller::startDaemonIfNeeded() if (!fDaemonWasRunning && KApplication::startServiceByDesktopName( CSL1("kpilotdaemon"), - TQString::null, &daemonError, &daemonDCOP, &daemonPID + TQString(), &daemonError, &daemonDCOP, &daemonPID , "0" /* no notify */ )) { @@ -178,9 +178,9 @@ void KPilotInstaller::startDaemonIfNeeded() { fLogWidget->addMessage(i18n("Could not start the " "KPilot daemon. The system error message " - "was: "%1"").arg(daemonError)); + "was: "%1"").tqarg(daemonError)); } - fAppStatus=Error; + fApptqStatus=Error; } else { @@ -189,14 +189,14 @@ void KPilotInstaller::startDaemonIfNeeded() { int wordoffset; s.remove(0,12); - wordoffset=s.find(';'); + wordoffset=s.tqfind(';'); if (wordoffset>0) s.truncate(wordoffset); fLogWidget->addMessage( i18n("Daemon status is `%1'") - .arg(s.isEmpty() ? i18n("not running") : s )); + .tqarg(s.isEmpty() ? i18n("not running") : s )); } - fAppStatus=Normal; + fApptqStatus=Normal; } } @@ -213,7 +213,7 @@ void KPilotInstaller::readConfig() { fLogWidget->addMessage(i18n("Using character set %1 on " "the handheld.") - .arg(Pilot::codecName())); + .tqarg(Pilot::codecName())); } } @@ -232,7 +232,7 @@ void KPilotInstaller::setupWidget() fManagingWidget->show(); setCentralWidget(fManagingWidget); connect( fManagingWidget, TQT_SIGNAL( aboutToShowPage ( TQWidget* ) ), - this, TQT_SLOT( slotAboutToShowComponent( TQWidget* ) ) ); + TQT_TQOBJECT(this), TQT_SLOT( slotAboutToShowComponent( TQWidget* ) ) ); initIcons(); initMenu(); @@ -256,7 +256,7 @@ void KPilotInstaller::initComponents() #define ADDICONPAGE(a,b) \ pixmap = KGlobal::iconLoader()->loadIcon(b, KIcon::Desktop, 64); \ - w = getManagingWidget()->addVBoxPage(a,TQString::null, pixmap) ; + w = getManagingWidget()->addVBoxPage(a,TQString(), pixmap) ; ADDICONPAGE(i18n("HotSync"),CSL1("kpilotbhotsync")); fLogWidget = new LogWidget(w); @@ -320,21 +320,21 @@ void KPilotInstaller::slotSelectComponent(PilotComponent *c) return; } - TQObject *o = c->parent(); + TQObject *o = c->tqparent(); if (!o) { - WARNINGKPILOT << "Widget has no parent." << endl; + WARNINGKPILOT << "Widget has no tqparent." << endl; return; } - TQWidget *parent = dynamic_cast<TQWidget *>(o); - if (!parent) + TQWidget *tqparent = dynamic_cast<TQWidget *>(o); + if (!tqparent) { - WARNINGKPILOT << "Widget's parent is not a widget." << endl; + WARNINGKPILOT << "Widget's tqparent is not a widget." << endl; return; } - int index = fManagingWidget->pageIndex(parent); + int index = fManagingWidget->pageIndex(tqparent); if (index < 0) { @@ -401,7 +401,7 @@ void KPilotInstaller::slotPCtoHHRequested() i18n("Please press the HotSync button.")); } -/* virtual DCOP */ ASYNC KPilotInstaller::daemonStatus(int i) +/* virtual DCOP */ ASYNC KPilotInstaller::daemontqStatus(int i) { FUNCTIONSETUP; DEBUGKPILOT << fname << ": Received daemon message " << i << endl; @@ -409,17 +409,17 @@ void KPilotInstaller::slotPCtoHHRequested() switch(i) { case KPilotDCOP::StartOfHotSync : - if (fAppStatus==Normal) + if (fApptqStatus==Normal) { - fAppStatus=WaitingForDaemon; + fApptqStatus=WaitingForDaemon; componentPreSync(); } break; case KPilotDCOP::EndOfHotSync : - if (fAppStatus==WaitingForDaemon) + if (fApptqStatus==WaitingForDaemon) { componentPostSync(); - fAppStatus=Normal; + fApptqStatus=Normal; } break; case KPilotDCOP::DaemonQuit : @@ -429,7 +429,7 @@ void KPilotInstaller::slotPCtoHHRequested() fLogWidget->logMessage(i18n("No further HotSyncs are possible.")); fLogWidget->logMessage(i18n("Restart the daemon to HotSync again.")); } - fAppStatus=WaitingForDaemon; + fApptqStatus=WaitingForDaemon; break; case KPilotDCOP::None : WARNINGKPILOT << "Unhandled status message " << i << endl; @@ -437,7 +437,7 @@ void KPilotInstaller::slotPCtoHHRequested() } } -/* virtual DCOP*/ int KPilotInstaller::kpiloStatus() +/* virtual DCOP*/ int KPilotInstaller::kpilotqStatus() { return status(); } @@ -459,7 +459,7 @@ bool KPilotInstaller::componentPreSync() if (!reason.isNull()) { KMessageBox::sorry(this, - rprefix.arg(reason), + rprefix.tqarg(reason), i18n("Cannot start Sync")); return false; } @@ -519,11 +519,11 @@ void KPilotInstaller::initMenu() "This applies only to the next HotSync; to change the default, use " "the configuration dialog.")); connect(syncPopup, TQT_SIGNAL(activated()), - this, TQT_SLOT(slotHotSyncRequested())); + TQT_TQOBJECT(this), TQT_SLOT(slotHotSyncRequested())); // File actions, keep this list synced with kpilotui.rc and pilotDaemon.cc a = new KAction(i18n("&HotSync"), CSL1("hotsync"), 0, - this, TQT_SLOT(slotHotSyncRequested()), + TQT_TQOBJECT(this), TQT_SLOT(slotHotSyncRequested()), actionCollection(), "file_hotsync"); a->setToolTip(i18n("Next HotSync will be normal HotSync.")); a->setWhatsThis(i18n("Tell the daemon that the next HotSync " @@ -531,7 +531,7 @@ void KPilotInstaller::initMenu() syncPopup->insert(a); a = new KAction(i18n("Full&Sync"), CSL1("fullsync"), 0, - this, TQT_SLOT(slotFullSyncRequested()), + TQT_TQOBJECT(this), TQT_SLOT(slotFullSyncRequested()), actionCollection(), "file_fullsync"); a->setToolTip(i18n("Next HotSync will be a FullSync.")); a->setWhatsThis(i18n("Tell the daemon that the next HotSync " @@ -539,7 +539,7 @@ void KPilotInstaller::initMenu() syncPopup->insert(a); a = new KAction(i18n("&Backup"), CSL1("backup"), 0, - this, TQT_SLOT(slotBackupRequested()), + TQT_TQOBJECT(this), TQT_SLOT(slotBackupRequested()), actionCollection(), "file_backup"); a->setToolTip(i18n("Next HotSync will be backup.")); a->setWhatsThis(i18n("Tell the daemon that the next HotSync " @@ -547,15 +547,15 @@ void KPilotInstaller::initMenu() syncPopup->insert(a); a = new KAction(i18n("&Restore"), CSL1("restore"), 0, - this, TQT_SLOT(slotRestoreRequested()), + TQT_TQOBJECT(this), TQT_SLOT(slotRestoreRequested()), actionCollection(), "file_restore"); a->setToolTip(i18n("Next HotSync will be restore.")); a->setWhatsThis(i18n("Tell the daemon that the next HotSync " "should restore the Handheld from data on the PC.")); syncPopup->insert(a); - a = new KAction(i18n("Copy Handheld to PC"), TQString::null, 0, - this, TQT_SLOT(slotHHtoPCRequested()), + a = new KAction(i18n("Copy Handheld to PC"), TQString(), 0, + TQT_TQOBJECT(this), TQT_SLOT(slotHHtoPCRequested()), actionCollection(), "file_HHtoPC"); a->setToolTip(i18n("Next HotSync will be backup.")); a->setWhatsThis(i18n("Tell the daemon that the next HotSync " @@ -563,8 +563,8 @@ void KPilotInstaller::initMenu() "overwriting entries on the PC.")); syncPopup->insert(a); - a = new KAction(i18n("Copy PC to Handheld"), TQString::null, 0, - this, TQT_SLOT(slotPCtoHHRequested()), + a = new KAction(i18n("Copy PC to Handheld"), TQString(), 0, + TQT_TQOBJECT(this), TQT_SLOT(slotPCtoHHRequested()), actionCollection(), "file_PCtoHH"); a->setToolTip(i18n("Next HotSync will copy PC to Handheld.")); a->setWhatsThis(i18n("Tell the daemon that the next HotSync " @@ -586,14 +586,14 @@ void KPilotInstaller::initMenu() a = new KAction(i18n("Rese&t Link"),CSL1("reload"), 0, - this, TQT_SLOT(slotResetLink()), + TQT_TQOBJECT(this), TQT_SLOT(slotResetLink()), actionCollection(),"file_reload"); a->setToolTip(i18n("Reset the device connection.")); a->setWhatsThis(i18n("Try to reset the daemon and its connection " "to the Handheld.")); - a = KStdAction::quit(this, TQT_SLOT(quit()), actionCollection()); + a = KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(quit()), actionCollection()); a->setWhatsThis(i18n("Quit KPilot, (and stop the daemon " "if configured that way).")); @@ -603,15 +603,15 @@ void KPilotInstaller::initMenu() createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - (void) KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()), + (void) KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureKeys()), actionCollection()); - (void) KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), + (void) KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureToolbars()), actionCollection()); - (void) KStdAction::preferences(this, TQT_SLOT(configure()), + (void) KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(configure()), actionCollection()); a = new KAction(i18n("Configuration &Wizard..."), CSL1("wizard"), 0, - this, TQT_SLOT(configureWizard()), + TQT_TQOBJECT(this), TQT_SLOT(configureWizard()), actionCollection(), "options_configure_wizard"); a->setWhatsThis(i18n("Configure KPilot using the configuration wizard.")); @@ -685,13 +685,13 @@ void KPilotInstaller::addComponentPage(PilotComponent * p, KToggleAction *pt = new KToggleAction(name, /* "kpilot" -- component icon, */ 0, - p, TQT_SLOT(slotShowComponent()), + TQT_TQOBJECT(p), TQT_SLOT(slotShowComponent()), actionCollection(), actionname); pt->setExclusiveGroup(CSL1("view_menu")); - connect(p, TQT_SIGNAL(showComponent(PilotComponent *)), - this, TQT_SLOT(slotSelectComponent(PilotComponent *))); + connect(TQT_TQOBJECT(p), TQT_SIGNAL(showComponent(PilotComponent *)), + TQT_TQOBJECT(this), TQT_SLOT(slotSelectComponent(PilotComponent *))); } /* slot */ void KPilotInstaller::initializeComponents() @@ -719,7 +719,7 @@ void KPilotInstaller::optionsConfigureToolbars() // This was added in KDE 3.1 saveMainWindowSettings( KGlobal::config(), autoSaveGroup() ); KEditToolbar dlg(actionCollection()); - connect(&dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(slotNewToolbarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_TQOBJECT(this), TQT_SLOT(slotNewToolbarConfig())); dlg.exec(); } @@ -741,7 +741,7 @@ void KPilotInstaller::slotResetLink() /* ** Can't be a member function because it needs to be called even with no KPilotInstaller. */ -static bool runConfigure(PilotDaemonDCOP_stub &daemon,TQWidget *parent) +static bool runConfigure(PilotDaemonDCOP_stub &daemon,TQWidget *tqparent) { FUNCTIONSETUP; bool ret = false; @@ -754,7 +754,7 @@ static bool runConfigure(PilotDaemonDCOP_stub &daemon,TQWidget *parent) KPilotSettings::self()->readConfig(); - KCMultiDialog *options = new KCMultiDialog( KDialogBase::Plain, i18n("Configuration"), parent, "KPilotPreferences", true ); + KCMultiDialog *options = new KCMultiDialog( KDialogBase::Plain, i18n("Configuration"), tqparent, "KPilotPreferences", true ); options->addModule( CSL1("kpilot_config.desktop") ); if (!options) @@ -796,7 +796,7 @@ static bool runConfigure(PilotDaemonDCOP_stub &daemon,TQWidget *parent) * canceled, though). */ typedef enum { Failed, OK, Cancel } WizardResult; -static WizardResult runWizard(PilotDaemonDCOP_stub &daemon,TQWidget *parent) +static WizardResult runWizard(PilotDaemonDCOP_stub &daemon,TQWidget *tqparent) { FUNCTIONSETUP; WizardResult ret = Failed ; @@ -826,7 +826,7 @@ static WizardResult runWizard(PilotDaemonDCOP_stub &daemon,TQWidget *parent) goto sorry; } - w = f(parent,ConfigWizard::Standalone); + w = f(tqparent,ConfigWizard::Standalone); if (!w) { WARNINGKPILOT << "Can't create wizard." << endl; @@ -847,7 +847,7 @@ static WizardResult runWizard(PilotDaemonDCOP_stub &daemon,TQWidget *parent) sorry: if (Failed == ret) { - KMessageBox::sorry(parent, + KMessageBox::sorry(tqparent, i18n("The library containing the configuration wizard for KPilot " "could not be loaded, and the wizard is not available. " "Please try to use the regular configuration dialog."), @@ -896,7 +896,7 @@ void KPilotInstaller::componentUpdate() if (fLogWidget) { fLogWidget->logMessage(i18n("Changed username to `%1'.") - .arg(KPilotSettings::userName())); + .tqarg(KPilotSettings::userName())); fManagingWidget->showPage(0); slotAboutToShowComponent(fLogWidget); } @@ -920,7 +920,7 @@ void KPilotInstaller::componentUpdate() { FUNCTIONSETUP; - if ( fAppStatus!=Normal || fConfigureKPilotDialogInUse ) + if ( fApptqStatus!=Normal || fConfigureKPilotDialogInUse ) { if (fLogWidget) { @@ -928,7 +928,7 @@ void KPilotInstaller::componentUpdate() } return; } - fAppStatus=UIBusy; + fApptqStatus=UIBusy; fConfigureKPilotDialogInUse = true; if (runWizard(getDaemon(),this) == OK) @@ -937,14 +937,14 @@ void KPilotInstaller::componentUpdate() } fConfigureKPilotDialogInUse = false; - fAppStatus=Normal; + fApptqStatus=Normal; } /* virtual DCOP */ ASYNC KPilotInstaller::configure() { FUNCTIONSETUP; - if ( fAppStatus!=Normal || fConfigureKPilotDialogInUse ) + if ( fApptqStatus!=Normal || fConfigureKPilotDialogInUse ) { if (fLogWidget) { @@ -952,7 +952,7 @@ void KPilotInstaller::componentUpdate() } return; } - fAppStatus=UIBusy; + fApptqStatus=UIBusy; fConfigureKPilotDialogInUse = true; if (runConfigure(getDaemon(),this)) { @@ -960,7 +960,7 @@ void KPilotInstaller::componentUpdate() } fConfigureKPilotDialogInUse = false; - fAppStatus=Normal; + fApptqStatus=Normal; } |