mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-09 14:52:39 +01:00
Fixed #15.
This commit is contained in:
parent
797747da4a
commit
f2ea3df1c8
@ -145,6 +145,7 @@ bool SystemFactory::setAutoStartStatus(const AutoStartStatus &new_status) {
|
||||
// Note that we expect here that no other program uses
|
||||
// "rssguard.desktop" desktop file.
|
||||
const QString destination_file = getAutostartDesktopFileLocation();
|
||||
const QString destination_folder = QFileInfo(destination_file).absolutePath();
|
||||
|
||||
switch (new_status) {
|
||||
case SystemFactory::Enabled: {
|
||||
@ -154,17 +155,17 @@ bool SystemFactory::setAutoStartStatus(const AutoStartStatus &new_status) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!QDir().mkpath(APP_DESKTOP_ENTRY_PATH)) {
|
||||
if (!QDir().mkpath(destination_folder)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const QString source_autostart_desktop_file = QString(APP_DESKTOP_ENTRY_PATH) + QDir::separator() + APP_DESKTOP_SOURCE_ENTRY_FILE;
|
||||
|
||||
return QFile::copy(source_autostart_desktop_file, getAutostartDesktopFileLocation());
|
||||
return QFile::copy(source_autostart_desktop_file, destination_file);
|
||||
}
|
||||
|
||||
case SystemFactory::Disabled:
|
||||
return QFile::remove(getAutostartDesktopFileLocation());
|
||||
return QFile::remove(destination_file);
|
||||
|
||||
default:
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user