summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c92c0e5)
raw | patch | inline | side by side (parent: c92c0e5)
author | joncruz <joncruz@users.sourceforge.net> | |
Thu, 27 Nov 2008 21:35:19 +0000 (21:35 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Thu, 27 Nov 2008 21:35:19 +0000 (21:35 +0000) |
src/color-profile.cpp | patch | blob | history | |
src/color-profile.h | patch | blob | history | |
src/ui/dialog/inkscape-preferences.cpp | patch | blob | history |
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 5a2a1efc9d57086a6e71161bb58fe3617784f6d3..9ac1f6414d25ad92483c00030a9e9ea8bab18dcf 100644 (file)
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
return result;
}
-#if ENABLE_LCMS
-std::list<gchar *> ColorProfile::getProfileDirs() {
- std::list<gchar *> sources;
+std::list<Glib::ustring> ColorProfile::getProfileDirs() {
+ std::list<Glib::ustring> sources;
gchar* base = profile_path("XXX");
{
return sources;
}
-#endif // ENABLE_LCMS
static void findThings() {
- std::list<gchar *> sources = ColorProfile::getProfileDirs();
+ std::list<Glib::ustring> sources = ColorProfile::getProfileDirs();
- while (!sources.empty()) {
- gchar *dirname = sources.front();
- if ( g_file_test( dirname, G_FILE_TEST_EXISTS ) && g_file_test( dirname, G_FILE_TEST_IS_DIR ) ) {
+ for ( std::list<Glib::ustring>::const_iterator it = sources.begin(); it != sources.end(); ++it ) {
+ if ( g_file_test( it->c_str(), G_FILE_TEST_EXISTS ) && g_file_test( it->c_str(), G_FILE_TEST_IS_DIR ) ) {
GError *err = 0;
- GDir *dir = g_dir_open(dirname, 0, &err);
+ GDir *dir = g_dir_open(it->c_str(), 0, &err);
if (dir) {
for (gchar const *file = g_dir_read_name(dir); file != NULL; file = g_dir_read_name(dir)) {
- gchar *filepath = g_build_filename(dirname, file, NULL);
+ gchar *filepath = g_build_filename(it->c_str(), file, NULL);
if ( g_file_test( filepath, G_FILE_TEST_IS_DIR ) ) {
}
}
}
-
- // toss the dirname
- g_free(dirname);
- sources.pop_front();
}
}
diff --git a/src/color-profile.h b/src/color-profile.h
index 0c4ec8e09061a959c44b17f9900238389d3f90b3..2e57e7ef0221b3b813b00dca270d4df2dbabf84a 100644 (file)
--- a/src/color-profile.h
+++ b/src/color-profile.h
#include <glib/gtypes.h>
#include <sp-object.h>
+#include <glibmm/ustring.h>
#if ENABLE_LCMS
#include <lcms.h>
#endif // ENABLE_LCMS
static GType getType();
static void classInit( ColorProfileClass *klass );
+ static std::list<Glib::ustring> getProfileDirs();
#if ENABLE_LCMS
static cmsHPROFILE getSRGBProfile();
- static std::list<gchar *> getProfileDirs();
icColorSpaceSignature getColorSpace() const {return _profileSpace;}
icProfileClassSignature getProfileClass() const {return _profileClass;}
index 43d1ea88cd8f71d7bb714f087b8356ec15a436a5..b1a14e7817c373c43067684832a56e22c7cd862b 100644 (file)
_page_cms.add_group_header( _("Display adjustment"));
-#if ENABLE_LCMS
Glib::ustring tmpStr;
- std::list<gchar *> sources = ColorProfile::getProfileDirs();
- while (!sources.empty()) {
- gchar* dirname = sources.front();
- gchar* part = g_strdup_printf("\n%s", dirname);
+ std::list<Glib::ustring> sources = ColorProfile::getProfileDirs();
+ for ( std::list<Glib::ustring>::const_iterator it = sources.begin(); it != sources.end(); ++it ) {
+ gchar* part = g_strdup_printf( "\n%s", it->c_str() );
tmpStr += part;
g_free(part);
- g_free(dirname);
- sources.pop_front();
}
gchar* profileTip = g_strdup_printf(_("The ICC profile to use to calibrate display output.\nSearched directories:%s"), tmpStr.c_str());
profileTip, false);
g_free(profileTip);
profileTip = 0;
-#endif // ENABLE_LCMS
_cms_from_display.init( _("Retrieve profile from display"), "/options/displayprofile/from_display", false);
_page_cms.add_line( false, "", _cms_from_display, "",