patch by Kjartan Maraas <kmaraas@gnome.org>, remove a load of leaks and

2005-02-08  Sebastien Bacher  <seb128@debian.org>

	* gnome-theme-installer.c: (file_theme_type), (transfer_done_cb),
	(install_dialog_response), (gnome_theme_installer_run):
	patch by Kjartan Maraas <kmaraas@gnome.org>, remove a load of leaks
	and make sure newly installed themes show up in the relevant lists
	without having to close/open the dialog again (Closes: #166267).

2005-02-08  Sebastien Bacher  <seb128@debian.org>

	* gnome-keyboard-properties-xkb.c: (setup_xkb_tabs):
	* gnome-keyboard-properties-xkblt.c: (def_group_in_gconf_changed):
	patch by Kjartan Maraas <kmaraas@gnome.org>, some code cleanups
	(Closes: #166267).

2005-02-08  Sebastien Bacher  <seb128@debian.org>

	* eggcellrendererkeys.c: (egg_cell_renderer_keys_start_editing):
	patch by Kjartan Maraas <kmaraas@gnome.org>, some code cleanups
        (Closes: #166267).

2005-02-08  Sebastien Bacher  <seb128@debian.org>

	* main.c: (wrap_in_label):
        patch by Kjartan Maraas <kmaraas@gnome.org>, some code cleanups
        (Closes: #166267).

2005-02-08  Sebastien Bacher  <seb128@debian.org>

	* gnome-theme-info.c: (update_common_theme_dir_index):
	* theme-thumbnail.c: (create_image):
	patch by Kjartan Maraas <kmaraas@gnome.org>, move to use GtkIconTheme
	and remove a load of leaks in the theme manager code (Closes: #166267).
This commit is contained in:
Sebastien Bacher 2005-02-08 22:42:10 +00:00 committed by Sebastien Bacher
parent b29dfe67f1
commit 12e01119d8
12 changed files with 134 additions and 34 deletions

View file

@ -1,3 +1,10 @@
2005-02-08 Sebastien Bacher <seb128@debian.org>
* gnome-theme-info.c: (update_common_theme_dir_index):
* theme-thumbnail.c: (create_image):
patch by Kjartan Maraas <kmaraas@gnome.org>, move to use GtkIconTheme
and remove a load of leaks in the theme manager code (Closes: #166267).
2005-02-03 Kjartan Maraas <kmaraas@gnome.org> 2005-02-03 Kjartan Maraas <kmaraas@gnome.org>
* gnome-theme-info.c: (update_theme_index), * gnome-theme-info.c: (update_theme_index),

View file

@ -687,7 +687,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
if (theme_exists) if (theme_exists)
{ {
g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info); g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info);
add_data_to_hash_by_name (hash_by_name, g_strdup (name), theme_info); add_data_to_hash_by_name (hash_by_name, name, theme_info);
handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME, handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME,
theme_info, GNOME_THEME_CHANGE_CREATED, 0); theme_info, GNOME_THEME_CHANGE_CREATED, 0);
} }
@ -705,7 +705,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
if (cmp != 0) if (cmp != 0)
{ {
g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info); g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info);
add_data_to_hash_by_name (hash_by_name, g_strdup (name), theme_info); add_data_to_hash_by_name (hash_by_name, name, theme_info);
handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME, handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME,
theme_info, GNOME_THEME_CHANGE_CHANGED, 0); theme_info, GNOME_THEME_CHANGE_CHANGED, 0);
if (icon_theme) if (icon_theme)

View file

@ -117,19 +117,16 @@ create_image (ThemeThumbnailData *theme_thumbnail_data,
MetaFrameFlags flags; MetaFrameFlags flags;
MetaTheme *theme = NULL; MetaTheme *theme = NULL;
GtkSettings *settings; GtkSettings *settings;
GnomeIconTheme *icon_theme; GtkIconTheme *icon_theme;
GdkPixbuf *folder_icon; GdkPixbuf *folder_icon;
char *folder_icon_name; GtkIconInfo *folder_icon_info;
char *foo; const gchar *filename;
settings = gtk_settings_get_default (); settings = gtk_settings_get_default ();
g_object_set (G_OBJECT (settings), g_object_set (G_OBJECT (settings),
"gtk-theme-name", (char *) theme_thumbnail_data->control_theme_name->data, "gtk-theme-name", (char *) theme_thumbnail_data->control_theme_name->data,
"gtk-font-name", (char *) theme_thumbnail_data->application_font->data, "gtk-font-name", (char *) theme_thumbnail_data->application_font->data,
NULL); NULL);
g_object_get (G_OBJECT (settings),
"gtk-icon-sizes", &foo,
NULL);
theme = meta_theme_load ((char *) theme_thumbnail_data->wm_theme_name->data, NULL); theme = meta_theme_load ((char *) theme_thumbnail_data->wm_theme_name->data, NULL);
flags = META_FRAME_ALLOWS_DELETE | flags = META_FRAME_ALLOWS_DELETE |
@ -197,27 +194,30 @@ create_image (ThemeThumbnailData *theme_thumbnail_data,
gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, ICON_SIZE_WIDTH, ICON_SIZE_HEIGHT); gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, ICON_SIZE_WIDTH, ICON_SIZE_HEIGHT);
/* Handle the icon theme */ /* Handle the icon theme */
icon_theme = gnome_icon_theme_new (); icon_theme = gtk_icon_theme_new ();
gnome_icon_theme_set_allow_svg (icon_theme, TRUE); gtk_icon_theme_set_custom_theme (icon_theme, (char *) theme_thumbnail_data->icon_theme_name->data);
gnome_icon_theme_set_custom_theme (icon_theme, (char *) theme_thumbnail_data->icon_theme_name->data);
/* Have to try both "folder" and "gnome-fs-directory" seems themes seem to use either name */ /* Have to try both "folder" and "gnome-fs-directory" seems themes seem to use either name */
folder_icon_name = gnome_icon_theme_lookup_icon (icon_theme, "folder", 48, NULL, NULL); folder_icon_info = gtk_icon_theme_lookup_icon (icon_theme, "folder", 48, GTK_ICON_LOOKUP_FORCE_SVG);
if (folder_icon_name == NULL) { if (folder_icon_info == NULL) {
folder_icon_name = gnome_icon_theme_lookup_icon (icon_theme, "gnome-fs-directory", 48, NULL, NULL); folder_icon_info = gtk_icon_theme_lookup_icon (icon_theme, "gnome-fs-directory", 48, GTK_ICON_LOOKUP_FORCE_SVG);
} }
g_object_unref (icon_theme); g_object_unref (icon_theme);
filename = gtk_icon_info_get_filename (folder_icon_info);
if (folder_icon_name != NULL) if (filename != NULL)
{ {
folder_icon = gdk_pixbuf_new_from_file (folder_icon_name, NULL); folder_icon = gdk_pixbuf_new_from_file (filename, NULL);
g_free (folder_icon_name);
} }
else else
{ {
folder_icon = NULL; folder_icon = NULL;
} }
gtk_icon_info_free (folder_icon_info);
/* render the icon to the thumbnail */ /* render the icon to the thumbnail */
if (folder_icon) if (folder_icon)
{ {

View file

@ -1,3 +1,9 @@
2005-02-08 Sebastien Bacher <seb128@debian.org>
* main.c: (wrap_in_label):
patch by Kjartan Maraas <kmaraas@gnome.org>, some code cleanups
(Closes: #166267).
2004-11-09 Mark McLoughlin <mark@skynet.ie> 2004-11-09 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: install .desktop file in $(datadir)/applications. * Makefile.am: install .desktop file in $(datadir)/applications.

View file

@ -255,7 +255,7 @@ wrap_in_label (GtkWidget *child, char *text)
char *str; char *str;
vbox = gtk_vbox_new (FALSE, 6); vbox = gtk_vbox_new (FALSE, 6);
label = 0; label = NULL;
label = gtk_label_new (""); label = gtk_label_new ("");

View file

@ -1,3 +1,9 @@
2005-02-08 Sebastien Bacher <seb128@debian.org>
* eggcellrendererkeys.c: (egg_cell_renderer_keys_start_editing):
patch by Kjartan Maraas <kmaraas@gnome.org>, some code cleanups
(Closes: #166267).
2005-01-13 Sebastien Bacher <seb128@debian.org> 2005-01-13 Sebastien Bacher <seb128@debian.org>
* gnome-keybinding-properties.c: (start_editing_kb_cb), * gnome-keybinding-properties.c: (start_editing_kb_cb),

View file

@ -574,7 +574,7 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell,
if (gdk_pointer_grab (widget->window, FALSE, if (gdk_pointer_grab (widget->window, FALSE,
GDK_BUTTON_PRESS_MASK, GDK_BUTTON_PRESS_MASK,
FALSE, NULL, NULL, NULL,
gdk_event_get_time (event)) != GDK_GRAB_SUCCESS) gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
{ {
gdk_keyboard_ungrab (gdk_event_get_time (event)); gdk_keyboard_ungrab (gdk_event_get_time (event));

View file

@ -1,3 +1,10 @@
2005-02-08 Sebastien Bacher <seb128@debian.org>
* gnome-keyboard-properties-xkb.c: (setup_xkb_tabs):
* gnome-keyboard-properties-xkblt.c: (def_group_in_gconf_changed):
patch by Kjartan Maraas <kmaraas@gnome.org>, some code cleanups
(Closes: #166267).
2005-01-19 Sergey V. Udaltsov <svu@gnome.org> 2005-01-19 Sergey V. Udaltsov <svu@gnome.org>
* gnome-keyboard-properties-xkb.c, * gnome-keyboard-properties-xkb.c,

View file

@ -137,8 +137,8 @@ chk_separate_group_per_window_toggled (GConfPropertyEditor *peditor,
void void
setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset) setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset)
{ {
xkbGConfClient = gconf_client_get_default ();
GObject * peditor; GObject * peditor;
xkbGConfClient = gconf_client_get_default ();
XklInit (GDK_DISPLAY ()); XklInit (GDK_DISPLAY ());
XklConfigInit (); XklConfigInit ();

View file

@ -105,11 +105,11 @@ def_group_in_gconf_changed (GConfClient * client,
if (value->type == GCONF_VALUE_INT) if (value->type == GCONF_VALUE_INT)
{ {
defaultGroup = gconf_value_get_int (value);
GtkWidget* treeView = WID ("xkb_layouts_selected"); GtkWidget* treeView = WID ("xkb_layouts_selected");
GtkTreeModel *model = GTK_TREE_MODEL (gtk_tree_view_get_model (GTK_TREE_VIEW (treeView))); GtkTreeModel *model = GTK_TREE_MODEL (gtk_tree_view_get_model (GTK_TREE_VIEW (treeView)));
GtkTreeIter iter; GtkTreeIter iter;
int counter = 0; int counter = 0;
defaultGroup = gconf_value_get_int (value);
if (gtk_tree_model_get_iter_first (model, &iter)) if (gtk_tree_model_get_iter_first (model, &iter))
{ {
do do

View file

@ -1,3 +1,11 @@
2005-02-08 Sebastien Bacher <seb128@debian.org>
* gnome-theme-installer.c: (file_theme_type), (transfer_done_cb),
(install_dialog_response), (gnome_theme_installer_run):
patch by Kjartan Maraas <kmaraas@gnome.org>, remove a load of leaks
and make sure newly installed themes show up in the relevant lists
without having to close/open the dialog again (Closes: #166267).
2005-02-07 Sebastien Bacher <seb128@debian.org> 2005-02-07 Sebastien Bacher <seb128@debian.org>
* gnome-theme-installer.c: (transfer_done_cb): fix some strings, * gnome-theme-installer.c: (transfer_done_cb): fix some strings,

View file

@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include <libwindow-settings/gnome-wm-manager.h> #include <libwindow-settings/gnome-wm-manager.h>
#include "gnome-theme-installer.h" #include "gnome-theme-installer.h"
#include "gnome-theme-details.h"
#include <gconf/gconf-client.h> #include <gconf/gconf-client.h>
#include <glade/glade.h> #include <glade/glade.h>
#include <libgnomevfs/gnome-vfs-async-ops.h> #include <libgnomevfs/gnome-vfs-async-ops.h>
@ -73,31 +74,43 @@ file_theme_type(gchar *dir)
pattern = g_pattern_spec_new ("*[Icon Theme]*"); pattern = g_pattern_spec_new ("*[Icon Theme]*");
if (g_pattern_match_string(pattern,file_contents)) { if (g_pattern_match_string(pattern,file_contents)) {
g_free (filename);
gnome_vfs_uri_unref (src_uri);
return THEME_ICON; return THEME_ICON;
} }
pattern = g_pattern_spec_new ("*[X-GNOME-Metatheme]*"); pattern = g_pattern_spec_new ("*[X-GNOME-Metatheme]*");
if (g_pattern_match_string(pattern,file_contents)) { if (g_pattern_match_string(pattern,file_contents)) {
g_free (filename);
gnome_vfs_uri_unref (src_uri);
return THEME_GNOME; return THEME_GNOME;
} }
} }
g_free (filename);
gnome_vfs_uri_unref (src_uri);
filename = g_strdup_printf ("%s/gtk-2.0/gtkrc",dir); filename = g_strdup_printf ("%s/gtk-2.0/gtkrc",dir);
src_uri = gnome_vfs_uri_new (filename); src_uri = gnome_vfs_uri_new (filename);
g_free (filename);
if (gnome_vfs_uri_exists(src_uri)) { if (gnome_vfs_uri_exists(src_uri)) {
gnome_vfs_uri_unref (src_uri);
return THEME_GTK; return THEME_GTK;
} }
filename = g_strdup_printf ("%s/metacity-1/metacity-theme-1.xml",dir); filename = g_strdup_printf ("%s/metacity-1/metacity-theme-1.xml",dir);
src_uri = gnome_vfs_uri_new (filename); src_uri = gnome_vfs_uri_new (filename);
g_free (filename);
if (gnome_vfs_uri_exists (src_uri)) { if (gnome_vfs_uri_exists (src_uri)) {
gnome_vfs_uri_unref (src_uri);
return THEME_METACITY; return THEME_METACITY;
} }
filename = g_strdup_printf ("%s/configure.in",dir); filename = g_strdup_printf ("%s/configure.in",dir);
src_uri = gnome_vfs_uri_new (filename); src_uri = gnome_vfs_uri_new (filename);
g_free (filename);
if (gnome_vfs_uri_exists (src_uri)) { if (gnome_vfs_uri_exists (src_uri)) {
gnome_vfs_uri_unref (src_uri);
return THEME_ENGINE; return THEME_ENGINE;
} }
@ -215,6 +228,8 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
gnome_vfs_unlink(path); gnome_vfs_unlink(path);
g_free (theme_props->target_tmp_dir);
g_free (theme_props);
return; return;
} }
@ -229,6 +244,9 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
_("Failed to create temporary directory")); _("Failed to create temporary directory"));
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
g_free (command);
g_free (theme_props->target_tmp_dir);
g_free (theme_props);
return; return;
} }
@ -247,6 +265,10 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
gnome_vfs_unlink(path); gnome_vfs_unlink(path);
g_free (command);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props);
return; return;
} }
@ -260,7 +282,11 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
_("Installation Failed")); _("Installation Failed"));
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
cleanup_tmp_dir (theme_props); cleanup_tmp_dir (theme_props);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props);
g_free (command);
return; return;
} }
} }
@ -268,15 +294,19 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
if (theme_props->filetype == TARGZ ) { if (theme_props->filetype == TARGZ ) {
if (!g_file_test ("/bin/gzip", G_FILE_TEST_EXISTS)) { if (!g_file_test ("/bin/gzip", G_FILE_TEST_EXISTS)) {
GtkWidget *dialog; GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL, dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL, GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, GTK_BUTTONS_OK,
_("Can not install themes. \nThe gzip utility is not installed.")); _("Can not install themes. \nThe gzip utility is not installed."));
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
gnome_vfs_unlink(path); gnome_vfs_unlink(path);
g_free (command);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props);
return; return;
} }
if (!transfer_done_targz_idle_cb(theme_props)) { if (!transfer_done_targz_idle_cb(theme_props)) {
@ -288,8 +318,12 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
GTK_BUTTONS_OK, GTK_BUTTONS_OK,
_("Installation Failed")); _("Installation Failed"));
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
cleanup_tmp_dir (theme_props); cleanup_tmp_dir (theme_props);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props);
g_free (command);
return; return;
} }
} }
@ -297,7 +331,7 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
/* What type of theme it is ? */ /* What type of theme it is ? */
if (g_spawn_command_line_sync (command, &first_line, NULL, &status, NULL) && status == 0) { if (g_spawn_command_line_sync (command, &first_line, NULL, &status, NULL) && status == 0) {
dir = g_strsplit(g_strchomp(first_line),"/",0); dir = g_strsplit(g_strchomp(first_line),"/",0);
theme_props->theme_tmp_dir=g_strdup(g_build_filename(theme_props->target_tmp_dir,dir[0],NULL)); theme_props->theme_tmp_dir=g_build_filename(theme_props->target_tmp_dir,dir[0],NULL);
theme_type = file_theme_type(theme_props->theme_tmp_dir); theme_type = file_theme_type(theme_props->theme_tmp_dir);
gnome_vfs_unlink (theme_props->filename); gnome_vfs_unlink (theme_props->filename);
@ -315,15 +349,20 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
theme_props->user_message=g_strdup_printf(_("Controls Theme %s correctly installed.\nYou can select it in the theme details."),dir[0]); theme_props->user_message=g_strdup_printf(_("Controls Theme %s correctly installed.\nYou can select it in the theme details."),dir[0]);
} else if (theme_type == THEME_ENGINE) { } else if (theme_type == THEME_ENGINE) {
GtkWidget *dialog; GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL, dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL, GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, GTK_BUTTONS_OK,
_("The theme is an engine. You need to compile the theme.")); _("The theme is an engine. You need to compile the theme."));
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
cleanup_tmp_dir(theme_props); cleanup_tmp_dir(theme_props);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props->theme_tmp_dir);
g_free (theme_props);
g_free (command);
return; return;
} else { } else {
GtkWidget *dialog; GtkWidget *dialog;
@ -334,7 +373,12 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
GTK_BUTTONS_OK, GTK_BUTTONS_OK,
_("The file format is invalid")); _("The file format is invalid"));
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props->theme_tmp_dir);
g_free (theme_props);
g_free (command);
return; return;
} }
/* Move the Dir to the target dir */ /* Move the Dir to the target dir */
@ -356,6 +400,13 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
cleanup_tmp_dir(theme_props); cleanup_tmp_dir(theme_props);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props->theme_tmp_dir);
g_free (theme_props->target_dir);
g_free (theme_props->user_message);
g_free (theme_props);
g_free (command);
return; return;
} else { } else {
GtkWidget *dialog; GtkWidget *dialog;
@ -368,11 +419,21 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
cleanup_tmp_dir (theme_props); cleanup_tmp_dir (theme_props);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props->theme_tmp_dir);
g_free (theme_props->target_dir);
g_free (theme_props->user_message);
g_free (theme_props);
g_free (command);
return; return;
} }
} }
g_free(theme_props); g_free (command);
g_free (theme_props->target_tmp_dir);
g_free (theme_props->filename);
g_free (theme_props);
} }
static void static void
@ -444,11 +505,13 @@ install_dialog_response (GtkWidget *widget, int response_id, gpointer data)
_("Insufficient permissions to install the theme in:\n%s"), path); _("Insufficient permissions to install the theme in:\n%s"), path);
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
g_free (path);
return; return;
} }
while(TRUE) { while(TRUE) {
gchar *file_tmp; gchar *file_tmp;
GtkWidget *dialog;
int len = strlen (base); int len = strlen (base);
if (base && len > 7 && ( (!strcmp (base + len - 7, ".tar.gz")) || (!strcmp (base + len - 4, ".tgz")) )) if (base && len > 7 && ( (!strcmp (base + len - 7, ".tar.gz")) || (!strcmp (base + len - 4, ".tgz")) ))
@ -463,7 +526,7 @@ install_dialog_response (GtkWidget *widget, int response_id, gpointer data)
_("The file format is invalid.")); _("The file format is invalid."));
gtk_dialog_run (GTK_DIALOG (dialog)); gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
gnome_vfs_unlink(path); g_free (path);
return; return;
} }
@ -494,6 +557,7 @@ install_dialog_response (GtkWidget *widget, int response_id, gpointer data)
g_free (base); g_free (base);
g_free (filename); g_free (filename);
g_free(temppath); g_free(temppath);
g_free (path);
return; return;
} }
g_free(temppath); g_free(temppath);
@ -558,6 +622,8 @@ gnome_theme_installer_run (GtkWidget *parent, gchar *filename)
while (gtk_dialog_run (GTK_DIALOG (widget)) == GTK_RESPONSE_HELP) while (gtk_dialog_run (GTK_DIALOG (widget)) == GTK_RESPONSE_HELP)
; ;
gnome_theme_details_reread_themes_from_disk();
gtk_widget_destroy (widget); gtk_widget_destroy (widget);
g_object_unref (G_OBJECT (dialog)); g_object_unref (G_OBJECT (dialog));