From cf457eea72b81850da5503d0091952871135c1fd Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 28 Jun 2017 09:04:16 +0200 Subject: Refactor profile directory use and promote IO::Resource get_path and get_filename methods --- src/shortcuts.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/shortcuts.cpp') diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp index e74d60abc..f8a647040 100644 --- a/src/shortcuts.cpp +++ b/src/shortcuts.cpp @@ -48,11 +48,7 @@ #include "ui/dialog/filedialog.h" using namespace Inkscape; - -using Inkscape::IO::Resource::get_path; -using Inkscape::IO::Resource::SYSTEM; -using Inkscape::IO::Resource::USER; -using Inkscape::IO::Resource::KEYS; +using namespace Inkscape::IO::Resource; static void try_shortcuts_file(char const *filename); static void read_shortcuts_file(char const *filename, bool const is_user_set=false); @@ -208,9 +204,11 @@ Inkscape::XML::Document *sp_shortcut_create_template_file(char const *filename) */ void sp_shortcut_get_file_names(std::vector *names, std::vector *paths) { - std::list sources; - sources.push_back( Inkscape::Application::profile_path("keys") ); - sources.push_back( g_strdup(INKSCAPE_KEYSDIR) ); + using namespace Inkscape::IO::Resource; + std::list sources; + + sources.push_back(g_strdup(get_path(USER, KEYS))); + sources.push_back(g_strdup(get_path(SYSTEM, KEYS))); // loop through possible keyboard shortcut file locations. while (!sources.empty()) { @@ -227,14 +225,12 @@ void sp_shortcut_get_file_names(std::vector *names, std::vector