aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-01-27 14:45:31 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-01-27 14:45:31 +0000
commit45572b611c4a3f704d9f143ea3be4e8f43db1294 (patch)
tree80f8d6970362e176ee2789efc57d4014ca67e66b /gtk
parentc3fa6a267c1fd8a71e05a1c620fb6f62016cc349 (diff)
Do not change profile if directory creation failed, and change to default
profile if existing profile was deleted. svn path=/trunk/; revision=24208
Diffstat (limited to 'gtk')
-rw-r--r--gtk/main.c7
-rw-r--r--gtk/profile_dlg.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/gtk/main.c b/gtk/main.c
index d5fc9fc4a8..3103b280e8 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -5026,7 +5026,12 @@ void change_configuration_profile (const gchar *profile_name)
{
char *gdp_path, *dp_path;
- /* First set profile name and update the status bar */
+ /* First check if profile exists */
+ if (!profile_exists(profile_name)) {
+ return;
+ }
+
+ /* Set profile name and update the status bar */
set_profile_name (profile_name);
profile_bar_update ();
diff --git a/gtk/profile_dlg.c b/gtk/profile_dlg.c
index 811343e225..9a102c0709 100644
--- a/gtk/profile_dlg.c
+++ b/gtk/profile_dlg.c
@@ -226,9 +226,12 @@ profile_select(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
gtk_tree_model_get(model, &iter, 1, &fl_entry, -1);
if (fl_entry) {
profile = (profile_def *) fl_entry->data;
- if (strcmp(profile->name, DEFAULT_PROFILE)!=0) {
+ if (profile_exists (profile->name)) {
+ /* The new profile exists, change */
change_configuration_profile (profile->name);
- } else {
+ } else if (!profile_exists (get_profile_name())) {
+ /* The new profile does not exist, and the previous profile has
+ been deleted. Change to the default profile */
change_configuration_profile (NULL);
}
}