Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void App::startUp() {
- QString home = QDir::homePath();
- QDir::setCurrent("~/.config/autostart");
- if ( ui->checkBox->isChecked() ) {
- if (QFileInfo::exists("app.desktop")) { ; }
- else {
- QString command = "cp /usr/share/applications/app.desktop "+home+"/.config/autostart/app.desktop";
- const char *out = command.toStdString().c_str();
- system(out);
- }
- } else {
- if (QFileInfo::exists("app.desktop")) {
- QString command = "cd ~/.config/autostart; rm app.desktop";
- const char *out = command.toStdString().c_str();
- system(out);
- } else { ; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment