From cb6155c85ec80cda541f202b3b12ee98e55b556c Mon Sep 17 00:00:00 2001
From: Ichthyostega
Date: Wed, 4 Apr 2018 03:59:11 +0200
Subject: [PATCH] ViewSpec: now turn the UILocationSolver into yet another
global service
feels a bit uncanny after all
can't be *that* easy
---
src/gui/interact/view-locator.cpp | 2 +-
src/gui/interact/view-locator.hpp | 8 +++-
wiki/thinkPad.ichthyo.mm | 70 ++++++++++++++++++++++++-------
3 files changed, 61 insertions(+), 19 deletions(-)
diff --git a/src/gui/interact/view-locator.cpp b/src/gui/interact/view-locator.cpp
index a02672c2d..d88863b36 100644
--- a/src/gui/interact/view-locator.cpp
+++ b/src/gui/interact/view-locator.cpp
@@ -73,7 +73,7 @@ namespace interact {
ViewLocator::ViewLocator (ctrl::GlobalCtx& uiTopLevel)
: globals_{uiTopLevel}
- , locResolver_{new UILocationSolver{LocationQuery::service}}
+ , locResolver_{LocationQuery::service}
{ }
// dtors via smart-ptr invoked from here...
diff --git a/src/gui/interact/view-locator.hpp b/src/gui/interact/view-locator.hpp
index a7b7f4a2e..fc7d39ffd 100644
--- a/src/gui/interact/view-locator.hpp
+++ b/src/gui/interact/view-locator.hpp
@@ -57,6 +57,7 @@
#define GUI_INTERACT_VIEW_LOCATOR_H
#include "gui/gtk-base.hpp"
+#include "lib/depend-inject.hpp"
#include "gui/interact/view-spec-dsl.hpp"
#include "gui/id-scheme.hpp"
#include "lib/nocopy.hpp"
@@ -89,8 +90,11 @@ namespace interact {
class ViewLocator
: util::NonCopyable
{
- ctrl::GlobalCtx& globals_;
- unique_ptr locResolver_;
+ using Service_LocationSolver = lib::DependInject::ServiceInstance<>;
+
+ ctrl::GlobalCtx& globals_;
+ Service_LocationSolver locResolver_;
+
public:
ViewLocator (ctrl::GlobalCtx&);
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm
index f86052263..f53bb4260 100644
--- a/wiki/thinkPad.ichthyo.mm
+++ b/wiki/thinkPad.ichthyo.mm
@@ -10378,7 +10378,7 @@
-
+
@@ -10389,18 +10389,50 @@
-
+
+
+
+
+
+
+
+
+ für LocationQuery
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+ für LocationSolver
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
@@ -10416,24 +10448,30 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
+
+