diff --git a/bluefish.spec b/bluefish.spec index 2a5d0e5..86c5d4a 100644 --- a/bluefish.spec +++ b/bluefish.spec @@ -1,6 +1,6 @@ %global pkgver 2.0.2 #global prerel rc1 -%global rpmrel 3 +%global rpmrel 4 Name: bluefish Version: %{pkgver} @@ -10,6 +10,7 @@ Group: Development/Tools License: GPLv3+ URL: http://bluefish.openoffice.nl/ Source0: http://www.bennewitz.com/bluefish/stable/source/bluefish-%{version}%{?prerel:-%{prerel}}.tar.bz2 +Patch0: fedora_bug_653299.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: desktop-file-utils BuildRequires: enchant-devel >= 1.4.2 @@ -65,6 +66,10 @@ Files common to every architecture version of %{name}. %prep %setup -q -n %{name}-%{version}%{?prerel:-%{prerel}} +# Fix crash when removing files/projects from recently-used lists (#653299) +# (upstream patch) +%patch0 -p0 + %build %configure --disable-dependency-tracking \ --disable-static \ @@ -141,6 +146,9 @@ fi %{_mandir}/man1/%{name}.1* %changelog +* Thu Nov 18 2010 Paul Howarth - 2.0.2-4 +- Fix crash when removing files/projects from recently-used lists (#653299) + * Thu Oct 7 2010 Paul Howarth - 2.0.2-3 - Drop charmap plugin from Rawhide for now diff --git a/fedora_bug_653299.patch b/fedora_bug_653299.patch new file mode 100644 index 0000000..c71947a --- /dev/null +++ b/fedora_bug_653299.patch @@ -0,0 +1,134 @@ +Index: src/menu.c +=================================================================== +--- src/menu.c (revision 6095) ++++ src/menu.c (working copy) +@@ -643,26 +643,30 @@ + /*******************************************************************/ + + static GtkWidget *remove_recent_entry(Tbfwin *bfwin, const gchar *filename, gboolean is_project) { +- GList *tmplist; +- GList **worklist; +- gpointer tmp; ++ if (filename) ++ { ++ GList *tmplist; ++ GList **worklist; ++ gpointer tmp; + +- worklist = (is_project) ? &bfwin->menu_recent_projects : &bfwin->menu_recent_files; ++ worklist = (is_project) ? &bfwin->menu_recent_projects : &bfwin->menu_recent_files; + +- if(strcmp(filename, "last") ==0) { +- tmplist = g_list_first(*worklist); +- if (tmplist) { +- tmp = tmplist->data; +- DEBUG_MSG("remove_recent_entry, remove last entry\n"); +- *worklist = g_list_remove(*worklist, tmplist->data); +- return tmp; ++ if(strcmp(filename, "last") ==0) { ++ tmplist = g_list_first(*worklist); ++ if (tmplist) { ++ tmp = tmplist->data; ++ DEBUG_MSG("remove_recent_entry, remove last entry\n"); ++ *worklist = g_list_remove(*worklist, tmplist->data); ++ return tmp; ++ } else { ++ DEBUG_MSG("remove_recent_entry, worklist contained no items, returning NULL\n"); ++ return NULL; ++ } + } else { +- DEBUG_MSG("remove_recent_entry, worklist contained no items, returning NULL\n"); +- return NULL; ++ return remove_menuitem_in_list_by_label(filename, worklist); + } +- } else { +- return remove_menuitem_in_list_by_label(filename, worklist); +- } ++ } else ++ return NULL; + } + + static void open_recent_project_cb(GtkWidget *widget, Tbfwin *bfwin) { +@@ -766,38 +770,41 @@ + * menu bar, and (if nessecary) deletes the last entry */ + void add_to_recent_list(Tbfwin *bfwin, GFile *file, gint closed_file, gboolean is_project) { + gchar *filename = g_file_get_uri(file); +- register_recent(filename,is_project); +- if (closed_file) { +- GList *tmplist = g_list_first(main_v->bfwinlist); +- while (tmplist) { +- Tbfwin *curbfwin = BFWIN(tmplist->data); +- if (!curbfwin->project || curbfwin == bfwin || is_project) { +- GtkWidget *tmp; +- GList **worklist; +- worklist = (is_project) ? &curbfwin->menu_recent_projects : &curbfwin->menu_recent_files; ++ if (filename) ++ { ++ register_recent(filename,is_project); ++ if (closed_file) { ++ GList *tmplist = g_list_first(main_v->bfwinlist); ++ while (tmplist) { ++ Tbfwin *curbfwin = BFWIN(tmplist->data); ++ if (!curbfwin->project || curbfwin == bfwin || is_project) { ++ GtkWidget *tmp; ++ GList **worklist; ++ worklist = (is_project) ? &curbfwin->menu_recent_projects : &curbfwin->menu_recent_files; + +- /* First of all, create the entry and insert it at the list*/ +- *worklist = g_list_append(*worklist,create_recent_entry(curbfwin,filename,is_project,TRUE)); ++ /* First of all, create the entry and insert it at the list*/ ++ *worklist = g_list_append(*worklist,create_recent_entry(curbfwin,filename,is_project,TRUE)); + +- DEBUG_MSG("add_to_recent_list, inserted item in menu\n"); +- if(g_list_length(*worklist) > main_v->props.max_recent_files) { +- tmp = remove_recent_entry(bfwin,"last",is_project); +- if (tmp) { +- DEBUG_MSG("add_to_recent_list, list too long, entry %s to be deleted\n", GTK_LABEL(GTK_BIN(tmp)->child)->label); +- gtk_widget_hide(tmp); +- gtk_widget_destroy(tmp); ++ DEBUG_MSG("add_to_recent_list, inserted item in menu\n"); ++ if(g_list_length(*worklist) > main_v->props.max_recent_files) { ++ tmp = remove_recent_entry(bfwin,"last",is_project); ++ if (tmp) { ++ DEBUG_MSG("add_to_recent_list, list too long, entry %s to be deleted\n", GTK_LABEL(GTK_BIN(tmp)->child)->label); ++ gtk_widget_hide(tmp); ++ gtk_widget_destroy(tmp); ++ } + } + } ++ tmplist = g_list_next(tmplist); + } +- tmplist = g_list_next(tmplist); + } ++ if (is_project) { ++ main_v->globses.recent_projects = add_to_history_stringlist(main_v->globses.recent_projects, filename, FALSE,TRUE); ++ } else { ++ bfwin->session->recent_files = add_to_history_stringlist(bfwin->session->recent_files, filename, FALSE,TRUE); ++ } ++ g_free(filename); + } +- if (is_project) { +- main_v->globses.recent_projects = add_to_history_stringlist(main_v->globses.recent_projects, filename, FALSE,TRUE); +- } else { +- bfwin->session->recent_files = add_to_history_stringlist(bfwin->session->recent_files, filename, FALSE,TRUE); +- } +- g_free(filename); + /*#ifdef MAC_INTEGRATION + ige_mac_menu_sync(GTK_MENU_SHELL(BFWIN(bfwin)->menubar)); + #endif*/ +Index: src/project.c +=================================================================== +--- src/project.c (revision 6095) ++++ src/project.c (working copy) +@@ -387,7 +387,10 @@ + void project_save_and_mark_closed(Tbfwin *bfwin) { + if (bfwin->project) { + project_save(bfwin, FALSE); +- add_to_recent_list(bfwin,bfwin->project->uri, TRUE, TRUE); ++ ++ if (bfwin->project->uri) ++ add_to_recent_list(bfwin,bfwin->project->uri, TRUE, TRUE); ++ + bfwin->project->close=TRUE; + } + }