summaryrefslogtreecommitdiffstats
path: root/core/settings/qPrefAnimations.h
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-21 18:12:59 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-25 08:35:04 -0700
commit3eae683b57d225c680a430c83db1425c38765742 (patch)
tree48ee9bacf8474a8147dca07dd791d2e5ddd7b993 /core/settings/qPrefAnimations.h
parent87d8963c788ab4618beea59e15e18982a4ec0373 (diff)
downloadsubsurface-3eae683b57d225c680a430c83db1425c38765742.tar.gz
core: make qPrefAnimations/CloudStorage getters static and inline
Add static and inline to getter in all qPref header files Remove call to GET_PREFERENCE_* in qPrefDisplay.cpp Remove GET_PREFERENCE_* from qPrefPrivate.h static inline is slightly faster than a function call, but it saves a lot of coding lines (no lines in qPref*.cpp). Getters are a direct reference to struct preferences, so they will normally only be used from QML. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPrefAnimations.h')
-rw-r--r--core/settings/qPrefAnimations.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/settings/qPrefAnimations.h b/core/settings/qPrefAnimations.h
index 4971aa06d..5b0fcaea4 100644
--- a/core/settings/qPrefAnimations.h
+++ b/core/settings/qPrefAnimations.h
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#ifndef QPREFANIMATIONS_H
#define QPREFANIMATIONS_H
+#include "core/pref.h"
#include <QObject>
@@ -18,7 +19,7 @@ public:
void sync() { loadSync(true); }
public:
- int animation_speed() const;
+ static inline int animation_speed() { return prefs.animation_speed; };
public slots:
void set_animation_speed(int value);