Skip to content

Commit 3cd1d9b

Browse files
committed
Migrate to MDConfItem
With mlite 0.5.0 MGConfItem is deprecated in favor of GDConfItem, which has the identical API but renamed. Ref: sailfishos/mlite@055c4aa
1 parent 51d94d2 commit 3cd1d9b

File tree

9 files changed

+41
-41
lines changed

9 files changed

+41
-41
lines changed

src/compositor/lipstickcompositor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ LipstickCompositor::LipstickCompositor()
8787
if (m_instance) qFatal("LipstickCompositor: Only one compositor instance per process is supported");
8888
m_instance = this;
8989

90-
m_orientationLock = new MGConfItem("/lipstick/orientationLock", this);
90+
m_orientationLock = new MDConfItem("/lipstick/orientationLock", this);
9191
connect(m_orientationLock, SIGNAL(valueChanged()), SIGNAL(orientationLockChanged()));
9292

9393
// Load legacy settings from the config file and delete it from there

src/compositor/lipstickcompositor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <QWaylandClient>
2727
#include <QPointer>
2828
#include <QTimer>
29-
#include <MGConfItem>
29+
#include <MDConfItem>
3030
#include <qmdisplaystate.h>
3131

3232
#include <timed-qt5/interface>
@@ -111,7 +111,7 @@ class LIPSTICK_EXPORT LipstickCompositor : public QWaylandQuickCompositor
111111
Q_INVOKABLE void clearKeyboardFocus();
112112
Q_INVOKABLE void setDisplayOff();
113113
Q_INVOKABLE QVariant settingsValue(const QString &key, const QVariant &defaultValue = QVariant()) const
114-
{ return (key == "orientationLock") ? m_orientationLock->value(defaultValue) : MGConfItem("/lipstick/" + key).value(defaultValue); }
114+
{ return (key == "orientationLock") ? m_orientationLock->value(defaultValue) : MDConfItem("/lipstick/" + key).value(defaultValue); }
115115

116116
LipstickCompositorProcWindow *mapProcWindow(const QString &title, const QString &category, const QRect &);
117117
LipstickCompositorProcWindow *mapProcWindow(const QString &title, const QString &category, const QRect &, QQuickItem *rootItem);
@@ -236,7 +236,7 @@ private slots:
236236
MeeGo::QmDisplayState *m_displayState;
237237
QOrientationSensor* m_orientationSensor;
238238
QPointer<QMimeData> m_retainedSelection;
239-
MGConfItem *m_orientationLock;
239+
MDConfItem *m_orientationLock;
240240
MeeGo::QmDisplayState::DisplayState m_currentDisplayState;
241241
bool m_updatesEnabled;
242242
bool m_completed;

src/devicelock/devicelock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <QDBusPendingCallWatcher>
2323
#include <keepalive/backgroundactivity.h>
2424

25-
class MGConfItem;
25+
class MDConfItem;
2626
class QTimer;
2727

2828
class DeviceLock : public QObject, protected QDBusContext

src/lipsticksettings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include <QGuiApplication>
1919
#include <QScreen>
20-
#include <MGConfItem>
20+
#include <MDConfItem>
2121
#include "screenlock/screenlock.h"
2222
#include "homeapplication.h"
2323
#include "lipsticksettings.h"
@@ -81,12 +81,12 @@ QSize LipstickSettings::screenSize()
8181
void LipstickSettings::exportScreenSize()
8282
{
8383
const int defaultValue = 0;
84-
MGConfItem widthConf("/lipstick/screen/primary/width");
84+
MDConfItem widthConf("/lipstick/screen/primary/width");
8585
if (widthConf.value(defaultValue) != QGuiApplication::primaryScreen()->size().width()) {
8686
widthConf.set(QGuiApplication::primaryScreen()->size().width());
8787
widthConf.sync();
8888
}
89-
MGConfItem heightConf("/lipstick/screen/primary/height");
89+
MDConfItem heightConf("/lipstick/screen/primary/height");
9090
if (heightConf.value(defaultValue) != QGuiApplication::primaryScreen()->size().height()) {
9191
heightConf.set(QGuiApplication::primaryScreen()->size().height());
9292
heightConf.sync();

src/volume/volumecontrol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <QQmlContext>
2222
#include <QScreen>
2323
#include <QKeyEvent>
24-
#include <MGConfItem>
24+
#include <MDConfItem>
2525
#include "utilities/closeeventeater.h"
2626
#include "pulseaudiocontrol.h"
2727
#include "volumecontrol.h"
@@ -35,7 +35,7 @@ VolumeControl::VolumeControl(QObject *parent) :
3535
hwKeysAcquired(false),
3636
volume_(0),
3737
maximumVolume_(0),
38-
audioWarning(new MGConfItem("/desktop/nemo/audiowarning", this)),
38+
audioWarning(new MDConfItem("/desktop/nemo/audiowarning", this)),
3939
safeVolume_(0),
4040
callActive_(false),
4141
mediaState_(MediaStateUnknown)

src/volume/volumecontrol.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class HomeWindow;
2424
class PulseAudioControl;
2525
class VolumeKeyListener;
26-
class MGConfItem;
26+
class MDConfItem;
2727

2828
namespace ResourcePolicy {
2929
class ResourceSet;
@@ -218,7 +218,7 @@ private slots:
218218
int maximumVolume_;
219219

220220
//! Stores audio warning acknowledgement state
221-
MGConfItem *audioWarning;
221+
MDConfItem *audioWarning;
222222

223223
//! The current safe volume
224224
int safeVolume_;

tests/stubs/mgconfitem_stub.h

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#ifndef MGCONFITEM_STUB
22
#define MGCONFITEM_STUB
33

4-
#include "mgconfitem.h"
4+
#include "mdconfitem.h"
55
#include <stubbase.h>
66

77

88
// 1. DECLARE STUB
99
// FIXME - stubgen is not yet finished
10-
class MGConfItemStub : public StubBase {
10+
class MDConfItemStub : public StubBase {
1111
public:
12-
virtual void MGConfItemConstructor(const QString &key, QObject *parent);
13-
virtual void MGConfItemDestructor();
12+
virtual void MDConfItemConstructor(const QString &key, QObject *parent);
13+
virtual void MDConfItemDestructor();
1414
virtual QString key() const;
1515
virtual QVariant value() const;
1616
virtual QVariant value(const QVariant &def) const;
@@ -19,75 +19,75 @@ class MGConfItemStub : public StubBase {
1919
};
2020

2121
// 2. IMPLEMENT STUB
22-
void MGConfItemStub::MGConfItemConstructor(const QString &key, QObject *parent) {
22+
void MDConfItemStub::MDConfItemConstructor(const QString &key, QObject *parent) {
2323
Q_UNUSED(key);
2424
Q_UNUSED(parent);
2525

2626
}
27-
void MGConfItemStub::MGConfItemDestructor() {
27+
void MDConfItemStub::MDConfItemDestructor() {
2828

2929
}
30-
QString MGConfItemStub::key() const {
30+
QString MDConfItemStub::key() const {
3131
stubMethodEntered("key");
3232
return stubReturnValue<QString>("key");
3333
}
3434

35-
QVariant MGConfItemStub::value() const {
35+
QVariant MDConfItemStub::value() const {
3636
stubMethodEntered("value");
3737
return stubReturnValue<QVariant>("value");
3838
}
3939

40-
QVariant MGConfItemStub::value(const QVariant &def) const {
40+
QVariant MDConfItemStub::value(const QVariant &def) const {
4141
QList<ParameterBase*> params;
4242
params.append( new Parameter<const QVariant & >(def));
4343
stubMethodEntered("value",params);
4444
return stubReturnValue<QVariant>("value");
4545
}
4646

47-
void MGConfItemStub::set(const QVariant &val) {
47+
void MDConfItemStub::set(const QVariant &val) {
4848
QList<ParameterBase*> params;
4949
params.append( new Parameter<const QVariant & >(val));
5050
stubMethodEntered("set",params);
5151
}
5252

53-
void MGConfItemStub::unset() {
53+
void MDConfItemStub::unset() {
5454
stubMethodEntered("unset");
5555
}
5656

5757

5858

5959
// 3. CREATE A STUB INSTANCE
60-
MGConfItemStub gDefaultMGConfItemStub;
61-
MGConfItemStub* gMGConfItemStub = &gDefaultMGConfItemStub;
60+
MDConfItemStub gDefaultMDConfItemStub;
61+
MDConfItemStub* gMDConfItemStub = &gDefaultMDConfItemStub;
6262

6363

6464
// 4. CREATE A PROXY WHICH CALLS THE STUB
65-
MGConfItem::MGConfItem(const QString &key, QObject *parent) {
66-
gMGConfItemStub->MGConfItemConstructor(key, parent);
65+
MDConfItem::MDConfItem(const QString &key, QObject *parent) {
66+
gMDConfItemStub->MDConfItemConstructor(key, parent);
6767
}
6868

69-
MGConfItem::~MGConfItem() {
70-
gMGConfItemStub->MGConfItemDestructor();
69+
MDConfItem::~MDConfItem() {
70+
gMDConfItemStub->MDConfItemDestructor();
7171
}
7272

73-
QString MGConfItem::key() const {
74-
return gMGConfItemStub->key();
73+
QString MDConfItem::key() const {
74+
return gMDConfItemStub->key();
7575
}
7676

77-
QVariant MGConfItem::value() const {
78-
return gMGConfItemStub->value();
77+
QVariant MDConfItem::value() const {
78+
return gMDConfItemStub->value();
7979
}
8080

81-
QVariant MGConfItem::value(const QVariant &def) const {
82-
return gMGConfItemStub->value(def);
81+
QVariant MDConfItem::value(const QVariant &def) const {
82+
return gMDConfItemStub->value(def);
8383
}
8484

85-
void MGConfItem::set(const QVariant &val) {
86-
gMGConfItemStub->set(val);
85+
void MDConfItem::set(const QVariant &val) {
86+
gMDConfItemStub->set(val);
8787
}
8888

89-
void MGConfItem::unset() {
90-
gMGConfItemStub->unset();
89+
void MDConfItem::unset() {
90+
gMDConfItemStub->unset();
9191
}
9292

9393

tests/ut_volumecontrol/ut_volumecontrol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "volumecontrol.h"
2121
#include "pulseaudiocontrol_stub.h"
2222
#include "closeeventeater_stub.h"
23-
#include "mgconfitem_stub.h"
23+
#include "mdconfitem_stub.h"
2424
#include "lipstickqmlpath_stub.h"
2525

2626
extern "C"

tests/ut_volumecontrol/ut_volumecontrol.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ HEADERS += \
1212
$$VOLUMESRCDIR/pulseaudiocontrol.h \
1313
$$UTILITYSRCDIR/closeeventeater.h \
1414
$$SRCDIR/homewindow.h \
15-
/usr/include/mlite5/mgconfitem.h \
15+
/usr/include/mlite5/mdconfitem.h \
1616

1717
SOURCES += \
1818
ut_volumecontrol.cpp \

0 commit comments

Comments
 (0)