diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2009-04-03 08:23:20 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2009-04-03 08:23:20 +0000 |
| commit | efe18cc8cbcf7bcc9aee557c03bb637ff6725960 (patch) | |
| tree | dc7c1f236f7be5a28b0b583de2a895de26bc664d /src/main.cpp | |
| parent | Fix ink toggle buttons to have non-stretching icons. Fixes blurring. (diff) | |
| download | inkscape-efe18cc8cbcf7bcc9aee557c03bb637ff6725960.tar.gz inkscape-efe18cc8cbcf7bcc9aee557c03bb637ff6725960.zip | |
Add XDG locations for icons
(bzr r7613)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index b5ace5405..db3255cad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -877,6 +877,16 @@ snooper(GdkEvent *event, gpointer /*data*/) { gtk_main_do_event (event); } +static std::vector<Glib::ustring> getDirectorySet(const gchar* userDir, const gchar* const * systemDirs) { + std::vector<Glib::ustring> listing; + listing.push_back(userDir); + for ( const char* const* cur = systemDirs; *cur; cur++ ) + { + listing.push_back(*cur); + } + return listing; +} + int sp_main_gui(int argc, char const **argv) { @@ -886,6 +896,19 @@ sp_main_gui(int argc, char const **argv) int retVal = sp_common_main( argc, argv, &fl ); g_return_val_if_fail(retVal == 0, 1); + // Add possible icon entry directories + std::vector<Glib::ustring> dataDirs = getDirectorySet( g_get_user_data_dir(), + g_get_system_data_dirs() ); + for (std::vector<Glib::ustring>::iterator it = dataDirs.begin(); it != dataDirs.end(); ++it) + { + std::vector<Glib::ustring> listing; + listing.push_back(*it); + listing.push_back("inkscape"); + listing.push_back("icons"); + Glib::ustring dir = Glib::build_filename(listing); + gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), dir.c_str()); + } + // Add our icon directory to the search path for icon theme lookups. gchar *usericondir = profile_path("icons"); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), usericondir); |
