summaryrefslogtreecommitdiffstats
path: root/src/inkscape.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-11-12 20:22:44 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-11-12 20:22:44 +0000
commitdb05b842cba28f01b431eee890537959aa2d8fe3 (patch)
tree04cad3abf64f9cda14a457ef61bd0d5bf6fa762c /src/inkscape.cpp
parentSupport multiple style sheets or style elements in an svg document (diff)
downloadinkscape-db05b842cba28f01b431eee890537959aa2d8fe3.tar.gz
inkscape-db05b842cba28f01b431eee890537959aa2d8fe3.zip
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.
Diffstat (limited to 'src/inkscape.cpp')
-rw-r--r--src/inkscape.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index d01b53e57..859f23ba9 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;
@@ -612,7 +612,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.
@@ -1282,6 +1282,7 @@ Application::action_context_for_document(SPDocument *doc)
// Document is not associated with any desktops - maybe we're in command-line mode
std::map<SPDocument *, AppSelectionModel *>::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());
@@ -1312,7 +1313,7 @@ Application::exit ()
signal_shut_down.emit();
Inkscape::Preferences::unload();
- gtk_main_quit ();
+ //gtk_main_quit ();
}