Browse Source

code cleanups

pull/2/head
Skycoder42 6 years ago
parent
commit
6a0cf3abaf
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 12
      src/jar/src/de/skycoder42/qtmvvm/core/AndroidSettingsAccessor.java
  2. 2
      src/mvvmcore/androidsettingsaccessor_p.h
  3. 8
      src/mvvmcore/message_p.h
  4. 4
      src/mvvmcore/serviceregistry_p.h
  5. 2
      src/mvvmcore/settingsconfigloader.cpp
  6. 4
      src/mvvmcore/settingsconfigloader_p.h
  7. 4
      src/mvvmcore/settingsviewmodel_p.h
  8. 4
      src/mvvmdatasynccore/accountmodel_p.h
  9. 2
      src/mvvmdatasynccore/datasyncsettingsaccessor_p.h
  10. 2
      src/mvvmdatasynccore/datasyncviewmodel_p.h
  11. 4
      src/mvvmdatasynccore/exchangedevicesmodel_p.h
  12. 2
      src/mvvmdatasynccore/networkexchangeviewmodel_p.h
  13. 2
      src/mvvmdatasyncwidgets/datasyncwindow_p.h
  14. 2
      src/mvvmdatasyncwidgets/networkexchangewindow_p.h
  15. 2
      src/mvvmquick/inputviewfactory_p.h
  16. 3
      src/mvvmquick/quickpresenter_p.h
  17. 4
      src/mvvmwidgets/inputwidgetfactory_p.h
  18. 2
      src/mvvmwidgets/widgetspresenter_p.h

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

@ -8,19 +8,19 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager;
class AndroidSettingsAccessor {
private long address = 0;
private SharedPreferences preferences = null;
private SharedPreferences.Editor editor = null;
private Listener listener = new Listener();
private class Listener implements SharedPreferences.OnSharedPreferenceChangeListener {
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if(address != 0 && preferences == sharedPreferences)
if(address != 0 && preferences.equals(sharedPreferences))
callback(address, key);
}
}
long address = 0;
SharedPreferences preferences = null;
SharedPreferences.Editor editor = null;
Listener listener = new Listener();
private static native void callback(long address, Object key);
public AndroidSettingsAccessor(Context context, long address) {

2
src/mvvmcore/androidsettingsaccessor_p.h

@ -10,6 +10,8 @@ namespace QtMvvm {
class AndroidSettingsAccessorPrivate
{
Q_DISABLE_COPY(AndroidSettingsAccessorPrivate)
public:
AndroidSettingsAccessor *q;
QAndroidJniObject settings;

8
src/mvvmcore/message_p.h

@ -30,7 +30,11 @@ public:
class MessageResultPrivate
{
Q_DISABLE_COPY(MessageResultPrivate)
public:
MessageResultPrivate() = default;
QMutex mutex;
QPointer<QObject> closeObject;
QMetaMethod closeMethod;
@ -41,7 +45,11 @@ public:
class ProgressControlPrivate
{
Q_DISABLE_COPY(ProgressControlPrivate)
public:
ProgressControlPrivate() = default;
bool autoDelete = true;
#ifdef Q_ATOMIC_INT8_IS_SUPPORTED
QAtomicInteger<bool> indeterminate = false;

4
src/mvvmcore/serviceregistry_p.h

@ -11,7 +11,11 @@ namespace QtMvvm {
class ServiceRegistryPrivate
{
Q_DISABLE_COPY(ServiceRegistryPrivate)
public:
ServiceRegistryPrivate() = default;
class ServiceInfo {
Q_DISABLE_COPY(ServiceInfo)
public:

2
src/mvvmcore/settingsconfigloader.cpp

@ -233,7 +233,7 @@ QException *SettingsConfigException::clone() const
uint qHash(const std::tuple<QString, QString, QStringList> &key, uint seed)
uint std::qHash(const std::tuple<QString, QString, QStringList> &key, uint seed)
{
return qHash(std::get<0>(key), seed) ^
qHash(std::get<1>(key), seed) ^

4
src/mvvmcore/settingsconfigloader_p.h

@ -66,6 +66,10 @@ private:
}
namespace std {
uint qHash(const std::tuple<QString, QString, QStringList> &key, uint seed);
}
#endif // SETTINGSCONFIGLOADER_P_H

4
src/mvvmcore/settingsviewmodel_p.h

@ -8,7 +8,11 @@ namespace QtMvvm {
class SettingsViewModelPrivate
{
Q_DISABLE_COPY(SettingsViewModelPrivate)
public:
SettingsViewModelPrivate() = default;
ISettingsSetupLoader *setupLoader = nullptr;
ISettingsAccessor *accessor = nullptr;

4
src/mvvmdatasynccore/accountmodel_p.h

@ -8,7 +8,11 @@ namespace QtMvvm {
class AccountModelPrivate
{
Q_DISABLE_COPY(AccountModelPrivate)
public:
AccountModelPrivate() = default;
QtDataSync::AccountManager *accountManager = nullptr;
QtDataSync::SyncManager *syncManager = nullptr;
QList<QtDataSync::DeviceInfo> devices;

2
src/mvvmdatasynccore/datasyncsettingsaccessor_p.h

@ -8,6 +8,8 @@ namespace QtMvvm {
class DataSyncSettingsAccessorPrivate
{
Q_DISABLE_COPY(DataSyncSettingsAccessorPrivate)
public:
DataSyncSettingsAccessorPrivate(QtDataSync::DataTypeStore<DataSyncSettingsEntry> *store);

2
src/mvvmdatasynccore/datasyncviewmodel_p.h

@ -10,6 +10,8 @@ namespace QtMvvm {
class DataSyncViewModelPrivate
{
Q_DISABLE_COPY(DataSyncViewModelPrivate)
public:
static const quint32 ExportRequestCode = 0xb201;
static const quint32 ChangeRemoteRequestCode = 0xb202;

4
src/mvvmdatasynccore/exchangedevicesmodel_p.h

@ -11,7 +11,11 @@ namespace QtMvvm {
class ExchangeDevicesModelPrivate
{
Q_DISABLE_COPY(ExchangeDevicesModelPrivate)
public:
ExchangeDevicesModelPrivate() = default;
struct LimitedUserInfo : public QtDataSync::UserInfo
{
LimitedUserInfo(const QtDataSync::UserInfo &info = {});

2
src/mvvmdatasynccore/networkexchangeviewmodel_p.h

@ -10,6 +10,8 @@ namespace QtMvvm {
class NetworkExchangeViewModelPrivate
{
Q_DISABLE_COPY(NetworkExchangeViewModelPrivate)
public:
static const quint32 ExportRequestCode = 0xb300;

2
src/mvvmdatasyncwidgets/datasyncwindow_p.h

@ -12,6 +12,8 @@ namespace QtMvvm {
class DataSyncWindowPrivate
{
Q_DISABLE_COPY(DataSyncWindowPrivate)
public:
DataSyncWindowPrivate(ViewModel *viewModel);

2
src/mvvmdatasyncwidgets/networkexchangewindow_p.h

@ -12,6 +12,8 @@ namespace QtMvvm {
class NetworkExchangeWindowPrivate
{
Q_DISABLE_COPY(NetworkExchangeWindowPrivate)
public:
NetworkExchangeWindowPrivate(ViewModel *viewModel);

2
src/mvvmquick/inputviewfactory_p.h

@ -8,6 +8,8 @@ namespace QtMvvm {
class InputViewFactoryPrivate
{
Q_DISABLE_COPY(InputViewFactoryPrivate)
public:
InputViewFactoryPrivate();

3
src/mvvmquick/quickpresenter_p.h

@ -11,9 +11,12 @@ namespace QtMvvm {
class Q_MVVMQUICK_EXPORT QuickPresenterPrivate
{
Q_DISABLE_COPY(QuickPresenterPrivate)
friend class QtMvvm::QuickPresenter;
public:
QuickPresenterPrivate() = default;
static QuickPresenter *currentPresenter();
static void setQmlPresenter(QObject *presenter);

4
src/mvvmwidgets/inputwidgetfactory_p.h

@ -8,7 +8,11 @@ namespace QtMvvm {
class InputWidgetFactoryPrivate
{
Q_DISABLE_COPY(InputWidgetFactoryPrivate)
public:
InputWidgetFactoryPrivate() = default;
QHash<QByteArray, std::function<QWidget*(QWidget*)>> simpleWidgets;
QHash<QByteArray, QByteArray> aliases;
};

2
src/mvvmwidgets/widgetspresenter_p.h

@ -12,6 +12,8 @@ namespace QtMvvm {
class WidgetsPresenterPrivate
{
Q_DISABLE_COPY(WidgetsPresenterPrivate)
public:
WidgetsPresenterPrivate();

Loading…
Cancel
Save