Commit 7fdf237f authored by flypig's avatar flypig

Rename VpnModel class to SettingsVpnModel and VpnCoreModel class to VpnModel

To allow the base class in libconnman-qt to be more easily named as
VpnModel. The class has been renamed in libconnma-qt to align with the overall
libconnman-qt class naming approach.
parent e1f125e9
Name: nemo-qml-plugin-systemsettings Name: nemo-qml-plugin-systemsettings
Summary: System settings plugin for Nemo Mobile Summary: System settings plugin for Nemo Mobile
Version: 0.5.6 Version: 0.5.27
Release: 1 Release: 1
Group: System/Libraries Group: System/Libraries
License: BSD License: BSD
...@@ -11,6 +11,7 @@ Requires(postun): /sbin/ldconfig ...@@ -11,6 +11,7 @@ Requires(postun): /sbin/ldconfig
Requires: connman Requires: connman
Requires: mce >= 1.83.0 Requires: mce >= 1.83.0
Requires: libsailfishkeyprovider >= 0.0.14 Requires: libsailfishkeyprovider >= 0.0.14
Requires: connman-qt5 >= 1.2.21
BuildRequires: pkgconfig(Qt5Qml) BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5SystemInfo) BuildRequires: pkgconfig(Qt5SystemInfo)
BuildRequires: pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5Test)
...@@ -25,7 +26,7 @@ BuildRequires: pkgconfig(libcrypto) ...@@ -25,7 +26,7 @@ BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(nemodbus) >= 2.1.16 BuildRequires: pkgconfig(nemodbus) >= 2.1.16
BuildRequires: pkgconfig(nemomodels-qt5) BuildRequires: pkgconfig(nemomodels-qt5)
BuildRequires: pkgconfig(libsailfishkeyprovider) >= 0.0.14 BuildRequires: pkgconfig(libsailfishkeyprovider) >= 0.0.14
BuildRequires: pkgconfig(connman-qt5) >= 1.2.7 BuildRequires: pkgconfig(connman-qt5) >= 1.2.21
BuildRequires: pkgconfig(ssu-sysinfo) >= 1.1.0 BuildRequires: pkgconfig(ssu-sysinfo) >= 1.1.0
BuildRequires: pkgconfig(packagekitqt5) BuildRequires: pkgconfig(packagekitqt5)
BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(glib-2.0)
......
...@@ -47,13 +47,14 @@ ...@@ -47,13 +47,14 @@
#include "diskusage.h" #include "diskusage.h"
#include "partitionmodel.h" #include "partitionmodel.h"
#include "certificatemodel.h" #include "certificatemodel.h"
#include "vpnmodel.h" #include "settingsvpnmodel.h"
#include "locationsettings.h" #include "locationsettings.h"
#include "deviceinfo.h" #include "deviceinfo.h"
static QObject *vpnmodel_api_factory(QQmlEngine *, QJSEngine *) template<class T>
static QObject *api_factory(QQmlEngine *, QJSEngine *)
{ {
return new VpnModel; return new T;
} }
class SystemSettingsPlugin : public QQmlExtensionPlugin class SystemSettingsPlugin : public QQmlExtensionPlugin
...@@ -82,7 +83,7 @@ public: ...@@ -82,7 +83,7 @@ public:
qRegisterMetaType<Partition>("Partition"); qRegisterMetaType<Partition>("Partition");
qmlRegisterType<DeveloperModeSettings>(uri, 1, 0, "DeveloperModeSettings"); qmlRegisterType<DeveloperModeSettings>(uri, 1, 0, "DeveloperModeSettings");
qmlRegisterType<CertificateModel>(uri, 1, 0, "CertificateModel"); qmlRegisterType<CertificateModel>(uri, 1, 0, "CertificateModel");
qmlRegisterSingletonType<VpnModel>(uri, 1, 0, "VpnModel", vpnmodel_api_factory); qmlRegisterSingletonType<SettingsVpnModel>(uri, 1, 0, "SettingsVpnModel", api_factory<SettingsVpnModel>);
qRegisterMetaType<DeveloperModeSettings::Status>("DeveloperModeSettings::Status"); qRegisterMetaType<DeveloperModeSettings::Status>("DeveloperModeSettings::Status");
qmlRegisterType<BatteryStatus>(uri, 1, 0, "BatteryStatus"); qmlRegisterType<BatteryStatus>(uri, 1, 0, "BatteryStatus");
qmlRegisterType<DiskUsage>(uri, 1, 0, "DiskUsage"); qmlRegisterType<DiskUsage>(uri, 1, 0, "DiskUsage");
......
...@@ -30,37 +30,37 @@ ...@@ -30,37 +30,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/ */
#ifndef VPNMODEL_H #ifndef SETTINGSVPNMODEL_H
#define VPNMODEL_H #define SETTINGSVPNMODEL_H
#include <QObject> #include <QObject>
#include <QSet> #include <QSet>
#include <QDir> #include <QDir>
#include <vpnconnection.h> #include <vpnconnection.h>
#include <vpncoremodel.h> #include <vpnmodel.h>
#include <systemsettingsglobal.h> #include <systemsettingsglobal.h>
class SYSTEMSETTINGS_EXPORT VpnModel : public VpnCoreModel class SYSTEMSETTINGS_EXPORT SettingsVpnModel : public VpnModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int bestState READ bestState NOTIFY bestStateChanged) Q_PROPERTY(VpnConnection::ConnectionState bestState READ bestState NOTIFY bestStateChanged)
Q_PROPERTY(bool autoConnect READ autoConnect NOTIFY autoConnectChanged) Q_PROPERTY(bool autoConnect READ autoConnect NOTIFY autoConnectChanged)
Q_PROPERTY(bool orderByConnected READ orderByConnected WRITE setOrderByConnected NOTIFY orderByConnectedChanged) Q_PROPERTY(bool orderByConnected READ orderByConnected WRITE setOrderByConnected NOTIFY orderByConnectedChanged)
public: public:
VpnModel(QObject* parent = nullptr); SettingsVpnModel(QObject* parent = nullptr);
~VpnModel() override; ~SettingsVpnModel() override;
enum ItemRoles { enum ItemRoles {
ConnectedRole = VpnCoreModel::VpnRole + 1 ConnectedRole = VpnModel::VpnRole + 1
}; };
QHash<int, QByteArray> roleNames() const override; QHash<int, QByteArray> roleNames() const override;
QVariant data(const QModelIndex &index, int role) const override; QVariant data(const QModelIndex &index, int role) const override;
int bestState() const; VpnConnection::ConnectionState bestState() const;
bool autoConnect() const; bool autoConnect() const;
bool orderByConnected() const; bool orderByConnected() const;
void setOrderByConnected(bool orderByConnected); void setOrderByConnected(bool orderByConnected);
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
signals: signals:
void bestStateChanged(); void bestStateChanged();
void autoConnectChanged(); void autoConnectChanged();
void connectionStateChanged(const QString &path, int state); void connectionStateChanged(const QString &path, VpnConnection::ConnectionState state);
void orderByConnectedChanged(); void orderByConnectedChanged();
private: private:
...@@ -139,4 +139,4 @@ private: ...@@ -139,4 +139,4 @@ private:
QHash<int, QByteArray> roles; QHash<int, QByteArray> roles;
}; };
#endif // VPNMODEL_H #endif // SETTINGSVPNMODEL_H
...@@ -22,7 +22,6 @@ SOURCES += \ ...@@ -22,7 +22,6 @@ SOURCES += \
displaysettings.cpp \ displaysettings.cpp \
aboutsettings.cpp \ aboutsettings.cpp \
certificatemodel.cpp \ certificatemodel.cpp \
vpnmodel.cpp \
developermodesettings.cpp \ developermodesettings.cpp \
batterystatus.cpp \ batterystatus.cpp \
diskusage.cpp \ diskusage.cpp \
...@@ -32,6 +31,7 @@ SOURCES += \ ...@@ -32,6 +31,7 @@ SOURCES += \
partitionmodel.cpp \ partitionmodel.cpp \
deviceinfo.cpp \ deviceinfo.cpp \
locationsettings.cpp \ locationsettings.cpp \
settingsvpnmodel.cpp \
timezoneinfo.cpp \ timezoneinfo.cpp \
udisks2block.cpp \ udisks2block.cpp \
udisks2blockdevices.cpp \ udisks2blockdevices.cpp \
...@@ -47,7 +47,7 @@ PUBLIC_HEADERS = \ ...@@ -47,7 +47,7 @@ PUBLIC_HEADERS = \
displaysettings.h \ displaysettings.h \
aboutsettings.h \ aboutsettings.h \
certificatemodel.h \ certificatemodel.h \
vpnmodel.h \ settingsvpnmodel.h \
developermodesettings.h \ developermodesettings.h \
batterystatus.h \ batterystatus.h \
udisks2block_p.h \ udisks2block_p.h \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment