Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void App::startUp() {
- QFileInfo desktopFile("/usr/share/applications/app.desktop");
- QFileInfo autostartFile(QDir::homePath()+"/.config/autostart/app.desktop");
- if ( ui->checkBox->isChecked() ) {
- if (autostartFile.exists()) ;
- else QFile::copy(desktopFile.absoluteFilePath() , autostartFile.absoluteFilePath());
- } else {
- if (autostartFile.exists()) QFile::remove(autostartFile.absoluteFilePath());
- else ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment