From a2277b6bc715464e83882b90c2a058139b8a6b54 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 23 Jun 2011 01:42:07 +0000 Subject: TQt4 port kdeutils This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1238125 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui | 44 ++++++++++----------- kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui.h | 2 +- kmilo/kmilo_kvaio/kcmkvaio/main.cpp | 18 ++++----- kmilo/kmilo_kvaio/kcmkvaio/main.h | 3 +- kmilo/kmilo_kvaio/kmilo_kvaio.cpp | 6 +-- kmilo/kmilo_kvaio/kmilo_kvaio.h | 5 ++- kmilo/kmilo_kvaio/kvaio.cpp | 50 ++++++++++++------------ kmilo/kmilo_kvaio/kvaio.h | 15 +++---- kmilo/kmilo_kvaio/kvaiodriverinterface.cpp | 10 ++--- kmilo/kmilo_kvaio/kvaiodriverinterface.h | 9 +++-- 10 files changed, 83 insertions(+), 79 deletions(-) (limited to 'kmilo/kmilo_kvaio') diff --git a/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui b/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui index ac376f3..e77244f 100644 --- a/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui +++ b/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui @@ -1,6 +1,6 @@ KCMKVaioGeneral - + KCMKVaioGeneral @@ -22,7 +22,7 @@ 0 - + tlOff @@ -36,7 +36,7 @@ Cannot find the <i>Sony Programmable Interrupt Controller</i>. If this is a Sony Vaio Laptop, make sure the <b>sonypi</b> driver module loads without failures. - + frameMain @@ -53,7 +53,7 @@ 0 - + bgBattery @@ -64,14 +64,14 @@ unnamed - + mTLBattery Remaining battery capacity: - + AlignVCenter|AlignRight @@ -98,7 +98,7 @@ - + tlAC @@ -109,7 +109,7 @@ AC - + AlignVCenter|AlignLeft @@ -139,7 +139,7 @@ - + tlBat1 @@ -150,7 +150,7 @@ Bat 1 - + AlignVCenter|AlignLeft @@ -175,7 +175,7 @@ - + tlBat2 @@ -186,13 +186,13 @@ Bat 2 - + AlignVCenter|AlignLeft - + bgGeneral @@ -203,7 +203,7 @@ unnamed - + mCbPowerMsgs @@ -211,7 +211,7 @@ Periodically inform about battery and AC adapter status - + mCbBackButtonMsg @@ -219,7 +219,7 @@ Show battery and AC status on Back button press - + cbReportUnknownEvents @@ -256,14 +256,14 @@ kcmkvaio_general.ui.h - + changed(); - - + + slotChanged() - - - + + + kprogress.h kled.h diff --git a/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui.h b/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui.h index 96d4938..e017799 100644 --- a/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui.h +++ b/kmilo/kmilo_kvaio/kcmkvaio/kcmkvaio_general.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an +** TQt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ diff --git a/kmilo/kmilo_kvaio/kcmkvaio/main.cpp b/kmilo/kmilo_kvaio/kcmkvaio/main.cpp index 4cf9707..e8a05e2 100644 --- a/kmilo/kmilo_kvaio/kcmkvaio/main.cpp +++ b/kmilo/kmilo_kvaio/kcmkvaio/main.cpp @@ -46,8 +46,8 @@ K_EXPORT_COMPONENT_FACTORY( kcm_kvaio, KVaioModuleFactory("kcmkvaio")) #define CONFIG_FILE "kmilodrc" -KVaioModule::KVaioModule(TQWidget *parent, const char *name, const TQStringList &) - : KCModule(KVaioModuleFactory::instance(), parent, name) +KVaioModule::KVaioModule(TQWidget *tqparent, const char *name, const TQStringList &) + : KCModule(KVaioModuleFactory::instance(), tqparent, name) { KAboutData *about = new KAboutData(I18N_NOOP("kcmkvaio"), @@ -61,12 +61,12 @@ KVaioModule::KVaioModule(TQWidget *parent, const char *name, const TQStringList "mirko@kde.org"); setAboutData( about ); - TQVBoxLayout *layout = new TQVBoxLayout(this); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); mKVaioGeneral = new KCMKVaioGeneral(this); - layout->addWidget( mKVaioGeneral ); - layout->addStretch(); + tqlayout->addWidget( mKVaioGeneral ); + tqlayout->addStretch(); - mDriver = new KVaioDriverInterface(this); + mDriver = new KVaioDriverInterface(TQT_TQOBJECT(this)); mDriverAvailable = mDriver->connectToDriver(false); mTimer = new TQTimer(this); mTimer->start(231); @@ -100,7 +100,7 @@ void KVaioModule::save() config.writeEntry("Report_Unknown_Events", mKVaioGeneral->cbReportUnknownEvents->isChecked()); - config.writeEntry("PeriodicallyReportPowerStatus", + config.writeEntry("PeriodicallyReportPowertqStatus", mKVaioGeneral->mCbPowerMsgs->isChecked() ); config.writeEntry("PowerStatusOnBackButton", mKVaioGeneral->mCbBackButtonMsg->isChecked() ); @@ -139,7 +139,7 @@ void KVaioModule::load(bool useDefaults) mKVaioGeneral->cbReportUnknownEvents->setChecked (config.readBoolEntry("Report_Unknown_Events", false)); mKVaioGeneral->mCbPowerMsgs->setChecked - (config.readBoolEntry("PeriodicallyReportPowerStatus", false) ); + (config.readBoolEntry("PeriodicallyReportPowertqStatus", false) ); mKVaioGeneral->mCbBackButtonMsg->setChecked (config.readBoolEntry("PowerStatusOnBackButton", true) ); @@ -156,7 +156,7 @@ void KVaioModule::timeout() bool bat1Avail = false, bat2Avail = false, acConnected = false; int bat1Remaining = 0, bat1Max = 0, bat2Remaining = 0, bat2Max = 0; - if(mDriver->getBatteryStatus(bat1Avail, bat1Remaining, bat1Max, + if(mDriver->getBatterytqStatus(bat1Avail, bat1Remaining, bat1Max, bat2Avail, bat2Remaining, bat2Max, acConnected) ) { diff --git a/kmilo/kmilo_kvaio/kcmkvaio/main.h b/kmilo/kmilo_kvaio/kcmkvaio/main.h index bf014c9..b7dbade 100644 --- a/kmilo/kmilo_kvaio/kcmkvaio/main.h +++ b/kmilo/kmilo_kvaio/kcmkvaio/main.h @@ -31,9 +31,10 @@ class KCMKVaioGeneral; class KVaioModule : public KCModule { Q_OBJECT + TQ_OBJECT public: - KVaioModule(TQWidget *parent, const char *name, const TQStringList &); + KVaioModule(TQWidget *tqparent, const char *name, const TQStringList &); void save(); void load(); diff --git a/kmilo/kmilo_kvaio/kmilo_kvaio.cpp b/kmilo/kmilo_kvaio/kmilo_kvaio.cpp index 1f4a886..fa22f0b 100644 --- a/kmilo/kmilo_kvaio/kmilo_kvaio.cpp +++ b/kmilo/kmilo_kvaio/kmilo_kvaio.cpp @@ -8,7 +8,7 @@ http://www.kde.org http://www.hackerbuero.org $ $ License: LGPL with the following explicit clarification: - This code may be linked against any version of the Qt toolkit + This code may be linked against any version of the TQt toolkit from Troll Tech, Norway. $ $Id$ @@ -26,9 +26,9 @@ #include "kvaio.h" #include "kmilointerface.h" -KMiloKVaio::KMiloKVaio(TQObject *parent, const char *name, +KMiloKVaio::KMiloKVaio(TQObject *tqparent, const char *name, const TQStringList& args) - : Monitor(parent, name, args), + : Monitor(tqparent, name, args), m_kvaio(0) { _poll = false; diff --git a/kmilo/kmilo_kvaio/kmilo_kvaio.h b/kmilo/kmilo_kvaio/kmilo_kvaio.h index ffcc604..b351f58 100644 --- a/kmilo/kmilo_kvaio/kmilo_kvaio.h +++ b/kmilo/kmilo_kvaio/kmilo_kvaio.h @@ -8,7 +8,7 @@ http://www.kde.org http://www.hackerbuero.org $ $ License: LGPL with the following explicit clarification: - This code may be linked against any version of the Qt toolkit + This code may be linked against any version of the TQt toolkit from Troll Tech, Norway. $ $Id$ @@ -35,9 +35,10 @@ class KVaio; class KMiloKVaio : public KMilo::Monitor { // Q_OBJECT + TQ_OBJECT public: - KMiloKVaio(TQObject *parent, + KMiloKVaio(TQObject *tqparent, const char *name, const TQStringList&); virtual ~KMiloKVaio(); diff --git a/kmilo/kmilo_kvaio/kvaio.cpp b/kmilo/kmilo_kvaio/kvaio.cpp index 167ddcb..b19c8ef 100644 --- a/kmilo/kmilo_kvaio/kvaio.cpp +++ b/kmilo/kmilo_kvaio/kvaio.cpp @@ -8,7 +8,7 @@ http://www.kde.org http://www.hackerbuero.org $ $ License: LGPL with the following explicit clarification: - This code may be linked against any version of the Qt toolkit + This code may be linked against any version of the TQt toolkit from Troll Tech, Norway. $ $Id$ @@ -55,12 +55,12 @@ extern "C" { } -KVaio::KVaio(KMiloKVaio *parent, const char* name) - : TQObject(parent, name), +KVaio::KVaio(KMiloKVaio *tqparent, const char* name) + : TQObject(tqparent, name), mDisp(0), mTimer (new TQTimer (this) ) { - myparent = parent; + mytqparent = tqparent; mDriver = new KVaioDriverInterface(this); @@ -163,7 +163,7 @@ void KVaio::slotVaioEvent(int event) case SONYPI_EVENT_BACK_PRESSED: if (mShowPowerStatusOnBackButton) { - showBatteryStatus (true); + showBatterytqStatus (true); } break; default: @@ -176,7 +176,7 @@ void KVaio::slotVaioEvent(int event) bool KVaio::showTextMsg(const TQString& msg) { - return myparent->showTextMsg(msg); + return mytqparent->showTextMsg(msg); } @@ -184,7 +184,7 @@ bool KVaio::showTextMsg(const TQString& msg) bool KVaio::showProgressMsg(const TQString& msg, int value) { m_progress = value; - return myparent->showProgressMsg(msg,value); + return mytqparent->showProgressMsg(msg,value); } void KVaio::blankScreen() @@ -244,7 +244,7 @@ bool KVaio::isKScreensaverAvailable() // kdDebug() << "KVaio::showTextMsg: kded is registered at dcop server." // << endl; objects = mClient.remoteObjects("kdesktop"); - if(objects.contains("KScreensaverIface")) + if(objects.tqcontains("KScreensaverIface")) { // kdDebug() << "KVaio::showTextMsg: kmilod is available at kded." // << endl; @@ -278,7 +278,7 @@ bool KVaio::isKMiloDAvailable() // kdDebug() << "KVaio::showTextMsg: kded is registered at dcop server." // << endl; objects = mClient.remoteObjects("kded"); - if(objects.contains("kmilod")) + if(objects.tqcontains("kmilod")) { // kdDebug() << "KVaio::showTextMsg: kmilod is available at kded." // << endl; @@ -306,16 +306,16 @@ void KVaio::loadConfiguration(KConfig *k) mReportUnknownEvents = k->readBoolEntry("Report_Unknown_Events", false); - mReportPowerStatus = - k->readBoolEntry("PeriodicallyReportPowerStatus", false); + mReportPowertqStatus = + k->readBoolEntry("PeriodicallyReportPowertqStatus", false); mShowPowerStatusOnBackButton = k->readBoolEntry("PowerStatusOnBackButton", true); kdDebug() << "KVaio::loadConfiguration: " << endl << " mReportUnknownEvents: " << mReportUnknownEvents << endl - << " mReportPowerStatus: " - << mReportPowerStatus << endl + << " mReportPowertqStatus: " + << mReportPowertqStatus << endl << "mShowPowerStatusOnBackButton: " << mShowPowerStatusOnBackButton << endl; } @@ -327,31 +327,31 @@ const KVaioDriverInterface* KVaio::driver() void KVaio::slotTimeout () { - showBatteryStatus (); + showBatterytqStatus (); mTimer->start (4000, true); } -bool KVaio::showBatteryStatus ( bool force ) +bool KVaio::showBatterytqStatus ( bool force ) { static bool acConnectedCache = false; static int previousChargeCache = -1; bool bat1Avail = false, bat2Avail = false, acConnected = false; int bat1Remaining = 0, bat1Max = 0, bat2Remaining = 0, bat2Max = 0; bool displayBatteryMsg = false; - bool displayACStatus = false; + bool displayACtqStatus = false; TQString text, acMsg; TQTextStream stream(text, IO_WriteOnly); // ----- - // only display on startup if mReportPowerStatus is true: - if (mReportPowerStatus==false || !force) + // only display on startup if mReportPowertqStatus is true: + if (mReportPowertqStatus==false || !force) { return true; } // query all necessary information: - (void) mDriver->getBatteryStatus(bat1Avail, bat1Remaining, bat1Max, + (void) mDriver->getBatterytqStatus(bat1Avail, bat1Remaining, bat1Max, bat2Avail, bat2Remaining, bat2Max, acConnected); @@ -364,7 +364,7 @@ bool KVaio::showBatteryStatus ( bool force ) if (acConnectedCache != acConnected || force) { - displayACStatus = true; + displayACtqStatus = true; acConnectedCache = acConnected; } @@ -379,10 +379,10 @@ bool KVaio::showBatteryStatus ( bool force ) } // ----- prepare text messages - if (displayACStatus || displayBatteryMsg) + if (displayACtqStatus || displayBatteryMsg) { - if (displayACStatus) + if (displayACtqStatus) { acMsg = acConnected ? i18n ("AC Connected") : i18n ("AC Disconnected"); } @@ -397,7 +397,7 @@ bool KVaio::showBatteryStatus ( bool force ) case 3: case 2: case 1: - stream << i18n("Caution: Battery is Almost Empty (%1% remaining).").arg(remaining); + stream << i18n("Caution: Battery is Almost Empty (%1% remaining).").tqarg(remaining); break; case 0: stream << i18n("Alert: Battery is Empty!"); @@ -406,11 +406,11 @@ bool KVaio::showBatteryStatus ( bool force ) stream << i18n("No Battery Inserted."); break; default: - stream << i18n("Remaining Battery Capacity: %1%").arg( remaining ); + stream << i18n("Remaining Battery Capacity: %1%").tqarg( remaining ); }; // show a message if the battery status changed by more then 10% or on startup - if (displayACStatus) + if (displayACtqStatus) { stream << endl << acMsg; } diff --git a/kmilo/kmilo_kvaio/kvaio.h b/kmilo/kmilo_kvaio/kvaio.h index fac0290..2e2d723 100644 --- a/kmilo/kmilo_kvaio/kvaio.h +++ b/kmilo/kmilo_kvaio/kvaio.h @@ -8,7 +8,7 @@ http://www.kde.org http://www.hackerbuero.org $ $ License: LGPL with the following explicit clarification: - This code may be linked against any version of the Qt toolkit + This code may be linked against any version of the TQt toolkit from Troll Tech, Norway. $ $Id$ @@ -53,12 +53,13 @@ class KMiloKVaio; * @author Mirko Boehm * @version 0.2 */ -class KVaio : public QObject +class KVaio : public TQObject { Q_OBJECT + TQ_OBJECT public: -// KVaio(TQObject *parent = 0, const char *name =0); - KVaio(KMiloKVaio *parent = 0, const char *name =0); +// KVaio(TQObject *tqparent = 0, const char *name =0); + KVaio(KMiloKVaio *tqparent = 0, const char *name =0); virtual ~KVaio(); const KVaioDriverInterface *driver(); @@ -73,7 +74,7 @@ protected: bool isKMiloDAvailable(); bool showTextMsg(const TQString& msg); bool showProgressMsg(const TQString& msg, int progress); - bool showBatteryStatus ( bool force = false); + bool showBatterytqStatus ( bool force = false); protected slots: void slotVaioEvent(int); void slotTimeout(); @@ -90,7 +91,7 @@ private: bool retrieveVolume(); void displayVolume(); - KMiloKVaio *myparent; + KMiloKVaio *mytqparent; DCOPRef *kmixClient, *kmixWindow; @@ -105,7 +106,7 @@ private: int m_BrightnessStep; bool mReportUnknownEvents; - bool mReportPowerStatus; + bool mReportPowertqStatus; bool mShowPowerStatusOnBackButton; TQTimer *mTimer; }; diff --git a/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp b/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp index 20a7a72..873633d 100644 --- a/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp +++ b/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp @@ -9,7 +9,7 @@ http://www.kde.org http://www.hackerbuero.org $ $ License: LGPL with the following explicit clarification: - This code may be linked against any version of the Qt toolkit + This code may be linked against any version of the TQt toolkit from Troll Tech, Norway. $ $Id$ @@ -64,8 +64,8 @@ extern "C" { #define SONYPI_IOCGBLUE _IOR('v', 8, __u8) #define SONYPI_IOCSBLUE _IOW('v', 9, __u8) -KVaioDriverInterface::KVaioDriverInterface(TQObject *parent) - : TQObject(parent), +KVaioDriverInterface::KVaioDriverInterface(TQObject *tqparent) + : TQObject(tqparent), mFd(0), mNotifier(0) { @@ -162,7 +162,7 @@ void KVaioDriverInterface::setBrightness(int value) } } -bool KVaioDriverInterface::getBatteryStatus( +bool KVaioDriverInterface::getBatterytqStatus( bool& bat1Avail, int& bat1Remaining, int& bat1Max, bool& bat2Avail, int& bat2Remaining, int& bat2Max, bool& acConnected) @@ -181,7 +181,7 @@ bool KVaioDriverInterface::getBatteryStatus( bat2Avail = batFlags & SONYPI_BFLAGS_B2; acConnected = batFlags & SONYPI_BFLAGS_AC; -// kdDebug() << "KVaioDriverInterface::getBatteryStatus: battery 1: " +// kdDebug() << "KVaioDriverInterface::getBatterytqStatus: battery 1: " // << (bat1Avail ? "available" : "not available") << endl // << " battery 2: " // << (bat2Avail ? "available" : "not available") << endl diff --git a/kmilo/kmilo_kvaio/kvaiodriverinterface.h b/kmilo/kmilo_kvaio/kvaiodriverinterface.h index 190caa1..6087b93 100644 --- a/kmilo/kmilo_kvaio/kvaiodriverinterface.h +++ b/kmilo/kmilo_kvaio/kvaiodriverinterface.h @@ -9,7 +9,7 @@ http://www.kde.org http://www.hackerbuero.org $ $ License: LGPL with the following explicit clarification: - This code may be linked against any version of the Qt toolkit + This code may be linked against any version of the TQt toolkit from Troll Tech, Norway. $ $Id$ @@ -31,18 +31,19 @@ extern "C" class TQSocketNotifier; -class KVaioDriverInterface : public QObject +class KVaioDriverInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: - KVaioDriverInterface(TQObject *parent=0); + KVaioDriverInterface(TQObject *tqparent=0); bool connectToDriver(bool listen = true); void disconnectFromDriver(); /** Return the current display brightness, a value between 0 and 255. Returns -1 if the setting cannot be retrieved. */ int brightness(); /** Get the battery status. */ - bool getBatteryStatus(bool& bat1Avail, int& bat1Remaining, int& bat1Max, + bool getBatterytqStatus(bool& bat1Avail, int& bat1Remaining, int& bat1Max, bool& bat2Avail, int& bat2Remaining, int& bat2Max, bool& acConnected); public slots: -- cgit v1.2.1