/*
* 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
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);
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 {