diff --git a/src/suprocess.cpp b/src/suprocess.cpp --- a/src/suprocess.cpp +++ b/src/suprocess.cpp @@ -25,14 +25,6 @@ #include #include -#ifndef __PATH_SU -#define __PATH_SU "false" -#endif - -#ifndef __PATH_SUDO -#define __PATH_SUDO "false" -#endif - #ifdef KDESU_USE_SUDO_DEFAULT # define DEFAULT_SUPER_USER_COMMAND QStringLiteral("sudo") #else @@ -128,11 +120,16 @@ args += "-"; // krazy:exclude=doublequote_chars (QList, not QString) QByteArray command; +#ifdef __PATH_SUDO if (d->superUserCommand == QLatin1String("sudo")) { command = __PATH_SUDO; - } else { + } +#endif +#ifdef __PATH_SU + if (d->superUserCommand == QLatin1String("su")) { command = __PATH_SU; } +#endif if (QT_ACCESS(command.constData(), X_OK) != 0) { command = QFile::encodeName(QStandardPaths::findExecutable(d->superUserCommand));