Commit f0c67cca authored by Lorn Potter's avatar Lorn Potter

[connectionagent] fix qt5 package build

parent fa6d4805
......@@ -2,18 +2,25 @@
QT += core network dbus gui
QT -= gui
TARGET = connectionagent
equals(QT_MAJOR_VERSION, 4): {
TARGET = connectionagent
INCLUDEPATH += libconnman-qt
INCLUDEPATH += lipstick
LIBS += -lconnman-qt4 -llipstick
}
equals(QT_MAJOR_VERSION, 5): {
TARGET = connectionagent
INCLUDEPATH += libconnman-qt5
INCLUDEPATH += lipstick
LIBS += -lconnman-qt5 -llipstick-qt5
}
CONFIG += console link_pkgconfig
CONFIG -= app_bundle
TEMPLATE = app
QT += core network dbus
QT -= gui
INCLUDEPATH += libconnman-qt
INCLUDEPATH += lipstick
OTHER_FILES += com.jolla.Connectiond.xml
......@@ -29,9 +36,6 @@ HEADERS+= \
qconnectionmanager.h \
connadaptor.h
LIBS += -lconnman-qt4
LIBS += -llipstick
target.path = /usr/bin
INSTALLS += target
......
......@@ -17,15 +17,23 @@
#include "qconnectionmanager.h"
#include "connadaptor.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <connman-qt5/useragent.h>
#include <connman-qt5/networkmanager.h>
#include <connman-qt5/networktechnology.h>
#include <connman-qt5/networkservice.h>
#include <connman-qt5/sessionagent.h>
#else
#include <connman-qt/useragent.h>
#include <connman-qt/networkmanager.h>
#include <connman-qt/networktechnology.h>
#include <connman-qt/networkservice.h>
#include <connman-qt/sessionagent.h>
#endif
#include <QtDBus/QDBusConnection>
#include <Qt/qobject.h>
#include <QObject>
#include <QSettings>
......@@ -164,7 +172,7 @@ void QConnectionManager::sendUserReply(const QVariantMap &input)
void QConnectionManager::onServiceAdded(const QString &servicePath)
{
qDebug() << Q_FUNC_INFO;
qDebug() << Q_FUNC_INFO << servicePath;
if (!servicesMap.contains(servicePath)) {
updateServicesMap();
}
......
......@@ -2,10 +2,18 @@ TEMPLATE = subdirs
TEMPLATE += ordered
SUBDIRS += config
SUBDIRS += connd
SUBDIRS += connectionagentplugin
SUBDIRS += test/testqml
equals(QT_MAJOR_VERSION, 4): {
SUBDIRS += test/testqml
OTHER_FILES += rpm/connectionagent.spec \
rpm/connectionagent.yaml
}
equals(QT_MAJOR_VERSION, 5): {
OTHER_FILES += rpm/connectionagent-qt5.spec \
rpm/connectionagent-qt5.yaml
}
......@@ -17,9 +17,15 @@
#include "connectionagentplugin.h"
#include "connectionamanagerinterface.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <connman-qt5/networkmanager.h>
#include <connman-qt5/networktechnology.h>
#include <connman-qt5/networkservice.h>
#else
#include <connman-qt/networkmanager.h>
#include <connman-qt/networktechnology.h>
#include <connman-qt/networkservice.h>
#endif
#include <qobject.h>
......
......@@ -17,7 +17,6 @@
#ifndef CONNECTIONAGENTPLUGIN_H
#define CONNECTIONAGENTPLUGIN_H
#include <QDeclarativeItem>
#include "connectionagentplugin.h"
#include "connectionamanagerinterface.h"
......
TEMPLATE = lib
TARGET = connectionagentplugin
QT += declarative dbus
QT += dbus
CONFIG += qt plugin
uri = com.jolla.connection
#create client
#system(qdbusxml2cpp ../connd/com.jollamobile.Connectiond.xml -c ConnectionManagerInterface -p connectionamanagerinterface)
equals(QT_MAJOR_VERSION, 4): {
QT += declarative
}
equals(QT_MAJOR_VERSION, 5): {
QT += quick
}
SOURCES += \
connectionagentplugin_plugin.cpp \
connectionagentplugin.cpp \
......
......@@ -17,8 +17,6 @@
#include "connectionagentplugin_plugin.h"
#include "connectionagentplugin.h"
#include <qdeclarative.h>
/*
*This class is for accessing connman's UserAgent from multiple sources.
*This is because currently, there can only be one UserAgent per system.
......
......@@ -16,8 +16,19 @@
#ifndef CONNECTIONAGENTPLUGIN_PLUGIN_H
#define CONNECTIONAGENTPLUGIN_PLUGIN_H
#include <QtPlugin>
#include <QDeclarativeExtensionPlugin>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
# include <QtQml>
# include <QQmlEngine>
# include <QQmlExtensionPlugin>
# define QDeclarativeEngine QQmlEngine
# define QDeclarativeExtensionPlugin QQmlExtensionPlugin
#else
# include <QtDeclarative>
# include <QDeclarativeEngine>
# include <QDeclarativeExtensionPlugin>
#endif
class ConnectionagentpluginPlugin : public QDeclarativeExtensionPlugin
{
......
......@@ -14,10 +14,11 @@ PROJECT=$(basename $PWD)
# Parse it from any Qt *.pro or *.pri files in CWD:
# PROJECT=$(grep -E "TARGET ?= ?" *.pr[io]|cut -d' ' -f3)
while getopts ht: o
while getopts qht: o
do case $o in
h) head=1;;
t) TAG="$OPTARG";;
q) PROJECT="$PROJECT"-qt5;;
?) printf >&2 "Usage: $0 [-h] [-t TAG]\n"
exit 2;;
esac
......
#
# Do NOT Edit the Auto-generated Part!
# Generated by: spectacle version 0.25
# Generated by: spectacle version 0.26
#
Name: connectionagent
......@@ -9,17 +9,17 @@ Name: connectionagent
# << macros
Summary: User Agent daemon
Version: 0.4
Version: 0.6.2
Release: 0
Group: Communications/Connectivity Adaptation
License: LGPLv2
URL: http://github.com/lpotter/connectionagent
Source0: %{name}-%{version}.tar.bz2
Source100: connectionagent.yaml
Requires: connman-qt-declarative
Requires: connman-qt5-declarative
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(QtDBus)
BuildRequires: pkgconfig(connman-qt4)
BuildRequires: pkgconfig(connman-qt5)
BuildRequires: pkgconfig(lipstick)
%description
......@@ -45,7 +45,6 @@ Requires: %{name} = %{version}
%description test
This package contains the declarative plugin for connection agent.
%prep
%setup -q -n %{name}-%{version}
......@@ -56,7 +55,7 @@ This package contains the declarative plugin for connection agent.
# >> build pre
# << build pre
%qmake
%qmake5
make %{?jobs:-j%jobs}
......@@ -72,7 +71,6 @@ rm -rf %{buildroot}
# >> install post
# << install post
%files
%defattr(-,root,root,-)
%{_bindir}/connectionagent
......@@ -83,7 +81,7 @@ rm -rf %{buildroot}
%files declarative
%defattr(-,root,root,-)
%{_libdir}/qt4/imports/com/jolla/connection/*
%{_libdir}/qt5/imports/com/jolla/connection/*
# >> files declarative
# << files declarative
......
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