some fixes including adding double quotes

This commit is contained in:
arcan1s
2014-08-12 22:58:13 +04:00
parent b65f761520
commit 3b1701f8b5
15 changed files with 207 additions and 29 deletions

View File

@ -137,14 +137,24 @@ bool MainWindow::startProfileSlot(const QString profile)
if (useHelper) {
QList<QVariant> args;
args.append(profile);
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Start"),
args, true, debug);
if (sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("ActiveProfile"),
QList<QVariant>(), true, debug)[0].toString().isEmpty())
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Start"),
args, true, debug);
else
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("SwitchTo"),
args, true, debug);
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug)[0].toBool();
} else {
netctlCommand->startProfile(profile);
if (netctlCommand->getActiveProfile().isEmpty())
netctlCommand->startProfile(profile);
else
netctlCommand->switchToProfile(profile);
current = netctlCommand->isProfileActive(profile);
}
@ -328,7 +338,6 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
qApp->installTranslator(translator);
createObjects();
checkHelperStatus();
createActions();
// tray

View File

@ -294,6 +294,8 @@ bool MainWindow::checkHelperStatus()
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Update"),
QList<QVariant>(), true, debug);
else
configuration[QString("FORCE_SUDO")] = QString("true");
if (isHelperServiceActive())
configuration[QString("CLOSE_HELPER")] = QString("false");
@ -401,6 +403,7 @@ void MainWindow::createObjects()
errorWin->showWindow(19, QString("[MainWindow] : [createObjects]"));
useHelper = false;
}
checkHelperStatus();
netctlCommand = new Netctl(debug, configuration);
netctlProfile = new NetctlProfile(debug, configuration);