[gnome-commander] Store fav-apps only if at least one exists; Only load them if fav-apps file exists
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Store fav-apps only if at least one exists; Only load them if fav-apps file exists
- Date: Wed, 28 Sep 2016 19:22:09 +0000 (UTC)
commit d67d730d9b31e04b5c3c3159f82d0d5ad240c13f
Author: Uwe Scholz <uwescholz src gnome org>
Date: Wed Sep 28 21:17:43 2016 +0200
Store fav-apps only if at least one exists; Only load them if fav-apps file exists
src/gnome-cmd-data.cc | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 2fdad16..0e3cbbe 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1760,7 +1760,8 @@ static void save_fav_apps (const gchar *fname)
}
}
- gcmd_key_file_save_to_file (path, key_file);
+ if (gnome_cmd_data.options.fav_apps)
+ gcmd_key_file_save_to_file (path, key_file);
g_key_file_free(key_file);
g_free (path);
@@ -2333,6 +2334,13 @@ static gboolean load_fav_apps_old (const gchar *fname)
string line;
int i = 0;
+ //Device file does not exist
+ if(f.fail())
+ {
+ g_free (path);
+ return FALSE;
+ }
+
while (getline(f,line))
{
/* Is the file using the new storage format? If yes, stop here
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]