diff options
| author | Martin Owens <doctormo@gmail.com> | 2017-06-28 07:04:16 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2017-06-28 07:04:16 +0000 |
| commit | cf457eea72b81850da5503d0091952871135c1fd (patch) | |
| tree | 3709bcf46a0152434a89ed68bbb343a8d45408dd /src/shortcuts.cpp | |
| parent | Update dxf_input.py for LP Bug #1700582 (diff) | |
| download | inkscape-cf457eea72b81850da5503d0091952871135c1fd.tar.gz inkscape-cf457eea72b81850da5503d0091952871135c1fd.zip | |
Refactor profile directory use and promote IO::Resource get_path and get_filename methods
Diffstat (limited to 'src/shortcuts.cpp')
| -rw-r--r-- | src/shortcuts.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
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<Glib::ustring> *names, std::vector<Glib::ustring> *paths) { - std::list<gchar *> sources; - sources.push_back( Inkscape::Application::profile_path("keys") ); - sources.push_back( g_strdup(INKSCAPE_KEYSDIR) ); + using namespace Inkscape::IO::Resource; + std::list<char *> 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<Glib::ustring> *names, std::vector<G gchar *filename = 0; while ((filename = (gchar *) g_dir_read_name(directory)) != NULL) { gchar* lower = g_ascii_strdown(filename, -1); - if (!strcmp(dirname, Inkscape::Application::profile_path("keys")) && - !strcmp(lower, "default.xml")) { + if (!strcmp(lower, "default.xml")) { // Dont add the users custom keys file continue; } - if (!strcmp(dirname, INKSCAPE_KEYSDIR) && - !strcmp(lower, "inkscape.xml")) { - // Dont add system inkscape.xml (since its a duplicate? of dfefault.xml) + if (!strcmp(lower, "inkscape.xml")) { + // Dont add system inkscape.xml (since its a duplicate? of default.xml) continue; } if (g_str_has_suffix(lower, ".xml")) { |
