From e8181caef11d8a8607af5dd3d59dd9641bfe87e9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jan 2013 13:27:01 -0600 Subject: [PATCH] Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4 --- tdesudo/main.cpp | 8 ++++---- tdesudo/tdesudo.cpp | 20 ++++++++++---------- tdesudo/tdesudo.h | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tdesudo/main.cpp b/tdesudo/main.cpp index 9494fc1..30c9a51 100644 --- a/tdesudo/main.cpp +++ b/tdesudo/main.cpp @@ -111,10 +111,10 @@ int main(int argc, char **argv) executable = executableList[i]; /* Kubuntu has a bug in it - this is a workaround for it */ - KGlobal::dirs()->addResourceDir("apps","/usr/share/applications/kde"); - KGlobal::dirs()->addResourceDir("apps","/usr/share/applications"); + TDEGlobal::dirs()->addResourceDir("apps","/usr/share/applications/kde"); + TDEGlobal::dirs()->addResourceDir("apps","/usr/share/applications"); - TQString deskFilePath = KGlobal::dirs()->findResource("apps",executable + ".desktop"); + TQString deskFilePath = TDEGlobal::dirs()->findResource("apps",executable + ".desktop"); KDesktopFile desktopFile(deskFilePath,true); /* icon parsing */ @@ -123,7 +123,7 @@ int main(int argc, char **argv) else { TQString iconName = desktopFile.readIcon(); - icon = KGlobal::iconLoader()->iconPath(iconName, -1* KIcon::StdSizes(KIcon::SizeHuge), true); + icon = TDEGlobal::iconLoader()->iconPath(iconName, -1* KIcon::StdSizes(KIcon::SizeHuge), true); } /* generic name parsing */ diff --git a/tdesudo/tdesudo.cpp b/tdesudo/tdesudo.cpp index f996f66..455a42e 100644 --- a/tdesudo/tdesudo.cpp +++ b/tdesudo/tdesudo.cpp @@ -74,7 +74,7 @@ KdeSudo::KdeSudo(TQWidget *parent, const char *name,const TQString& icon, const noExec = true; } - p = new KProcess; + p = new TDEProcess; p->clearArguments(); // Parsins args @@ -166,9 +166,9 @@ KdeSudo::KdeSudo(TQWidget *parent, const char *name,const TQString& icon, const kdeSycoca = TQFile::encodeName(locateLocal("cache", "ksycoca")); } - connect( p, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(receivedOut(KProcess*, char*, int)) ); - connect( p, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), this, TQT_SLOT(receivedOut(KProcess*, char*, int)) ); - connect( p, TQT_SIGNAL(processExited (KProcess *)), this, TQT_SLOT(procExited(KProcess*))); + connect( p, TQT_SIGNAL(receivedStdout(TDEProcess*, char*, int)), this, TQT_SLOT(receivedOut(TDEProcess*, char*, int)) ); + connect( p, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), this, TQT_SLOT(receivedOut(TDEProcess*, char*, int)) ); + connect( p, TQT_SIGNAL(processExited (TDEProcess *)), this, TQT_SLOT(procExited(TDEProcess*))); TQString xauthenv = TQString(getenv("HOME")) + "/.Xauthority"; p->setEnvironment("XAUTHORITY", xauthenv); @@ -273,7 +273,7 @@ KdeSudo::KdeSudo(TQWidget *parent, const char *name,const TQString& icon, const if (i == 0) cmd += validArg(commandSplit[i]) + TQChar(' '); else - cmd += KProcess::quote(validArg(commandSplit[i])) + TQChar(' '); + cmd += TDEProcess::quote(validArg(commandSplit[i])) + TQChar(' '); } } @@ -290,7 +290,7 @@ KdeSudo::KdeSudo(TQWidget *parent, const char *name,const TQString& icon, const if (j == 0) cmd += validArg(argsSplit[j]) + TQChar(' '); else - cmd += KProcess::quote(validArg(argsSplit[j])) + TQChar(' '); + cmd += TDEProcess::quote(validArg(argsSplit[j])) + TQChar(' '); } } else @@ -318,14 +318,14 @@ KdeSudo::KdeSudo(TQWidget *parent, const char *name,const TQString& icon, const if (noExec) exit(0); else - p->start( KProcess::NotifyOnExit, KProcess::All ); + p->start( TDEProcess::NotifyOnExit, TDEProcess::All ); } KdeSudo::~KdeSudo() { } -void KdeSudo::receivedOut(KProcess*, char*buffer, int buflen) +void KdeSudo::receivedOut(TDEProcess*, char*buffer, int buflen) { char *pcTmp= new char[buflen+1]; strncpy(pcTmp,buffer,buflen); @@ -383,14 +383,14 @@ void KdeSudo::receivedOut(KProcess*, char*buffer, int buflen) } } -void KdeSudo::procExited(KProcess*) +void KdeSudo::procExited(TDEProcess*) { if (!keepPwd && unCleaned) { unCleaned = false; p->clearArguments(); *p << "sudo" << "-k"; - p->start( KProcess::NotifyOnExit, KProcess::All ); + p->start( TDEProcess::NotifyOnExit, TDEProcess::All ); } if (!newDcop && !iceauthorityFile.isEmpty()) diff --git a/tdesudo/tdesudo.h b/tdesudo/tdesudo.h index 18e58e3..8545ddf 100644 --- a/tdesudo/tdesudo.h +++ b/tdesudo/tdesudo.h @@ -64,11 +64,11 @@ public slots: // Public slots /* * This slot gets exectuted if sudo creates some output */ - void receivedOut(KProcess*proc, char*buffer, int buflen); + void receivedOut(TDEProcess*proc, char*buffer, int buflen); /* * This slot gets exectuted when sudo exits */ - void procExited(KProcess *proc); + void procExited(TDEProcess *proc); /* * This slot overrides the slot from KPasswordDialog * @see KPasswordDialog @@ -78,7 +78,7 @@ public slots: // Public slots TQString validArg(TQString arg); private: // Private attributes - KProcess * p; + TDEProcess * p; bool bError; bool newDcop; bool keepPwd;