mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
87d8963c78
commit
3eae683b57
4 changed files with 16 additions and 55 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue