[Xfce4-commits] r23440 - xarchiver/branches/xarchiver-psybsd/src
Stephan Arts
stephan at xfce.org
Tue Oct 17 08:44:20 UTC 2006
Author: stephan
Date: 2006-10-17 08:44:19 +0000 (Tue, 17 Oct 2006)
New Revision: 23440
Modified:
xarchiver/branches/xarchiver-psybsd/src/main_window.c
xarchiver/branches/xarchiver-psybsd/src/path_bar.c
xarchiver/branches/xarchiver-psybsd/src/tool_bar.c
xarchiver/branches/xarchiver-psybsd/src/tool_bar.h
Log:
Applied patch from Peter de Ridder <pc.ridder at zonnet.nl>
(fixes segfault)
Partially fixed looks of toolbar
Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.c 2006-10-17 08:42:38 UTC (rev 23439)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.c 2006-10-17 08:44:19 UTC (rev 23440)
@@ -508,7 +508,8 @@
open_archive_path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
if(window->lp_xa_archive)
{
- xa_navigation_bar_clear_history(window->navigationbar);
+ if(window->navigationbar)
+ xa_navigation_bar_clear_history(window->navigationbar);
xa_archive_store_set_contents(XA_ARCHIVE_STORE(window->treemodel), NULL);
g_object_unref(window->lp_xa_archive);
window->lp_xa_archive = NULL;
@@ -595,7 +596,8 @@
GtkTreeModel *liststore = window->treemodel;
GList *columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(window->treeview));
- xa_navigation_bar_clear_history(window->navigationbar);
+ if(window->navigationbar)
+ xa_navigation_bar_clear_history(window->navigationbar);
xa_archive_store_set_contents(XA_ARCHIVE_STORE(liststore), NULL);
/* xa_archive_tree_store_set_contents(XA_ARCHIVE_TREE_STORE(liststore), NULL); */
Modified: xarchiver/branches/xarchiver-psybsd/src/path_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/path_bar.c 2006-10-17 08:42:38 UTC (rev 23439)
+++ xarchiver/branches/xarchiver-psybsd/src/path_bar.c 2006-10-17 08:44:19 UTC (rev 23440)
@@ -426,8 +426,8 @@
{
while(buttons)
{
- /* it seems remove also unref de button */
gtk_container_remove(GTK_CONTAINER(path_bar), GTK_WIDGET(buttons->data));
+ gtk_widget_unref(GTK_WIDGET(buttons->data));
buttons = buttons->next;
}
if(lastbutton)
@@ -453,6 +453,7 @@
while(iter)
{
button = GTK_RADIO_BUTTON(gtk_radio_button_new_with_label(path_bar->path_button, (const gchar*)iter->data));
+ gtk_widget_ref(GTK_WIDGET(button));
gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(button), FALSE);
path_bar->path_button = g_slist_append(path_bar->path_button, button);
Modified: xarchiver/branches/xarchiver-psybsd/src/tool_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/tool_bar.c 2006-10-17 08:42:38 UTC (rev 23439)
+++ xarchiver/branches/xarchiver-psybsd/src/tool_bar.c 2006-10-17 08:44:19 UTC (rev 23440)
@@ -147,11 +147,11 @@
button = gtk_tool_item_new();
tool_bar->path_field = gtk_entry_new();
gtk_tool_item_set_expand(button, TRUE);
- GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
+ tool_bar->hbox = gtk_hbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(button), hbox);
- gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(_("Location:")), FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(hbox), tool_bar->path_field, TRUE, TRUE, 5);
+ gtk_container_add(GTK_CONTAINER(button), tool_bar->hbox);
+ gtk_box_pack_start(GTK_BOX(tool_bar->hbox), gtk_label_new(_("Location:")), FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(tool_bar->hbox), tool_bar->path_field, TRUE, TRUE, 5);
g_signal_connect(G_OBJECT(tool_bar->path_field), "activate", (GCallback)cb_xa_tool_bar_path_field_activated, tool_bar);
gtk_tool_item_set_visible_horizontal(button, TRUE);
gtk_tool_item_set_homogeneous(button, FALSE);
@@ -159,7 +159,7 @@
gtk_toolbar_insert(GTK_TOOLBAR(tool_bar->bar), button, 5);
gtk_widget_show_all(GTK_WIDGET(button));
gtk_widget_show(GTK_WIDGET(tool_bar->path_field));
- gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->path_field), 0);
+ gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->hbox), 0);
gtk_widget_show_all(GTK_WIDGET(tool_bar->bar));
}
@@ -294,7 +294,7 @@
xa_navigation_bar_history_push(XA_NAVIGATION_BAR(tool_bar), path);
xa_tool_bar_refresh(tool_bar, path);
g_free(path);
- gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->path_field), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->hbox), TRUE);
}
static void
Modified: xarchiver/branches/xarchiver-psybsd/src/tool_bar.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/tool_bar.h 2006-10-17 08:42:38 UTC (rev 23439)
+++ xarchiver/branches/xarchiver-psybsd/src/tool_bar.h 2006-10-17 08:44:19 UTC (rev 23440)
@@ -51,6 +51,7 @@
GtkToolItem *up_button;
GtkToolItem *home_button;
GtkWidget *path_field;
+ GtkWidget *hbox;
};
typedef struct _XAToolBarClass XAToolBarClass;
More information about the Xfce4-commits
mailing list