diff options
-rw-r--r-- | libmediaoverridesqt/libmediaoverridesqt.pro | 36 | ||||
-rw-r--r-- | libmediaoverridesqt/libmediaoverridesqt1.pc | 12 | ||||
-rw-r--r-- | libmediaoverridesqt/override.cpp | 63 | ||||
-rw-r--r-- | libmediaoverridesqt/override.h | 32 | ||||
-rw-r--r-- | libresourceqt.pro | 5 | ||||
-rw-r--r-- | libresourceqt.spec | 181 | ||||
-rw-r--r-- | libresourceqt.yaml | 78 | ||||
-rwxr-xr-x | makedist.sh | 2 | ||||
-rw-r--r-- | mediaoverrider/main.cpp | 10 | ||||
-rw-r--r-- | mediaoverrider/mediaoverrider.cpp | 83 | ||||
-rw-r--r-- | mediaoverrider/mediaoverrider.desktop | 7 | ||||
-rw-r--r-- | mediaoverrider/mediaoverrider.h | 38 | ||||
-rw-r--r-- | mediaoverrider/mediaoverrider.pro | 28 | ||||
-rw-r--r-- | tests/test-security-with-aegis-token/test-security-with-aegis-token.pro | 39 | ||||
-rw-r--r-- | tests/test-security-with-aegis-token/test-security.cpp | 70 | ||||
-rw-r--r-- | tests/test-security-without-aegis-token/test-security-without-aegis-token.pro | 41 | ||||
-rw-r--r-- | tests/test-security-without-aegis-token/test-security.cpp | 70 | ||||
-rw-r--r-- | tests/tests.pro | 4 |
18 files changed, 262 insertions, 537 deletions
diff --git a/libmediaoverridesqt/libmediaoverridesqt.pro b/libmediaoverridesqt/libmediaoverridesqt.pro deleted file mode 100644 index 20296c4..0000000 --- a/libmediaoverridesqt/libmediaoverridesqt.pro +++ /dev/null @@ -1,36 +0,0 @@ -include(../common.pri) -TEMPLATE = lib -TARGET = mediaoverridesqt -DESTDIR = build -DEPENDPATH += . -INCLUDEPATH += . - -# Input -PUBLIC_HEADERS = override.h - -HEADERS += $${PUBLIC_HEADERS} - -SOURCES += override.cpp - -QMAKE_CXXFLAGS += -Wall -LIBS += -L$${LIBDBUSQEVENTLOOP}/build -ldbus-qeventloop - -OBJECTS_DIR = build -MOC_DIR = moc - -CONFIG += qt dll -QT += dbus -PKGCONFIG += dbus-1 libresource0 - -QMAKE_DISTCLEAN += -r moc build - -# Install directives -headers.files = $${PUBLIC_HEADERS} -INSTALLBASE = /usr -target.path = $${INSTALLBASE}/lib -headers.path = $${INSTALLBASE}/include/resource/qt4/policy -pc.files = libmediaoverridesqt1.pc -pc.path = $${INSTALLBASE}/lib/pkgconfig - -INSTALLS = target headers pc - diff --git a/libmediaoverridesqt/libmediaoverridesqt1.pc b/libmediaoverridesqt/libmediaoverridesqt1.pc deleted file mode 100644 index c5293bf..0000000 --- a/libmediaoverridesqt/libmediaoverridesqt1.pc +++ /dev/null @@ -1,12 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include/resource/qt4 - -Name: libmediaoverridesqt1 -Description: Maemo overrides Qt API -Version: 1.26 -Libs: -L${libdir} -Cflags: -I${includedir} -Requires: QtDbus - diff --git a/libmediaoverridesqt/override.cpp b/libmediaoverridesqt/override.cpp deleted file mode 100644 index 71102df..0000000 --- a/libmediaoverridesqt/override.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "override.h" - -#define MANAGER_PATH "/org/maemo/Playback/Manager" -#define MANAGER_SERVICE "org.maemo.Playback.Manager" -#define MANAGER_INTERFACE "org.maemo.Playback.Manager" - -using namespace ResourcePolicy; - -Override * ResourcePolicy::createMute(QObject *parent) -{ - return new Override("Mute", parent); -} - -Override * ResourcePolicy::createPrivacyOverride(QObject *parent) -{ - return new Override("PrivacyOverride", parent); -} - -Override * ResourcePolicy::createBluetoothOVerride(QObject *parent) -{ - return new Override("BluetoothOverride", parent); -} - -Override::Override(QString overrideType, QObject *parent): - QObject(parent), dBusConnection(QDBusConnection::sessionBus()), type(overrideType) -{ - dBusConnection.connect(MANAGER_SERVICE, MANAGER_PATH, MANAGER_INTERFACE, - type, this, SLOT(handleChange(bool))); -} - -Override::~Override() -{ -} - -void Override::fetchState() -{ - QDBusMessage msg; - QString method = "Get" + type; - - msg = QDBusMessage::createMethodCall(MANAGER_SERVICE, MANAGER_PATH, - MANAGER_INTERFACE, method); - dBusConnection.send(msg); -} - -void Override::request(bool newState) -{ - QDBusMessage msg; - QString method = "Request" + type; - - msg = QDBusMessage::createMethodCall(MANAGER_SERVICE, MANAGER_PATH, - MANAGER_INTERFACE, method); - - QVariantList args; - args.append(newState); - msg.setArguments(args); - dBusConnection.send(msg); -} - -void Override::handleChange(bool newState) -{ - emit changed(newState); -} - diff --git a/libmediaoverridesqt/override.h b/libmediaoverridesqt/override.h deleted file mode 100644 index c906a55..0000000 --- a/libmediaoverridesqt/override.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include <QtDBus> -#include <QDBusConnection> -#include <QDBusArgument> - -namespace ResourcePolicy -{ - class Override : public QObject - { - Q_OBJECT -public: - Override(QString overrideType, QObject *parent=NULL); - virtual ~Override(); - void fetchState(); - -signals: - void changed(bool newState); - -private slots: - void handleChange(bool newState); - void request(bool newState); - -private: - QDBusConnection dBusConnection; - QString type; - }; - Override * createMute(QObject *parent=NULL); - Override * createPrivacyOverride(QObject *parent=NULL); - Override * createBluetoothOVerride(QObject *parent=NULL); -} - diff --git a/libresourceqt.pro b/libresourceqt.pro index d570fb7..a18ff18 100644 --- a/libresourceqt.pro +++ b/libresourceqt.pro @@ -24,11 +24,8 @@ TEMPLATE = subdirs SUBDIRS = libdbus-qeventloop \ libresourceqt \ - libmediaoverridesqt \ resourceqt-client \ - mediaoverrider \ - tests \ - demo/player + tests dist.commands = ./makedist.sh FORCE.commands = $(CHK_DIR_EXISTS) libresourceqt/docs/man || mkdir -p libresourceqt/docs/man ;\ diff --git a/libresourceqt.spec b/libresourceqt.spec new file mode 100644 index 0000000..86090d3 --- /dev/null +++ b/libresourceqt.spec @@ -0,0 +1,181 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.20 +# +# >> macros +# << macros + +Name: libresourceqt +Summary: Resource Policy Qt API +Version: 1.26 +Release: 1 +Group: System/Libraries +License: LGPLv2.1 +URL: http://meego.gitorious.org/maemo-multimedia/libresourceqt/ +Source0: %{name}-%{version}.tar.gz +Source100: libresourceqt.yaml +Requires: libdbus-qeventloop = %{version}-%{release} +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +BuildRequires: pkgconfig(QtCore) >= 4.6.0 +BuildRequires: pkgconfig(libresource0) +BuildRequires: pkgconfig(dbus-1) +BuildRequires: doxygen + + +%description +Qt library for Resource Policy. + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +Description: %{summary} + +%package -n libdbus-qeventloop +Summary: Library that runs the low level D-Bus inside QEventloop +Group: System/Libraries +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig + +%description -n libdbus-qeventloop +This library enables Qt applications to run the D-Bus low-level api in the Qt Eventloop. + +%package -n libdbus-qeventloop-devel +Summary: Development files for libdbus-qeventloop +Group: Development/Libraries + +%description -n libdbus-qeventloop-devel +Description: %{summary} + +%package client +Summary: Test client to test %{name} +Group: System/Utilities +Requires: %{name} = %{version}-%{release} + +%description client +Description: %{summary} + +%package tests +Summary: Unit-tests for %{name} +Group: System/Libraries +Requires: %{name} = %{version}-%{release} +Requires: libdbus-qeventloop = %{version}-%{release} + +%description tests +Description: %{summary} + +%package doc +Summary: Developer documentation for %{name} +Group: Documentation +Requires: %{name} = %{version}-%{release} + +%description doc +Description: %{summary} + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +qmake PREFIX=%{_prefix} +make +# << build pre + + + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +# << install pre + +# >> install post +make INSTALL_ROOT=%{buildroot} install +# << install post + + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + + + + + + +%post -n libdbus-qeventloop -p /sbin/ldconfig + +%postun -n libdbus-qeventloop -p /sbin/ldconfig + + + + + + + + + + + + + +%files +%defattr(-,root,root,-) +%{_libdir}/libresourceqt.so.* +# >> files +# << files + + +%files devel +%defattr(-,root,root,-) +%{_includedir}/resource/qt4/policy/*resource*.h +%{_libdir}/libresourceqt.so +%{_libdir}/pkgconfig/libresourceqt1.pc +# >> files devel +# << files devel + +%files -n libdbus-qeventloop +%defattr(-,root,root,-) +%{_libdir}/libdbus-qeventloop.so.* +# >> files libdbus-qeventloop +# << files libdbus-qeventloop + +%files -n libdbus-qeventloop-devel +%defattr(-,root,root,-) +%{_includedir}/dbusconnectioneventloop.h +%{_libdir}/libdbus-qeventloop.so +%{_libdir}/pkgconfig/libdbus-qeventloop1.pc +# >> files libdbus-qeventloop-devel +# << files libdbus-qeventloop-devel + +%files client +%defattr(-,root,root,-) +%{_bindir}/resourceqt-client +# >> files client +# << files client + +%files tests +%defattr(-,root,root,-) +%{_libdir}/libresourceqt-tests/* +%{_datadir}/%{name}-tests/tests.xml +%config %{_sysconfdir}/dbus-1/system.d/test-dbus-qeventloop.conf +# >> files tests +# << files tests + +%files doc +%defattr(-,root,root,-) +%{_datadir}/doc/%{name}/* +%{_mandir}/* +# >> files doc +# << files doc + diff --git a/libresourceqt.yaml b/libresourceqt.yaml new file mode 100644 index 0000000..19c6677 --- /dev/null +++ b/libresourceqt.yaml @@ -0,0 +1,78 @@ +Name: libresourceqt +Summary: Resource Policy Qt API +Version: 1.26 +Release: 1 +Group: System/Libraries +License: LGPLv2.1 +URL: http://meego.gitorious.org/maemo-multimedia/libresourceqt/ +Sources: + - "%{name}-%{version}.tar.gz" +Description: Qt library for Resource Policy. +Requires: + - libdbus-qeventloop = %{version}-%{release} +PkgBR: + - doxygen +PkgConfigBR: + - QtCore >= 4.6.0 + - libresource0 + - dbus-1 + +Configure: none +Builder: none + +Files: + - "%{_libdir}/libresourceqt.so.*" + +SubPackages: +- + Name: devel + Summary: Development files for %{name} + Files: + - "%{_includedir}/resource/qt4/policy/*resource*.h" + - "%{_libdir}/libresourceqt.so" + - "%{_libdir}/pkgconfig/libresourceqt1.pc" + Group: Development/Libraries +- + Name: libdbus-qeventloop + Summary: Library that runs the low level D-Bus inside QEventloop + Files: + - "%{_libdir}/libdbus-qeventloop.so.*" + Group: System/Libraries + Description: This library enables Qt applications to run the D-Bus + low-level api in the Qt Eventloop. + AsWholeName: yes + AutoDepend: no +- + Name: libdbus-qeventloop-devel + Summary: Development files for libdbus-qeventloop + Files: + - "%{_includedir}/dbusconnectioneventloop.h" + - "%{_libdir}/libdbus-qeventloop.so" + - "%{_libdir}/pkgconfig/libdbus-qeventloop1.pc" + Group: Development/Libraries + AsWholeName: yes + AutoDepend: no +- + Name: client + Summary: Test client to test %{name} + Files: + - "%{_bindir}/resourceqt-client" + Group: System/Utilities +- + Name: tests + Summary: Unit-tests for %{name} + Files: + - "%{_libdir}/libresourceqt-tests/*" + - "%{_datadir}/%{name}-tests/tests.xml" + - "%config %{_sysconfdir}/dbus-1/system.d/test-dbus-qeventloop.conf" + Group: System/Libraries + Requires: + - libdbus-qeventloop = %{version}-%{release} +- + Name: doc + Summary: Developer documentation for %{name} + Files: + - "%{_datadir}/doc/%{name}/*" + - "%{_mandir}/*" + Group: Documentation + diff --git a/makedist.sh b/makedist.sh index c0a64b1..62553be 100755 --- a/makedist.sh +++ b/makedist.sh @@ -1,6 +1,6 @@ #!/bin/sh -version="1.24" +version="1.26" name="libresourceqt-$version" echo "packaging $name" diff --git a/mediaoverrider/main.cpp b/mediaoverrider/main.cpp deleted file mode 100644 index db13d33..0000000 --- a/mediaoverrider/main.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mediaoverrider.h" - -int main(int argc, char **argv) -{ - MediaOverrider app(argc, argv); -// MApplication app(argc, argv); - - return app.run(); -} - diff --git a/mediaoverrider/mediaoverrider.cpp b/mediaoverrider/mediaoverrider.cpp deleted file mode 100644 index 24d9afc..0000000 --- a/mediaoverrider/mediaoverrider.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include "mediaoverrider.h" - -MediaOverrider::MediaOverrider(int argc, char **argv, QObject *parent): - QObject(parent), app(argc, argv) -{ -// MTheme::loadCSS("MediaOverrider.css"); - window = new MApplicationWindow; - page = new MApplicationPage; - - layout = new MLayout; - policy = new MGridLayoutPolicy(layout); - policy->setSpacing(10); - - page->setTitle("Resource Overrider"); - MLabel * label = new MLabel("Press the toggle buttons to change overrides"); - policy->addItem(label, 0, 1); - label->setObjectName("label"); - label->setAlignment(Qt::AlignCenter); - - muteButton = new MButton(page->centralWidget()); - muteButton->setText("Mute"); - muteButton->setViewType(MButton::toggleType); - muteButton->setCheckable(true); - policy->addItem(muteButton, 1, 0); - muteButton->setObjectName("button"); - - privacyButton = new MButton(page->centralWidget()); - privacyButton->setText("Privacy"); - privacyButton->setViewType(MButton::toggleType); - privacyButton->setCheckable(true); - policy->addItem(privacyButton, 1, 1); - privacyButton->setObjectName("button"); - - btButton = new MButton(page->centralWidget()); - btButton->setText("BT"); - btButton->setViewType(MButton::toggleType); - btButton->setCheckable(true); - policy->addItem(btButton, 1, 2); - btButton->setObjectName("button"); - - page->centralWidget()->setLayout(layout); - - mute = ResourcePolicy::createMute(this); - privacyOverride = ResourcePolicy::createPrivacyOverride(this); - btOverride = ResourcePolicy::createBluetoothOVerride(this); - - QObject::connect(mute, SIGNAL(changed(bool)), this, SLOT(handleMuteChange(bool))); - QObject::connect(muteButton, SIGNAL(toggled(bool)), mute, SLOT(request(bool))); - - QObject::connect(privacyOverride, SIGNAL(changed(bool)), this, SLOT(handlePrivacyChange(bool))); - QObject::connect(privacyButton, SIGNAL(toggled(bool)), privacyOverride, SLOT(request(bool))); - - QObject::connect(btOverride, SIGNAL(changed(bool)), this, SLOT(handleBtChange(bool))); - QObject::connect(btButton, SIGNAL(toggled(bool)), btOverride, SLOT(request(bool))); - -} - -MediaOverrider::~MediaOverrider() -{} - -int MediaOverrider::run() -{ - page->appear(); - window->show(); - - return app.exec(); -} - -void MediaOverrider::handleMuteChange(bool newState) -{ - muteButton->setChecked(newState); -} - -void MediaOverrider::handlePrivacyChange(bool newState) -{ - privacyButton->setChecked(newState); -} - -void MediaOverrider::handleBtChange(bool newState) -{ - btButton->setChecked(newState); -} - diff --git a/mediaoverrider/mediaoverrider.desktop b/mediaoverrider/mediaoverrider.desktop deleted file mode 100644 index b257a5e..0000000 --- a/mediaoverrider/mediaoverrider.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Policy Media Overrider -Icon=icon-l-music -Exec=/usr/bin/mediaoverrider -OnlyShowIn=X-MeeGo; - diff --git a/mediaoverrider/mediaoverrider.h b/mediaoverrider/mediaoverrider.h deleted file mode 100644 index 052a7e0..0000000 --- a/mediaoverrider/mediaoverrider.h +++ /dev/null @@ -1,38 +0,0 @@ -#include <MApplication> -#include <MApplicationWindow> -#include <MApplicationPage> -#include <MButton> -#include <MLabel> -#include <MGridLayoutPolicy> -#include <MLayout> -#include <MTheme> - -#include <override.h> - -class MediaOverrider: public QObject -{ - Q_OBJECT -public: - MediaOverrider(int argc, char **argv, QObject *parent=NULL); - ~MediaOverrider(); - int run(); -private slots: - void handleMuteChange(bool newState); - void handlePrivacyChange(bool newState); - void handleBtChange(bool newState); - -private: - MApplication app; - ResourcePolicy::Override *mute; - ResourcePolicy::Override *privacyOverride; - ResourcePolicy::Override *btOverride; - - MApplicationWindow *window; - MApplicationPage *page; - MLayout *layout; - MGridLayoutPolicy *policy; - MButton *muteButton; - MButton *privacyButton; - MButton *btButton; -}; - diff --git a/mediaoverrider/mediaoverrider.pro b/mediaoverrider/mediaoverrider.pro deleted file mode 100644 index e74679a..0000000 --- a/mediaoverrider/mediaoverrider.pro +++ /dev/null @@ -1,28 +0,0 @@ -include(../common.pri) - -TEMPLATE = app -TARGET = mediaoverrider -MOC_DIR = moc -OBJECTS_DIR = build -DEPENDPATH += . -INCLUDEPATH += $${LIBMEDIAOVERRIDESQT} -CONFIG += qt meegotouch -QT += dbus - -LIBS += -L$${LIBMEDIAOVERRIDESQT}/build -lmediaoverridesqt - -# Input -HEADERS += mediaoverrider.h -SOURCES += main.cpp mediaoverrider.cpp - -QMAKE_DISTCLEAN += -r moc build - -# Install options - -target.path = /usr/bin/ - -desktop.path = /usr/share/applications/ -desktop.files = mediaoverrider.desktop - -INSTALLS = target desktop - diff --git a/tests/test-security-with-aegis-token/test-security-with-aegis-token.pro b/tests/test-security-with-aegis-token/test-security-with-aegis-token.pro deleted file mode 100644 index 3a19ddf..0000000 --- a/tests/test-security-with-aegis-token/test-security-with-aegis-token.pro +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################## -# This file is part of libresourceqt # -# # -# Copyright (C) 2010 Nokia Corporation. # -# # -# This library is free software; you can redistribute # -# it and/or modify it under the terms of the GNU Lesser General Public # -# License as published by the Free Software Foundation # -# version 2.1 of the License. # -# # -# This library is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # -# Lesser General Public License for more details. # -# # -# You should have received a copy of the GNU Lesser General Public # -# License along with this library; if not, write to the Free Software # -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 # -# USA. # -############################################################################## - -include(../../common.pri) -TEMPLATE = app -TARGET = test-security-with-aegis-token -QT = testlib core -CONFIG -= app_bundle -DEPENDPATH += $${POLICY} $${BASE}/src . -INCLUDEPATH += $${LIBRESOURCEQT}/src $${LIBRESOURCEQT}/include $${LIBRESOURCEINC} $${LIBDBUSQEVENTLOOP} - -# Input -SOURCES += test-security.cpp - -LIBS += -L$${LIBDBUSQEVENTLOOP}/build -L$${LIBRESOURCEQT}/build -ldbus-qeventloop -lresourceqt - -# Install options -target.path = /usr/lib/libresourceqt-tests/ -#target.files = test-security-with-aegis-token - -INSTALLS = target diff --git a/tests/test-security-with-aegis-token/test-security.cpp b/tests/test-security-with-aegis-token/test-security.cpp deleted file mode 100644 index 16eedd5..0000000 --- a/tests/test-security-with-aegis-token/test-security.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************* -This file is part of libresourceqt - -Copyright (C) 2010 Nokia Corporation. - -This library is free software; you can redistribute -it and/or modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation -version 2.1 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -USA. -*************************************************************************/ - - - -#include "qt4/policy/resource-set.h" -#include <cstdio> -#include <cstdlib> -#include <QCoreApplication> - -using namespace ResourcePolicy; - -class TestSecurity: public QObject -{ - Q_OBJECT - -public: - void testSecurity() { - - ResourceSet *resourceSet = new ResourceSet("call", this); - resourceSet->addResource(ResourcePolicy::AudioRecorderType); - - connect(resourceSet, SIGNAL(resourcesGranted(const QList<ResourcePolicy::ResourceType>&)), - this, SLOT(resourceAcquiredHandler(const QList<ResourcePolicy::ResourceType>&))); - - connect(resourceSet, SIGNAL(errorCallback(quint32, const char*)), this, SLOT(errorCallback(quint32, const char*))); - - resourceSet->acquire(); - } - -private slots: - void resourceAcquiredHandler(const QList<ResourcePolicy::ResourceType>& /*grantedOptionalResList*/) { - printf(">>> resource acquired\n"); - exit(0); - } - - void errorCallback(quint32 code, const char* message) { - printf(">>> error %u, %s\n", code, message); - exit(1); - } -}; - -int main(int argc, char* argv[]) { - QCoreApplication app(argc, argv); - - TestSecurity *test = new TestSecurity(); - test->testSecurity(); - - return app.exec(); -} - -#include "test-security.moc" diff --git a/tests/test-security-without-aegis-token/test-security-without-aegis-token.pro b/tests/test-security-without-aegis-token/test-security-without-aegis-token.pro deleted file mode 100644 index 8066c88..0000000 --- a/tests/test-security-without-aegis-token/test-security-without-aegis-token.pro +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# This file is part of libresourceqt # -# # -# Copyright (C) 2010 Nokia Corporation. # -# # -# This library is free software; you can redistribute # -# it and/or modify it under the terms of the GNU Lesser General Public # -# License as published by the Free Software Foundation # -# version 2.1 of the License. # -# # -# This library is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # -# Lesser General Public License for more details. # -# # -# You should have received a copy of the GNU Lesser General Public # -# License along with this library; if not, write to the Free Software # -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 # -# USA. # -############################################################################## - -include(../../common.pri) -TEMPLATE = app -TARGET = test-security-without-aegis-token -QT = testlib core -CONFIG -= app_bundle -DEPENDPATH += $${POLICY} $${BASE}/src . -INCLUDEPATH += $${LIBRESOURCEQT}/src $${LIBRESOURCEQT}/include $${LIBRESOURCEINC} $${LIBDBUSQEVENTLOOP} - -# Input -SOURCES += test-security.cpp - -LIBS += -L$${LIBDBUSQEVENTLOOP}/build -L$${LIBRESOURCEQT}/build -ldbus-qeventloop -lresourceqt - -# Install options -# Install options -target.path = /usr/lib/libresourceqt-tests/ -#target.files = test-security-without-aegis-token - -INSTALLS = target - diff --git a/tests/test-security-without-aegis-token/test-security.cpp b/tests/test-security-without-aegis-token/test-security.cpp deleted file mode 100644 index 16eedd5..0000000 --- a/tests/test-security-without-aegis-token/test-security.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************* -This file is part of libresourceqt - -Copyright (C) 2010 Nokia Corporation. - -This library is free software; you can redistribute -it and/or modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation -version 2.1 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -USA. -*************************************************************************/ - - - -#include "qt4/policy/resource-set.h" -#include <cstdio> -#include <cstdlib> -#include <QCoreApplication> - -using namespace ResourcePolicy; - -class TestSecurity: public QObject -{ - Q_OBJECT - -public: - void testSecurity() { - - ResourceSet *resourceSet = new ResourceSet("call", this); - resourceSet->addResource(ResourcePolicy::AudioRecorderType); - - connect(resourceSet, SIGNAL(resourcesGranted(const QList<ResourcePolicy::ResourceType>&)), - this, SLOT(resourceAcquiredHandler(const QList<ResourcePolicy::ResourceType>&))); - - connect(resourceSet, SIGNAL(errorCallback(quint32, const char*)), this, SLOT(errorCallback(quint32, const char*))); - - resourceSet->acquire(); - } - -private slots: - void resourceAcquiredHandler(const QList<ResourcePolicy::ResourceType>& /*grantedOptionalResList*/) { - printf(">>> resource acquired\n"); - exit(0); - } - - void errorCallback(quint32 code, const char* message) { - printf(">>> error %u, %s\n", code, message); - exit(1); - } -}; - -int main(int argc, char* argv[]) { - QCoreApplication app(argc, argv); - - TestSecurity *test = new TestSecurity(); - test->testSecurity(); - - return app.exec(); -} - -#include "test-security.moc" diff --git a/tests/tests.pro b/tests/tests.pro index 5c3bac1..b0797ed 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -26,9 +26,7 @@ SUBDIRS = test-dbus-qeventloop \ test-dbus-pong \ test-resource \ test-resource-set \ - test-resource-engine \ - test-security-with-aegis-token \ - test-security-without-aegis-token + test-resource-engine # Install options testsxml.path = /usr/share/libresourceqt-tests/ |