Commit 3e7899c1 authored by Robin Burchell's avatar Robin Burchell

[systemsettings] Seperate code into a shared library and plugin.

Also ports this to Qt 5, without worrying about Qt 4 compatibility -- as Qt 4 is
going away.
parent 283e2115
#
# Do NOT Edit the Auto-generated Part!
# Generated by: spectacle version 0.26
# Generated by: spectacle version 0.27
#
Name: nemo-qml-plugin-systemsettings
......@@ -16,16 +16,25 @@ License: BSD
URL: https://github.com/nemomobile/nemo-qml-plugin-systemsettings
Source0: %{name}-%{version}.tar.bz2
Source100: nemo-qml-plugin-systemsettings.yaml
BuildRequires: pkgconfig(QtCore) >= 4.7.0
BuildRequires: pkgconfig(QtDeclarative)
BuildRequires: pkgconfig(qmsystem2)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5SystemInfo)
BuildRequires: pkgconfig(qmsystem2-qt5)
BuildRequires: pkgconfig(profile)
BuildRequires: pkgconfig(QtSystemInfo)
BuildRequires: mce-headers
BuildRequires: pkgconfig(mce)
%description
%{summary}.
%package devel
Summary: System settings C++ library
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
%{summary}.
%prep
%setup -q -n %{name}-%{version}
......@@ -36,7 +45,7 @@ BuildRequires: mce-headers
# >> build pre
# << build pre
%qmake
%qmake5
make %{?jobs:-j%jobs}
......@@ -47,14 +56,27 @@ make %{?jobs:-j%jobs}
rm -rf %{buildroot}
# >> install pre
# << install pre
%qmake_install
%qmake5_install
# >> install post
# << install post
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_libdir}/qt4/imports/org/nemomobile/systemsettings/libnemosystemsettings.so
%{_libdir}/qt4/imports/org/nemomobile/systemsettings/qmldir
%{_libdir}/qt5/qml/org/nemomobile/systemsettings/libnemosystemsettings.so
%{_libdir}/qt5/qml/org/nemomobile/systemsettings/qmldir
%{_libdir}/libsystemsettings.so.*
# >> files
# << files
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/systemsettings.pc
%{_includedir}/systemsettings/*
%{_libdir}/libsystemsettings.so
# >> files devel
# << files devel
......@@ -9,15 +9,24 @@ Sources:
- "%{name}-%{version}.tar.bz2"
License: BSD
Configure: none
Builder: qmake
Builder: qmake5
PkgConfigBR:
- QtCore >= 4.7.0
- QtDeclarative
- qmsystem2
- Qt5Qml
- Qt5SystemInfo
- qmsystem2-qt5
- profile
- QtSystemInfo
PkgBR:
- mce-headers
- mce
Files:
- "%{_libdir}/qt4/imports/org/nemomobile/systemsettings/libnemosystemsettings.so"
- "%{_libdir}/qt4/imports/org/nemomobile/systemsettings/qmldir"
- "%{_libdir}/qt5/qml/org/nemomobile/systemsettings/libnemosystemsettings.so"
- "%{_libdir}/qt5/qml/org/nemomobile/systemsettings/qmldir"
- "%{_libdir}/libsystemsettings.so.*"
SubPackages:
- Name: devel
Summary: System settings C++ library
Group: System/Libraries
Description: "%{summary}."
Files:
- "%{_libdir}/pkgconfig/systemsettings.pc"
- "%{_includedir}/systemsettings/*"
- "%{_libdir}/libsystemsettings.so"
......@@ -30,9 +30,9 @@
*/
#include <QtGlobal>
#include <QtDeclarative>
#include <QDeclarativeEngine>
#include <QDeclarativeExtensionPlugin>
#include <QtQml>
#include <QQmlEngine>
#include <QQmlExtensionPlugin>
#include "languagemodel.h"
#include "datetimesettings.h"
......@@ -41,11 +41,15 @@
#include "displaysettings.h"
#include "usbsettings.h"
#include "aboutsettings.h"
#include "devicelockiface.h"
class SystemSettingsPlugin : public QDeclarativeExtensionPlugin
class SystemSettingsPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.nemomobile.systemsettings")
public:
void initializeEngine(QDeclarativeEngine *engine, const char *uri)
void initializeEngine(QQmlEngine *engine, const char *uri)
{
Q_UNUSED(uri)
}
......@@ -60,8 +64,8 @@ public:
qmlRegisterType<DisplaySettings>(uri, 1, 0, "DisplaySettings");
qmlRegisterType<USBSettings>(uri, 1, 0, "USBSettings");
qmlRegisterType<AboutSettings>(uri, 1, 0, "AboutSettings");
qmlRegisterType<DeviceLockInterface>(uri, 1, 0, "DeviceLockInterface");
}
};
Q_EXPORT_PLUGIN2(systemsettingsplugin, SystemSettingsPlugin)
#include "plugin.moc"
TARGET = nemosystemsettings
PLUGIN_IMPORT_PATH = org/nemomobile/systemsettings
TEMPLATE = lib
CONFIG += qt plugin hide_symbols
QT += declarative
target.path = $$[QT_INSTALL_IMPORTS]/$$PLUGIN_IMPORT_PATH
INSTALLS += target
qmldir.files += $$_PRO_FILE_PWD_/qmldir
qmldir.path += $$[QT_INSTALL_IMPORTS]/$$$$PLUGIN_IMPORT_PATH
INSTALLS += qmldir
TARGET = systemsettings
QT += dbus
CONFIG += qmsystem2 mobility link_pkgconfig
PKGCONFIG += profile
MOBILITY += systeminfo
# TODO: hide_symbols
CONFIG += qt create_pc create_prl no_install_prl
QT += qml dbus systeminfo
OTHER_FILES += \
qmldir
CONFIG += link_pkgconfig
PKGCONFIG += qmsystem2-qt5 profile
system(qdbusxml2cpp -p mceiface.h:mceiface.cpp mce.xml)
SOURCES += \
plugin.cpp \
languagemodel.cpp \
datetimesettings.cpp \
profilecontrol.cpp \
......@@ -31,7 +18,8 @@ SOURCES += \
mceiface.cpp \
displaysettings.cpp \
usbsettings.cpp \
aboutsettings.cpp
aboutsettings.cpp \
devicelockiface.cpp
HEADERS += \
languagemodel.h \
......@@ -41,7 +29,21 @@ HEADERS += \
mceiface.h \
displaysettings.h \
usbsettings.h \
aboutsettings.h
aboutsettings.h \
devicelockiface.h
develheaders.path = /usr/include/systemsettings
develheaders.files = $$HEADERS
target.path = $$[QT_INSTALL_LIBS]
pkgconfig.files = $$PWD/pkgconfig/systemsettings.pc
pkgconfig.path = $$target.path/pkgconfig
include(../../plugin.pri)
QMAKE_PKGCONFIG_NAME = lib$$TARGET
QMAKE_PKGCONFIG_DESCRIPTION = System settings application development files
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = $$develheaders.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
QMAKE_PKGCONFIG_REQUIRES = Qt5Core Qt5DBus profile qmsystem2-qt5
INSTALLS += target develheaders pkgconfig
TEMPLATE = subdirs
SUBDIRS = src
src_plugins.subdir = src/plugin
src_plugins.target = sub-plugins
src_plugins.depends = src
SUBDIRS = src src_plugins
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