1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
Description: fix for Ubuntu package, might become available upstream
Forwarded: not-needed
@@ -424,7 +424,7 @@
{
loginfo("Ignoring previous settings\n");
cpdbDeleteSettings(f->last_saved_settings);
- f->last_saved_settings = NULL;
+ f->last_saved_settings = cpdbGetNewSettings();
}
gboolean cpdbAddPrinter(cpdb_frontend_obj_t *f,
@@ -1857,10 +1857,12 @@
char buf[CPDB_BSIZE];
cpdb_settings_t *s;
+ s = cpdbGetNewSettings();
+
if ((conf_dir = cpdbGetUserConfDir()) == NULL)
{
logerror("No previous settings found : Couldn't obtain user config dir\n");
- return NULL;
+ return s;
}
path = cpdbConcatPath(conf_dir, CPDB_PRINT_SETTINGS_FILE);
@@ -1871,10 +1873,9 @@
free(path);
free(conf_dir);
- return NULL;
+ return s;
}
- s = cpdbGetNewSettings();
if (fscanf(fp, "%d\n", &count) == 0)
{
logerror("Error getting settings from disk : Couldn't parse %s\n",
@@ -1882,8 +1883,7 @@
fclose(fp);
free(path);
free(conf_dir);
- cpdbDeleteSettings(s);
- return NULL;
+ return s;
}
while (count--)
{
|