Commit 2eee6542 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Run clang-format

If you want git blame to ignore formatting revisions run:
git config blame.ignoreRevsFile .git-blame-ignore-revs
parent cec24fdc
/* /*
* Copyright 2016 Kai Uwe Broulik <kde@privat.broulik.de> * Copyright 2016 Kai Uwe Broulik <kde@privat.broulik.de>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of * published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version * the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved * accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy * by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license. * defined in Section 14 of version 3 of the license.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QCoreApplication>
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QCoreApplication>
#include <QDBusConnection> #include <QDBusConnection>
#include <QDBusMessage> #include <QDBusMessage>
#include <QTimer> #include <QTimer>
...@@ -34,7 +34,8 @@ int main(int argc, char *argv[]) ...@@ -34,7 +34,8 @@ int main(int argc, char *argv[])
QCoreApplication app(argc, argv); QCoreApplication app(argc, argv);
KLocalizedString::setApplicationDomain("kbroadcastnotification"); KLocalizedString::setApplicationDomain("kbroadcastnotification");
KAboutData aboutData(QStringLiteral("kbroadcastnotification"), i18n("Broadcast Notifications"), KAboutData aboutData(QStringLiteral("kbroadcastnotification"),
i18n("Broadcast Notifications"),
QLatin1String(PROJECT_VERSION), QLatin1String(PROJECT_VERSION),
i18n("A tool that emits a notification for all users by sending it on the system DBus"), i18n("A tool that emits a notification for all users by sending it on the system DBus"),
KAboutLicense::GPL, KAboutLicense::GPL,
...@@ -44,13 +45,18 @@ int main(int argc, char *argv[]) ...@@ -44,13 +45,18 @@ int main(int argc, char *argv[])
QCommandLineParser parser; QCommandLineParser parser;
aboutData.setupCommandLine(&parser); aboutData.setupCommandLine(&parser);
QCommandLineOption applicationNameOption(QStringLiteral("application"), i18n("Name of the application that should be associated with this notification"), QStringLiteral("application")); QCommandLineOption applicationNameOption(QStringLiteral("application"),
i18n("Name of the application that should be associated with this notification"),
QStringLiteral("application"));
parser.addOption(applicationNameOption); parser.addOption(applicationNameOption);
QCommandLineOption summaryOption(QStringLiteral("summary"), i18n("A brief one-line summary of the notification"), QStringLiteral("summary")); QCommandLineOption summaryOption(QStringLiteral("summary"), i18n("A brief one-line summary of the notification"), QStringLiteral("summary"));
parser.addOption(summaryOption); parser.addOption(summaryOption);
QCommandLineOption iconOption(QStringLiteral("icon"), i18n("Icon for the notification"), QStringLiteral("icon")); QCommandLineOption iconOption(QStringLiteral("icon"), i18n("Icon for the notification"), QStringLiteral("icon"));
parser.addOption(iconOption); parser.addOption(iconOption);
QCommandLineOption uidsOption(QStringLiteral("uids"), i18n("A comma-separated list of user IDs this notification should be sent to. If omitted, the notification will be sent to all users."), QStringLiteral("uids")); QCommandLineOption uidsOption(
QStringLiteral("uids"),
i18n("A comma-separated list of user IDs this notification should be sent to. If omitted, the notification will be sent to all users."),
QStringLiteral("uids"));
parser.addOption(uidsOption); parser.addOption(uidsOption);
QCommandLineOption timeoutOption(QStringLiteral("timeout"), i18n("Timeout for the notification"), QStringLiteral("timeout")); QCommandLineOption timeoutOption(QStringLiteral("timeout"), i18n("Timeout for the notification"), QStringLiteral("timeout"));
parser.addOption(timeoutOption); parser.addOption(timeoutOption);
......
...@@ -30,20 +30,19 @@ ...@@ -30,20 +30,19 @@
#include <KAboutData> #include <KAboutData>
#include <KAuthorized> #include <KAuthorized>
#include <KActivities/ResourceInstance>
#include <KCModuleProxy> #include <KCModuleProxy>
#include <QDebug>
#include <KLocalizedString> #include <KLocalizedString>
#include <KServiceTypeTrader> #include <KServiceTypeTrader>
#include <KStartupInfo> #include <KStartupInfo>
#include <KActivities/ResourceInstance> #include <QDebug>
#include <kworkspace.h>
#include <KQuickAddons/QtQuickSettings> #include <KQuickAddons/QtQuickSettings>
#include <kworkspace.h>
#include <QIcon>
#include <QCommandLineParser>
#include <QCommandLineOption> #include <QCommandLineOption>
#include <QCommandLineParser>
#include <QIcon>
using namespace std; using namespace std;
...@@ -51,9 +50,7 @@ KService::List m_modules; ...@@ -51,9 +50,7 @@ KService::List m_modules;
static bool caseInsensitiveLessThan(const KService::Ptr s1, const KService::Ptr s2) static bool caseInsensitiveLessThan(const KService::Ptr s1, const KService::Ptr s2)
{ {
const int compare = QString::compare(s1->desktopEntryName(), const int compare = QString::compare(s1->desktopEntryName(), s2->desktopEntryName(), Qt::CaseInsensitive);
s2->desktopEntryName(),
Qt::CaseInsensitive);
return (compare < 0); return (compare < 0);
} }
...@@ -61,25 +58,30 @@ static void listModules() ...@@ -61,25 +58,30 @@ static void listModules()
{ {
// First condition is what systemsettings does, second what kinfocenter does, make sure this is kept in sync // First condition is what systemsettings does, second what kinfocenter does, make sure this is kept in sync
// We need the exist calls because otherwise the trader language aborts if the property doesn't exist and the second part of the or is not evaluated // We need the exist calls because otherwise the trader language aborts if the property doesn't exist and the second part of the or is not evaluated
const KService::List services = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), QStringLiteral("(exist [X-KDE-System-Settings-Parent-Category] and [X-KDE-System-Settings-Parent-Category] != '') or (exist [X-KDE-ParentApp] and [X-KDE-ParentApp] == 'kinfocenter')") ); const KService::List services =
for( KService::List::const_iterator it = services.constBegin(); it != services.constEnd(); ++it) { KServiceTypeTrader::self()->query(QStringLiteral("KCModule"),
QStringLiteral("(exist [X-KDE-System-Settings-Parent-Category] and [X-KDE-System-Settings-Parent-Category] != '') or "
"(exist [X-KDE-ParentApp] and [X-KDE-ParentApp] == 'kinfocenter')"));
for (KService::List::const_iterator it = services.constBegin(); it != services.constEnd(); ++it) {
const KService::Ptr s = (*it); const KService::Ptr s = (*it);
if (!KAuthorized::authorizeControlModule(s->menuId())) if (!KAuthorized::authorizeControlModule(s->menuId())) {
continue; continue;
}
m_modules.append(s); m_modules.append(s);
} }
std::stable_sort(m_modules.begin(), m_modules.end(), caseInsensitiveLessThan); std::stable_sort(m_modules.begin(), m_modules.end(), caseInsensitiveLessThan);
} }
static KService::Ptr locateModule(const QString& module) static KService::Ptr locateModule(const QString &module)
{ {
QString path = module; QString path = module;
if (!path.endsWith(QLatin1String(".desktop"))) if (!path.endsWith(QLatin1String(".desktop"))) {
path += QStringLiteral(".desktop"); path += QStringLiteral(".desktop");
}
KService::Ptr service = KService::serviceByStorageId( path ); KService::Ptr service = KService::serviceByStorageId(path);
if (!service) { if (!service) {
return KService::Ptr(); return KService::Ptr();
} }
...@@ -108,8 +110,7 @@ bool KCMShell::isRunning() ...@@ -108,8 +110,7 @@ bool KCMShell::isRunning()
QDBusInterface iface(m_serviceName, QStringLiteral("/KCModule/dialog"), QStringLiteral("org.kde.KCMShellMultiDialog")); QDBusInterface iface(m_serviceName, QStringLiteral("/KCModule/dialog"), QStringLiteral("org.kde.KCMShellMultiDialog"));
QDBusReply<void> reply = iface.call(QStringLiteral("activate"), KStartupInfo::startupId()); QDBusReply<void> reply = iface.call(QStringLiteral("activate"), KStartupInfo::startupId());
if (!reply.isValid()) if (!reply.isValid()) {
{
qDebug() << "Calling D-Bus function dialog::activate() failed."; qDebug() << "Calling D-Bus function dialog::activate() failed.";
return false; // Error, we have to do it ourselves. return false; // Error, we have to do it ourselves.
} }
...@@ -125,18 +126,17 @@ KCMShellMultiDialog::KCMShellMultiDialog(KPageDialog::FaceType dialogFace, QWidg ...@@ -125,18 +126,17 @@ KCMShellMultiDialog::KCMShellMultiDialog(KPageDialog::FaceType dialogFace, QWidg
QDBusConnection::sessionBus().registerObject(QStringLiteral("/KCModule/dialog"), this, QDBusConnection::ExportScriptableSlots); QDBusConnection::sessionBus().registerObject(QStringLiteral("/KCModule/dialog"), this, QDBusConnection::ExportScriptableSlots);
connect(this, &KCMShellMultiDialog::currentPageChanged, connect(this, &KCMShellMultiDialog::currentPageChanged, this, [](KPageWidgetItem *newPage, KPageWidgetItem *oldPage) {
this, [](KPageWidgetItem *newPage,KPageWidgetItem *oldPage) { Q_UNUSED(oldPage);
Q_UNUSED(oldPage); KCModuleProxy *activeModule = newPage->widget()->findChild<KCModuleProxy *>();
KCModuleProxy *activeModule = newPage->widget()->findChild<KCModuleProxy *>(); if (activeModule) {
if (activeModule) { KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("kcm:") + activeModule->moduleInfo().service()->storageId()),
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("kcm:") + activeModule->moduleInfo().service()->storageId()), QStringLiteral("org.kde.systemsettings"));
QStringLiteral("org.kde.systemsettings")); }
} });
});
} }
void KCMShellMultiDialog::activate(const QByteArray& asn_id) void KCMShellMultiDialog::activate(const QByteArray &asn_id)
{ {
#ifdef HAVE_X11 #ifdef HAVE_X11
setAttribute(Qt::WA_NativeWindow, true); setAttribute(Qt::WA_NativeWindow, true);
...@@ -146,7 +146,7 @@ void KCMShellMultiDialog::activate(const QByteArray& asn_id) ...@@ -146,7 +146,7 @@ void KCMShellMultiDialog::activate(const QByteArray& asn_id)
void KCMShell::setServiceName(const QString &dbusName) void KCMShell::setServiceName(const QString &dbusName)
{ {
m_serviceName = QLatin1String( "org.kde.kcmshell_" ) + dbusName; m_serviceName = QLatin1String("org.kde.kcmshell_") + dbusName;
QDBusConnection::sessionBus().registerService(m_serviceName); QDBusConnection::sessionBus().registerService(m_serviceName);
} }
...@@ -156,8 +156,7 @@ void KCMShell::waitForExit() ...@@ -156,8 +156,7 @@ void KCMShell::waitForExit()
watcher->setConnection(QDBusConnection::sessionBus()); watcher->setConnection(QDBusConnection::sessionBus());
watcher->setWatchMode(QDBusServiceWatcher::WatchForOwnerChange); watcher->setWatchMode(QDBusServiceWatcher::WatchForOwnerChange);
watcher->addWatchedService(m_serviceName); watcher->addWatchedService(m_serviceName);
connect(watcher, &QDBusServiceWatcher::serviceOwnerChanged, connect(watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KCMShell::appExit);
this, &KCMShell::appExit);
exec(); exec();
} }
...@@ -166,8 +165,7 @@ void KCMShell::appExit(const QString &appId, const QString &oldName, const QStri ...@@ -166,8 +165,7 @@ void KCMShell::appExit(const QString &appId, const QString &oldName, const QStri
Q_UNUSED(appId); Q_UNUSED(appId);
Q_UNUSED(newName); Q_UNUSED(newName);
if (!oldName.isEmpty()) if (!oldName.isEmpty()) {
{
qDebug() << "'" << appId << "' closed, quitting."; qDebug() << "'" << appId << "' closed, quitting.";
qApp->quit(); qApp->quit();
} }
...@@ -187,7 +185,8 @@ int main(int _argc, char *_argv[]) ...@@ -187,7 +185,8 @@ int main(int _argc, char *_argv[])
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
KAboutData aboutData(QStringLiteral("kcmshell5"), i18n("System Settings Module"), KAboutData aboutData(QStringLiteral("kcmshell5"), //
i18n("System Settings Module"),
QLatin1String(PROJECT_VERSION), QLatin1String(PROJECT_VERSION),
i18n("A tool to start single system settings modules"), i18n("A tool to start single system settings modules"),
KAboutLicense::GPL, KAboutLicense::GPL,
...@@ -195,10 +194,10 @@ int main(int _argc, char *_argv[]) ...@@ -195,10 +194,10 @@ int main(int _argc, char *_argv[])
aboutData.addAuthor(i18n("Frans Englich"), i18n("Maintainer"), QStringLiteral("frans.englich@kde.org")); aboutData.addAuthor(i18n("Frans Englich"), i18n("Maintainer"), QStringLiteral("frans.englich@kde.org"));
aboutData.addAuthor(i18n("Daniel Molkentin"), QString(), QStringLiteral("molkentin@kde.org")); aboutData.addAuthor(i18n("Daniel Molkentin"), QString(), QStringLiteral("molkentin@kde.org"));
aboutData.addAuthor(i18n("Matthias Hoelzer-Kluepfel"),QString(), QStringLiteral("hoelzer@kde.org")); aboutData.addAuthor(i18n("Matthias Hoelzer-Kluepfel"), QString(), QStringLiteral("hoelzer@kde.org"));
aboutData.addAuthor(i18n("Matthias Elter"),QString(), QStringLiteral("elter@kde.org")); aboutData.addAuthor(i18n("Matthias Elter"), QString(), QStringLiteral("elter@kde.org"));
aboutData.addAuthor(i18n("Matthias Ettrich"),QString(), QStringLiteral("ettrich@kde.org")); aboutData.addAuthor(i18n("Matthias Ettrich"), QString(), QStringLiteral("ettrich@kde.org"));
aboutData.addAuthor(i18n("Waldo Bastian"),QString(), QStringLiteral("bastian@kde.org")); aboutData.addAuthor(i18n("Waldo Bastian"), QString(), QStringLiteral("bastian@kde.org"));
KAboutData::setApplicationData(aboutData); KAboutData::setApplicationData(aboutData);
QCommandLineParser parser; QCommandLineParser parser;
...@@ -227,20 +226,22 @@ int main(int _argc, char *_argv[]) ...@@ -227,20 +226,22 @@ int main(int _argc, char *_argv[])
listModules(); listModules();
int maxLen=0; int maxLen = 0;
for (KService::List::ConstIterator it = m_modules.constBegin(); it != m_modules.constEnd(); ++it) { for (KService::List::ConstIterator it = m_modules.constBegin(); it != m_modules.constEnd(); ++it) {
int len = (*it)->desktopEntryName().length(); int len = (*it)->desktopEntryName().length();
if (len > maxLen) if (len > maxLen) {
maxLen = len; maxLen = len;
}
} }
for (KService::List::ConstIterator it = m_modules.constBegin(); it != m_modules.constEnd(); ++it) { for (KService::List::ConstIterator it = m_modules.constBegin(); it != m_modules.constEnd(); ++it) {
QString entry(QStringLiteral("%1 - %2")); QString entry(QStringLiteral("%1 - %2"));
entry = entry.arg((*it)->desktopEntryName().leftJustified(maxLen, QLatin1Char(' '))) entry = entry
.arg(!(*it)->comment().isEmpty() ? (*it)->comment() .arg((*it)->desktopEntryName().leftJustified(maxLen, QLatin1Char(' '))) //
: i18n("No description available")); .arg(!(*it)->comment().isEmpty() ? (*it)->comment() //
: i18n("No description available"));
cout << entry.toLocal8Bit().data() << endl; cout << entry.toLocal8Bit().data() << endl;
} }
...@@ -310,12 +311,12 @@ int main(int _argc, char *_argv[]) ...@@ -310,12 +311,12 @@ int main(int _argc, char *_argv[])
dlg->setWindowIcon(QIcon::fromTheme(parser.value(QStringLiteral("icon")))); dlg->setWindowIcon(QIcon::fromTheme(parser.value(QStringLiteral("icon"))));
} else if (!parser.isSet(QStringLiteral("icon")) && !modules.isEmpty()) { } else if (!parser.isSet(QStringLiteral("icon")) && !modules.isEmpty()) {
const QString iconName = modules.first()->icon(); const QString iconName = modules.first()->icon();
dlg->setWindowIcon( QIcon::fromTheme(iconName) ); dlg->setWindowIcon(QIcon::fromTheme(iconName));
} }
if (modules.count() == 1 && app.desktopFileName() == QLatin1String("org.kde.kcmshell5")) { if (modules.count() == 1 && app.desktopFileName() == QLatin1String("org.kde.kcmshell5")) {
const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, const QString path =
QStringLiteral("kservices5/%1.desktop").arg(modules.first()->desktopEntryName())); QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kservices5/%1.desktop").arg(modules.first()->desktopEntryName()));
if (!path.isEmpty()) { if (!path.isEmpty()) {
app.setDesktopFileName(path); app.setDesktopFileName(path);
} }
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#ifndef MAIN_H #ifndef MAIN_H
#define MAIN_H #define MAIN_H
#include <QApplication>
#include <KCMultiDialog> #include <KCMultiDialog>
#include <KPageDialog> #include <KPageDialog>
#include <QApplication>
/** /**
* The application instance for kcmshell. * The application instance for kcmshell.
...@@ -34,7 +34,10 @@ class KCMShell : public QApplication ...@@ -34,7 +34,10 @@ class KCMShell : public QApplication
Q_OBJECT Q_OBJECT
public: public:
KCMShell(int &argc, char** argv) : QApplication(argc, argv) {} KCMShell(int &argc, char **argv)
: QApplication(argc, argv)
{
}
/** /**
* Sets m_serviceName basically to @p serviceName, * Sets m_serviceName basically to @p serviceName,
...@@ -42,7 +45,7 @@ public: ...@@ -42,7 +45,7 @@ public:
* *
* @param serviceName name to set the D-BUS name to * @param serviceName name to set the D-BUS name to
*/ */
void setServiceName(const QString &serviceName ); void setServiceName(const QString &serviceName);
/** /**
* Waits until the last instance of kcmshell with the same * Waits until the last instance of kcmshell with the same
...@@ -59,19 +62,16 @@ private Q_SLOTS: ...@@ -59,19 +62,16 @@ private Q_SLOTS:
/** /**
*/ */
void appExit( const QString &appId, const QString &, const QString & ); void appExit(const QString &appId, const QString &, const QString &);
private: private:
/** /**
* The D-Bus name which actually is registered. * The D-Bus name which actually is registered.
* For example "kcmshell_mouse". * For example "kcmshell_mouse".
*/ */
QString m_serviceName; QString m_serviceName;
}; };
/** /**
* Essentially a plain KCMultiDialog, but has the additional functionality * Essentially a plain KCMultiDialog, but has the additional functionality
* of allowing it to be told to request windows focus. * of allowing it to be told to request windows focus.
...@@ -84,7 +84,6 @@ class KCMShellMultiDialog : public KCMultiDialog ...@@ -84,7 +84,6 @@ class KCMShellMultiDialog : public KCMultiDialog
Q_CLASSINFO("D-Bus Interface", "org.kde.KCMShellMultiDialog") Q_CLASSINFO("D-Bus Interface", "org.kde.KCMShellMultiDialog")
public: public:
/** /**
* Constructor. Parameter @p dialogFace is passed to KCMultiDialog * Constructor. Parameter @p dialogFace is passed to KCMultiDialog
* unchanged. * unchanged.
...@@ -97,8 +96,7 @@ public Q_SLOTS: ...@@ -97,8 +96,7 @@ public Q_SLOTS:
* Activate a module with id @p asn_id . This is used when * Activate a module with id @p asn_id . This is used when
* black helicopters are spotted overhead. * black helicopters are spotted overhead.
*/ */
virtual Q_SCRIPTABLE void activate( const QByteArray& asn_id ); virtual Q_SCRIPTABLE void activate(const QByteArray &asn_id);
}; };
// vim: sw=4 et sts=4 // vim: sw=4 et sts=4
......
...@@ -17,15 +17,15 @@ You should have received a copy of the GNU General Public License ...@@ -17,15 +17,15 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
#include <QCommandLineOption>
#include <QCommandLineParser>
#include <QCoreApplication> #include <QCoreApplication>
#include <QDBusConnection> #include <QDBusConnection>
#include <QDBusMessage> #include <QDBusMessage>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QDebug> #include <QDebug>
#include <KProcess>
#include <KLocalizedString> #include <KLocalizedString>
#include <KProcess>
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
#include <config-kde-cli-tools.h> #include <config-kde-cli-tools.h>
#include <unistd.h>
#include <errno.h> #include <errno.h>
#include <string.h>
#include <pwd.h> #include <pwd.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/time.h>
#if defined(HAVE_SYS_WAIT_H) #if defined(HAVE_SYS_WAIT_H)
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
...@@ -22,29 +22,29 @@ ...@@ -22,29 +22,29 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#endif #endif
#if HAVE_SYS_PROCCTL_H #if HAVE_SYS_PROCCTL_H
#include <unistd.h>
#include <sys/procctl.h> #include <sys/procctl.h>
#include <unistd.h>
#endif #endif
#include <QFileInfo> #include <QApplication>
#include <QCommandLineParser>
#include <QFile> #include <QFile>
#include <QFileInfo>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QCommandLineParser>
#include <QApplication>
#include <kconfiggroup.h>
#include <KSharedConfig> #include <KSharedConfig>
#include <kaboutdata.h>
#include <kconfiggroup.h>
#include <klocalizedstring.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kuser.h>
#include <kshell.h> #include <kshell.h>
#include <kstartupinfo.h> #include <kstartupinfo.h>
#include <kuser.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>
#include <klocalizedstring.h>
#include <kaboutdata.h>
#include <kdesu/client.h>
#include <kdesu/defaults.h> #include <kdesu/defaults.h>
#include <kdesu/su.h> #include <kdesu/su.h>
#include <kdesu/client.h>
#include "sudlg.h" #include "sudlg.h"
...@@ -74,7 +74,7 @@ QByteArray dcopNetworkId() ...@@ -74,7 +74,7 @@ QByteArray dcopNetworkId()
} }
#endif #endif
static int startApp(QCommandLineParser& p); static int startApp(QCommandLineParser &p);
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
...@@ -94,19 +94,20 @@ int main(int argc, char *argv[]) ...@@ -94,19 +94,20 @@ int main(int argc, char *argv[])
// anyway, i vote against removing it even when we have a proper gui // anyway, i vote against removing it even when we have a proper gui
// implementation. -- ossi // implementation. -- ossi
QByteArray duser = qgetenv("ADMIN_ACCOUNT"); QByteArray duser = qgetenv("ADMIN_ACCOUNT");
if (duser.isEmpty()) if (duser.isEmpty()) {
duser = "root"; duser = "root";
}