From 408cb49b5559a81ea803df64bf58457a5dd4bf16 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 12 Nov 2018 21:22:44 +0100 Subject: Rewrite of main.cpp using InkscapeApplication (Gtk::Application) Use Gio::File for accessing files. Use Gio options to handle command line arguments. Use Gio::Actions for some command line arguments. Move file export code to src/io/file-export-cmd.h/.cpp. Make into class. --- src/inkscape.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 19438b437..acac67649 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -67,7 +67,7 @@ Inkscape::Application * Inkscape::Application::_S_inst = nullptr; bool Inkscape::Application::_crashIsHappening = false; -#define DESKTOP_IS_ACTIVE(d) (!INKSCAPE._desktops->empty() && ((d) == INKSCAPE._desktops->front())) +#define DESKTOP_IS_ACTIVE(d) (INKSCAPE._desktops != nullptr && !INKSCAPE._desktops->empty() && ((d) == INKSCAPE._desktops->front())) static void (* segv_handler) (int) = SIG_DFL; static void (* abrt_handler) (int) = SIG_DFL; @@ -609,7 +609,7 @@ Application::~Application() _S_inst = nullptr; // this will probably break things refCount = 0; - gtk_main_quit (); + // gtk_main_quit (); } /** Sets the keyboard modifer to map to Alt. @@ -1279,6 +1279,7 @@ Application::action_context_for_document(SPDocument *doc) // Document is not associated with any desktops - maybe we're in command-line mode std::map::iterator sel_iter = _selection_models.find(doc); if (sel_iter == _selection_models.end()) { + std::cout << "Application::action_context_for_document: no selection model" << std::endl; return Inkscape::ActionContext(); } return Inkscape::ActionContext(sel_iter->second->getSelection()); @@ -1309,7 +1310,7 @@ Application::exit () signal_shut_down.emit(); Inkscape::Preferences::unload(); - gtk_main_quit (); + //gtk_main_quit (); } -- cgit v1.2.3