Yasumichi Akahoshi
yasum****@users*****
2005年 5月 7日 (土) 22:23:11 JST
Index: cxplorer/src/cxp-right-pane.c diff -u cxplorer/src/cxp-right-pane.c:1.36 cxplorer/src/cxp-right-pane.c:1.37 --- cxplorer/src/cxp-right-pane.c:1.36 Sat May 7 21:50:40 2005 +++ cxplorer/src/cxp-right-pane.c Sat May 7 22:23:11 2005 @@ -244,6 +244,7 @@ * the most simple solution is to unref all members on which you own a * reference. */ + g_object_unref (priv->client); g_object_unref (priv->handler); magic_close (priv->normal_cookie); magic_close (priv->mime_cookie); @@ -433,7 +434,6 @@ return; } - g_object_unref (priv->client); model = gtk_tree_view_get_model (treeview); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, COL_FILE_PATH, &fullpath, @@ -625,7 +625,8 @@ const gchar * filename) { CxpRightPanePrivate *priv = CXP_RIGHT_PANE_GET_PRIVATE (self); - gchar *cmd; + gchar *preview_cmd = NULL; + gchar *cmd = NULL; const gchar *filetype; gchar *standard_output; gchar *stdout_utf8; @@ -633,14 +634,14 @@ if (g_file_test (filename, G_FILE_TEST_IS_DIR)) { - cmd = g_strdup_printf ("%s '%s'", gconf_client_get_string (priv->client,"/apps/cxp/cxplorer/PreviewDir", NULL), filename); + preview_cmd = gconf_client_get_string (priv->client,"/apps/cxp/cxplorer/PreviewDir", NULL); } else { filetype = magic_file (priv->normal_cookie, filename); if (g_strrstr (filetype, "text") != NULL) { - cmd = g_strdup_printf ("%s '%s'", gconf_client_get_string (priv->client,"/apps/cxp/cxplorer/PreviewText", NULL), filename); + preview_cmd = gconf_client_get_string (priv->client,"/apps/cxp/cxplorer/PreviewText", NULL); } else if (strstr (filetype, "fifo") != NULL) { @@ -652,12 +653,15 @@ } else { - cmd = g_strdup_printf ("%s '%s'", gconf_client_get_string (priv->client,"/apps/cxp/cxplorer/PreviewBinary", NULL), filename); + preview_cmd = gconf_client_get_string (priv->client,"/apps/cxp/cxplorer/PreviewBinary", NULL); } } + cmd = g_strdup_printf ("%s '%s'", preview_cmd, filename); g_spawn_command_line_sync (cmd, &standard_output, NULL, &exit_status, NULL); + g_free (preview_cmd); g_free (cmd); + if (exit_status == 0) { stdout_utf8 = Index: cxplorer/src/cxplorer-window.c diff -u cxplorer/src/cxplorer-window.c:1.40 cxplorer/src/cxplorer-window.c:1.41 --- cxplorer/src/cxplorer-window.c:1.40 Sat May 7 21:50:40 2005 +++ cxplorer/src/cxplorer-window.c Sat May 7 22:23:11 2005 @@ -57,7 +57,6 @@ GtkWidget *dirview; GtkWidget *right_pane; GtkWidget *statusbar; - CxpProfile *profile; CxpProfile *sendto; CxpProfile *bookmark; gboolean dispose_has_run; @@ -198,7 +197,6 @@ g_free (filter); } - private->profile = cxp_profile_new ("cxplorer", "main"); private->bookmark = cxp_profile_new ("cxplorer", "bookmark"); private->sendto = cxp_profile_new ("common", "SendTo"); @@ -366,7 +364,6 @@ * reference. */ g_object_unref (private->client); - g_object_unref (private->profile); g_object_unref (private->bookmark); g_object_unref (private->action_group); g_object_unref (private->ui_manager);