on xenial help sign in
Remove unused pointer and fix code syntax
commit69e88ba57af4a9d6559e38ec73f975ee0613b74c authorGerry Boland <gerry.boland@canonical.com> dateThu 18 Sep 2014, 15:20 (12 years ago) parent9e38890
2 files changed+7−9
plugins/Unity/Session/orientationlock.cpp+6−6 plugins/Unity/Session/orientationlock.h+1−3
plugins/Unity/Session/orientationlock.cpp+6−6
@@ -24,16 +24,16 @@ OrientationLock::OrientationLock(QObject *parent)
2424 , m_enabled(false)
2525 , m_savedOrientation(Qt::PortraitOrientation)
2626{
27− systemSettings = g_settings_new("com.ubuntu.touch.system");
28− g_signal_connect(systemSettings, "changed::rotation-lock",
27+ m_systemSettings = g_settings_new("com.ubuntu.touch.system");
28+ g_signal_connect(m_systemSettings, "changed::rotation-lock",
2929 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");
3131}
3232
3333OrientationLock::~OrientationLock()
3434{
35− g_signal_handlers_disconnect_by_data(systemSettings, this);
36− g_object_unref(systemSettings);
35+ g_signal_handlers_disconnect_by_data(m_systemSettings, this);
36+ g_object_unref(m_systemSettings);
3737}
3838
3939bool OrientationLock::enabled() const
@@ -54,7 +54,7 @@ void OrientationLock::onEnabledChangedProxy(GSettings */*settings*/, const gchar
5454
5555void OrientationLock::onEnabledChanged()
5656{
57− const bool enabled = g_settings_get_boolean(systemSettings, "rotation-lock");
57+ const bool enabled = g_settings_get_boolean(m_systemSettings, "rotation-lock");
5858 if (m_enabled != enabled) {
5959 m_enabled = enabled;
6060 Q_EMIT enabledChanged();
plugins/Unity/Session/orientationlock.h+1−3
@@ -19,7 +19,6 @@
1919
2020#include <gio/gio.h>
2121#include <QtCore/QObject>
22−#include <QtDBus/QDBusInterface>
2322
2423/**
2524 * @brief The OrientationLock class exports orientation lock related properties to QML
@@ -52,8 +51,7 @@ private Q_SLOTS:
5251 void onEnabledChanged();
5352
5453private:
55− QDBusInterface *dbusInterface;
56− GSettings *systemSettings;
54+ GSettings *m_systemSettings;
5755
5856 bool m_enabled;
5957 Qt::ScreenOrientation m_savedOrientation;