From d6bbd3260a6e78cf9973f407b116b0a4ea7904b7 Mon Sep 17 00:00:00 2001
From: Stanislaw Halik <sthalik@misaki.pl>
Date: Sat, 2 Dec 2017 08:18:20 +0100
Subject: options/value: add always-default values

Also Visual Studio 2017 Preview 15.5 now does "constexpr inline"
---
 options/value.hpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'options')

diff --git a/options/value.hpp b/options/value.hpp
index 099a8cb2..244f23fd 100644
--- a/options/value.hpp
+++ b/options/value.hpp
@@ -69,17 +69,18 @@ public:
         return datum;
     }
 
-    static constexpr const Qt::ConnectionType DIRECT_CONNTYPE = Qt::DirectConnection;
-    static constexpr const Qt::ConnectionType SAFE_CONNTYPE = Qt::QueuedConnection;
+    static constexpr inline Qt::ConnectionType DIRECT_CONNTYPE = Qt::DirectConnection;
+    static constexpr inline Qt::ConnectionType SAFE_CONNTYPE = Qt::QueuedConnection;
 
     never_inline
     value(bundle b, const QString& name, t def) :
         base_value(b, name, &is_equal, std::type_index(typeid(element_type))),
         def(def)
     {
-        QObject::connect(b.get(), SIGNAL(reloading()),
-                         this, SLOT(reload()),
-                         DIRECT_CONNTYPE);
+        if (!self_name.isEmpty())
+            QObject::connect(b.get(), SIGNAL(reloading()),
+                             this, SLOT(reload()),
+                             DIRECT_CONNTYPE);
     }
 
     never_inline
-- 
cgit v1.2.3