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
Summary: System settings plugin for Nemo Mobile
Version: 0.5.6
Version: 0.5.27
Release: 1
Group: System/Libraries
License: BSD
......@@ -11,6 +11,7 @@ Requires(postun): /sbin/ldconfig
Requires: connman
Requires: mce >= 1.83.0
Requires: libsailfishkeyprovider >= 0.0.14
Requires: connman-qt5 >= 1.2.21
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5SystemInfo)
BuildRequires: pkgconfig(Qt5Test)
......@@ -25,7 +26,7 @@ BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(nemodbus) >= 2.1.16
BuildRequires: pkgconfig(nemomodels-qt5)
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(packagekitqt5)
BuildRequires: pkgconfig(glib-2.0)
......
......@@ -47,13 +47,14 @@
#include "diskusage.h"
#include "partitionmodel.h"
#include "certificatemodel.h"
#include "vpnmodel.h"
#include "settingsvpnmodel.h"
#include "locationsettings.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
......@@ -82,7 +83,7 @@ public:
qRegisterMetaType<Partition>("Partition");
qmlRegisterType<DeveloperModeSettings>(uri, 1, 0, "DeveloperModeSettings");
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");
qmlRegisterType<BatteryStatus>(uri, 1, 0, "BatteryStatus");
qmlRegisterType<DiskUsage>(uri, 1, 0, "DiskUsage");
......
......@@ -30,37 +30,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/
#ifndef VPNMODEL_H
#define VPNMODEL_H
#ifndef SETTINGSVPNMODEL_H
#define SETTINGSVPNMODEL_H
#include <QObject>
#include <QSet>
#include <QDir>
#include <vpnconnection.h>
#include <vpncoremodel.h>
#include <vpnmodel.h>
#include <systemsettingsglobal.h>
class SYSTEMSETTINGS_EXPORT VpnModel : public VpnCoreModel
class SYSTEMSETTINGS_EXPORT SettingsVpnModel : public VpnModel
{
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 orderByConnected READ orderByConnected WRITE setOrderByConnected NOTIFY orderByConnectedChanged)
public:
VpnModel(QObject* parent = nullptr);
~VpnModel() override;
SettingsVpnModel(QObject* parent = nullptr);
~SettingsVpnModel() override;
enum ItemRoles {
ConnectedRole = VpnCoreModel::VpnRole + 1
ConnectedRole = VpnModel::VpnRole + 1
};
QHash<int, QByteArray> roleNames() const override;
QVariant data(const QModelIndex &index, int role) const override;
int bestState() const;
VpnConnection::ConnectionState bestState() const;
bool autoConnect() const;
bool orderByConnected() const;
void setOrderByConnected(bool orderByConnected);
......@@ -88,7 +88,7 @@ public:
signals:
void bestStateChanged();
void autoConnectChanged();
void connectionStateChanged(const QString &path, int state);
void connectionStateChanged(const QString &path, VpnConnection::ConnectionState state);
void orderByConnectedChanged();
private:
......@@ -139,4 +139,4 @@ private:
QHash<int, QByteArray> roles;
};
#endif // VPNMODEL_H
#endif // SETTINGSVPNMODEL_H
......@@ -22,7 +22,6 @@ SOURCES += \
displaysettings.cpp \
aboutsettings.cpp \
certificatemodel.cpp \
vpnmodel.cpp \
developermodesettings.cpp \
batterystatus.cpp \
diskusage.cpp \
......@@ -32,6 +31,7 @@ SOURCES += \
partitionmodel.cpp \
deviceinfo.cpp \
locationsettings.cpp \
settingsvpnmodel.cpp \
timezoneinfo.cpp \
udisks2block.cpp \
udisks2blockdevices.cpp \
......@@ -47,7 +47,7 @@ PUBLIC_HEADERS = \
displaysettings.h \
aboutsettings.h \
certificatemodel.h \
vpnmodel.h \
settingsvpnmodel.h \
developermodesettings.h \
batterystatus.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