From 8874c8d8f787c27407de71f05419febfd83a1024 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jan 2013 13:24:45 -0600 Subject: [PATCH] Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4 --- ChangeLog | 2 +- src/countdowndialog.cpp | 8 ++--- src/hardware.cpp | 2 +- src/hardware_battery.cpp | 2 +- src/hardware_cpu.cpp | 2 +- src/inactivity.cpp | 18 +++++----- src/inactivity.h | 6 ++-- src/infodialog.cpp | 2 +- src/kpowersave.cpp | 16 ++++----- src/kpowersave.h | 6 ++-- src/screen.cpp | 74 ++++++++++++++++++++-------------------- src/screen.h | 24 ++++++------- src/suspenddialog.cpp | 8 ++--- 13 files changed, 85 insertions(+), 85 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4045a7c..1fa039a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,7 +57,7 @@ 2007-09-11 Danny Kukawka * src/screen.cpp: Fixed b.n.c #309491. Fixed code to free - KProcess object if gnome-screensaver is running (which + TDEProcess object if gnome-screensaver is running (which mean unfortunately GNOME is running). 2007-09-11 Danny Kukawka diff --git a/src/countdowndialog.cpp b/src/countdowndialog.cpp index f8d268d..a4c8158 100644 --- a/src/countdowndialog.cpp +++ b/src/countdowndialog.cpp @@ -76,13 +76,13 @@ void countDownDialog::setPixmap( TQString type ) TQPixmap pixmap = 0; if(type.startsWith("suspend2disk")){ - pixmap = KGlobal::iconLoader()->loadIcon("suspend_to_disk", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("suspend_to_disk", KIcon::NoGroup, KIcon::SizeLarge); } else if (type.startsWith("suspend2ram")) { - pixmap = KGlobal::iconLoader()->loadIcon("suspend_to_ram", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("suspend_to_ram", KIcon::NoGroup, KIcon::SizeLarge); } else if (type.startsWith("standby")) { - pixmap = KGlobal::iconLoader()->loadIcon("stand_by", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("stand_by", KIcon::NoGroup, KIcon::SizeLarge); } else { - pixmap = KGlobal::iconLoader()->loadIcon("kpowersave", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("kpowersave", KIcon::NoGroup, KIcon::SizeLarge); } iconPixmap->setPixmap( pixmap ); } diff --git a/src/hardware.cpp b/src/hardware.cpp index f0996fd..10cd4b6 100644 --- a/src/hardware.cpp +++ b/src/hardware.cpp @@ -53,7 +53,7 @@ HardwareInfo::HardwareInfo() { sessionIsActive = true; // assume as first we are active // initialize connection to the TDE hardware library - m_hwdevices = KGlobal::hardwareDevices(); + m_hwdevices = TDEGlobal::hardwareDevices(); connect(m_hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(processHardwareChangedEvent(TDEGenericDevice*))); connect(m_hwdevices, TQT_SIGNAL(eventDeviceKeyPressed(unsigned int, TDEEventDevice*)), this, TQT_SLOT(processKeyPressEvent(unsigned int, TDEEventDevice*))); diff --git a/src/hardware_battery.cpp b/src/hardware_battery.cpp index 21dc5c9..6011b72 100644 --- a/src/hardware_battery.cpp +++ b/src/hardware_battery.cpp @@ -64,7 +64,7 @@ Battery::Battery( TQString _udi ) { if (trace) kdDebug() << funcinfo << "IN , udi: " << udi << endl; - m_hwdevices = KGlobal::hardwareDevices(); + m_hwdevices = TDEGlobal::hardwareDevices(); udi = _udi; diff --git a/src/hardware_cpu.cpp b/src/hardware_cpu.cpp index 69f43d8..618af0a 100644 --- a/src/hardware_cpu.cpp +++ b/src/hardware_cpu.cpp @@ -47,7 +47,7 @@ CPUInfo::CPUInfo() { update_info_cpufreq_speed_changed = true; numOfCPUs = -1; - m_hwdevices = KGlobal::hardwareDevices(); + m_hwdevices = TDEGlobal::hardwareDevices(); kdDebugFuncOut(trace); } diff --git a/src/inactivity.cpp b/src/inactivity.cpp index 48969a9..28fe520 100644 --- a/src/inactivity.cpp +++ b/src/inactivity.cpp @@ -285,15 +285,15 @@ void inactivity::checkBlacklisted(){ proc = NULL; } - proc = new KProcess; + proc = new TDEProcess; *proc << "pidof" << blacklist; - connect( proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),this, - TQT_SLOT(getPIDs(KProcess *, char *, int))); - connect( proc, TQT_SIGNAL(processExited(KProcess *)), - TQT_SLOT(getPIDsExited(KProcess *))); + connect( proc, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)),this, + TQT_SLOT(getPIDs(TDEProcess *, char *, int))); + connect( proc, TQT_SIGNAL(processExited(TDEProcess *)), + TQT_SLOT(getPIDsExited(TDEProcess *))); - if (!proc->start(KProcess::NotifyOnExit, KProcess::AllOutput)) + if (!proc->start(TDEProcess::NotifyOnExit, TDEProcess::AllOutput)) { emit displayErrorMsg(i18n("Could not start 'pidof'. " "Could not autosuspend the machine.\n" @@ -311,11 +311,11 @@ void inactivity::checkBlacklisted(){ /*! * \b TQT_SLOT to get the return of the command pidof and parse this to set * \ref blacklisted_running . - * \param *proc pointer to the sending KProcess + * \param *proc pointer to the sending TDEProcess * \param *buffer the char pointer to the output of the process to stdout * \param *length the length of the buffer */ -void inactivity::getPIDs(KProcess */*proc*/, char *buffer, int /*length*/) { +void inactivity::getPIDs(TDEProcess */*proc*/, char *buffer, int /*length*/) { kdDebugFuncIn(trace); TQString pids(buffer); @@ -345,7 +345,7 @@ void inactivity::getPIDs(KProcess */*proc*/, char *buffer, int /*length*/) { * \b TQT_SLOT which called if the call of pidof is exited * \param proc the KPocess which called this SLOT */ -void inactivity::getPIDsExited(KProcess *proc){ +void inactivity::getPIDsExited(TDEProcess *proc){ kdDebugFuncIn(trace); pidof_call_returned = true; diff --git a/src/inactivity.h b/src/inactivity.h index c86f2f1..206cfea 100644 --- a/src/inactivity.h +++ b/src/inactivity.h @@ -85,7 +85,7 @@ signals: private: //! pointer to the process to call pidof - KProcess *proc; + TDEProcess *proc; //! about the call result of pidof /*! @@ -163,9 +163,9 @@ private slots: //! to monitor the values void recheck(); //! to get the PIDs of blacklisted programs/processes - void getPIDs(KProcess *, char *, int); + void getPIDs(TDEProcess *, char *, int); //! to get the signal if the command call is exited - void getPIDsExited(KProcess *); + void getPIDsExited(TDEProcess *); }; #endif diff --git a/src/infodialog.cpp b/src/infodialog.cpp index 57b1efa..cdf611f 100644 --- a/src/infodialog.cpp +++ b/src/infodialog.cpp @@ -67,7 +67,7 @@ infoDialog::infoDialog( KConfig *config, TQString captionName, TQString message, buttonOK->setIconSet(SmallIconSet("ok", TQIconSet::Automatic)); TQPixmap pixmap = 0; - pixmap = KGlobal::iconLoader()->loadIcon("messagebox_warning", KIcon::NoGroup, KIcon::SizeMedium); + pixmap = TDEGlobal::iconLoader()->loadIcon("messagebox_warning", KIcon::NoGroup, KIcon::SizeMedium); iconPixmap->setPixmap( pixmap ); msgText->setText(message); diff --git a/src/kpowersave.cpp b/src/kpowersave.cpp index 85a9440..33a86f8 100644 --- a/src/kpowersave.cpp +++ b/src/kpowersave.cpp @@ -67,7 +67,7 @@ kpowersave::kpowersave( bool force_acpi_check, bool trace_func ) : KSystemTray(0 resume_result = 0; - config = KGlobal::config(); + config = TDEGlobal::config(); config->setGroup("General"); if(!config->readBoolEntry("AlreadyStarted", false) || force_acpi_check){ config->writeEntry("AlreadyStarted", true); @@ -504,7 +504,7 @@ void kpowersave::updateTooltip(){ /*! * \b TQT_SLOT to starts the Yast2-power-management module. This called by the menuentry * with ID \ref YAST_MODULE_MENU_ID, named "Start YaST2 Power Management Module". - * It create a new KProcess and execute "/sbin/yast2 power-management" with tdesu. + * It create a new TDEProcess and execute "/sbin/yast2 power-management" with tdesu. */ void kpowersave::do_config(){ kdDebugFuncIn(trace); @@ -512,12 +512,12 @@ void kpowersave::do_config(){ #ifdef ENABLE_YAST_ENTRY delete yast2; - yast2 = new KProcess; + yast2 = new TDEProcess; *yast2 << "tdesu" << "--nonewdcop" << "/sbin/yast2" << "power-management"; - connect(yast2, TQT_SIGNAL(processExited(KProcess *)), - TQT_SLOT(slotConfigProcessExited(KProcess *))); - if(!yast2->start(KProcess::NotifyOnExit)) + connect(yast2, TQT_SIGNAL(processExited(TDEProcess *)), + TQT_SLOT(slotConfigProcessExited(TDEProcess *))); + if(!yast2->start(TDEProcess::NotifyOnExit)) { delete yast2; yast2 = NULL; @@ -642,10 +642,10 @@ void kpowersave::observeConfigDlg(){ } /*! - * \b TQT_SLOT which called from \ref do_config() if the 'tdesu yast2' KProcess exited. + * \b TQT_SLOT which called from \ref do_config() if the 'tdesu yast2' TDEProcess exited. * This function control the return value and display if needed a errormessage on failure. */ -void kpowersave::slotConfigProcessExited(KProcess *proc){ +void kpowersave::slotConfigProcessExited(TDEProcess *proc){ kdDebugFuncIn(trace); #ifdef ENABLE_YAST_ENTRY diff --git a/src/kpowersave.h b/src/kpowersave.h index eed1927..e3008b1 100644 --- a/src/kpowersave.h +++ b/src/kpowersave.h @@ -88,8 +88,8 @@ private: autodimm * autoDimm; // temporary pointer, use them if needed - //! KProcess to start YaST-module for configuration - KProcess *yast2; + //! TDEProcess to start YaST-module for configuration + TDEProcess *yast2; //! instance of \ref ConfigureDialog /*! the implemtation and all related functions for the configure dialog*/ ConfigureDialog *configDlg; @@ -330,7 +330,7 @@ private slots: //! sets the CPU Freq policy via the TDE hardware library void do_setSpeedPolicy( int ); //! called if there are problems with starting yast module - void slotConfigProcessExited( KProcess * ); + void slotConfigProcessExited( TDEProcess * ); //! called to open the kpowersave help void slotHelp(); //! called to open the kpowersave About dialog diff --git a/src/screen.cpp b/src/screen.cpp index 2a7f658..16cca85 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -281,12 +281,12 @@ int screen::checkScreenSaverStatus() { if (check == 10) { delete gnomeScreensaverCheck; - gnomeScreensaverCheck = new KProcess; + gnomeScreensaverCheck = new TDEProcess; *gnomeScreensaverCheck << "gnome-screensaver-command" << "--query"; - connect( gnomeScreensaverCheck , TQT_SIGNAL(processExited(KProcess *)),TQT_SLOT(getGSExited(KProcess *))); + connect( gnomeScreensaverCheck , TQT_SIGNAL(processExited(TDEProcess *)),TQT_SLOT(getGSExited(TDEProcess *))); - if(!gnomeScreensaverCheck->start(KProcess::NotifyOnExit)) + if(!gnomeScreensaverCheck->start(TDEProcess::NotifyOnExit)) { delete gnomeScreensaverCheck; gnomeScreensaverCheck = NULL; @@ -302,7 +302,7 @@ int screen::checkScreenSaverStatus() { * \b TQT_SLOT which called if the call of gnomescreensaver-command exited * \param gnomecheckcommand the KPocess which called this SLOT */ -void screen::getGSExited (KProcess *gnomecheckcommand) { +void screen::getGSExited (TDEProcess *gnomecheckcommand) { kdDebugFuncIn(trace); if (gnomecheckcommand->normalExit()){ @@ -449,12 +449,12 @@ bool screen::lockScreen(){ xscreensaver: delete xscreensaver_lock; - xscreensaver_lock = new KProcess; + xscreensaver_lock = new TDEProcess; *xscreensaver_lock << "xscreensaver-command" << "-lock"; - connect(xscreensaver_lock, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); + connect(xscreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); - bool status = xscreensaver_lock->start(KProcess::DontCare); + bool status = xscreensaver_lock->start(TDEProcess::DontCare); if(!status) { delete xscreensaver_lock; @@ -466,12 +466,12 @@ xscreensaver: else if(SCREENSAVER_STATUS == 20){ delete gnomescreensaver_lock; - gnomescreensaver_lock = new KProcess; + gnomescreensaver_lock = new TDEProcess; *gnomescreensaver_lock << "gnome-screensaver-command" << "--lock"; - connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); - bool status = gnomescreensaver_lock->start(KProcess::DontCare); + connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); + bool status = gnomescreensaver_lock->start(TDEProcess::DontCare); if(!status) { delete gnomescreensaver_lock; @@ -485,11 +485,11 @@ xscreensaver: else if(SCREENSAVER_STATUS == 10 || SCREENSAVER_STATUS == 99){ delete xlock; - xlock = new KProcess; + xlock = new TDEProcess; *xlock << "xlock"; //<< "-mode" << "blank"; - connect(xlock, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); - bool status = xlock->start(KProcess::DontCare); + connect(xlock, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); + bool status = xlock->start(TDEProcess::DontCare); if(!status) { delete xlock; @@ -519,12 +519,12 @@ bool screen::lockScreen( TQString lock_withMethod ) { else if (lock_withMethod == "xlock") { delete xlock; - xlock = new KProcess; + xlock = new TDEProcess; *xlock << "xlock"; - connect(xlock, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); + connect(xlock, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); - bool status = xlock->start(KProcess::DontCare); + bool status = xlock->start(TDEProcess::DontCare); if(!status) { delete xlock; @@ -534,12 +534,12 @@ bool screen::lockScreen( TQString lock_withMethod ) { return status; } else if (lock_withMethod == "gnomescreensaver") { - gnomescreensaver_lock = new KProcess; + gnomescreensaver_lock = new TDEProcess; *gnomescreensaver_lock << "gnome-screensaver-command" << "--lock"; - connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); + connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); - bool status = gnomescreensaver_lock->start(KProcess::DontCare); + bool status = gnomescreensaver_lock->start(TDEProcess::DontCare); if(!status) { delete gnomescreensaver_lock; @@ -569,12 +569,12 @@ bool screen::lockScreen( TQString lock_withMethod ) { xscreensaver: delete xscreensaver_lock; - xscreensaver_lock = new KProcess; + xscreensaver_lock = new TDEProcess; *xscreensaver_lock << "xscreensaver-command" << "-lock"; - connect(xscreensaver_lock, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); + connect(xscreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); - bool status = xscreensaver_lock->start(KProcess::DontCare); + bool status = xscreensaver_lock->start(TDEProcess::DontCare); if(!status) { delete xscreensaver_lock; @@ -652,12 +652,12 @@ bool screen::resetXScreensaver(){ delete xscreensaver_reset; - xscreensaver_reset = new KProcess; + xscreensaver_reset = new TDEProcess; *xscreensaver_reset << "xscreensaver-command" << "-restart"; - connect(xscreensaver_reset, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); + connect(xscreensaver_reset, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); - bool status = xscreensaver_reset->start(KProcess::DontCare); + bool status = xscreensaver_reset->start(TDEProcess::DontCare); if(!status) { delete xscreensaver_reset; @@ -677,10 +677,10 @@ bool screen::resetXScreensaver(){ void screen::forceDPMSOff() { kdDebugFuncIn(trace); - KProcess *xset = new KProcess; + TDEProcess *xset = new TDEProcess; *xset << "xset" << "dpms" << "force" << "off"; - connect(xset, TQT_SIGNAL(processExited(KProcess*)), - this, TQT_SLOT(cleanProcess(KProcess*))); + connect(xset, TQT_SIGNAL(processExited(TDEProcess*)), + this, TQT_SLOT(cleanProcess(TDEProcess*))); if(!xset->start()) { delete xset; @@ -690,9 +690,9 @@ void screen::forceDPMSOff() { } /*! - * function to clean KProcess objects + * function to clean TDEProcess objects */ -void screen::cleanProcess(KProcess* proc) +void screen::cleanProcess(TDEProcess* proc) { delete proc; proc = NULL; diff --git a/src/screen.h b/src/screen.h index 7dc58b5..6d7fe9b 100644 --- a/src/screen.h +++ b/src/screen.h @@ -66,16 +66,16 @@ private: * commandos to the active KScreensaver. */ DCOPRef screen_save_dcop_ref; - //! KProcess to start xlock to lock the screen - KProcess *xlock; - //! KProcess to start xscreensaver with lock command - KProcess *xscreensaver_lock; - //! KProcess to start xscreensaver with restart command - KProcess *xscreensaver_reset; - //! KProcess to start gnome-screen-saver with lock command - KProcess *gnomescreensaver_lock; - //! KProcess to check if gnome-screensaver is running - KProcess *gnomeScreensaverCheck; + //! TDEProcess to start xlock to lock the screen + TDEProcess *xlock; + //! TDEProcess to start xscreensaver with lock command + TDEProcess *xscreensaver_lock; + //! TDEProcess to start xscreensaver with restart command + TDEProcess *xscreensaver_reset; + //! TDEProcess to start gnome-screen-saver with lock command + TDEProcess *gnomescreensaver_lock; + //! TDEProcess to check if gnome-screensaver is running + TDEProcess *gnomeScreensaverCheck; //! contains information about Xscreensaver /*! @@ -120,9 +120,9 @@ private slots: //! to ping and deactivate the Xscreensaver void xscreensaver_ping(); //! to get the return value of gnomescreensaver-command - void getGSExited(KProcess *); + void getGSExited(TDEProcess *); - void cleanProcess(KProcess *); + void cleanProcess(TDEProcess *); public slots: diff --git a/src/suspenddialog.cpp b/src/suspenddialog.cpp index 8be599b..af6e7b0 100644 --- a/src/suspenddialog.cpp +++ b/src/suspenddialog.cpp @@ -59,13 +59,13 @@ void suspendDialog::setPixmap( TQString type ) { TQPixmap pixmap = 0; if(type.startsWith("suspend2disk")){// || type.startsWith("NULL")) { - pixmap = KGlobal::iconLoader()->loadIcon("suspend_to_disk", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("suspend_to_disk", KIcon::NoGroup, KIcon::SizeLarge); } else if (type.startsWith("suspend2ram")) { - pixmap = KGlobal::iconLoader()->loadIcon("suspend_to_ram", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("suspend_to_ram", KIcon::NoGroup, KIcon::SizeLarge); } else if (type.startsWith("standby")) { - pixmap = KGlobal::iconLoader()->loadIcon("stand_by", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("stand_by", KIcon::NoGroup, KIcon::SizeLarge); } else { - pixmap = KGlobal::iconLoader()->loadIcon("kpowersave", KIcon::NoGroup, KIcon::SizeLarge); + pixmap = TDEGlobal::iconLoader()->loadIcon("kpowersave", KIcon::NoGroup, KIcon::SizeLarge); } setCaption(i18n("Preparing Suspend...")); iconPixmap->setPixmap( pixmap );