gagiD

StartUp

Jul 30th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. void App::startUp() {
  2.     QString home = QDir::homePath();
  3.     QDir::setCurrent("~/.config/autostart");
  4.     if ( ui->checkBox->isChecked() ) {
  5.         if (QFileInfo::exists("app.desktop")) { ; }
  6.         else {
  7.             QString command = "cp /usr/share/applications/app.desktop "+home+"/.config/autostart/app.desktop";
  8.             const char *out = command.toStdString().c_str();
  9.             system(out);
  10.         }
  11.     } else {
  12.         if (QFileInfo::exists("app.desktop")) {
  13.         QString command = "cd ~/.config/autostart; rm app.desktop";
  14.                 const char *out = command.toStdString().c_str();
  15.                 system(out);
  16.         } else { ; }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment