[gimp] libgimpwidgets: add a shortcut to the profile chooser dialog on OS X too
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: add a shortcut to the profile chooser dialog on OS X too
- Date: Thu, 5 May 2016 17:43:09 +0000 (UTC)
commit 1bfd57b99c659ce5df8189077a6840657ab12f00
Author: Michael Natterer <mitch gimp org>
Date: Thu May 5 19:40:52 2016 +0200
libgimpwidgets: add a shortcut to the profile chooser dialog on OS X too
Apparently it's "/Library/ColorSync/Profiles".
libgimpwidgets/gimpcolorprofilechooserdialog.c | 25 +++++++++++++++--------
1 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/libgimpwidgets/gimpcolorprofilechooserdialog.c b/libgimpwidgets/gimpcolorprofilechooserdialog.c
index 9febe2f..d5cc4b4 100644
--- a/libgimpwidgets/gimpcolorprofilechooserdialog.c
+++ b/libgimpwidgets/gimpcolorprofilechooserdialog.c
@@ -146,7 +146,16 @@ gimp_color_profile_chooser_dialog_new (const gchar *title)
NULL);
}
-/* Add shortcut for default ICC profile location */
+/* Add shortcuts for default ICC profile locations */
+static gboolean
+add_shortcut (GimpColorProfileChooserDialog *dialog,
+ const gchar *folder)
+{
+ return (g_file_test (folder, G_FILE_TEST_IS_DIR) &&
+ gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
+ folder, NULL));
+}
+
static void
gimp_color_profile_chooser_dialog_add_shortcut (GimpColorProfileChooserDialog *dialog)
{
@@ -160,19 +169,17 @@ gimp_color_profile_chooser_dialog_add_shortcut (GimpColorProfileChooserDialog *d
folder = g_strconcat (prefix, "\\system32\\spool\\drivers\\color", NULL);
- if (g_file_test (folder, G_FILE_TEST_IS_DIR))
- gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
- folder, NULL);
+ add_shortcut (dialog, folder);
g_free (folder);
}
+#elif defined(PLATFORM_OSX)
+ {
+ add_shortcut (dialog, "/Library/ColorSync/Profiles");
+ }
#else
{
- const gchar folder[] = "/usr/share/color/icc";
-
- if (g_file_test (folder, G_FILE_TEST_IS_DIR))
- gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
- folder, NULL);
+ add_shortcut (dialog, "/usr/share/color/icc");
}
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]