diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/inkscape-application.cpp | 4 | ||||
| -rw-r--r-- | src/inkscape.cpp | 21 | ||||
| -rw-r--r-- | src/inkscape.h | 10 | ||||
| -rw-r--r-- | src/inkview-application.cpp | 2 | ||||
| -rw-r--r-- | src/io/resource.cpp | 4 |
5 files changed, 9 insertions, 32 deletions
diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp index 4e31f8751..031f93bd6 100644 --- a/src/inkscape-application.cpp +++ b/src/inkscape-application.cpp @@ -569,7 +569,7 @@ template<> void ConcreteInkscapeApplication<Gio::Application>::on_startup2() { - Inkscape::Application::create(nullptr, false); + Inkscape::Application::create(false); } #ifdef GDK_WINDOWING_QUARTZ @@ -582,7 +582,7 @@ void ConcreteInkscapeApplication<Gtk::Application>::on_startup2() { // This should be completely rewritten. - Inkscape::Application::create(nullptr, _with_gui); // argv appears to not be used. + Inkscape::Application::create(_with_gui); if (!_with_gui) { return; diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 72ca329ab..984bccf6d 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -161,10 +161,10 @@ Application::operator &() const * Creates a new Inkscape::Application global object. */ void -Application::create(const char *argv0, bool use_gui) +Application::create(bool use_gui) { if (!Application::exists()) { - new Application(argv0, use_gui); + new Application(use_gui); } else { // g_assert_not_reached(); Can happen with InkscapeApplication } @@ -361,11 +361,6 @@ void Application::autosave_init() } } -void Application::argv0(char const* argv) -{ - _argv0 = g_strdup(argv); -} - /** * \brief Add our CSS style sheets */ @@ -489,7 +484,7 @@ Application::add_gtk_css() * \pre Application::_S_inst == NULL */ -Application::Application(const char* argv, bool use_gui) : +Application::Application(bool use_gui) : _menus(nullptr), _desktops(nullptr), refCount(1), @@ -509,8 +504,6 @@ Application::Application(const char* argv, bool use_gui) : bus_handler = signal (SIGBUS, Application::crash_handler); #endif - _argv0 = g_strdup(argv); - // \TODO: this belongs to Application::init but if it isn't here // then the Filters and Extensions menus don't work. _S_inst = this; @@ -603,11 +596,6 @@ Application::~Application() _menus = nullptr; } - if (_argv0) { - g_free(_argv0); - _argv0 = nullptr; - } - _S_inst = nullptr; // this will probably break things refCount = 0; @@ -668,7 +656,6 @@ Application::crash_handler (int /*signum*/) gint count = 0; gchar *curdir = g_get_current_dir(); // This one needs to be freed explicitly - gchar *inkscapedir = g_path_get_dirname(INKSCAPE._argv0); // Needs to be freed std::vector<gchar *> savednames; std::vector<gchar *> failednames; for (std::map<SPDocument*,int>::iterator iter = INKSCAPE._document_set.begin(), e = INKSCAPE._document_set.end(); @@ -714,7 +701,6 @@ Application::crash_handler (int /*signum*/) g_get_home_dir(), g_get_tmp_dir(), curdir, - inkscapedir }; FILE *file = nullptr; for(auto & location : locations) { @@ -740,7 +726,6 @@ Application::crash_handler (int /*signum*/) } } g_free(curdir); - g_free(inkscapedir); if (!savednames.empty()) { fprintf (stderr, "\nEmergency save document locations:\n"); diff --git a/src/inkscape.h b/src/inkscape.h index 840620171..d14420352 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -76,7 +76,7 @@ class Application { public: static Application& instance(); static bool exists(); - static void create(const char* argv0, bool use_gui); + static void create(bool use_gui); // returns the mask of the keyboard modifier to map to Alt, zero if no mapping // Needs to be a guint because gdktypes.h does not define a 'no-modifier' value @@ -91,15 +91,12 @@ public: bool use_gui() const { return _use_gui; } void use_gui(gboolean guival) { _use_gui = guival; } - char const* argv0() const { return _argv0; } - void argv0(char const *); - // no setter for this -- only we can control this variable static bool isCrashing() { return _crashIsHappening; } // useful functions void autosave_init(); - void application_init (const gchar *argv0, gboolean use_gui); + void application_init (gboolean use_gui); void load_config (const gchar *filename, Inkscape::XML::Document *config, const gchar *skeleton, unsigned int skel_size, const gchar *e_notreg, const gchar *e_notxml, const gchar *e_notsp, const gchar *warn); @@ -212,7 +209,7 @@ public: private: static Inkscape::Application * _S_inst; - Application(const char* argv0, bool use_gui); + Application(bool use_gui); ~Application(); Application(Application const&); // no copy @@ -228,7 +225,6 @@ public: bool _dialogs_toggle; guint _mapalt; guint _trackalt; - char * _argv0; static bool _crashIsHappening; bool _use_gui; gint _pdf_page; diff --git a/src/inkview-application.cpp b/src/inkview-application.cpp index 25a96756e..f29f8b805 100644 --- a/src/inkview-application.cpp +++ b/src/inkview-application.cpp @@ -89,7 +89,7 @@ InkviewApplication::on_startup() Gtk::Application::on_startup(); // Inkscape::Application should disappear! - Inkscape::Application::create(nullptr, true); // argv appears to not be used. + Inkscape::Application::create(true); } diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 5a92096ee..078914ba0 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -457,10 +457,6 @@ char *homedir_path(const char *filename) static const gchar *homedir = nullptr; homedir = g_get_home_dir(); - // I suspect this is for handling inkscape app packages - /*if (!homedir && Application::exists()) { - homedir = g_path_get_dirname(Application::instance()._argv0); - }*/ return g_build_filename(homedir, filename, NULL); } |
