added utility function to reduce code duplication.

2007-12-14  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpfiledialog.c: added utility function to reduce
	code duplication.


svn path=/trunk/; revision=24367
This commit is contained in:
Sven Neumann 2007-12-14 20:08:39 +00:00 committed by Sven Neumann
parent 8d38858180
commit d8d68bd5b5
3 changed files with 23 additions and 15 deletions

View File

@ -1,3 +1,8 @@
2007-12-14 Sven Neumann <sven@gimp.org>
* app/widgets/gimpfiledialog.c: added utility function to reduce
code duplication.
2007-12-14 Kevin Cozens <kcozens@cvs.gnome.org> 2007-12-14 Kevin Cozens <kcozens@cvs.gnome.org>
* plug-ins/script-fu/tinyscheme/scheme.c (eqv): Only return true * plug-ins/script-fu/tinyscheme/scheme.c (eqv): Only return true
@ -15,7 +20,8 @@
* tools/pdbgen/pdb/edit.pdb: use gimp_pdb_get_buffer() which * tools/pdbgen/pdb/edit.pdb: use gimp_pdb_get_buffer() which
sets a proper error instead of looking up the buffers manually. sets a proper error instead of looking up the buffers manually.
* app/pdb/edit_cmds.c: regenerated. * app/pdb/edit_cmds.c
* libgimp/gimpedit_pdb.c: regenerated.
2007-12-14 Michael Natterer <mitch@gimp.org> 2007-12-14 Michael Natterer <mitch@gimp.org>

View File

@ -75,6 +75,8 @@ static gdouble gimp_file_dialog_progress_get_value (GimpProgress *progress)
static void gimp_file_dialog_progress_pulse (GimpProgress *progress); static void gimp_file_dialog_progress_pulse (GimpProgress *progress);
static guint32 gimp_file_dialog_progress_get_window(GimpProgress *progress); static guint32 gimp_file_dialog_progress_get_window(GimpProgress *progress);
static void gimp_file_dialog_add_user_dir (GimpFileDialog *dialog,
GUserDirectory directory);
static void gimp_file_dialog_add_preview (GimpFileDialog *dialog, static void gimp_file_dialog_add_preview (GimpFileDialog *dialog,
Gimp *gimp); Gimp *gimp);
static void gimp_file_dialog_add_filters (GimpFileDialog *dialog, static void gimp_file_dialog_add_filters (GimpFileDialog *dialog,
@ -256,8 +258,6 @@ gimp_file_dialog_new (Gimp *gimp,
GSList *file_procs; GSList *file_procs;
const gchar *automatic; const gchar *automatic;
const gchar *automatic_help_id; const gchar *automatic_help_id;
const gchar *pictures;
const gchar *documents;
gboolean local_only; gboolean local_only;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
@ -336,17 +336,8 @@ gimp_file_dialog_new (Gimp *gimp,
g_object_set_data (G_OBJECT (dialog), "gimp-dialog-help-button", button); g_object_set_data (G_OBJECT (dialog), "gimp-dialog-help-button", button);
} }
pictures = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES); gimp_file_dialog_add_user_dir (dialog, G_USER_DIRECTORY_PICTURES);
gimp_file_dialog_add_user_dir (dialog, G_USER_DIRECTORY_DOCUMENTS);
if (pictures)
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
pictures, NULL);
documents = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
if (documents)
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
documents, NULL);
gimp_file_dialog_add_preview (dialog, gimp); gimp_file_dialog_add_preview (dialog, gimp);
@ -501,6 +492,17 @@ gimp_file_dialog_set_image (GimpFileDialog *dialog,
/* private functions */ /* private functions */
static void
gimp_file_dialog_add_user_dir (GimpFileDialog *dialog,
GUserDirectory directory)
{
const gchar *user_dir = g_get_user_special_dir (directory);
if (user_dir)
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
user_dir, NULL);
}
static void static void
gimp_file_dialog_add_preview (GimpFileDialog *dialog, gimp_file_dialog_add_preview (GimpFileDialog *dialog,
Gimp *gimp) Gimp *gimp)

View File

@ -300,7 +300,7 @@ gimp_edit_named_copy (gint32 drawable_ID,
* available for later pasting, regardless of any intermediate copy or * available for later pasting, regardless of any intermediate copy or
* cut operations. * cut operations.
* *
* Returns: The real name given to the buffer. * Returns: The real name given to the buffer, or NULL if the selection contained only transparent pixels.
* *
* Since: GIMP 2.4 * Since: GIMP 2.4
*/ */