commit e1538240d88f985b8aac4623034a4817ad5533a7
Author: phantomjinx <[email protected]>
Date: Sat Jul 3 12:24:01 2010 +0100
Fix bug where preferences are shutdown before plugins can write to them
* sorttab display has a cleanup() function which is called on deactivate.
However, gtkpod_shutdown is called prior to the plugin deactivation hence
preferences are destroyed.
libgtkpod/gtkpod_app_iface.c | 8 +++-----
libgtkpod/gtkpod_app_iface.h | 1 +
src/gtkpod.c | 12 ++++++++----
3 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/libgtkpod/gtkpod_app_iface.c b/libgtkpod/gtkpod_app_iface.c
index 42505f8..254bf58 100644
--- a/libgtkpod/gtkpod_app_iface.c
+++ b/libgtkpod/gtkpod_app_iface.c
@@ -127,7 +127,7 @@ gchar* gtkpod_get_glade_xml() {
*
* return value: TRUE if it's OK to quit.
*/
-static gboolean ok_to_close_gtkpod(void) {
+gboolean ok_to_close_gtkpod(void) {
gint result = GTK_RESPONSE_OK;
if (!files_are_saved()) {
@@ -155,10 +155,8 @@ static gboolean ok_to_close_gtkpod(void) {
*/
gint gtkpod_cleanup_quit() {
if (!widgets_blocked) {
- if (ok_to_close_gtkpod()) {
- gtkpod_shutdown();
- return TRUE; // Already to carry on quitting
- }
+ gtkpod_shutdown();
+ return TRUE; // Already to carry on quitting
}
return FALSE; // dont quit!
}
diff --git a/libgtkpod/gtkpod_app_iface.h b/libgtkpod/gtkpod_app_iface.h
index b0ceaba..88403d0 100644
--- a/libgtkpod/gtkpod_app_iface.h
+++ b/libgtkpod/gtkpod_app_iface.h
@@ -153,6 +153,7 @@ void gp_init(int argc, char *argv[]);
void gtkpod_app_set_glade_xml(gchar *xml_file);
gchar* gtkpod_get_glade_xml();
+gboolean ok_to_close_gtkpod();
gint gtkpod_cleanup_quit();
void gtkpod_statusbar_message(gchar* message, ...);
diff --git a/src/gtkpod.c b/src/gtkpod.c
index a607f3d..bda4f87 100644
--- a/src/gtkpod.c
+++ b/src/gtkpod.c
@@ -82,7 +82,7 @@ void gtkpod_init(int argc, char *argv[]) {
gtkpod_app_set_glade_xml(glade_xml_file);
g_free(glade_xml_file);
- /* initialise gtkpod library items depedent on path of executable*/
+ /* initialise gtkpod library items dependent on path of executable*/
gp_init(argc, argv);
/* Add blocking widgets from the framework */
@@ -184,10 +184,8 @@ void gtkpod_init(int argc, char *argv[]) {
/* callback for gtkpod window's close button */
static gboolean on_gtkpod_delete_event(GtkWidget *widget, GdkEvent *event,
gpointer user_data) {
- if (!gtkpod_cleanup_quit()) {
- // Dont want to quit so avoid signalling any destroy event
+ if (! ok_to_close_gtkpod())
return TRUE;
- }
AnjutaPluginManager *plugin_manager;
AnjutaProfileManager *profile_manager;
@@ -228,6 +226,12 @@ static gboolean on_gtkpod_delete_event(GtkWidget *widget,
GdkEvent *event, gpoin
gtk_widget_hide(GTK_WIDGET (app));
anjuta_plugin_manager_unload_all_plugins(plugin_manager);
}
+
+ if (!gtkpod_cleanup_quit()) {
+ // Dont want to quit so avoid signalling any destroy event
+ return TRUE;
+ }
+
return FALSE;
}
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2