Merge lp:~mateo-salta/nitroshare/0.2 into lp:nitroshare/0.2

Proposed by Mateo Salta
Status: Needs review
Proposed branch: lp:~mateo-salta/nitroshare/0.2
Merge into: lp:nitroshare/0.2
Diff against target: 26 lines (+4/-3)
1 file modified
src/util/settings.cpp (+4/-3)
To merge this branch: bzr merge lp:~mateo-salta/nitroshare/0.2
Reviewer Review Type Date Requested Status
Nathan Osman Pending
Review via email: mp+138033@code.launchpad.net

Description of the change

Fix of extras-nitroshare.desktop load at startup persistence.

Part of code that was changed in "settings.cpp"

<code>

#elif defined(Q_OS_LINUX)
    QString desktop_file = GetStartupDir().absoluteFilePath("extras-nitroshare.desktop");
    QString bugdesktop_file = GetStartupDir().absoluteFilePath("nitroshare.desktop");
    if(load) QFile::copy(":/other/extras-nitroshare.desktop", desktop_file);
    else QFile::remove(desktop_file);
    QFile::remove(bugdesktop_file);

</code>

This should fix the persistence, as well as prevent problems in updating, and keeps the "extras-nitroshare.desktop" naming convention.

To verify, Open unchanged linux version of NitroShare, and Check "Load at startup" in Settings, this will create the "nitroshare.desktop" file in `~/.config/autostart`, now with the startup file still there change to version with fix. The new version should detect the old startup file when launching the "settings". Also It will delete the old one and replace it(if you want it to still load at startup) once you click "Ok".

To post a comment you must log in.

Unmerged revisions

140. By Mateo Salta

Fix first run with old .desktop file not detecting startup value

139. By Mateo Salta

Fix for startup persistence, and fix of possible duplicate startup problem

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/util/settings.cpp'
--- src/util/settings.cpp 2012-07-06 18:54:00 +0000
+++ src/util/settings.cpp 2012-12-04 23:28:22 +0000
@@ -79,7 +79,7 @@
7979
80 return registry.contains("NitroShare");80 return registry.contains("NitroShare");
81#elif defined(Q_OS_LINUX)81#elif defined(Q_OS_LINUX)
82 return GetStartupDir().exists("extras-nitroshare.desktop");82 return GetStartupDir().exists("extras-nitroshare.desktop") or GetStartupDir().exists("nitroshare.desktop");
83#endif83#endif
8484
85 /* Just return false on other platforms. */85 /* Just return false on other platforms. */
@@ -96,10 +96,11 @@
96 if(load) registry.setValue("NitroShare", QCoreApplication::applicationFilePath());96 if(load) registry.setValue("NitroShare", QCoreApplication::applicationFilePath());
97 else registry.remove("NitroShare");97 else registry.remove("NitroShare");
98#elif defined(Q_OS_LINUX)98#elif defined(Q_OS_LINUX)
99 QString desktop_file = GetStartupDir().absoluteFilePath("nitroshare.desktop");99 QString desktop_file = GetStartupDir().absoluteFilePath("extras-nitroshare.desktop");
100100 QString bugdesktop_file = GetStartupDir().absoluteFilePath("nitroshare.desktop");
101 if(load) QFile::copy(":/other/extras-nitroshare.desktop", desktop_file);101 if(load) QFile::copy(":/other/extras-nitroshare.desktop", desktop_file);
102 else QFile::remove(desktop_file);102 else QFile::remove(desktop_file);
103 QFile::remove(bugdesktop_file);
103#else104#else
104 /* Mark the variable as unused. */105 /* Mark the variable as unused. */
105 Q_UNUSED(load);106 Q_UNUSED(load);

Subscribers

People subscribed via source and target branches

to all changes: