simple fixes

This commit is contained in:
Andrei Yankovich 2020-05-20 12:01:06 +03:00
parent 15da148a35
commit ad3e78cf71
3 changed files with 17 additions and 11 deletions

View File

@ -132,16 +132,19 @@ QList<Feature> Controller::features() {
}
void Controller::printDefaultHelp() const {
auto quasarappHelp = QuasarAppUtils::Params::getparamsHelp();
QuasarAppUtils::Help::Charters help{{"General options of this controller",{
{"start", QObject::tr("Start a service")},
{"stop", QObject::tr("Stop a service")},
{"pause", QObject::tr("Pause a service")},
{"resume", QObject::tr("Resume a service")},
{"install", QObject::tr("Install a service")},
{"uninstall", QObject::tr("Uninstall a service")}
}}};
{"start", QObject::tr("Start a service")},
{"stop", QObject::tr("Stop a service")},
{"pause", QObject::tr("Pause a service")},
{"resume", QObject::tr("Resume a service")},
{"install", QObject::tr("Install a service")},
{"uninstall", QObject::tr("Uninstall a service")}
}}};
QuasarAppUtils::Help::print(help);
QuasarAppUtils::Help::print(quasarappHelp.unite(help));
}
}

View File

@ -91,10 +91,14 @@ int ServiceBase::exec() {
d_ptr->listen();
});
} else if (!controller()->send()) {
return static_cast<int>(ControllerError::ServiceUnavailable);
}
QTimer::singleShot(0, [this](){
if (!controller()->send()) {
_core->exit(static_cast<int>(ControllerError::ServiceUnavailable));
}
});
return _core->exec();
}

View File

@ -6,7 +6,6 @@
namespace Patronum {
const QString systemDPath = "/etc/systemd/system/";
static bool isServiceInited = false;
InstallerSystemD::InstallerSystemD(const QString& name):
BaseInstaller(name) {