Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit 6a0cf3a

Browse files
committed
code cleanups
1 parent ec1b2a3 commit 6a0cf3a

18 files changed

+58
-7
lines changed

src/jar/src/de/skycoder42/qtmvvm/core/AndroidSettingsAccessor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
import android.preference.PreferenceManager;
99

1010
class AndroidSettingsAccessor {
11+
private long address = 0;
12+
private SharedPreferences preferences = null;
13+
private SharedPreferences.Editor editor = null;
14+
private Listener listener = new Listener();
15+
1116
private class Listener implements SharedPreferences.OnSharedPreferenceChangeListener {
1217
@Override
1318
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
14-
if(address != 0 && preferences == sharedPreferences)
19+
if(address != 0 && preferences.equals(sharedPreferences))
1520
callback(address, key);
1621
}
1722
}
1823

19-
long address = 0;
20-
SharedPreferences preferences = null;
21-
SharedPreferences.Editor editor = null;
22-
Listener listener = new Listener();
23-
2424
private static native void callback(long address, Object key);
2525

2626
public AndroidSettingsAccessor(Context context, long address) {

src/mvvmcore/androidsettingsaccessor_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace QtMvvm {
1010

1111
class AndroidSettingsAccessorPrivate
1212
{
13+
Q_DISABLE_COPY(AndroidSettingsAccessorPrivate)
14+
1315
public:
1416
AndroidSettingsAccessor *q;
1517
QAndroidJniObject settings;

src/mvvmcore/message_p.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ class MessageConfigPrivate : public QSharedData
3030

3131
class MessageResultPrivate
3232
{
33+
Q_DISABLE_COPY(MessageResultPrivate)
34+
3335
public:
36+
MessageResultPrivate() = default;
37+
3438
QMutex mutex;
3539
QPointer<QObject> closeObject;
3640
QMetaMethod closeMethod;
@@ -41,7 +45,11 @@ class MessageResultPrivate
4145

4246
class ProgressControlPrivate
4347
{
48+
Q_DISABLE_COPY(ProgressControlPrivate)
49+
4450
public:
51+
ProgressControlPrivate() = default;
52+
4553
bool autoDelete = true;
4654
#ifdef Q_ATOMIC_INT8_IS_SUPPORTED
4755
QAtomicInteger<bool> indeterminate = false;

src/mvvmcore/serviceregistry_p.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ namespace QtMvvm {
1111

1212
class ServiceRegistryPrivate
1313
{
14+
Q_DISABLE_COPY(ServiceRegistryPrivate)
15+
1416
public:
17+
ServiceRegistryPrivate() = default;
18+
1519
class ServiceInfo {
1620
Q_DISABLE_COPY(ServiceInfo)
1721
public:

src/mvvmcore/settingsconfigloader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ QException *SettingsConfigException::clone() const
233233

234234

235235

236-
uint qHash(const std::tuple<QString, QString, QStringList> &key, uint seed)
236+
uint std::qHash(const std::tuple<QString, QString, QStringList> &key, uint seed)
237237
{
238238
return qHash(std::get<0>(key), seed) ^
239239
qHash(std::get<1>(key), seed) ^

src/mvvmcore/settingsconfigloader_p.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ class Q_MVVMCORE_EXPORT SettingsConfigException : public SettingsLoaderException
6666

6767
}
6868

69+
namespace std {
70+
6971
uint qHash(const std::tuple<QString, QString, QStringList> &key, uint seed);
7072

73+
}
74+
7175
#endif // SETTINGSCONFIGLOADER_P_H

src/mvvmcore/settingsviewmodel_p.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ namespace QtMvvm {
88

99
class SettingsViewModelPrivate
1010
{
11+
Q_DISABLE_COPY(SettingsViewModelPrivate)
12+
1113
public:
14+
SettingsViewModelPrivate() = default;
15+
1216
ISettingsSetupLoader *setupLoader = nullptr;
1317
ISettingsAccessor *accessor = nullptr;
1418

src/mvvmdatasynccore/accountmodel_p.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ namespace QtMvvm {
88

99
class AccountModelPrivate
1010
{
11+
Q_DISABLE_COPY(AccountModelPrivate)
12+
1113
public:
14+
AccountModelPrivate() = default;
15+
1216
QtDataSync::AccountManager *accountManager = nullptr;
1317
QtDataSync::SyncManager *syncManager = nullptr;
1418
QList<QtDataSync::DeviceInfo> devices;

src/mvvmdatasynccore/datasyncsettingsaccessor_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace QtMvvm {
88

99
class DataSyncSettingsAccessorPrivate
1010
{
11+
Q_DISABLE_COPY(DataSyncSettingsAccessorPrivate)
12+
1113
public:
1214
DataSyncSettingsAccessorPrivate(QtDataSync::DataTypeStore<DataSyncSettingsEntry> *store);
1315

src/mvvmdatasynccore/datasyncviewmodel_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace QtMvvm {
1010

1111
class DataSyncViewModelPrivate
1212
{
13+
Q_DISABLE_COPY(DataSyncViewModelPrivate)
14+
1315
public:
1416
static const quint32 ExportRequestCode = 0xb201;
1517
static const quint32 ChangeRemoteRequestCode = 0xb202;

0 commit comments

Comments
 (0)