comparison src/gtksavedstatuses.c @ 13173:07ecd51f1f07

[gaim-migrate @ 15536] SF Patch #1425827 from Sadrul "Start gaim with -c /dev/null, try to add a new status. gaim seems to crash here." I wasn't able to reproduce this crash, but the changes look okay anyway. Let me know if you think this is wrong... committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Wed, 08 Feb 2006 04:20:05 +0000
parents 12d960995cdc
children 488619ad7ed5
comparison
equal deleted inserted replaced
13172:12d960995cdc 13173:07ecd51f1f07
144 status_window_find_savedstatus(GtkTreeIter *iter, const char *title) 144 status_window_find_savedstatus(GtkTreeIter *iter, const char *title)
145 { 145 {
146 GtkTreeModel *model; 146 GtkTreeModel *model;
147 char *cur; 147 char *cur;
148 148
149 if (status_window == NULL) 149 if (status_window == NULL || title == NULL)
150 return FALSE; 150 return FALSE;
151 151
152 model = GTK_TREE_MODEL(status_window->model); 152 model = GTK_TREE_MODEL(status_window->model);
153 153
154 if (!gtk_tree_model_get_iter_first(model, iter)) 154 if (!gtk_tree_model_get_iter_first(model, iter))
1018 GtkWidget *win; 1018 GtkWidget *win;
1019 GList *focus_chain = NULL; 1019 GList *focus_chain = NULL;
1020 1020
1021 /* Find a possible window for this saved status and present it */ 1021 /* Find a possible window for this saved status and present it */
1022 if (status_window) { 1022 if (status_window) {
1023 status_window_find_savedstatus(&iter, gaim_savedstatus_get_title(saved_status)); 1023 if (status_window_find_savedstatus(&iter, gaim_savedstatus_get_title(saved_status))) {
1024 gtk_tree_model_get(GTK_TREE_MODEL(status_window->model), &iter, 1024 gtk_tree_model_get(GTK_TREE_MODEL(status_window->model), &iter,
1025 STATUS_WINDOW_COLUMN_WINDOW, &dialog, 1025 STATUS_WINDOW_COLUMN_WINDOW, &dialog,
1026 -1); 1026 -1);
1027 if (dialog) { 1027 if (dialog) {
1028 gtk_window_present(GTK_WINDOW(dialog->window)); 1028 gtk_window_present(GTK_WINDOW(dialog->window));
1029 return; 1029 return;
1030 }
1030 } 1031 }
1031 } 1032 }
1032 1033
1033 dialog = g_new0(StatusEditor, 1); 1034 dialog = g_new0(StatusEditor, 1);
1034 if (status_window) 1035 if (status_window)