From bd55e01bc4764c5daa84bf46db6978d43898d619 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jan 2013 13:26:15 -0600 Subject: [PATCH] Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4 --- src/common/common/number.cpp | 2 +- src/common/global/process.cpp | 18 +++++++++--------- src/common/global/process.h | 16 ++++++++-------- src/common/nokde/nokde_kcmdlineargs.cpp | 6 +++--- src/common/nokde/nokde_kprocess.cpp | 24 ++++++++++++------------ src/common/nokde/nokde_kprocess.h | 14 +++++++------- src/devices/base/device_group.cpp | 2 +- src/libgui/likeback.cpp | 6 +++--- src/libgui/likeback.h | 4 ++-- src/libgui/toplevel.cpp | 4 ++-- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/common/common/number.cpp b/src/common/common/number.cpp index e0b5b0a..39a9c73 100644 --- a/src/common/common/number.cpp +++ b/src/common/common/number.cpp @@ -179,7 +179,7 @@ TQString formatNumber(ulong v) #if defined(NO_KDE) return TQString::number(v); #else - return KGlobal::locale()->formatNumber(v, 0); + return TDEGlobal::locale()->formatNumber(v, 0); #endif } diff --git a/src/common/global/process.cpp b/src/common/global/process.cpp index 238d336..9dc4761 100644 --- a/src/common/global/process.cpp +++ b/src/common/global/process.cpp @@ -34,10 +34,10 @@ Process::State Process::runSynchronously(Base &process, RunActions actions, uint Process::Base::Base(TQObject *parent, const char *name) : TQObject(parent, name), _state(Stopped) { - _process = new KProcess(this); - connect(_process, TQT_SIGNAL(processExited(KProcess *)), TQT_SLOT(exited())); - connect(_process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), TQT_SLOT(receivedStdout(KProcess*, char *, int))); - connect(_process, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), TQT_SLOT(receivedStderr(KProcess*, char *, int))); + _process = new TDEProcess(this); + connect(_process, TQT_SIGNAL(processExited(TDEProcess *)), TQT_SLOT(exited())); + connect(_process, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)), TQT_SLOT(receivedStdout(TDEProcess*, char *, int))); + connect(_process, TQT_SIGNAL(receivedStderr(TDEProcess *, char *, int)), TQT_SLOT(receivedStderr(TDEProcess*, char *, int))); _timer = new TQTimer(this); connect(_timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutSlot())); } @@ -82,7 +82,7 @@ bool Process::Base::start(uint timeout) #if defined(NO_KDE) if ( !_process->start() ) { #else - if ( !_process->start(KProcess::NotifyOnExit, KProcess::All) ) { + if ( !_process->start(TDEProcess::NotifyOnExit, TDEProcess::All) ) { #endif _state = StartFailed; return false; @@ -144,20 +144,20 @@ bool Process::Base::isFilteredLine(const TQString &line) } //---------------------------------------------------------------------------- -void Process::StringOutput::receivedStdout(KProcess*, char *data, int len) +void Process::StringOutput::receivedStdout(TDEProcess*, char *data, int len) { _stdout += TQString::fromLatin1(data, len); emit stdoutDataReceived(); } -void Process::StringOutput::receivedStderr(KProcess*, char *data, int len) +void Process::StringOutput::receivedStderr(TDEProcess*, char *data, int len) { _stderr += TQString::fromLatin1(data, len); emit stderrDataReceived(); } //---------------------------------------------------------------------------- -void Process::LineBase::receivedStdout(KProcess*, char *data, int len) +void Process::LineBase::receivedStdout(TDEProcess*, char *data, int len) { for (uint i=0; i #include #include -class KProcess; +class TDEProcess; #include "global.h" namespace PURL { class Directory; } @@ -57,14 +57,14 @@ signals: protected slots: void exited(); void timeoutSlot(); - virtual void receivedStdout(KProcess*, char *buffer, int len) = 0; - virtual void receivedStderr(KProcess*, char *buffer, int len) = 0; + virtual void receivedStdout(TDEProcess*, char *buffer, int len) = 0; + virtual void receivedStderr(TDEProcess*, char *buffer, int len) = 0; friend State runSynchronously(Base &, RunActions, uint); protected: State _state; - KProcess *_process; + TDEProcess *_process; TQTimer *_timer; TQString _stdout, _stderr; @@ -82,8 +82,8 @@ public: TQString serr() const { return _stderr; } private slots: - virtual void receivedStdout(KProcess *, char *buffer, int len); - virtual void receivedStderr(KProcess *, char *buffer, int len); + virtual void receivedStdout(TDEProcess *, char *buffer, int len); + virtual void receivedStderr(TDEProcess *, char *buffer, int len); }; //---------------------------------------------------------------------------- @@ -95,8 +95,8 @@ public: LineBase(TQObject *parent = 0, const char *name = 0) : Base(parent, name) {} private slots: - virtual void receivedStdout(KProcess *, char *buffer, int len); - virtual void receivedStderr(KProcess *, char *buffer, int len); + virtual void receivedStdout(TDEProcess *, char *buffer, int len); + virtual void receivedStderr(TDEProcess *, char *buffer, int len); private: virtual void addStdoutLine(const TQString &line) = 0; diff --git a/src/common/nokde/nokde_kcmdlineargs.cpp b/src/common/nokde/nokde_kcmdlineargs.cpp index dea5d6a..6f45ef0 100644 --- a/src/common/nokde/nokde_kcmdlineargs.cpp +++ b/src/common/nokde/nokde_kcmdlineargs.cpp @@ -757,10 +757,10 @@ void TDECmdLineArgs::enable_i18n() { // called twice or too late -/* if (KGlobal::_locale) +/* if (TDEGlobal::_locale) return; - if (!KGlobal::_instance) { + if (!TDEGlobal::_instance) { TDEInstance *instance = new TDEInstance(about); (void) instance->config(); // Don't delete instance! @@ -770,7 +770,7 @@ TDECmdLineArgs::enable_i18n() void TDECmdLineArgs::usage(const TQString &error) { -// assert(KGlobal::_locale); +// assert(TDEGlobal::_locale); # if [[[TQT_VERSION IS DEPRECATED]]]<0x040000 TQCString localError = error.local8Bit(); #else diff --git a/src/common/nokde/nokde_kprocess.cpp b/src/common/nokde/nokde_kprocess.cpp index 8bbb711..ee3e35b 100644 --- a/src/common/nokde/nokde_kprocess.cpp +++ b/src/common/nokde/nokde_kprocess.cpp @@ -11,7 +11,7 @@ # include #endif -KProcess::KProcess(TQObject *parent, const char *name) +TDEProcess::TDEProcess(TQObject *parent, const char *name) : TQObject(parent, name) { _process = new Q3Process(this); @@ -20,7 +20,7 @@ KProcess::KProcess(TQObject *parent, const char *name) connect(_process, TQT_SIGNAL(readyReadStderr()), TQT_SLOT(readyReadStderrSlot())); } -bool KProcess::start() +bool TDEProcess::start() { _process->setArguments(_arguments); TQStringList env; @@ -31,26 +31,26 @@ bool KProcess::start() return _process->start(env.isEmpty() ? 0 : &env); } -void KProcess::processExitedSlot() +void TDEProcess::processExitedSlot() { readyReadStdoutSlot(); readyReadStderrSlot(); emit processExited(this); } -void KProcess::readyReadStdoutSlot() +void TDEProcess::readyReadStdoutSlot() { TQByteArray a = _process->readStdout(); emit receivedStdout(this, a.data(), a.count()); } -void KProcess::readyReadStderrSlot() +void TDEProcess::readyReadStderrSlot() { TQByteArray a = _process->readStderr(); emit receivedStderr(this, a.data(), a.count()); } -bool KProcess::writeStdin(const char *buffer, int len) +bool TDEProcess::writeStdin(const char *buffer, int len) { #if [[[TQT_VERSION IS DEPRECATED]]]<0x040000 TQByteArray a; @@ -62,13 +62,13 @@ bool KProcess::writeStdin(const char *buffer, int len) return true; } -bool KProcess::kill() +bool TDEProcess::kill() { _process->kill(); return true; } -bool KProcess::kill(int n) +bool TDEProcess::kill(int n) { #if defined(Q_OS_UNIX) return ( ::kill(_process->processIdentifier(), n)!=-1 ); @@ -78,22 +78,22 @@ bool KProcess::kill(int n) #endif } -int KProcess::exitStatus() const +int TDEProcess::exitStatus() const { return _process->exitStatus(); } -bool KProcess::isRunning() const +bool TDEProcess::isRunning() const { return _process->isRunning(); } -void KProcess::setWorkingDirectory(const TQDir &dir) +void TDEProcess::setWorkingDirectory(const TQDir &dir) { return _process->setWorkingDirectory(dir); } -void KProcess::setUseShell(bool useShell) +void TDEProcess::setUseShell(bool useShell) { // ### TODO: just issue "/bin/sh" "-c" "command" Q_ASSERT(false); diff --git a/src/common/nokde/nokde_kprocess.h b/src/common/nokde/nokde_kprocess.h index 06d6851..b51d05b 100644 --- a/src/common/nokde/nokde_kprocess.h +++ b/src/common/nokde/nokde_kprocess.h @@ -10,15 +10,15 @@ class TQProcess; class Q3Process; #endif -class KProcess : public TQObject +class TDEProcess : public TQObject { Q_OBJECT public: - KProcess(TQObject *parent = 0, const char *name = 0); + TDEProcess(TQObject *parent = 0, const char *name = 0); void clearArguments() { _arguments.clear(); } - KProcess &operator<< (const TQString &arg) { _arguments += arg; return *this; } - KProcess &operator<< (const TQStringList &args) { _arguments += args; return *this; } + TDEProcess &operator<< (const TQString &arg) { _arguments += arg; return *this; } + TDEProcess &operator<< (const TQStringList &args) { _arguments += args; return *this; } TQStringList args() const { return _arguments; } void setEnvironment(const TQString &name, const TQString &value) { _environment += name + "=" + value; } bool start(); @@ -31,9 +31,9 @@ public: void setUseShell(bool useShell); signals: - void processExited(KProcess *process); - void receivedStdout(KProcess *process, char *buffer, int len); - void receivedStderr(KProcess *process, char *buffer, int len); + void processExited(TDEProcess *process); + void receivedStdout(TDEProcess *process, char *buffer, int len); + void receivedStderr(TDEProcess *process, char *buffer, int len); private slots: void processExitedSlot(); diff --git a/src/devices/base/device_group.cpp b/src/devices/base/device_group.cpp index 169a103..8cace79 100644 --- a/src/devices/base/device_group.cpp +++ b/src/devices/base/device_group.cpp @@ -41,7 +41,7 @@ class Tick { public: Tick() {} Tick(double value, double oValue) { - s = KGlobal::locale()->formatNumber(value, 1); + s = TDEGlobal::locale()->formatNumber(value, 1); min = oValue; } TQString s; diff --git a/src/libgui/likeback.cpp b/src/libgui/likeback.cpp index 6740322..d5af677 100644 --- a/src/libgui/likeback.cpp +++ b/src/libgui/likeback.cpp @@ -451,9 +451,9 @@ void LikeBack::init(bool isDevelopmentVersion, Button buttons) { if (m_process) return; - m_process = new KProcess(); + m_process = new TDEProcess(); *m_process << TQString::fromLatin1("kcmshell") << TQString::fromLatin1("kcm_useraccount"); - connect( m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(endFetchingEmailFrom()) ); + connect( m_process, TQT_SIGNAL(processExited(TDEProcess*)), TQT_SLOT(endFetchingEmailFrom()) ); if (!m_process->start()) { kdDebug() << "Couldn't start kcmshell.." << endl; delete m_process; @@ -625,7 +625,7 @@ void LikeBackDialog::send() "protocol=" + KURL::encode_string("1.0") + "&" + "type=" + KURL::encode_string(type) + "&" + "version=" + KURL::encode_string(LikeBack::about()->version()) + "&" + - "locale=" + KURL::encode_string(KGlobal::locale()->language()) + "&" + + "locale=" + KURL::encode_string(TDEGlobal::locale()->language()) + "&" + "window=" + KURL::encode_string(m_windowName) + "&" + "context=" + KURL::encode_string(m_context) + "&" + "comment=" + KURL::encode_string(m_comment->text()) + "&" + diff --git a/src/libgui/likeback.h b/src/libgui/likeback.h index 95046c3..fa1e260 100644 --- a/src/libgui/likeback.h +++ b/src/libgui/likeback.h @@ -26,7 +26,7 @@ class TQTextEdit; class TQToolButton; class TQPushButton; -class KProcess; +class TDEProcess; class KConfig; class TDEAboutData; @@ -87,7 +87,7 @@ class LikeBack : public TQWidget Button m_buttons; TQToolButton *m_configureButton; TQString m_fetchedEmail; - KProcess *m_process; + TDEProcess *m_process; static TQString s_hostName; static TQString s_remotePath; static TQ_UINT16 s_hostPort; diff --git a/src/libgui/toplevel.cpp b/src/libgui/toplevel.cpp index c724d1a..a9ac10e 100644 --- a/src/libgui/toplevel.cpp +++ b/src/libgui/toplevel.cpp @@ -402,7 +402,7 @@ void MainWindow::openRecentFile(const KURL &kurl) void MainWindow::configureToolbar() { - saveMainWindowSettings(KGlobal::config(), "MainWindow"); + saveMainWindowSettings(TDEGlobal::config(), "MainWindow"); KEditToolbar dlg(actionCollection()); connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_SLOT(applyToolbarSettings())); dlg.exec(); @@ -411,7 +411,7 @@ void MainWindow::configureToolbar() void MainWindow::applyToolbarSettings() { createGUI(); - applyMainWindowSettings(KGlobal::config(), "MainWindow"); + applyMainWindowSettings(TDEGlobal::config(), "MainWindow"); } void MainWindow::configure(ConfigCenter::Type showType)