summaryrefslogtreecommitdiffstats
path: root/src/helper
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2019-01-30 14:54:01 +0000
committerTavmjong Bah <tavmjong@free.fr>2019-01-30 14:54:01 +0000
commit7531449fc6f5c3113802747db11a2bca2e308555 (patch)
treeeb1e211ef0f68674f3f929516e00b3a0c288a800 /src/helper
parentGradientToolbar: GtkAction migration (diff)
downloadinkscape-7531449fc6f5c3113802747db11a2bca2e308555.tar.gz
inkscape-7531449fc6f5c3113802747db11a2bca2e308555.zip
Allow InkscapeApplication to track current document, selection, and desktop.
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/action-context.cpp5
-rw-r--r--src/helper/action-context.h2
2 files changed, 1 insertions, 6 deletions
diff --git a/src/helper/action-context.cpp b/src/helper/action-context.cpp
index 648101540..36b6914d6 100644
--- a/src/helper/action-context.cpp
+++ b/src/helper/action-context.cpp
@@ -62,11 +62,6 @@ UI::View::View *ActionContext::getView() const
SPDesktop *ActionContext::getDesktop() const
{
- // TODO: this slightly horrible storage of a UI::View::View*, and
- // casting to an SPDesktop*, is only done because that's what was
- // already the norm in the Inkscape codebase. This seems wrong. Surely
- // we should store an SPDesktop* in the first place? Is there a case
- // of actions being carried out on a View that is not an SPDesktop?
return static_cast<SPDesktop *>(_view);
}
diff --git a/src/helper/action-context.h b/src/helper/action-context.h
index 2660bc59c..d3468ea3e 100644
--- a/src/helper/action-context.h
+++ b/src/helper/action-context.h
@@ -37,7 +37,7 @@ class View;
used to take as parameters in their methods. Why is this? They almost
always seemed to cast straight to an SPDesktop* - so shouldn't we actually
be storing an SPDesktop*? Is there a case where a non-SPDesktop
- UI::View::View is used by the actions?
+ UI::View::View is used by the actions? YES: Command-line wihtout GUI.
ActionContext is designed to be copyable, so it may be used with stack
storage if required. */