on xenial help sign in
Remove unused pointer and fix code syntax
69e88baGerry Boland
plugins/Unity/Session/orientationlock.cpp+6−6
@@ -24,16 +24,16 @@ OrientationLock::OrientationLock(QObject *parent)
24 , m_enabled(false)
24 , m_enabled(false)
25 , m_savedOrientation(Qt::PortraitOrientation)
25 , m_savedOrientation(Qt::PortraitOrientation)
26{
26{
27− systemSettings = g_settings_new("com.ubuntu.touch.system");
27+ m_systemSettings = g_settings_new("com.ubuntu.touch.system");
28− g_signal_connect(systemSettings, "changed::rotation-lock",
28+ g_signal_connect(m_systemSettings, "changed::rotation-lock",
29 G_CALLBACK(OrientationLock::onEnabledChangedProxy), this);
29 G_CALLBACK(OrientationLock::onEnabledChangedProxy), this);
30− m_enabled = g_settings_get_boolean(systemSettings, "rotation-lock");
30+ m_enabled = g_settings_get_boolean(m_systemSettings, "rotation-lock");
31}
31}
32
32
33OrientationLock::~OrientationLock()
33OrientationLock::~OrientationLock()
34{
34{
35− g_signal_handlers_disconnect_by_data(systemSettings, this);
35+ g_signal_handlers_disconnect_by_data(m_systemSettings, this);
36− g_object_unref(systemSettings);
36+ g_object_unref(m_systemSettings);
37}
37}
38
38
39bool OrientationLock::enabled() const
39bool OrientationLock::enabled() const
@@ -54,7 +54,7 @@ void OrientationLock::onEnabledChangedProxy(GSettings */*settings*/, const gchar
54
54
55void OrientationLock::onEnabledChanged()
55void OrientationLock::onEnabledChanged()
56{
56{
57− const bool enabled = g_settings_get_boolean(systemSettings, "rotation-lock");
57+ const bool enabled = g_settings_get_boolean(m_systemSettings, "rotation-lock");
58 if (m_enabled != enabled) {
58 if (m_enabled != enabled) {
59 m_enabled = enabled;
59 m_enabled = enabled;
60 Q_EMIT enabledChanged();
60 Q_EMIT enabledChanged();
plugins/Unity/Session/orientationlock.h+1−3
@@ -19,7 +19,6 @@
19
19
20#include <gio/gio.h>
20#include <gio/gio.h>
21#include <QtCore/QObject>
21#include <QtCore/QObject>
22−#include <QtDBus/QDBusInterface>
23
22
24/**
23/**
25 * @brief The OrientationLock class exports orientation lock related properties to QML
24 * @brief The OrientationLock class exports orientation lock related properties to QML
@@ -52,8 +51,7 @@ private Q_SLOTS:
52 void onEnabledChanged();
51 void onEnabledChanged();
53
52
54private:
53private:
55− QDBusInterface *dbusInterface;
54+ GSettings *m_systemSettings;
56− GSettings *systemSettings;
57
55
58 bool m_enabled;
56 bool m_enabled;
59 Qt::ScreenOrientation m_savedOrientation;
57 Qt::ScreenOrientation m_savedOrientation;