2011-04-08 [colin] 3.7.8cvs73
[claws.git] / src / gtk / filesel.c
index 79f37f7c85f3bf53f9e2bbb69e093bb6c49acd23..a511aabf142ba88e4476e4c7985a128709b40003 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
        if (pixbuf) {
                have_preview = TRUE;
                gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
-               gdk_pixbuf_unref (pixbuf);
+               g_object_unref(G_OBJECT(pixbuf));
        }
 
        gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview);
@@ -168,21 +168,13 @@ static GList *filesel_create(const gchar *title, const gchar *path,
                        g_free(realpath); 
                        realpath = g_strdup(get_home_dir());
                }
-               tmp = NULL;
                if (g_utf8_validate(realpath, -1, NULL))
-                       tmp = g_filename_from_utf8(realpath, -1, NULL, NULL, NULL);
-               if (tmp == NULL)
-                       tmp = g_strdup(realpath);
-               gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(chooser), tmp);
-               g_free(tmp);
+                       gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(chooser),
+                                                           realpath);
                if (action == GTK_FILE_CHOOSER_ACTION_SAVE) {
-                       tmp = NULL;
                        if (g_utf8_validate(filename, -1, NULL))
-                               tmp = g_filename_from_utf8(filename, -1, NULL, NULL, NULL);
-                       if (tmp == NULL)
-                               tmp = g_strdup(filename);
-                       gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(chooser), tmp);
-                       g_free(tmp);
+                               gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(chooser),
+                                                                 filename);
                }
                g_free(realpath);
        } else {