diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdesu | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdesu')
-rw-r--r-- | kdesu/client.cpp | 92 | ||||
-rw-r--r-- | kdesu/client.h | 36 | ||||
-rw-r--r-- | kdesu/kcookie.cpp | 32 | ||||
-rw-r--r-- | kdesu/kcookie.h | 32 | ||||
-rw-r--r-- | kdesu/kdesu_pty.cpp | 6 | ||||
-rw-r--r-- | kdesu/kdesu_pty.h | 6 | ||||
-rw-r--r-- | kdesu/process.cpp | 32 | ||||
-rw-r--r-- | kdesu/process.h | 26 | ||||
-rw-r--r-- | kdesu/ssh.cpp | 26 | ||||
-rw-r--r-- | kdesu/ssh.h | 28 | ||||
-rw-r--r-- | kdesu/stub.cpp | 18 | ||||
-rw-r--r-- | kdesu/stub.h | 32 | ||||
-rw-r--r-- | kdesu/su.cpp | 24 | ||||
-rw-r--r-- | kdesu/su.h | 6 |
14 files changed, 198 insertions, 198 deletions
diff --git a/kdesu/client.cpp b/kdesu/client.cpp index ae97f0af8..5261886fc 100644 --- a/kdesu/client.cpp +++ b/kdesu/client.cpp @@ -25,10 +25,10 @@ #include <sys/un.h> #include <sys/stat.h> -#include <qglobal.h> -#include <qcstring.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqglobal.h> +#include <tqcstring.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kdebug.h> #include <kstandarddirs.h> @@ -39,7 +39,7 @@ class KDEsuClient::KDEsuClientPrivate { public: - QString daemon; + TQString daemon; }; #ifndef SUN_LEN @@ -51,7 +51,7 @@ KDEsuClient::KDEsuClient() { sockfd = -1; #ifdef Q_WS_X11 - QCString display(getenv("DISPLAY")); + TQCString display(getenv("DISPLAY")); if (display.isEmpty()) { kdWarning(900) << k_lineinfo << "$DISPLAY is not set\n"; @@ -59,12 +59,12 @@ KDEsuClient::KDEsuClient() } // strip the screen number from the display - display.replace(QRegExp("\\.[0-9]+$"), ""); + display.replace(TQRegExp("\\.[0-9]+$"), ""); #else - QCString display("QWS"); + TQCString display("QWS"); #endif - sock = QFile::encodeName(locateLocal("socket", QString("kdesud_%1").arg(display))); + sock = TQFile::encodeName(locateLocal("socket", TQString("kdesud_%1").arg(display))); d = new KDEsuClientPrivate; connect(); } @@ -165,9 +165,9 @@ int KDEsuClient::connect() return 0; } -QCString KDEsuClient::escape(const QCString &str) +TQCString KDEsuClient::escape(const TQCString &str) { - QCString copy = str; + TQCString copy = str; int n = 0; while ((n = copy.find("\\", n)) != -1) { @@ -185,7 +185,7 @@ QCString KDEsuClient::escape(const QCString &str) return copy; } -int KDEsuClient::command(const QCString &cmd, QCString *result) +int KDEsuClient::command(const TQCString &cmd, TQCString *result) { if (sockfd < 0) return -1; @@ -202,7 +202,7 @@ int KDEsuClient::command(const QCString &cmd, QCString *result) } buf[nbytes] = '\000'; - QCString reply = buf; + TQCString reply = buf; if (reply.left(2) != "OK") return -1; @@ -213,17 +213,17 @@ int KDEsuClient::command(const QCString &cmd, QCString *result) int KDEsuClient::setPass(const char *pass, int timeout) { - QCString cmd = "PASS "; + TQCString cmd = "PASS "; cmd += escape(pass); cmd += " "; - cmd += QCString().setNum(timeout); + cmd += TQCString().setNum(timeout); cmd += "\n"; return command(cmd); } -int KDEsuClient::exec(const QCString &prog, const QCString &user, const QCString &options, const QCStringList &env) +int KDEsuClient::exec(const TQCString &prog, const TQCString &user, const TQCString &options, const QCStringList &env) { - QCString cmd; + TQCString cmd; cmd = "EXEC "; cmd += escape(prog); cmd += " "; @@ -243,9 +243,9 @@ int KDEsuClient::exec(const QCString &prog, const QCString &user, const QCString return command(cmd); } -int KDEsuClient::setHost(const QCString &host) +int KDEsuClient::setHost(const TQCString &host) { - QCString cmd = "HOST "; + TQCString cmd = "HOST "; cmd += escape(host); cmd += "\n"; return command(cmd); @@ -253,61 +253,61 @@ int KDEsuClient::setHost(const QCString &host) int KDEsuClient::setPriority(int prio) { - QCString cmd; + TQCString cmd; cmd.sprintf("PRIO %d\n", prio); return command(cmd); } int KDEsuClient::setScheduler(int sched) { - QCString cmd; + TQCString cmd; cmd.sprintf("SCHD %d\n", sched); return command(cmd); } -int KDEsuClient::delCommand(const QCString &key, const QCString &user) +int KDEsuClient::delCommand(const TQCString &key, const TQCString &user) { - QCString cmd = "DEL "; + TQCString cmd = "DEL "; cmd += escape(key); cmd += " "; cmd += escape(user); cmd += "\n"; return command(cmd); } -int KDEsuClient::setVar(const QCString &key, const QCString &value, int timeout, - const QCString &group) +int KDEsuClient::setVar(const TQCString &key, const TQCString &value, int timeout, + const TQCString &group) { - QCString cmd = "SET "; + TQCString cmd = "SET "; cmd += escape(key); cmd += " "; cmd += escape(value); cmd += " "; cmd += escape(group); cmd += " "; - cmd += QCString().setNum(timeout); + cmd += TQCString().setNum(timeout); cmd += "\n"; return command(cmd); } -QCString KDEsuClient::getVar(const QCString &key) +TQCString KDEsuClient::getVar(const TQCString &key) { - QCString cmd = "GET "; + TQCString cmd = "GET "; cmd += escape(key); cmd += "\n"; - QCString reply; + TQCString reply; command(cmd, &reply); return reply; } -QValueList<QCString> KDEsuClient::getKeys(const QCString &group) +TQValueList<TQCString> KDEsuClient::getKeys(const TQCString &group) { - QCString cmd = "GETK "; + TQCString cmd = "GETK "; cmd += escape(group); cmd += "\n"; - QCString reply; + TQCString reply; command(cmd, &reply); int index=0, pos; - QValueList<QCString> list; + TQValueList<TQCString> list; if( !reply.isEmpty() ) { // kdDebug(900) << "Found a matching entry: " << reply << endl; @@ -332,9 +332,9 @@ QValueList<QCString> KDEsuClient::getKeys(const QCString &group) return list; } -bool KDEsuClient::findGroup(const QCString &group) +bool KDEsuClient::findGroup(const TQCString &group) { - QCString cmd = "CHKG "; + TQCString cmd = "CHKG "; cmd += escape(group); cmd += "\n"; if( command(cmd) == -1 ) @@ -342,25 +342,25 @@ bool KDEsuClient::findGroup(const QCString &group) return true; } -int KDEsuClient::delVar(const QCString &key) +int KDEsuClient::delVar(const TQCString &key) { - QCString cmd = "DELV "; + TQCString cmd = "DELV "; cmd += escape(key); cmd += "\n"; return command(cmd); } -int KDEsuClient::delGroup(const QCString &group) +int KDEsuClient::delGroup(const TQCString &group) { - QCString cmd = "DELG "; + TQCString cmd = "DELG "; cmd += escape(group); cmd += "\n"; return command(cmd); } -int KDEsuClient::delVars(const QCString &special_key) +int KDEsuClient::delVars(const TQCString &special_key) { - QCString cmd = "DELS "; + TQCString cmd = "DELS "; cmd += escape(special_key); cmd += "\n"; return command(cmd); @@ -373,7 +373,7 @@ int KDEsuClient::ping() int KDEsuClient::exitCode() { - QCString result; + TQCString result; if (command("EXIT\n", &result) != 0) return -1; @@ -385,9 +385,9 @@ int KDEsuClient::stopServer() return command("STOP\n"); } -static QString findDaemon() +static TQString findDaemon() { - QString daemon = locate("bin", "kdesud"); + TQString daemon = locate("bin", "kdesud"); if (daemon.isEmpty()) // if not in KDEDIRS, rely on PATH daemon = KStandardDirs::findExe("kdesud"); @@ -406,7 +406,7 @@ bool KDEsuClient::isServerSGID() return false; KDE_struct_stat sbuf; - if (KDE_stat(QFile::encodeName(d->daemon), &sbuf) < 0) + if (KDE_stat(TQFile::encodeName(d->daemon), &sbuf) < 0) { kdWarning(900) << k_lineinfo << "stat(): " << perror << "\n"; return false; diff --git a/kdesu/client.h b/kdesu/client.h index 00957b1ed..c1df06ff1 100644 --- a/kdesu/client.h +++ b/kdesu/client.h @@ -15,7 +15,7 @@ #ifndef __KDE_su_Client_h_Included__ #define __KDE_su_Client_h_Included__ -#include <qglobal.h> +#include <tqglobal.h> #include <kdelibs_export.h> #ifdef Q_OS_UNIX @@ -24,10 +24,10 @@ #include <sys/socket.h> #include <sys/un.h> -#include <qcstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqvaluelist.h> -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> QCStringList; /** * A client class to access kdesud, the KDE su daemon. Kdesud can assist in @@ -62,7 +62,7 @@ public: * @param env Extra environment variables. * @return Zero on success, -1 on failure. */ - int exec(const QCString &command, const QCString &user, const QCString &options=0, const QCStringList &env=QCStringList()); + int exec(const TQCString &command, const TQCString &user, const TQCString &options=0, const QCStringList &env=QCStringList()); /** * Wait for the last command to exit and return the exit code. @@ -82,7 +82,7 @@ public: /** * Set the target host (optional). */ - int setHost(const QCString &host); + int setHost(const TQCString &host); /** * Set the desired priority (optional), see StubProcess. @@ -100,7 +100,7 @@ public: * @param user The user. * @return zero on success, -1 on an error */ - int delCommand(const QCString &command, const QCString &user); + int delCommand(const TQCString &command, const TQCString &user); /** * Set a persistent variable. @@ -111,21 +111,21 @@ public: * @param group Make the key part of a group. See delGroup. * @return zero on success, -1 on failure. */ - int setVar(const QCString &key, const QCString &value, int timeout=0, const QCString &group=0); + int setVar(const TQCString &key, const TQCString &value, int timeout=0, const TQCString &group=0); /** * Get a persistent variable. * @param key The name of the variable. * @return Its value. */ - QCString getVar(const QCString &key); + TQCString getVar(const TQCString &key); /** * Gets all the keys that are membes of the given group. * @param group the group name of the variables. * @return a list of the keys in the group. */ - QValueList<QCString> getKeys(const QCString &group); + TQValueList<TQCString> getKeys(const TQCString &group); /** * Returns true if the specified group exists is @@ -134,19 +134,19 @@ public: * @param group the group key * @return true if the group is found */ - bool findGroup(const QCString &group); + bool findGroup(const TQCString &group); /** * Delete a persistent variable. * @param key The name of the variable. * @return zero on success, -1 on failure. */ - int delVar(const QCString &key); + int delVar(const TQCString &key); /** * Delete all persistent variables with the given key. * - * A specicalized variant of delVar(QCString) that removes all + * A specicalized variant of delVar(TQCString) that removes all * subsets of the cached varaibles given by @p key. In order for all * cached variables related to this key to be deleted properly, the * value given to the @p group argument when the setVar function @@ -158,7 +158,7 @@ public: * @param special_key the name of the variable. * @return zero on success, -1 on failure. */ - int delVars(const QCString &special_key); + int delVars(const TQCString &special_key); /** * Delete all persistent variables in a group. @@ -166,7 +166,7 @@ public: * @param group the group name. See setVar. * @return */ - int delGroup(const QCString &group); + int delGroup(const TQCString &group); /** * Ping kdesud. This can be used for diagnostics. @@ -193,10 +193,10 @@ private: int connect(); int sockfd; - QCString sock; + TQCString sock; - int command(const QCString &cmd, QCString *result=0L); - QCString escape(const QCString &str); + int command(const TQCString &cmd, TQCString *result=0L); + TQCString escape(const TQCString &str); class KDEsuClientPrivate; KDEsuClientPrivate *d; diff --git a/kdesu/kcookie.cpp b/kdesu/kcookie.cpp index 355dad82e..f60ec7314 100644 --- a/kdesu/kcookie.cpp +++ b/kdesu/kcookie.cpp @@ -19,10 +19,10 @@ #include <errno.h> #include <signal.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qglobal.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqglobal.h> +#include <tqfile.h> #include <dcopclient.h> @@ -39,7 +39,7 @@ KCookie::KCookie() setDcopTransport("local"); } -void KCookie::setDcopTransport(const QCString &dcopTransport) +void KCookie::setDcopTransport(const TQCString &dcopTransport) { m_dcopTransport = dcopTransport; m_bHaveDCOPCookies = false; @@ -49,7 +49,7 @@ void KCookie::setDcopTransport(const QCString &dcopTransport) m_ICEAuth = ""; } -QCStringList KCookie::split(const QCString &line, char ch) +QCStringList KCookie::split(const TQCString &line, char ch) { QCStringList result; @@ -96,19 +96,19 @@ void KCookie::getXCookie() return; } #ifdef Q_WS_X11 // No need to mess with X Auth stuff - QCString disp = m_Display; + TQCString disp = m_Display; if (!memcmp(disp.data(), "localhost:", 10)) disp.remove(0, 9); - QString cmd = "xauth list "+KProcess::quote(disp); + TQString cmd = "xauth list "+KProcess::quote(disp); blockSigChild(); // pclose uses waitpid() - if (!(f = popen(QFile::encodeName(cmd), "r"))) + if (!(f = popen(TQFile::encodeName(cmd), "r"))) { kdError(900) << k_lineinfo << "popen(): " << perror << "\n"; unblockSigChild(); return; } - QCString output = fgets(buf, 1024, f); + TQCString output = fgets(buf, 1024, f); if (pclose(f) < 0) { kdError(900) << k_lineinfo << "Could not run xauth.\n"; @@ -137,10 +137,10 @@ void KCookie::getICECookie() FILE *f; char buf[1024]; - QCString dcopsrv = getenv("DCOPSERVER"); + TQCString dcopsrv = getenv("DCOPSERVER"); if (dcopsrv.isEmpty()) { - QCString dcopFile = DCOPClient::dcopServerFile(); + TQCString dcopFile = DCOPClient::dcopServerFile(); if (!(f = fopen(dcopFile, "r"))) { kdWarning(900) << k_lineinfo << "Cannot open " << dcopFile << ".\n"; @@ -163,7 +163,7 @@ void KCookie::getICECookie() if (strncmp((*it).data(), m_dcopTransport.data(), m_dcopTransport.length()) != 0) continue; m_DCOPSrv = *it; - QCString cmd = DCOPClient::iceauthPath()+" list netid="+QFile::encodeName(KProcess::quote(m_DCOPSrv)); + TQCString cmd = DCOPClient::iceauthPath()+" list netid="+TQFile::encodeName(KProcess::quote(m_DCOPSrv)); blockSigChild(); if (!(f = popen(cmd, "r"))) { @@ -203,21 +203,21 @@ void KCookie::getICECookie() m_bHaveICECookies = true; } -QCString KCookie::dcopServer() +TQCString KCookie::dcopServer() { if (!m_bHaveDCOPCookies) getICECookie(); return m_DCOPSrv; } -QCString KCookie::dcopAuth() +TQCString KCookie::dcopAuth() { if (!m_bHaveDCOPCookies) getICECookie(); return m_DCOPAuth; } -QCString KCookie::iceAuth() +TQCString KCookie::iceAuth() { if (!m_bHaveICECookies) getICECookie(); diff --git a/kdesu/kcookie.h b/kdesu/kcookie.h index ed1cbf1d2..4bd9fbf1e 100644 --- a/kdesu/kcookie.h +++ b/kdesu/kcookie.h @@ -13,10 +13,10 @@ #ifndef __KCookie_h_Included__ #define __KCookie_h_Included__ -#include <qcstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqvaluelist.h> -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> QCStringList; /** @@ -32,40 +32,40 @@ public: /** * Returns the X11 display. */ - QCString display() { return m_Display; } + TQCString display() { return m_Display; } #ifdef Q_WS_X11 /** * Returns the X11 magic cookie, if available. */ - QCString displayAuth() { return m_DisplayAuth; } + TQCString displayAuth() { return m_DisplayAuth; } #endif /** * Select the DCOP transport to look for. Default: "local" */ - void setDcopTransport(const QCString &dcopTransport); + void setDcopTransport(const TQCString &dcopTransport); /** * Returns the netid where the dcopserver is running */ - QCString dcopServer(); + TQCString dcopServer(); /** * Returns a list of magic cookies for DCOP protocol authentication. * The order is the same as in dcopServer(). */ - QCString dcopAuth(); + TQCString dcopAuth(); /** * Returns a list of magic cookies for the ICE protocol. */ - QCString iceAuth(); + TQCString iceAuth(); private: void getXCookie(); void getICECookie(); - QCStringList split(const QCString &line, char ch); + QCStringList split(const TQCString &line, char ch); void blockSigChild(); void unblockSigChild(); @@ -73,14 +73,14 @@ private: bool m_bHaveDCOPCookies; bool m_bHaveICECookies; - QCString m_Display; + TQCString m_Display; #ifdef Q_WS_X11 - QCString m_DisplayAuth; + TQCString m_DisplayAuth; #endif - QCString m_DCOPSrv; - QCString m_DCOPAuth; - QCString m_ICEAuth; - QCString m_dcopTransport; + TQCString m_DCOPSrv; + TQCString m_DCOPAuth; + TQCString m_ICEAuth; + TQCString m_dcopTransport; class KCookiePrivate; KCookiePrivate *d; diff --git a/kdesu/kdesu_pty.cpp b/kdesu/kdesu_pty.cpp index 3b0499f58..8f48f0b88 100644 --- a/kdesu/kdesu_pty.cpp +++ b/kdesu/kdesu_pty.cpp @@ -37,8 +37,8 @@ #include <pty.h> #endif -#include <qglobal.h> -#include <qcstring.h> +#include <tqglobal.h> +#include <tqcstring.h> #include <kdebug.h> #include <kstandarddirs.h> @@ -292,7 +292,7 @@ int PTY::unlockpt() * Return the slave side name. */ -QCString PTY::ptsname() +TQCString PTY::ptsname() { if (ptyfd < 0) return 0; diff --git a/kdesu/kdesu_pty.h b/kdesu/kdesu_pty.h index c9eadceda..1a6a12c35 100644 --- a/kdesu/kdesu_pty.h +++ b/kdesu/kdesu_pty.h @@ -18,7 +18,7 @@ #ifndef __PTY_h_Included__ #define __PTY_h_Included__ -#include <qcstring.h> +#include <tqcstring.h> #include <kdelibs_export.h> @@ -57,12 +57,12 @@ public: * Get the slave name. * @return The slave name. */ - QCString ptsname(); + TQCString ptsname(); private: int ptyfd; - QCString ptyname, ttyname; + TQCString ptyname, ttyname; class PTYPrivate; PTYPrivate *d; diff --git a/kdesu/process.cpp b/kdesu/process.cpp index bb09c309f..06558ce04 100644 --- a/kdesu/process.cpp +++ b/kdesu/process.cpp @@ -44,9 +44,9 @@ #include <sys/select.h> // Needed on some systems. #endif -#include <qglobal.h> -#include <qcstring.h> -#include <qfile.h> +#include <tqglobal.h> +#include <tqcstring.h> +#include <tqfile.h> #include <kconfig.h> #include <kdebug.h> @@ -76,7 +76,7 @@ bool PtyProcess::checkPid(pid_t pid) { KConfig* config = KGlobal::config(); config->setGroup("super-user-command"); - QString superUserCommand = config->readEntry("super-user-command", DEFAULT_SUPER_USER_COMMAND); + TQString superUserCommand = config->readEntry("super-user-command", DEFAULT_SUPER_USER_COMMAND); //sudo does not accept signals from user so we except it if (superUserCommand == "sudo") { return true; @@ -172,10 +172,10 @@ const QCStringList& PtyProcess::environment() const * one time. */ -QCString PtyProcess::readLine(bool block) +TQCString PtyProcess::readLine(bool block) { int pos; - QCString ret; + TQCString ret; if (!m_Inbuf.isEmpty()) { @@ -244,9 +244,9 @@ QCString PtyProcess::readLine(bool block) return ret; } -QCString PtyProcess::readAll(bool block) +TQCString PtyProcess::readAll(bool block) { - QCString ret; + TQCString ret; if (!m_Inbuf.isEmpty()) { @@ -299,7 +299,7 @@ QCString PtyProcess::readAll(bool block) } -void PtyProcess::writeLine(const QCString &line, bool addnl) +void PtyProcess::writeLine(const TQCString &line, bool addnl) { if (!line.isEmpty()) write(m_Fd, line, line.length()); @@ -308,9 +308,9 @@ void PtyProcess::writeLine(const QCString &line, bool addnl) } -void PtyProcess::unreadLine(const QCString &line, bool addnl) +void PtyProcess::unreadLine(const TQCString &line, bool addnl) { - QCString tmp = line; + TQCString tmp = line; if (addnl) tmp += '\n'; if (!tmp.isEmpty()) @@ -321,7 +321,7 @@ void PtyProcess::unreadLine(const QCString &line, bool addnl) * Fork and execute the command. This returns in the parent. */ -int PtyProcess::exec(const QCString &command, const QCStringList &args) +int PtyProcess::exec(const TQCString &command, const QCStringList &args) { kdDebug(900) << k_lineinfo << "Running `" << command << "'\n"; @@ -370,18 +370,18 @@ int PtyProcess::exec(const QCString &command, const QCStringList &args) // From now on, terminal output goes through the tty. - QCString path; + TQCString path; if (command.contains('/')) path = command; else { - QString file = KStandardDirs::findExe(command); + TQString file = KStandardDirs::findExe(command); if (file.isEmpty()) { kdError(900) << k_lineinfo << command << " not found\n"; _exit(1); } - path = QFile::encodeName(file); + path = TQFile::encodeName(file); } const char **argp = (const char **)malloc((args.count()+2)*sizeof(char *)); @@ -506,7 +506,7 @@ int PtyProcess::waitForChild() if (ret) { - QCString output = readAll(false); + TQCString output = readAll(false); bool lineStart = true; while (!output.isNull()) { diff --git a/kdesu/process.h b/kdesu/process.h index 8a2004d92..c45132a9c 100644 --- a/kdesu/process.h +++ b/kdesu/process.h @@ -15,15 +15,15 @@ #include <sys/types.h> -#include <qcstring.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> #include <kdelibs_export.h> class PTY; -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> QCStringList; /** * Synchronous communication with tty programs. @@ -46,7 +46,7 @@ public: * @param command The command to execute. * @param args The arguments to the command. */ - int exec(const QCString &command, const QCStringList &args); + int exec(const TQCString &command, const QCStringList &args); /** * Reads a line from the program's standard out. Depending on the @em block @@ -54,33 +54,33 @@ public: * @param block Block until a full line is read? * @return The output string. */ - QCString readLine(bool block=true); + TQCString readLine(bool block=true); /** * Read all available output from the program's standard out. * @param block If no output is in the buffer, should the function block * @return The output. */ - QCString readAll(bool block=true); + TQCString readAll(bool block=true); /** * Writes a line of text to the program's standard in. * @param line The text to write. * @param addNewline Adds a '\n' to the line. */ - void writeLine(const QCString &line, bool addNewline=true); + void writeLine(const TQCString &line, bool addNewline=true); /** * Puts back a line of input. * @param line The line to put back. * @param addNewline Adds a '\n' to the line. */ - void unreadLine(const QCString &line, bool addNewline=true); + void unreadLine(const TQCString &line, bool addNewline=true); /** * Sets the exit string. If a line of program output matches this, * waitForChild() will terminate the program and return. */ - void setExitString(const QCString &exit) { m_Exit = exit; } + void setExitString(const TQCString &exit) { m_Exit = exit; } /** * Waits for the child to exit. See also setExitString. @@ -168,14 +168,14 @@ protected: bool m_bErase, m_bTerminal; int m_Pid, m_Fd; - QCString m_Command, m_Exit; + TQCString m_Command, m_Exit; private: int init(); int SetupTTY(int fd); PTY *m_pPTY; - QCString m_Inbuf, m_TTY; + TQCString m_Inbuf, m_TTY; protected: virtual void virtual_hook( int id, void* data ); diff --git a/kdesu/ssh.cpp b/kdesu/ssh.cpp index a325fb62e..d39634ac5 100644 --- a/kdesu/ssh.cpp +++ b/kdesu/ssh.cpp @@ -28,8 +28,8 @@ #include <sys/types.h> #include <sys/stat.h> -#include <qglobal.h> -#include <qcstring.h> +#include <tqglobal.h> +#include <tqcstring.h> #include <kdebug.h> #include <klocale.h> @@ -39,7 +39,7 @@ #include "kcookie.h" -SshProcess::SshProcess(const QCString &host, const QCString &user, const QCString &command) +SshProcess::SshProcess(const TQCString &host, const TQCString &user, const TQCString &command) { m_Host = host; m_User = user; @@ -54,7 +54,7 @@ SshProcess::~SshProcess() } -void SshProcess::setStub(const QCString &stub) +void SshProcess::setStub(const TQCString &stub) { m_Stub = stub; } @@ -146,13 +146,13 @@ int SshProcess::exec(const char *password, int check) * 14/SEP/2000: DCOP forwarding is not used anymore. */ -QCString SshProcess::dcopForward() +TQCString SshProcess::dcopForward() { - QCString result; + TQCString result; setDcopTransport("tcp"); - QCString srv = StubProcess::dcopServer(); + TQCString srv = StubProcess::dcopServer(); if (srv.isEmpty()) return result; @@ -164,7 +164,7 @@ QCString SshProcess::dcopForward() int j = srv.find(':', ++i); if (j == -1) return result; - QCString host = srv.mid(i, j-i); + TQCString host = srv.mid(i, j-i); bool ok; int port = srv.mid(++j).toInt(&ok); if (!ok) @@ -193,7 +193,7 @@ int SshProcess::ConverseSsh(const char *password, int check) { unsigned i, j, colon; - QCString line; + TQCString line; int state = 0; while (state < 2) @@ -257,22 +257,22 @@ int SshProcess::ConverseSsh(const char *password, int check) // Display redirection is handled by ssh natively. -QCString SshProcess::display() +TQCString SshProcess::display() { return "no"; } -QCString SshProcess::displayAuth() +TQCString SshProcess::displayAuth() { return "no"; } // Return the remote end of the forwarded connection. -QCString SshProcess::dcopServer() +TQCString SshProcess::dcopServer() { - return QCString().sprintf("tcp/localhost:%d", m_dcopPort); + return TQCString().sprintf("tcp/localhost:%d", m_dcopPort); } void SshProcess::virtual_hook( int id, void* data ) diff --git a/kdesu/ssh.h b/kdesu/ssh.h index 23308fd64..66ee0fccc 100644 --- a/kdesu/ssh.h +++ b/kdesu/ssh.h @@ -13,7 +13,7 @@ #ifndef __SSH_h_Included__ #define __SSH_h_Included__ -#include <qcstring.h> +#include <tqcstring.h> #include "stub.h" @@ -26,7 +26,7 @@ class KDESU_EXPORT SshProcess: public StubProcess { public: - SshProcess(const QCString &host=0, const QCString &user=0, const QCString &command=0); + SshProcess(const TQCString &host=0, const TQCString &user=0, const TQCString &command=0); ~SshProcess(); enum Errors { SshNotFound=1, SshNeedsPassword, SshIncorrectPassword }; @@ -34,12 +34,12 @@ public: /** * Sets the target host. */ - void setHost(const QCString &host) { m_Host = host; } + void setHost(const TQCString &host) { m_Host = host; } /** * Sets the localtion of the remote stub. */ - void setStub(const QCString &stub); + void setStub(const TQCString &stub); /** * Checks if the current user\@host needs a password. @@ -61,24 +61,24 @@ public: */ int exec(const char *password, int check=0); - QCString prompt() { return m_Prompt; } - QCString error() { return m_Error; } + TQCString prompt() { return m_Prompt; } + TQCString error() { return m_Error; } protected: - virtual QCString display(); - virtual QCString displayAuth(); - virtual QCString dcopServer(); + virtual TQCString display(); + virtual TQCString displayAuth(); + virtual TQCString dcopServer(); private: - QCString dcopForward(); + TQCString dcopForward(); int ConverseSsh(const char *password, int check); int m_dcopPort; int m_dcopSrv; - QCString m_Prompt; - QCString m_Host; - QCString m_Error; - QCString m_Stub; + TQCString m_Prompt; + TQCString m_Host; + TQCString m_Error; + TQCString m_Stub; protected: virtual void virtual_hook( int id, void* data ); diff --git a/kdesu/stub.cpp b/kdesu/stub.cpp index c0e968200..2af171d72 100644 --- a/kdesu/stub.cpp +++ b/kdesu/stub.cpp @@ -16,8 +16,8 @@ #include <stdlib.h> #include <unistd.h> -#include <qglobal.h> -#include <qcstring.h> +#include <tqglobal.h> +#include <tqcstring.h> #include <kdatastream.h> #include <kapplication.h> @@ -56,13 +56,13 @@ void StubProcess::setPriority(int prio) } -QCString StubProcess::commaSeparatedList(QCStringList lst) +TQCString StubProcess::commaSeparatedList(QCStringList lst) { if (lst.count() == 0) - return QCString(""); + return TQCString(""); QCStringList::Iterator it = lst.begin(); - QCString str = *it; + TQCString str = *it; for (it++; it!=lst.end(); it++) { str += ','; @@ -79,7 +79,7 @@ QCString StubProcess::commaSeparatedList(QCStringList lst) int StubProcess::ConverseStub(int check) { - QCString line, tmp; + TQCString line, tmp; while (1) { line = readLine(); @@ -118,7 +118,7 @@ int StubProcess::ConverseStub(int check) } else if (line == "command") { writeLine(m_Command); } else if (line == "path") { - QCString path = getenv("PATH"); + TQCString path = getenv("PATH"); if (!path.isEmpty() && path[0] == ':') path = path.mid(1); if (m_User == "root") @@ -140,7 +140,7 @@ int StubProcess::ConverseStub(int check) else writeLine("yes"); } else if (line == "app_startup_id") { QCStringList env = environment(); - QCString tmp; + TQCString tmp; for( QCStringList::ConstIterator it = env.begin(); it != env.end(); ++it ) @@ -175,7 +175,7 @@ int StubProcess::ConverseStub(int check) } -void StubProcess::notifyTaskbar(const QString &) +void StubProcess::notifyTaskbar(const TQString &) { kdWarning(900) << "Obsolete StubProcess::notifyTaskbar() called!" << endl; } diff --git a/kdesu/stub.h b/kdesu/stub.h index 921db0e1c..48d2f65bb 100644 --- a/kdesu/stub.h +++ b/kdesu/stub.h @@ -13,15 +13,15 @@ #ifndef __Stub_h_Included__ #define __Stub_h_Included__ -#include <qcstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqvaluelist.h> #include "process.h" #include "kcookie.h" #include <kdelibs_export.h> -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> QCStringList; /** * Chat with kdesu_stub. @@ -38,18 +38,18 @@ public: /** * Specify dcop transport */ - void setDcopTransport(const QCString &dcopTransport) + void setDcopTransport(const TQCString &dcopTransport) { m_pCookie->setDcopTransport(dcopTransport); } /** * Set the command. */ - void setCommand(const QCString &command) { m_Command = command; } + void setCommand(const TQCString &command) { m_Command = command; } /** * Set the target user. */ - void setUser(const QCString &user) { m_User = user; } + void setUser(const TQCString &user) { m_User = user; } /** * Set to "X only mode": Sycoca is not built and kdeinit is not launched. @@ -91,43 +91,43 @@ protected: * @obsolete */ // KDE4 remove - void notifyTaskbar(const QString &suffix); + void notifyTaskbar(const TQString &suffix); /** * This virtual function can be overloaded when special behavior is * desired. By default, it returns the value returned by KCookie. */ - virtual QCString display() { return m_pCookie->display(); } + virtual TQCString display() { return m_pCookie->display(); } #ifdef Q_WS_X11 /** * See display. */ - virtual QCString displayAuth() { return m_pCookie->displayAuth(); } + virtual TQCString displayAuth() { return m_pCookie->displayAuth(); } #endif /** * See display. */ - virtual QCString dcopServer() { return m_pCookie->dcopServer(); } + virtual TQCString dcopServer() { return m_pCookie->dcopServer(); } /** * See display. */ - virtual QCString dcopAuth() { return m_pCookie->dcopAuth(); } + virtual TQCString dcopAuth() { return m_pCookie->dcopAuth(); } /** * See display. */ - virtual QCString iceAuth() { return m_pCookie->iceAuth(); } + virtual TQCString iceAuth() { return m_pCookie->iceAuth(); } bool m_bXOnly; bool m_bDCOPForwarding; int m_Priority; int m_Scheduler; - QCString m_dcopTransport; - QCString m_Command; - QCString m_User; + TQCString m_dcopTransport; + TQCString m_Command; + TQCString m_User; KCookie *m_pCookie; private: - QCString commaSeparatedList(QCStringList); + TQCString commaSeparatedList(QCStringList); protected: virtual void virtual_hook( int id, void* data ); diff --git a/kdesu/su.cpp b/kdesu/su.cpp index 344c0f34c..864a3bcc0 100644 --- a/kdesu/su.cpp +++ b/kdesu/su.cpp @@ -29,9 +29,9 @@ #include <sys/types.h> #include <sys/stat.h> -#include <qglobal.h> -#include <qcstring.h> -#include <qfile.h> +#include <tqglobal.h> +#include <tqcstring.h> +#include <tqfile.h> #include <kconfig.h> #include <kdebug.h> @@ -50,7 +50,7 @@ #define __PATH_SUDO "false" #endif -SuProcess::SuProcess(const QCString &user, const QCString &command) +SuProcess::SuProcess(const TQCString &user, const TQCString &command) { m_User = user; m_Command = command; @@ -112,14 +112,14 @@ int SuProcess::exec(const char *password, int check) if (superUserCommand == "su") { args += "-c"; } - args += QCString(__KDE_BINDIR) + "/kdesu_stub"; + args += TQCString(__KDE_BINDIR) + "/kdesu_stub"; #ifndef Q_OS_DARWIN args += "-"; #endif - /// QCString command = __PATH_SU; + /// TQCString command = __PATH_SU; /// if (::access(__PATH_SU, X_OK) != 0) - QCString command; + TQCString command; if (superUserCommand == "sudo") { command = __PATH_SUDO; } else { @@ -128,8 +128,8 @@ int SuProcess::exec(const char *password, int check) if (::access(command, X_OK) != 0) { - /// command = QFile::encodeName(KGlobal::dirs()->findExe("su")); - command = QFile::encodeName( KGlobal::dirs()->findExe(superUserCommand.ascii()) ); + /// command = TQFile::encodeName(KGlobal::dirs()->findExe("su")); + command = TQFile::encodeName( KGlobal::dirs()->findExe(superUserCommand.ascii()) ); if (command.isEmpty()) return check ? SuNotFound : -1; } @@ -231,7 +231,7 @@ int SuProcess::ConverseSU(const char *password) unsigned i, j; // kdDebug(900) << k_lineinfo << "ConverseSU starting." << endl; - QCString line; + TQCString line; while (true) { line = readLine(); @@ -257,7 +257,7 @@ int SuProcess::ConverseSU(const char *password) // couldn't have been a password prompt (the definition // of prompt being that there's a line of output followed // by a colon, and then the process waits). - QCString more = readLine(); + TQCString more = readLine(); if (more.isEmpty()) break; @@ -302,7 +302,7 @@ int SuProcess::ConverseSU(const char *password) ////////////////////////////////////////////////////////////////////////// case CheckStar: { - QCString s = line.stripWhiteSpace(); + TQCString s = line.stripWhiteSpace(); if (s.isEmpty()) { state=HandleStub; diff --git a/kdesu/su.h b/kdesu/su.h index c82e459eb..bb99e6f31 100644 --- a/kdesu/su.h +++ b/kdesu/su.h @@ -13,7 +13,7 @@ #ifndef __SU_h_Included__ #define __SU_h_Included__ -#include <qcstring.h> +#include <tqcstring.h> #include <kdelibs_export.h> @@ -26,7 +26,7 @@ class KDESU_EXPORT SuProcess: public StubProcess { public: - SuProcess(const QCString &user=0, const QCString &command=0); + SuProcess(const TQCString &user=0, const TQCString &command=0); ~SuProcess(); enum Errors { SuNotFound=1, SuNotAllowed, SuIncorrectPassword }; @@ -57,7 +57,7 @@ protected: private: class SuProcessPrivate; SuProcessPrivate *d; - QString superUserCommand; + TQString superUserCommand; }; #endif |