summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2017-06-28 07:04:16 +0000
committerMartin Owens <doctormo@gmail.com>2017-06-28 07:04:16 +0000
commitcf457eea72b81850da5503d0091952871135c1fd (patch)
tree3709bcf46a0152434a89ed68bbb343a8d45408dd /src/widgets
parentUpdate dxf_input.py for LP Bug #1700582 (diff)
downloadinkscape-cf457eea72b81850da5503d0091952871135c1fd.tar.gz
inkscape-cf457eea72b81850da5503d0091952871135c1fd.zip
Refactor profile directory use and promote IO::Resource get_path and get_filename methods
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/icon.cpp10
-rw-r--r--src/widgets/toolbox.cpp14
2 files changed, 13 insertions, 11 deletions
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index 885deaab7..730fe3e31 100644
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
@@ -34,6 +34,7 @@
#include "display/drawing-item.h"
#include "display/drawing.h"
#include "io/sys.h"
+#include "io/resource.h"
#include "sp-root.h"
#include "sp-namedview.h"
#include "util/units.h"
@@ -1237,14 +1238,15 @@ GdkPixbuf *get_cached_pixbuf(Glib::ustring const &key) {
std::list<gchar*> &IconImpl::icons_svg_paths()
{
+ using namespace Inkscape::IO::Resource;
static std::list<gchar *> sources;
static bool initialized = false;
if (!initialized) {
// Fall back from user prefs dir into system locations.
- gchar *userdir = Inkscape::Application::profile_path("icons");
- sources.push_back(g_build_filename(userdir,"icons.svg", NULL));
- sources.push_back(g_build_filename(INKSCAPE_PIXMAPDIR, "icons.svg", NULL));
- g_free(userdir);
+ // doctormo 2017 hackfest - I've left this modification very light
+ // because there is a refactoring of the icons underway.
+ sources.push_back(g_strdup(get_path(USER, ICONS, "icons.svg")));
+ sources.push_back(g_strdup(get_path(SYSTEM, ICONS, "icons.svg")));
initialized = true;
}
return sources;
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 65c54f0ce..672cb708b 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -102,7 +102,7 @@ using Inkscape::UI::ToolboxFactory;
using Inkscape::UI::Tools::ToolBase;
using Inkscape::IO::Resource::get_filename;
-using Inkscape::IO::Resource::UI;
+using Inkscape::IO::Resource::UIS;
typedef void (*SetupFunction)(GtkWidget *toolbox, SPDesktop *desktop);
typedef void (*UpdateFunction)(SPDesktop *desktop, ToolBase *eventcontext, GtkWidget *toolbox);
@@ -840,10 +840,10 @@ static void setupToolboxCommon( GtkWidget *toolbox,
gtk_ui_manager_insert_action_group( mgr, mainActions->gobj(), 0 );
- char const *filename = get_filename(UI, ui_file);
- gtk_ui_manager_add_ui_from_file( mgr, filename, &err );
+ Glib::ustring filename = get_filename(UIS, ui_file);
+ gtk_ui_manager_add_ui_from_file( mgr, filename.c_str(), &err );
if(err) {
- g_warning("Failed to load %s: %s", filename, err->message);
+ g_warning("Failed to load %s: %s", filename.c_str(), err->message);
g_error_free(err);
return;
}
@@ -984,10 +984,10 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
GError *err = 0;
gtk_ui_manager_insert_action_group( mgr, mainActions->gobj(), 0 );
- char const *filename = get_filename(UI, "select-toolbar.ui");
- guint ret = gtk_ui_manager_add_ui_from_file(mgr, filename, &err);
+ Glib::ustring filename = get_filename(UIS, "select-toolbar.ui");
+ guint ret = gtk_ui_manager_add_ui_from_file(mgr, filename.c_str(), &err);
if(err) {
- g_warning("Failed to load aux toolbar %s: %s", filename, err->message);
+ g_warning("Failed to load aux toolbar %s: %s", filename.c_str(), err->message);
g_error_free(err);
return;
}