gagiD

StartUp #1

Jul 30th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void App::startUp() {
  2.     QFileInfo desktopFile("/usr/share/applications/app.desktop");
  3.     QFileInfo autostartFile(QDir::homePath()+"/.config/autostart/app.desktop");
  4.     if ( ui->checkBox->isChecked() ) {
  5.         if (autostartFile.exists()) ;
  6.         else QFile::copy(desktopFile.absoluteFilePath() , autostartFile.absoluteFilePath());
  7.     } else {
  8.         if (autostartFile.exists()) QFile::remove(autostartFile.absoluteFilePath());
  9.         else ;
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment