diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-07-31 22:44:30 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-07-31 22:44:30 +0000 |
| commit | e16723672743dc4014f4823a7326411618fcf386 (patch) | |
| tree | c74f490281f8a9995b54e0480c26660eb944436d | |
| parent | Fixing coding style (diff) | |
| download | inkscape-e16723672743dc4014f4823a7326411618fcf386.tar.gz inkscape-e16723672743dc4014f4823a7326411618fcf386.zip | |
Remove XGD_DATA_DIR as sugestion of su_v
| -rw-r--r-- | src/helper/icon-loader.cpp | 8 | ||||
| -rw-r--r-- | src/inkscape.cpp | 1 | ||||
| -rw-r--r-- | src/main.cpp | 25 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 3 | ||||
| -rw-r--r-- | src/ui/interface.cpp | 7 |
6 files changed, 16 insertions, 30 deletions
diff --git a/src/helper/icon-loader.cpp b/src/helper/icon-loader.cpp index 68326bdc9..cfbd6bfc0 100644 --- a/src/helper/icon-loader.cpp +++ b/src/helper/icon-loader.cpp @@ -27,8 +27,14 @@ Glib::RefPtr<Gdk::Pixbuf> sp_get_icon_pixbuf(Glib::ustring icon_name, gint size) { using namespace Inkscape::IO::Resource; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - auto icon_theme = Gtk::IconTheme::get_default(); Glib::RefPtr<Gdk::Pixbuf> _icon_pixbuf; + static auto icon_theme = Gtk::IconTheme::get_default(); + static bool icon_theme_set; + if (!icon_theme_set) { + icon_theme_set = true; + icon_theme->prepend_search_path(get_path_ustring(SYSTEM, ICONS)); + icon_theme->prepend_search_path(get_path_ustring(USER, ICONS)); + } try { if (prefs->getBool("/theme/symbolicIcons", false)) { gchar colornamed[64]; diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 3f9496403..4b5ca297b 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -423,6 +423,7 @@ Application::add_style_sheet() Gtk::StyleContext::add_provider_for_screen (screen, provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } } + /* \brief Constructor for the application. * Creates a new Inkscape::Application. * diff --git a/src/main.cpp b/src/main.cpp index 501a32fcc..5206a6403 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -618,30 +618,6 @@ static void set_extensions_env() // printf("PYTHONPATH = %s\n", g_getenv("PYTHONPATH")); } -static void set_datadir_env() -{ - gchar const *xgd = g_getenv("XDG_DATA_DIRS"); -#ifdef _WIN32 - Glib::ustring datadir = get_datadir_path(); - datadir += ";"; - datadir += append_inkscape_datadir("inkscape"); - if (xgd) { - datadir += ";"; - } -#else - Glib::ustring datadir = get_datadir_path(); - datadir += ":"; - datadir += append_inkscape_datadir("inkscape"); - if (xgd) { - datadir += ":"; - } -#endif - if (xgd) { - datadir += xgd; - } - g_setenv("XDG_DATA_DIRS", datadir.c_str(), TRUE); - printf("XDG_DATA_DIRS=%s\n", g_getenv("XDG_DATA_DIRS")); -} /** * This is the classic main() entry point of the program, though on some @@ -673,7 +649,6 @@ main(int argc, char **argv) rt.setPathInfo(); } #endif - set_datadir_env(); set_extensions_env(); // Prevents errors like "Unable to wrap GdkPixbuf..." (in nr-filter-image.cpp for example) diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 520efa323..831190bb0 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -2312,6 +2312,8 @@ bool InkscapePreferences::PresentPage(const Gtk::TreeModel::iterator& iter) if (desired_page >= PREFS_PAGE_IO && desired_page <= PREFS_PAGE_IO_OPENCLIPART) _page_list.expand_row(_path_io, false); _page_list.get_selection()->select(iter); + if (desired_page == PREFS_PAGE_UI_THEME) + symbolicThemeCheck(); return true; } return false; diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index cce2509d7..a2f758287 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -571,10 +571,9 @@ protected: bool onKBSearchFilter(const Gtk::TreeModel::const_iterator& iter); static void onKBShortcutRenderer(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter); - private: - void symbolicThemeCheck(); void themeChange(); + void symbolicThemeCheck(); InkscapePreferences(); InkscapePreferences(InkscapePreferences const &d); InkscapePreferences operator=(InkscapePreferences const &d); diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 17501019b..cd924f79d 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -302,8 +302,11 @@ void sp_ui_reload() continue; } sp_create_window(dtw, TRUE); - sp_namedview_window_from_document(static_cast<SPDesktop *>(dtw->view)); - sp_namedview_update_layers_from_document(static_cast<SPDesktop *>(dtw->view)); + SPDesktop * desktop = static_cast<SPDesktop *>(dtw->view); + if (desktop) { + sp_namedview_window_from_document(desktop); + sp_namedview_update_layers_from_document(desktop); + } dt->destroyWidget(); i++; } |
