diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-06-26 19:40:39 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-06-26 19:40:39 +0000 |
| commit | 1ed5e67c01975040a78765a1cf97b942d736c14b (patch) | |
| tree | 03edf93ade2b20003f04a517edb3b453efed970c /src | |
| parent | 4. further refactor Application class; create proper singleton, encapsulate m... (diff) | |
| download | inkscape-1ed5e67c01975040a78765a1cf97b942d736c14b.tar.gz inkscape-1ed5e67c01975040a78765a1cf97b942d736c14b.zip | |
Convert accidental member accesses into static function accesses
(bzr r13341.5.7)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/error-file.cpp | 3 | ||||
| -rw-r--r-- | src/extension/extension.cpp | 2 | ||||
| -rw-r--r-- | src/extension/init.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/filter/filter-file.cpp | 2 | ||||
| -rw-r--r-- | src/file.cpp | 2 | ||||
| -rw-r--r-- | src/io/resource.cpp | 2 | ||||
| -rw-r--r-- | src/main.cpp | 2 | ||||
| -rw-r--r-- | src/preferences.cpp | 8 | ||||
| -rw-r--r-- | src/shortcuts.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/filedialogimpl-gtkmm.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/swatches.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 8 | ||||
| -rw-r--r-- | src/ui/dialog/template-load-tab.cpp | 2 | ||||
| -rw-r--r-- | src/widgets/icon.cpp | 2 |
15 files changed, 25 insertions, 20 deletions
diff --git a/src/extension/error-file.cpp b/src/extension/error-file.cpp index 2970bf8d9..db354c0ce 100644 --- a/src/extension/error-file.cpp +++ b/src/extension/error-file.cpp @@ -48,9 +48,10 @@ ErrorFileNotice::ErrorFileNotice (void) : ) { + // \FIXME change this /* This is some filler text, needs to change before relase */ Glib::ustring dialog_text(_("<span weight=\"bold\" size=\"larger\">One or more extensions failed to load</span>\n\nThe failed extensions have been skipped. Inkscape will continue to run normally but those extensions will be unavailable. For details to troubleshoot this problem, please refer to the error log located at: ")); - gchar * ext_error_file = INKSCAPE->profile_path(EXTENSION_ERROR_LOG_FILENAME); + gchar * ext_error_file = Inkscape::Application::profile_path(EXTENSION_ERROR_LOG_FILENAME); dialog_text += ext_error_file; g_free(ext_error_file); set_message(dialog_text, true); diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index b62cfd8af..a5f0e6467 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -662,7 +662,7 @@ Extension::set_param_color (const gchar * name, guint32 color, SPDocument * doc, void Extension::error_file_open (void) { - gchar * ext_error_file = INKSCAPE->profile_path(EXTENSION_ERROR_LOG_FILENAME); + gchar * ext_error_file = Inkscape::Application::profile_path(EXTENSION_ERROR_LOG_FILENAME); gchar * filename = g_filename_from_utf8( ext_error_file, -1, NULL, NULL, NULL ); error_file.open(filename); if (!error_file.is_open()) { diff --git a/src/extension/init.cpp b/src/extension/init.cpp index 57d7f9e33..c16a5a899 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -243,7 +243,7 @@ init() /* Load search path for extensions */ if (Inkscape::Extension::Extension::search_path.size() == 0) { - Inkscape::Extension::Extension::search_path.push_back(INKSCAPE->profile_path("extensions")); + Inkscape::Extension::Extension::search_path.push_back(Inkscape::Application::profile_path("extensions")); Inkscape::Extension::Extension::search_path.push_back(g_strdup(INKSCAPE_EXTENSIONDIR)); diff --git a/src/extension/internal/filter/filter-file.cpp b/src/extension/internal/filter/filter-file.cpp index 04d3f27e1..b1993057d 100644 --- a/src/extension/internal/filter/filter-file.cpp +++ b/src/extension/internal/filter/filter-file.cpp @@ -29,7 +29,7 @@ namespace Filter { void Filter::filters_all_files(void) { - gchar *filtersProfilePath = INKSCAPE->profile_path("filters"); + gchar *filtersProfilePath = Inkscape::Application::profile_path("filters"); filters_load_dir(INKSCAPE_FILTERDIR, _("Bundled")); filters_load_dir(filtersProfilePath, _("Personal")); diff --git a/src/file.cpp b/src/file.cpp index 2c0ba5365..99bfcc77f 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -175,7 +175,7 @@ SPDesktop *sp_file_new(const std::string &templ) Glib::ustring sp_file_default_template_uri() { std::list<gchar *> sources; - sources.push_back( INKSCAPE->profile_path("templates") ); // first try user's local dir + sources.push_back( Inkscape::Application::profile_path("templates") ); // first try user's local dir sources.push_back( g_strdup(INKSCAPE_TEMPLATESDIR) ); // then the system templates dir std::list<gchar const*> baseNames; gchar const* localized = _("default.svg"); diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 94bd7fca1..501eab03b 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -73,7 +73,7 @@ Util::ptr_shared<char> get_path(Domain domain, Type type, char const *filename) case TEMPLATES: name = "templates"; break; default: return get_path(SYSTEM, type, filename); } - path = INKSCAPE->profile_path(name); + path = Inkscape::Application::profile_path(name); } break; } diff --git a/src/main.cpp b/src/main.cpp index 8d978c5ab..499285a7b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1042,7 +1042,7 @@ sp_main_gui(int argc, char const **argv) } // Add our icon directory to the search path for icon theme lookups. - gchar *usericondir = INKSCAPE->profile_path("icons"); + gchar *usericondir = Inkscape::Application::profile_path("icons"); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), usericondir); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), INKSCAPE_PIXMAPDIR); g_free(usericondir); diff --git a/src/preferences.cpp b/src/preferences.cpp index ede60c686..e5a5fe7f0 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -91,11 +91,13 @@ Preferences::Preferences() : _hasError(false) { // profile_path essentailly returns the argument prefixed by the profile directory. - gchar *path = INKSCAPE->profile_path(NULL); + // \TODO this is kinda hackish, but the alternative (strrchr) is worse + + gchar *path = Inkscape::Application::profile_path(NULL); _prefs_dir = path; g_free(path); - path = INKSCAPE->profile_path(_prefs_basename.c_str()); + path = Inkscape::Application::profile_path(_prefs_basename.c_str()); _prefs_filename = path; g_free(path); @@ -155,7 +157,7 @@ void Preferences::_load() // create some subdirectories for user stuff char const *user_dirs[] = {"keys", "templates", "icons", "extensions", "palettes", NULL}; for (int i=0; user_dirs[i]; ++i) { - char *dir = INKSCAPE->profile_path(user_dirs[i]); + char *dir = Inkscape::Application::profile_path(user_dirs[i]); g_mkdir(dir, 0755); g_free(dir); } diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp index 016a48d8f..e72c16de0 100644 --- a/src/shortcuts.cpp +++ b/src/shortcuts.cpp @@ -211,7 +211,7 @@ 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->profile_path("keys") ); + sources.push_back( Inkscape::Application::profile_path("keys") ); sources.push_back( g_strdup(INKSCAPE_KEYSDIR) ); // loop through possible keyboard shortcut file locations. @@ -229,7 +229,7 @@ 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->profile_path("keys")) && + if (!strcmp(dirname, Inkscape::Application::profile_path("keys")) && !strcmp(lower, "default.xml")) { // Dont add the users custom keys file continue; diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index 38e359b28..50a883612 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -1044,7 +1044,7 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk(Gtk::Window &parentWindow, const Gl } // allow easy access to the user's own templates folder - gchar *templates = INKSCAPE->profile_path("templates"); + gchar *templates = Inkscape::Application::profile_path("templates"); if (Inkscape::IO::file_test(templates, G_FILE_TEST_EXISTS) && Inkscape::IO::file_test(templates, G_FILE_TEST_IS_DIR) && g_path_is_absolute(templates)) { add_shortcut_folder(templates); diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index f1535175a..5e698355c 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1908,7 +1908,7 @@ void InkscapePreferences::initPageSystem() _page_system.add_group_header( _("System info")); - _sys_user_config.set_text((char const *)INKSCAPE->profile_path("")); + _sys_user_config.set_text((char const *)Inkscape::Application::profile_path("")); _sys_user_config.set_editable(false); _page_system.add_line(true, _("User config: "), _sys_user_config, "", _("Location of users configuration"), true); diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 6dbb1d5e9..16c7bc3e6 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -527,7 +527,7 @@ static void loadEmUp() beenHere = true; std::list<gchar *> sources; - sources.push_back( INKSCAPE->profile_path("palettes") ); + sources.push_back( Inkscape::Application::profile_path("palettes") ); sources.push_back( g_strdup(INKSCAPE_PALETTESDIR) ); sources.push_back( g_strdup(CREATE_PALETTESDIR) ); diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 9e5e94498..0a35ee760 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -568,13 +568,15 @@ void SymbolsDialog::get_symbols() { std::list<Glib::ustring> directories; +// \TODO optimize this + if( Inkscape::IO::file_test( INKSCAPE_SYMBOLSDIR, G_FILE_TEST_EXISTS ) && Inkscape::IO::file_test( INKSCAPE_SYMBOLSDIR, G_FILE_TEST_IS_DIR ) ) { directories.push_back( INKSCAPE_SYMBOLSDIR ); } - if( Inkscape::IO::file_test( INKSCAPE->profile_path("symbols"), G_FILE_TEST_EXISTS ) && - Inkscape::IO::file_test( INKSCAPE->profile_path("symbols"), G_FILE_TEST_IS_DIR ) ) { - directories.push_back( INKSCAPE->profile_path("symbols") ); + if( Inkscape::IO::file_test( Inkscape::Application::profile_path("symbols"), G_FILE_TEST_EXISTS ) && + Inkscape::IO::file_test( Inkscape::Application::profile_path("symbols"), G_FILE_TEST_IS_DIR ) ) { + directories.push_back( Inkscape::Application::profile_path("symbols") ); } std::list<Glib::ustring>::iterator it; diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 1bd9510dc..ff94aad5d 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -194,7 +194,7 @@ void TemplateLoadTab::_refreshTemplatesList() void TemplateLoadTab::_loadTemplates() { // user's local dir - _getTemplatesFromDir(INKSCAPE->profile_path("templates") + _loading_path); + _getTemplatesFromDir(Inkscape::Application::profile_path("templates") + _loading_path); // system templates dir _getTemplatesFromDir(INKSCAPE_TEMPLATESDIR + _loading_path); diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 214990b6b..e0b834961 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -1257,7 +1257,7 @@ std::list<gchar*> &IconImpl::icons_svg_paths() static bool initialized = false; if (!initialized) { // Fall back from user prefs dir into system locations. - gchar *userdir = INKSCAPE->profile_path("icons"); + 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); |
