Patch by: Alberto Ruiz <aruiz@synaptia.net>
2007-01-26 Thomas Wood <thos@gnome.org> Patch by: Alberto Ruiz <aruiz@synaptia.net> * gnome-theme-installer.c: (transfer_done_cb), (gnome_theme_install_from_uri): Fixes on the suffix checks. svn path=/trunk/; revision=7185
This commit is contained in:
parent
2f7a57426a
commit
908ab38dfa
2 changed files with 12 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
|||
2007-01-26 Thomas Wood <thos@gnome.org>
|
||||
|
||||
Patch by: Alberto Ruiz <aruiz@synaptia.net>
|
||||
|
||||
* gnome-theme-installer.c: (transfer_done_cb),
|
||||
(gnome_theme_install_from_uri): Fixes on the suffix checks.
|
||||
|
||||
2007-01-23 Thomas Wood <thos@gnome.org>
|
||||
|
||||
* gnome-theme-installer.c: (transfer_done_cb): Fix a compiler warning
|
||||
|
|
|
@ -292,7 +292,6 @@ static void
|
|||
transfer_done_cb (GtkWidget *dlg, gchar *path)
|
||||
{
|
||||
GtkWidget *dialog, *apply_button;
|
||||
int len = strlen (path);
|
||||
gchar **dir;
|
||||
int theme_type, xfer_options;
|
||||
theme_properties *theme_props;
|
||||
|
@ -310,9 +309,9 @@ transfer_done_cb (GtkWidget *dlg, gchar *path)
|
|||
g_random_int());
|
||||
|
||||
|
||||
if (path && len > 7 && ( (!strcmp (path + len - 7, ".tar.gz")) || (!strcmp (path + len - 4, ".tgz")) ))
|
||||
if (g_str_has_suffix (path, ".tar.gz") || g_str_has_suffix (path, ".tgz") || g_str_has_suffix(path, ".gtp"))
|
||||
theme_props->filetype=TARGZ;
|
||||
else if (path && len > 8 && !strcmp (path + len - 8, ".tar.bz2"))
|
||||
else if (g_str_has_suffix (path, ".tar.bz2"))
|
||||
theme_props->filetype=TARBZ;
|
||||
else if (g_file_test (path, G_FILE_TEST_IS_DIR))
|
||||
theme_props->filetype=DIRECTORY;
|
||||
|
@ -577,11 +576,10 @@ gnome_theme_install_from_uri (gchar * theme_filename, GtkWindow *parent)
|
|||
while(TRUE) {
|
||||
gchar *file_tmp;
|
||||
GtkWidget *dialog;
|
||||
int len = strlen (base);
|
||||
|
||||
if (base && len > 7 && ( (!strcmp (base + len - 7, ".tar.gz")) || (!strcmp (base + len - 4, ".tgz")) || (!strcmp (base + len - 4, ".gtp"))))
|
||||
file_tmp = g_strdup_printf("gnome-theme-%d.tar.gz", rand ());
|
||||
else if (base && len > 8 && !strcmp (base + len - 8, ".tar.bz2"))
|
||||
if (g_str_has_suffix (base, ".tar.gz") || g_str_has_suffix (base, ".tgz") || g_str_has_suffix(base, ".gtp"))
|
||||
file_tmp = g_strdup_printf("gnome-theme-%d.gtp", rand ());
|
||||
else if (g_str_has_suffix (base, ".tar.bz2"))
|
||||
file_tmp = g_strdup_printf("gnome-theme-%d.tar.bz2", rand ());
|
||||
else {
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
|
|
Loading…
Add table
Reference in a new issue