From adef09cd6fe65fa0f8a713f566bddb7d26ee80fb Mon Sep 17 00:00:00 2001 From: John Brooks Date: Wed, 10 Apr 2013 02:26:36 -0600 Subject: [PATCH] [mapplauncherd] Remove Qt boosters and related tests These have been split to a separate repository and package. --- CMakeLists.txt | 7 - .../features/qdeclarative-boostable.prf | 5 - data/mkspecs/features/qt-boostable.prf | 5 - data/pkgconfig/qdeclarative-boostable.pc | 6 - data/pkgconfig/qt-boostable.pc | 5 - rpm/mapplauncherd.spec | 39 +-- rpm/mapplauncherd.yaml | 37 +-- src/CMakeLists.txt | 6 - src/qdeclarativebooster/CMakeLists.txt | 42 --- src/qdeclarativebooster/MDeclarativeCache | 2 - .../README-QDECLARATIVEBOOSTER | 256 ----------------- src/qdeclarativebooster/eventhandler.cpp | 120 -------- src/qdeclarativebooster/eventhandler.h | 63 ----- src/qdeclarativebooster/mdeclarativecache.cpp | 263 ------------------ src/qdeclarativebooster/mdeclarativecache.h | 96 ------- src/qdeclarativebooster/mdeclarativecache_p.h | 61 ---- src/qdeclarativebooster/pluginfactory.cpp | 45 --- .../qdeclarativebooster.cpp | 112 -------- src/qdeclarativebooster/qdeclarativebooster.h | 98 ------- .../testabilityinterface.h | 41 --- src/qtbooster/CMakeLists.txt | 27 -- src/qtbooster/pluginfactory.cpp | 45 --- src/qtbooster/qtbooster.cpp | 53 ---- src/qtbooster/qtbooster.h | 88 ------ tests/CMakeLists.txt | 25 -- .../common/testapps/fala_dbus/CMakeLists.txt | 33 --- tests/common/testapps/fala_dbus/fala_dbus.cpp | 40 --- .../fala_qml_helloworld/CMakeLists.txt | 42 --- .../fala_qml_helloworld/fala_qml_wl.desktop | 7 - .../fala_qml_helloworld/fala_qml_wol.desktop | 7 - .../testapps/fala_qml_helloworld/main.cpp | 144 ---------- .../testapps/fala_qml_helloworld/main.qml | 12 - .../testapps/fala_qml_helloworld/main.qrc | 5 - .../scripts/create_links.cmake | 4 - .../testapps/fala_status/CMakeLists.txt | 22 -- .../testapps/fala_status/fala_status.cpp | 10 +- .../common/testapps/fala_wait/CMakeLists.txt | 21 -- tests/common/testapps/fala_wait/fala_wait.cpp | 10 +- .../testapps/fala_windowless/CMakeLists.txt | 30 -- .../fala_windowless/fala_windowless.cpp | 26 -- .../common/testapps/focustest/CMakeLists.txt | 4 - tests/common/testapps/focustest/fala_focus | 18 -- tests/common/testapps/focustest/view.qml | 12 - tests/common/testapps/testapp/CMakeLists.txt | 34 --- .../testapp/com.nokia.fala_testapp.service | 4 - .../testapp/com.nokia.fala_wl.service | 3 - .../testapp/com.nokia.fala_wol.service | 3 - tests/common/testapps/testapp/fala_wl.desktop | 7 - .../common/testapps/testapp/fala_wol.desktop | 7 - .../testapps/testapp/images/landscape.jpg | Bin 10190 -> 0 bytes .../testapps/testapp/images/portrait.jpg | Bin 6104 -> 0 bytes tests/common/testapps/testapp/main.cpp | 102 ------- .../common/testapps/xsendevent/CMakeLists.txt | 9 - tests/common/testapps/xsendevent/README | 10 - tests/common/testapps/xsendevent/main.cpp | 90 ------ tests/common/unittests/CMakeLists.txt | 9 +- tests/common/unittests/tests.xml | 8 - .../unittests/ut_dbooster/CMakeLists.txt | 31 --- .../unittests/ut_dbooster/ut_dbooster.cpp | 81 ------ .../unittests/ut_dbooster/ut_dbooster.h | 53 ---- .../unittests/ut_qtbooster/CMakeLists.txt | 27 -- .../unittests/ut_qtbooster/ut_qtbooster.cpp | 56 ---- .../unittests/ut_qtbooster/ut_qtbooster.h | 51 ---- 63 files changed, 20 insertions(+), 2559 deletions(-) delete mode 100644 data/mkspecs/features/qdeclarative-boostable.prf delete mode 100644 data/mkspecs/features/qt-boostable.prf delete mode 100644 data/pkgconfig/qdeclarative-boostable.pc delete mode 100644 data/pkgconfig/qt-boostable.pc delete mode 100644 src/qdeclarativebooster/CMakeLists.txt delete mode 100644 src/qdeclarativebooster/MDeclarativeCache delete mode 100644 src/qdeclarativebooster/README-QDECLARATIVEBOOSTER delete mode 100644 src/qdeclarativebooster/eventhandler.cpp delete mode 100644 src/qdeclarativebooster/eventhandler.h delete mode 100644 src/qdeclarativebooster/mdeclarativecache.cpp delete mode 100644 src/qdeclarativebooster/mdeclarativecache.h delete mode 100644 src/qdeclarativebooster/mdeclarativecache_p.h delete mode 100644 src/qdeclarativebooster/pluginfactory.cpp delete mode 100644 src/qdeclarativebooster/qdeclarativebooster.cpp delete mode 100644 src/qdeclarativebooster/qdeclarativebooster.h delete mode 100644 src/qdeclarativebooster/testabilityinterface.h delete mode 100644 src/qtbooster/CMakeLists.txt delete mode 100644 src/qtbooster/pluginfactory.cpp delete mode 100644 src/qtbooster/qtbooster.cpp delete mode 100644 src/qtbooster/qtbooster.h delete mode 100644 tests/common/testapps/fala_dbus/CMakeLists.txt delete mode 100644 tests/common/testapps/fala_dbus/fala_dbus.cpp delete mode 100644 tests/common/testapps/fala_qml_helloworld/CMakeLists.txt delete mode 100644 tests/common/testapps/fala_qml_helloworld/fala_qml_wl.desktop delete mode 100644 tests/common/testapps/fala_qml_helloworld/fala_qml_wol.desktop delete mode 100644 tests/common/testapps/fala_qml_helloworld/main.cpp delete mode 100644 tests/common/testapps/fala_qml_helloworld/main.qml delete mode 100644 tests/common/testapps/fala_qml_helloworld/main.qrc delete mode 100644 tests/common/testapps/fala_qml_helloworld/scripts/create_links.cmake delete mode 100644 tests/common/testapps/fala_windowless/CMakeLists.txt delete mode 100644 tests/common/testapps/fala_windowless/fala_windowless.cpp delete mode 100644 tests/common/testapps/focustest/CMakeLists.txt delete mode 100755 tests/common/testapps/focustest/fala_focus delete mode 100644 tests/common/testapps/focustest/view.qml delete mode 100644 tests/common/testapps/testapp/CMakeLists.txt delete mode 100644 tests/common/testapps/testapp/com.nokia.fala_testapp.service delete mode 100644 tests/common/testapps/testapp/com.nokia.fala_wl.service delete mode 100644 tests/common/testapps/testapp/com.nokia.fala_wol.service delete mode 100644 tests/common/testapps/testapp/fala_wl.desktop delete mode 100644 tests/common/testapps/testapp/fala_wol.desktop delete mode 100644 tests/common/testapps/testapp/images/landscape.jpg delete mode 100644 tests/common/testapps/testapp/images/portrait.jpg delete mode 100644 tests/common/testapps/testapp/main.cpp delete mode 100644 tests/common/testapps/xsendevent/CMakeLists.txt delete mode 100644 tests/common/testapps/xsendevent/README delete mode 100644 tests/common/testapps/xsendevent/main.cpp delete mode 100644 tests/common/unittests/ut_dbooster/CMakeLists.txt delete mode 100644 tests/common/unittests/ut_dbooster/ut_dbooster.cpp delete mode 100644 tests/common/unittests/ut_dbooster/ut_dbooster.h delete mode 100644 tests/common/unittests/ut_qtbooster/CMakeLists.txt delete mode 100644 tests/common/unittests/ut_qtbooster/ut_qtbooster.cpp delete mode 100644 tests/common/unittests/ut_qtbooster/ut_qtbooster.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 89742fe..863c85b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,10 +75,3 @@ if ($ENV{DEBUG_BUILD}) else ($ENV{DEBUG_BUILD}) install(PROGRAMS src/scripts/applauncherd DESTINATION /usr/bin/) endif ($ENV{DEBUG_BUILD}) - -# Install pkg-config and qmake feature files -install(FILES data/pkgconfig/qt-boostable.pc DESTINATION /usr/lib/pkgconfig) -install(FILES data/mkspecs/features/qt-boostable.prf DESTINATION /usr/share/qt4/mkspecs/features) -install(FILES data/pkgconfig/qdeclarative-boostable.pc DESTINATION /usr/lib/pkgconfig) -install(FILES data/mkspecs/features/qdeclarative-boostable.prf DESTINATION /usr/share/qt4/mkspecs/features) - diff --git a/data/mkspecs/features/qdeclarative-boostable.prf b/data/mkspecs/features/qdeclarative-boostable.prf deleted file mode 100644 index cb346ac..0000000 --- a/data/mkspecs/features/qdeclarative-boostable.prf +++ /dev/null @@ -1,5 +0,0 @@ -# Tell qmake to use pkg-config to get correct compiler and linker -# flags to make an application usable with applauncherd. - -CONFIG += link_pkgconfig -PKGCONFIG += qdeclarative-boostable diff --git a/data/mkspecs/features/qt-boostable.prf b/data/mkspecs/features/qt-boostable.prf deleted file mode 100644 index c7aebf1..0000000 --- a/data/mkspecs/features/qt-boostable.prf +++ /dev/null @@ -1,5 +0,0 @@ -# Tell qmake to use pkg-config to get correct compiler and linker -# flags to make an application usable with applauncherd. - -CONFIG += link_pkgconfig -PKGCONFIG += qt-boostable diff --git a/data/pkgconfig/qdeclarative-boostable.pc b/data/pkgconfig/qdeclarative-boostable.pc deleted file mode 100644 index 15a89fa..0000000 --- a/data/pkgconfig/qdeclarative-boostable.pc +++ /dev/null @@ -1,6 +0,0 @@ -Name: qdeclarative-boostable -Description: make application boostable by applauncherd -Version: 0.2.0 -Libs: -pie -rdynamic -lmdeclarativecache -Cflags: -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -I/usr/include/applauncherd - diff --git a/data/pkgconfig/qt-boostable.pc b/data/pkgconfig/qt-boostable.pc deleted file mode 100644 index 73a4f17..0000000 --- a/data/pkgconfig/qt-boostable.pc +++ /dev/null @@ -1,5 +0,0 @@ -Name: qt-boostable -Description: make application boostable by applauncherd -Version: 0.2.0 -Libs: -pie -rdynamic -Cflags: -fPIC -fvisibility=hidden -fvisibility-inlines-hidden diff --git a/rpm/mapplauncherd.spec b/rpm/mapplauncherd.spec index 3d9b4e4..4260f3e 100644 --- a/rpm/mapplauncherd.spec +++ b/rpm/mapplauncherd.spec @@ -19,16 +19,16 @@ Source1: mapplauncherd.service Source100: mapplauncherd.yaml Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig -BuildRequires: pkgconfig(QtCore) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xtst) BuildRequires: pkgconfig(xextproto) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(systemd) +BuildRequires: pkgconfig(QtCore) +BuildRequires: pkgconfig(QtTest) BuildRequires: cmake BuildRequires: python -BuildRequires: desktop-file-utils Provides: meegotouch-applauncherd > 3.0.3 Obsoletes: meegotouch-applauncherd <= 3.0.3 @@ -109,9 +109,6 @@ mv %{buildroot}/usr/share/applauncherd-tests %{buildroot}/usr/lib rm -f %{buildroot}/usr/share/fala_images/fala_qml_helloworld # << install post -desktop-file-install --delete-original \ - --dir %{buildroot}%{_datadir}/applications \ - %{buildroot}%{_datadir}/applications/*.desktop %post -p /sbin/ldconfig @@ -122,10 +119,6 @@ desktop-file-install --delete-original \ %{_bindir}/invoker %{_libdir}/libapplauncherd.so* %{_libdir}/applauncherd/libebooster.so -%{_libdir}/applauncherd/libqtbooster.so -%{_libdir}/applauncherd/libqdeclarativebooster.so -%{_libdir}/libmdeclarativecache.so.0 -%{_libdir}/libmdeclarativecache.so.0.1 %{_bindir}/applauncherd.bin %{_bindir}/applauncherd %{_bindir}/single-instance @@ -136,37 +129,18 @@ desktop-file-install --delete-original \ %files devel %defattr(-,root,root,-) -%{_libdir}/pkgconfig/qdeclarative-boostable.pc -%{_libdir}/pkgconfig/qt-boostable.pc %{_includedir}/applauncherd/* -%{_datadir}/qt4/mkspecs/features/qt-boostable.prf -%{_datadir}/qt4/mkspecs/features/qdeclarative-boostable.prf -%{_libdir}/libmdeclarativecache.so # >> files devel # << files devel %files testapps %defattr(-,root,root,-) -%{_bindir}/fala_dbus -%{_bindir}/fala_focus %{_bindir}/fala_gettime_ms %{_bindir}/fala_pixelchanged %{_bindir}/fala_status -%{_bindir}/fala_wl -%{_bindir}/fala_wol %{_bindir}/fala_gettime %{_bindir}/fala_windowid -%{_bindir}/fala_qml_helloworld -%{_bindir}/fala_qml_helloworld1 -%{_bindir}/fala_qml_helloworld2 -%{_bindir}/fala_qml_wl -%{_bindir}/fala_qml_wol %{_bindir}/fala_wait -%{_bindir}/fala_windowless -%{_bindir}/xsendevent -%{_datadir}/dbus-1/services/com.nokia.fala_testapp.service -%{_datadir}/fala_images/landscape.jpg -%{_datadir}/fala_images/portrait.jpg # >> files testapps # << files testapps @@ -182,9 +156,7 @@ desktop-file-install --delete-original \ %{_libdir}/applauncherd-tests/ut_daemon %{_libdir}/applauncherd-tests/ut_ebooster %{_libdir}/applauncherd-tests/ut_connection -%{_libdir}/applauncherd-tests/ut_qtbooster %{_libdir}/applauncherd-tests/ut_socketmanager -%{_libdir}/applauncherd-tests/ut_dbooster %{_libdir}/applauncherd-tests/libutplugin.so %{_libdir}/applauncherd-tests/libutwithcreate.so %{_libdir}/applauncherd-tests/libutwithcreatetype.so @@ -218,12 +190,5 @@ desktop-file-install --delete-original \ %{_datadir}/applauncherd-M-testscripts/utils.py %{_datadir}/applauncherd-M-testscripts/utils.pyc %{_datadir}/applauncherd-M-testscripts/utils.pyo -%{_datadir}/applauncherd-testscripts/view.qml -%{_datadir}/applications/fala_wl.desktop -%{_datadir}/applications/fala_wol.desktop -%{_datadir}/applications/fala_qml_wol.desktop -%{_datadir}/applications/fala_qml_wl.desktop -%{_datadir}/dbus-1/services/com.nokia.fala_wl.service -%{_datadir}/dbus-1/services/com.nokia.fala_wol.service # >> files tests # << files tests diff --git a/rpm/mapplauncherd.yaml b/rpm/mapplauncherd.yaml index 20a73f5..daa6866 100644 --- a/rpm/mapplauncherd.yaml +++ b/rpm/mapplauncherd.yaml @@ -14,13 +14,15 @@ Description: | application startup time and share memory. Provides also functionality to launch applications as single instances. PkgConfigBR: - - QtCore - x11 - xtst - xextproto - xi - xext - systemd +# For tests only + - QtCore + - QtTest PkgBR: - cmake - python @@ -33,10 +35,6 @@ Files: - "%{_bindir}/invoker" - "%{_libdir}/libapplauncherd.so*" - "%{_libdir}/applauncherd/libebooster.so" - - "%{_libdir}/applauncherd/libqtbooster.so" - - "%{_libdir}/applauncherd/libqdeclarativebooster.so" - - "%{_libdir}/libmdeclarativecache.so.0" - - "%{_libdir}/libmdeclarativecache.so.0.1" - "%{_bindir}/applauncherd.bin" - "%{_bindir}/applauncherd" - "%{_bindir}/single-instance" @@ -55,12 +53,7 @@ SubPackages: Obsoletes: - meegotouch-applauncherd-devel <= 3.0.3 Files: - - "%{_libdir}/pkgconfig/qdeclarative-boostable.pc" - - "%{_libdir}/pkgconfig/qt-boostable.pc" - "%{_includedir}/applauncherd/*" - - "%{_datadir}/qt4/mkspecs/features/qt-boostable.prf" - - "%{_datadir}/qt4/mkspecs/features/qdeclarative-boostable.prf" - - "%{_libdir}/libmdeclarativecache.so" - Name: testapps Group: Development/Tools @@ -68,27 +61,12 @@ SubPackages: Description: | Test applications used for testing mapplauncherd. Files: - - "%{_bindir}/fala_dbus" - - "%{_bindir}/fala_focus" - "%{_bindir}/fala_gettime_ms" - "%{_bindir}/fala_pixelchanged" - "%{_bindir}/fala_status" - - "%{_bindir}/fala_wl" - - "%{_bindir}/fala_wol" - "%{_bindir}/fala_gettime" - "%{_bindir}/fala_windowid" - - "%{_bindir}/fala_qml_helloworld" - - "%{_bindir}/fala_qml_helloworld1" - - "%{_bindir}/fala_qml_helloworld2" - - "%{_bindir}/fala_qml_wl" - - "%{_bindir}/fala_qml_wol" - "%{_bindir}/fala_wait" - - "%{_bindir}/fala_windowless" - - "%{_bindir}/xsendevent" - - "%{_datadir}/dbus-1/services/com.nokia.fala_testapp.service" - - "%{_datadir}/fala_images/landscape.jpg" - - "%{_datadir}/fala_images/portrait.jpg" - - Name: tests Group: Development/Tools @@ -108,9 +86,7 @@ SubPackages: - "%{_libdir}/applauncherd-tests/ut_daemon" - "%{_libdir}/applauncherd-tests/ut_ebooster" - "%{_libdir}/applauncherd-tests/ut_connection" - - "%{_libdir}/applauncherd-tests/ut_qtbooster" - "%{_libdir}/applauncherd-tests/ut_socketmanager" - - "%{_libdir}/applauncherd-tests/ut_dbooster" - "%{_libdir}/applauncherd-tests/libutplugin.so" - "%{_libdir}/applauncherd-tests/libutwithcreate.so" - "%{_libdir}/applauncherd-tests/libutwithcreatetype.so" @@ -144,10 +120,3 @@ SubPackages: - "%{_datadir}/applauncherd-M-testscripts/utils.py" - "%{_datadir}/applauncherd-M-testscripts/utils.pyc" - "%{_datadir}/applauncherd-M-testscripts/utils.pyo" - - "%{_datadir}/applauncherd-testscripts/view.qml" - - "%{_datadir}/applications/fala_wl.desktop" - - "%{_datadir}/applications/fala_wol.desktop" - - "%{_datadir}/applications/fala_qml_wol.desktop" - - "%{_datadir}/applications/fala_qml_wl.desktop" - - "%{_datadir}/dbus-1/services/com.nokia.fala_wl.service" - - "%{_datadir}/dbus-1/services/com.nokia.fala_wol.service" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 11d469e..73b0a72 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,12 +10,6 @@ add_subdirectory(launcherlib) # Sub build: ebooster plugin add_subdirectory(ebooster) -# Sub build: qtbooster plugin -add_subdirectory(qtbooster) - -# Sub build: qdeclarativebooster plugin -add_subdirectory(qdeclarativebooster) - # Sub build: single-instance binary / library add_subdirectory(single-instance) diff --git a/src/qdeclarativebooster/CMakeLists.txt b/src/qdeclarativebooster/CMakeLists.txt deleted file mode 100644 index f604405..0000000 --- a/src/qdeclarativebooster/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -include(FindX11) - -# Find Qt4 -find_package(Qt4 4.6.0 REQUIRED) -include(${QT_USE_FILE}) -if (${QTVERSION} VERSION_LESS 4.6.0) - message(FATAL_ERROR "You need Qt4.6, found ${QTVERSION}.") -endif (${QTVERSION} VERSION_LESS 4.6.0) - -set(LAUNCHER "${CMAKE_HOME_DIRECTORY}/src/launcherlib") - -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${LAUNCHER} "${CMAKE_HOME_DIRECTORY}/src/common") - -# Set sources -set(PLUGINSRC qdeclarativebooster.cpp pluginfactory.cpp) - -set(LIBSRC mdeclarativecache.cpp mdeclarativecache.h mdeclarativecache_p.h eventhandler.cpp eventhandler.h) -set(MOC_HDRS eventhandler.h) -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) - -# Set executables -add_library(mdeclarativecache SHARED ${LIBSRC} ${MOC_SRC}) -set_target_properties(mdeclarativecache PROPERTIES - VERSION 0.1 SOVERSION 0) -if ($ENV{HARMATTAN}) - set_target_properties(mdeclarativecache PROPERTIES COMPILE_FLAGS -DHAVE_PATH_REINIT) -endif ($ENV{HARMATTAN}) -target_link_libraries(mdeclarativecache ${LIBDL} ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTGUI_LIBRARY} ${X11_LIBRARIES} "-L../launcherlib -lapplauncherd") -add_dependencies(mdeclarativecache applauncherd) - -add_library(qdeclarativebooster MODULE ${PLUGINSRC}) -set_target_properties(qdeclarativebooster PROPERTIES - COMPILE_FLAGS -fvisibility=hidden) -target_link_libraries(qdeclarativebooster ${LIBDL} "-L. -lmdeclarativecache -L../launcherlib -lapplauncherd") -add_dependencies(qdeclarativebooster applauncherd mdeclarativecache) - -# Add install rule -install(TARGETS qdeclarativebooster DESTINATION /usr/lib/applauncherd/) -install(TARGETS mdeclarativecache DESTINATION /usr/lib) -install(FILES mdeclarativecache.h MDeclarativeCache eventhandler.h DESTINATION /usr/include/applauncherd - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) - diff --git a/src/qdeclarativebooster/MDeclarativeCache b/src/qdeclarativebooster/MDeclarativeCache deleted file mode 100644 index be9d09a..0000000 --- a/src/qdeclarativebooster/MDeclarativeCache +++ /dev/null @@ -1,2 +0,0 @@ -#include "mdeclarativecache.h" - diff --git a/src/qdeclarativebooster/README-QDECLARATIVEBOOSTER b/src/qdeclarativebooster/README-QDECLARATIVEBOOSTER deleted file mode 100644 index fe78612..0000000 --- a/src/qdeclarativebooster/README-QDECLARATIVEBOOSTER +++ /dev/null @@ -1,256 +0,0 @@ -This File -========= - -This document describes how to use to speed up QML application startup -in Harmattan/MeeGo using the applauncherd daemon and the qdeclarative booster. - -For a more general description of the launcher concept and technical -details, see the README file in the meegotouch-applauncherd source -tree. - -1. COMPILING YOUR APPLICATION TO BE LAUNCHABLE - -Binaries intended to be run with applauncherd should be compiled with -fPIC option -to produce position independent code. In order to produce a position independent -executable, -pie option and -rdynamic options can be used in linking. This allows -the result to be executed both traditionally and with the launcher. - -To improve linking and loading times of shared object libraries it is -encouraged to hide any unnecessary symbols from the resulting binary by using --fvisibility=hidden and -fvisibility-inlines-hidden flags as well. - - -1.1 Build configuration - -These instructions describe how to build your application so that it -can be launched using applauncherd. Only Debian packaging is considered, -you have to creatively apply the instructions if you are doing RPM packaging. - - Using QMake - ----------- - - If you are using QMake, making your application boostable is just a - matter of adding a suitable configuration option. - - For Qt Declarative (QML) applications, the configuration option is - provided by the applauncherd-dev package. If you are building a - Debian package, you have to add a build dependency to - applauncherd-dev. The configuration option is: - - CONFIG += qdeclarative-boostable - - If you want to use pkg-config directly for some reason (like getting - error messages), you can add explicit pkg-config calls in the appropriate - flags: - - QMAKE_CXXFLAGS += `pkg-config --cflags qdeclarative-boostable` - QMAKE_LFLAGS += `pkg-config --libs qdeclarative-boostable` - - You can also manually set the options in your .pro file like this: - - QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden - QMAKE_LFLAGS += -pie -rdynamic - - Note that you have to update the flags manually if there are any changes in - the required flags. - - Using CMake - --------------------------- - - You can utilize pkg-config in CMake by including FindPkgConfig in CMakeLists.txt: - - include(FindPkgConfig) - - To get Debian packages built correctly, make the package - build-depend on applauncherd-dev. To obtain the compiler and linker - flags, add the following lines in CMakeLists.txt: - - pkg_check_modules(QDECLARATIVE_BOOSTABLE REQUIRED qdeclarative-boostable) - add_definitions(${QDECLARATIVE_BOOSTABLE_CFLAGS}) - link_libraries(${QDECLARATIVE_BOOSTABLE_LDFLAGS}) - - If you do not want to use pkg-config for some reason, you can manually add the - compiler and linker flags like this: - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fvisibility=hidden - -fvisibility-inlines-hidden") - set(CMAKE_EXE_LINKER_FLAGS "-pie -rdynamic") - - Again, this requires you to update the flags if something changes. - - Automatic settings with pkg-config (any build system) - ----------------------------------------------------- - - To get Debian packages built correctly, make the package - build-depend on applauncherd-dev. The correct flags can be - automatically obtained with: - - pkg-config --cflags qdeclarative-boostable - pkg-config --libs qdeclarative-boostable - -1.3 Changes to the code - -With -fvisibility=hidden you must make sure that the symbol for main() is -exported, because otherwise the launcher is not able to find the entry point -for your application. This can be done like this: - - #include - - Q_DECL_EXPORT int main(int argc, char **argv) - { - ... - } - -The application cannot directly instantiate QApplication and -QDeclarativeView. Instead of writing e.g. - - QApplication app; - QDeclarativeView view; - -you need to pick up instances of QApplication and QDeclarativeView from a cache: - - QApplication *app = MDeclarativeCache::qApplication(argc, argv); - QDeclarativeView *window = MDeclarativeCache::qDeclarativeView(); - -The ownership of the instances is currently transferred from the cache to the -application code, but this is subject to change if there is a need to align -the API with Symbian. - -If you plan to use QCoreApplication::applicationDirPath() or -QCoreApplication::applicationFilePath(), please see KNOWN ISSUES below. - -2. LAUNCHING YOUR APPLICATION USING INVOKER - -The application to be launched must be "invoked" using the invoker binary. The -invoker then sends the application data, essentially arguments and environment -variables, to the launcher daemon via a socket connection. The launched -application will see its real binary name in its argv[0]. - -2.1 Launch from the command-line - -Use --type=d for Qt Declarative applications: - - /usr/bin/invoker --type=d - -2.2 D-Bus launch - -If you are using D-Bus to launch your application, it can be done -straightly in the .service-file and without any wrapper scripts slowing -things down: - - [D-BUS Service] - Name=com.nokia. - Exec=/usr/bin/invoker --type=d /usr/bin/ - -By default, invoker waits for the application to terminate and exits with -the same exit code. Unix signals are also forwarded. - -Note 1: If --no-wait and --delay is used, it is important to add enough delay to -invoker so that it won't exit before the launched application gets its -(possible) D-Bus service registered. Otherwise D-Bus daemon may think that the -application just died. - -Note 2: There is a slight difference in the application start-up time if you use a -wrapper script instead of the actual binary in Exec-field of .desktop and .service files. -Therefore, it is recommended that you always use the actual invoker call with the -binary name as presented above. - -Note 3: When .desktop file contains the X-Maemo-Service field, the application -is started by default through D-Bus. This might cause some delay for -application start-up time. Therefore it is recommended to use the single -instance launch functionality (see below) instead of a X-Maemo-Service if -possible - -See invoker --help for all possible command-line parameters. - -2.3 Single instance launch - -Usually user wants the application to be run as a single instance. This means, -that if the launched application is already running, the existing application -window is activated and no new application processes are started. - -This can be achieved by adding --single-instance to the invoker command: - - [D-BUS Service] - Name=com.nokia. - Exec=/usr/bin/invoker --single-instance --type=d /usr/bin/ - -As a result, a lock file $HOME/.single-instance-locks//instance.lock -is created. If applauncherd cannot acquire the lock, it tries to find the -corresponding window and activates it. - -This functionality is implemented in a position-independent executable called -single-instance. Applauncherd uses the executable as a library, but it can be -used as an ordinary program to start anything as a single instance: - - /usr/bin/single-instance - -Note, that in this case the launcher is not used. - -Consider using --single-instance instead of the single instance functionality -provided by D-Bus, because it very likely is much faster. - -2.4 Splash screen - -Applauncherd supports showing a splash screen if there is mcompositor -(the MeeGo window manager) running. - -The splash screen is not shown by default. If an application wants it -to be shown, it must pass --splash, and optionally --splash-landscape -arguments to the invoker. - -For instance, - -/usr/bin/invoker --splash=/usr/share/application_name/splash.jpg \ - --splash-landscape=/usr/share/application_name/splash-l.jpg \ - --type=d \ - /usr/bin/application_name - -shows the splash screen with splash.jpg as its content when the device -is in the portrait orientation. Otherwise splash-l.jpg is shown. If -only --splash is given, that image is shown in both orientations. - -Invoker passes the splash request to the booster. The booster sends -the splash request to the window manager by setting a window property -to window manager's window. - -If the filenames do not include absolute paths, the window manager -looks for the files from a default location. - -3. PACKAGE DEPENDENCIES - -Applications using the launcher must depend on the applauncherd Debian package. - - -4. CURRENT KNOWN ISSUES - -4.1 Forking - -Using QApplication or QDeclarativeView fetched from the cache in a child -process does not work, because they would share the X11 connection with the -parent. - -4.2 Non-working QCoreApplication methods - -The following methods of QCoreApplication are known not to work with -qdeclarative booster: - - QCoreApplication::applicationDirPath() - QCoreApplication::applicationFilePath() - -The reason for this that the methods get the path from the /proc file system, -so they return the path to the booster rather than the path to the launched -application. This is unlikely to be fixed for Qt 4.7. - -The MDeclarativeCache class provides the replacements -MDeclarativeCache::applicationDirPath() and -MDeclarativeCache::applicationFilePath(), which are identical to the -QCoreApplication counterparts, except that in the boosted case they use argv[0] -of the boosted application. - -5. COMMAND-LINE PARAMETERS - -All parameters are listed by: - -invoker --help -applauncherd --help diff --git a/src/qdeclarativebooster/eventhandler.cpp b/src/qdeclarativebooster/eventhandler.cpp deleted file mode 100644 index 4ea8d0e..0000000 --- a/src/qdeclarativebooster/eventhandler.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include - -#include "eventhandler.h" -#include "connection.h" -#include "logger.h" -#include "booster.h" -#include - -int EventHandler::m_sighupFd[2]; -struct sigaction EventHandler::m_oldSigAction; - -EventHandler::EventHandler(Booster* parent) - : m_parent(parent) -{ - m_sighupFd[0] = -1; - m_sighupFd[1] = -1; -} - -EventHandler::~EventHandler() -{ - if (m_sighupFd[0] != -1) - ::close(m_sighupFd[0]); - - if (m_sighupFd[1] != -1) - ::close(m_sighupFd[1]); -} - -void EventHandler::runEventLoop() -{ - // Exit from event loop when invoker is ready to connect - connect(this, SIGNAL(connectionAccepted()), QApplication::instance(), SLOT(quit())); - connect(this, SIGNAL(connectionRejected()), QApplication::instance(), SLOT(quit())); - - // Start another thread to listen connection from invoker - QtConcurrent::run(this, &EventHandler::accept); - - // Create socket pair for SIGHUP - bool handlerIsSet = false; - if (::socketpair(AF_UNIX, SOCK_STREAM, 0, m_sighupFd)) - { - Logger::logError("EventHandler: Couldn't create HUP socketpair"); - } - else - { - // Install signal handler e.g. to exit cleanly if launcher dies. - // This is a problem because MBooster runs a Qt event loop. - EventHandler::setupUnixSignalHandlers(); - - // Install a socket notifier on the socket - connect(new QSocketNotifier(m_sighupFd[1], QSocketNotifier::Read, this), - SIGNAL(activated(int)), this, SLOT(handleSigHup())); - - handlerIsSet = true; - } - - // Run event loop so application instance can receive notifications - QApplication::exec(); - - // Restore signal handlers to previous values - if (handlerIsSet) - { - restoreUnixSignalHandlers(); - } -} - -void EventHandler::accept() -{ - if (m_parent->connection()->accept(m_parent->appData())) - { - emit connectionAccepted(); - } - else - { - emit connectionRejected(); - } -} - -// -// All this signal handling code is taken from Qt's Best Practices: -// http://doc.qt.nokia.com/latest/unix-signals.html -// - -void EventHandler::hupSignalHandler(int) -{ - char a = 1; - ::write(m_sighupFd[0], &a, sizeof(a)); -} - -void EventHandler::handleSigHup() -{ - QApplication::quit(); - _exit(EXIT_SUCCESS); -} - -bool EventHandler::setupUnixSignalHandlers() -{ - struct sigaction hup; - - hup.sa_handler = hupSignalHandler; - sigemptyset(&hup.sa_mask); - hup.sa_flags = SA_RESTART; - - if (sigaction(SIGHUP, &hup, &m_oldSigAction) > 0) - { - return false; - } - - return true; -} - -bool EventHandler::restoreUnixSignalHandlers() -{ - if (sigaction(SIGHUP, &m_oldSigAction, 0) > 0) - { - return false; - } - - return true; -} diff --git a/src/qdeclarativebooster/eventhandler.h b/src/qdeclarativebooster/eventhandler.h deleted file mode 100644 index 8446b77..0000000 --- a/src/qdeclarativebooster/eventhandler.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef EVENTHANDLER_H -#define EVENTHANDLER_H - -#include -#include -#include -#include - -using std::tr1::shared_ptr; - -class Connection; -class Booster; - -class EventHandler : public QObject -{ - Q_OBJECT - -public: - //! \brief Constructor - EventHandler(Booster* parent); - - //! \brief Destructor - virtual ~EventHandler(); - - void runEventLoop(); - - //! UNIX signal handler for SIGHUP - static void hupSignalHandler(int unused); - - //! Setup UNIX signal handlers - static bool setupUnixSignalHandlers(); - - //! Restore UNIX signal handlers to previous values - static bool restoreUnixSignalHandlers(); - -private: - - //! wait for socket connection - void accept(); - - //! Socket pair used to get SIGHUP - static int m_sighupFd[2]; - - //! Socket notifier used for m_sighupFd - shared_ptr m_snHup; - - //! Old sigaction struct - static struct sigaction m_oldSigAction; - - // Parent object - Booster* m_parent; - -private slots: - - //! Qt signal handler for SIGHUP. - void handleSigHup(); - -signals: - void connectionAccepted(); - void connectionRejected(); -}; - -#endif diff --git a/src/qdeclarativebooster/mdeclarativecache.cpp b/src/qdeclarativebooster/mdeclarativecache.cpp deleted file mode 100644 index e8b3787..0000000 --- a/src/qdeclarativebooster/mdeclarativecache.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "mdeclarativecache.h" -#include "mdeclarativecache_p.h" - -#ifdef Q_WS_X11 -#include -#include -#endif - -MDeclarativeCachePrivate * const MDeclarativeCache::d_ptr = new MDeclarativeCachePrivate; -const int MDeclarativeCachePrivate::ARGV_LIMIT = 32; - -MDeclarativeCachePrivate::MDeclarativeCachePrivate() : - qApplicationInstance(0), - qDeclarativeViewInstance(0), - initialArgc(ARGV_LIMIT), - initialArgv(new char* [initialArgc]), - appDirPath(QString()), - appFilePath(QString()), - cachePopulated(false), - testabilityInterface(0) -{ -} - -MDeclarativeCachePrivate::~MDeclarativeCachePrivate() -{ - delete qDeclarativeViewInstance; - delete[] initialArgv; -} - -void MDeclarativeCachePrivate::populate() -{ - // Record the fact that the cache has been populated - cachePopulated = true; - - static const char *const emptyString = ""; - static const QString appNameFormat = "mdeclarativecache_pre_initialized_qapplication-%1"; - static QByteArray appName; - - // Append pid to appName to make it unique. This is required because the - // libminputcontext.so instantiates MComponentData, which in turn registers - // a dbus service with the application's name. - appName = appNameFormat.arg(getpid()).toLatin1(); - - // We support at most ARGV_LIMIT arguments in QCoreApplication. These will be set when real - // arguments are known (in MDeclarativeCachePrivate::qApplication). - initialArgv[0] = const_cast(appName.constData()); - for (int i = 1; i < initialArgc; i++) { - initialArgv[i] = const_cast(emptyString); - } - - if (qApplicationInstance == 0) { - qApplicationInstance = new QApplication(initialArgc, initialArgv); - } - - qDeclarativeViewInstance = new QDeclarativeView(); - -} - -QApplication* MDeclarativeCachePrivate::qApplication(int &argc, char **argv) -{ - if (qApplicationInstance == 0) - { - qApplicationInstance = new QApplication(argc, argv); - } - else - { - if (argc > ARGV_LIMIT) - { - qWarning("MDeclarativeCache: QCoreApplication::arguments() will not contain all arguments."); - } - - // Copy arguments to QCoreApplication - for (int i = 0; i < qMin(argc, ARGV_LIMIT); i++) - { - qApp->argv()[i] = argv[i]; - } - - // This changes argc in QCoreApplication - initialArgc = qMin(argc, ARGV_LIMIT); - - // Take application name from argv - QString appName = QFileInfo(argv[0]).fileName(); - - // Set object name - qApp->setObjectName(appName); - - bool loadTestabilityArg = false; - const char* testabilityArg = "-testability"; - for (int i = 0; i < argc; i++) - { - if (strcmp(argv[i], testabilityArg) == 0) - { - loadTestabilityArg = true; - break; - } - } - - bool loadTestabilityEnv = !qgetenv("QT_LOAD_TESTABILITY").isNull(); - if (loadTestabilityEnv || loadTestabilityArg) - testabilityInit(); - -#ifdef Q_WS_X11 - // Currently QDeclarativeView is "Alien" widget and doesn't have it's XWindow. The procedure below is not needed. - // Call to winId() converts the widget to "Native" and makes it slow. - // If things get changed to use the procedure need to define QDV_USE_NATIVE_WIDGETS - // In this case it should be considered to add XErrorHandler around XSetCommand and XSetClassHint - // because those can generate BadAlloc and BadWindow errors. -#ifdef QDV_USE_NATIVE_WIDGETS - // reinit WM_COMMAND X11 property - if (qDeclarativeViewInstance) - { - Display *display = QX11Info::display(); - if (display) - { - qDeclarativeViewInstance->winId(); - XSetCommand(display, qDeclarativeViewInstance->effectiveWinId(), argv, argc); - - // set correct WM_CLASS properties - QString appClass = appName.left(1).toUpper(); - if (appName.length() > 1) - appClass += appName.right(appName.length() - 1); - - // reserve memory for C strings - QByteArray arrName(appName.toLatin1()); - QByteArray arrClass(appClass.toLatin1()); - - XClassHint class_hint; - class_hint.res_name = arrName.data(); - class_hint.res_class = arrClass.data(); - - XSetClassHint(display, qDeclarativeViewInstance->effectiveWinId(), &class_hint); - } - } -#endif -#endif - if (cachePopulated) - { - // In Qt 4.7, QCoreApplication::applicationDirPath() and - // QCoreApplication::applicationFilePath() look up the paths in /proc, - // which does not work when the booster is used. As a workaround, we - // use argv[0] to provide the correct values in the cache class. - appFilePath = QString(argv[0]); - appDirPath = QString(argv[0]); - appDirPath.chop(appDirPath.size() - appDirPath.lastIndexOf("/")); - } - - } - -#ifdef HAVE_PATH_REINIT - // Set the magic attribute so that paths are reinitialized - qApplicationInstance->setAttribute(Qt::AA_LinuxReinitPathsFromArgv0, true); -#endif - - return qApplicationInstance; -} - -void MDeclarativeCachePrivate::testabilityInit() -{ - // Activate testability plugin if exists - QString testabilityPluginPostfix = ".so"; - QString testabilityPlugin = "testability/libtestability"; - - testabilityPlugin = QLibraryInfo::location(QLibraryInfo::PluginsPath) + QDir::separator() + testabilityPlugin + testabilityPluginPostfix; - QPluginLoader loader(testabilityPlugin.toLatin1().data()); - - QObject *plugin = loader.instance(); - - if (plugin) - { - testabilityInterface = qobject_cast(plugin); - - if (testabilityInterface) - { - testabilityInterface->Initialize(); - } - } -} - - -QDeclarativeView* MDeclarativeCachePrivate::qDeclarativeView() -{ - QDeclarativeView *returnValue = 0; - if (qDeclarativeViewInstance != 0) { - returnValue = qDeclarativeViewInstance; - qDeclarativeViewInstance = 0; - } else { - returnValue = new QDeclarativeView(); - } - - return returnValue; -} - -QString MDeclarativeCachePrivate::applicationDirPath() -{ - if (cachePopulated) { - // In the booster case use the workaround - return appDirPath; - } else { - return QCoreApplication::applicationDirPath(); - } -} - -QString MDeclarativeCachePrivate::applicationFilePath() -{ - if (cachePopulated) { - // In the booster case use the workaround - return appFilePath; - } else { - return QCoreApplication::applicationFilePath(); - } -} - -QDeclarativeView *MDeclarativeCache::populate() -{ - d_ptr->populate(); - return d_ptr->qDeclarativeViewInstance; -} - -QApplication* MDeclarativeCache::qApplication(int &argc, char **argv) -{ - return d_ptr->qApplication(argc, argv); -} - -QDeclarativeView* MDeclarativeCache::qDeclarativeView() -{ - return d_ptr->qDeclarativeView(); -} - -QString MDeclarativeCache::applicationDirPath() -{ - return d_ptr->applicationDirPath(); -} - -QString MDeclarativeCache::applicationFilePath() -{ - return d_ptr->applicationFilePath(); -} diff --git a/src/qdeclarativebooster/mdeclarativecache.h b/src/qdeclarativebooster/mdeclarativecache.h deleted file mode 100644 index f298e32..0000000 --- a/src/qdeclarativebooster/mdeclarativecache.h +++ /dev/null @@ -1,96 +0,0 @@ -/*! -** -** @copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** @license GNU Lesser General Public License version 2.1 -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#ifndef MDECLARATIVECACHE_H -#define MDECLARATIVECACHE_H - -#include - -class MDeclarativeCachePrivate; -class QApplication; -class QDeclarativeView; - -/*! - * \class MDeclarativeCache. - * \brief Cache class for QDeclarativeBooster. - */ -class MDeclarativeCache -{ -public: - - //! Constructor. - MDeclarativeCache() {}; - - //! Destructor. - virtual ~MDeclarativeCache() {}; - - //! Populate cache with QApplication and QDeclarativeView - /*! - * Returns the cached QDeclarativeView instance, which can be used for booster-specific - * initialization. - */ - static QDeclarativeView *populate(); - - //! Returns QApplication instance from cache or creates a new one. - /*! - * Ownership of the returned object is passed to the caller. - * NOTE: This is subject to change. - */ - static QApplication *qApplication(int &argc, char **argv); - - //! Returns QDeclarativeView instance from cache or creates a new one. - /*! - * Ownership of the returned object is passed to the caller. - * NOTE: This is subject to change. - */ - static QDeclarativeView *qDeclarativeView(); - - //! Returns the directory that contains the application executable. - /*! - * This function is deprecated. It used to be a workaround for QApplication::applicationDirPath() - * not working on harmattan with qdeclarativebooster and Qt 4.7, but this has been fixed. - */ - static QString applicationDirPath() __attribute__ ((deprecated)); - - //! Returns the file path of the application executable. - /*! - * This function is deprecated. It used to be a workaround for QApplication::applicationFilePath() - * not working on harmattan with qdeclarativebooster and Qt 4.7, but this has been fixed. - */ - static QString applicationFilePath() __attribute__ ((deprecated)); - -protected: - - static MDeclarativeCachePrivate* const d_ptr; - -private: - - //! Disable copy-constructor - MDeclarativeCache(const MDeclarativeCache & r); - - //! Disable assignment operator - MDeclarativeCache & operator= (const MDeclarativeCache & r); - -#ifdef UNIT_TEST - friend class Ut_MDeclarativeCache; -#endif -}; - -#endif //MDECLARATIVECACHE_H diff --git a/src/qdeclarativebooster/mdeclarativecache_p.h b/src/qdeclarativebooster/mdeclarativecache_p.h deleted file mode 100644 index 0fc97be..0000000 --- a/src/qdeclarativebooster/mdeclarativecache_p.h +++ /dev/null @@ -1,61 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#ifndef MDECLARATIVECACHE_P_H -#define MDECLARATIVECACHE_P_H - -#include -#include "testabilityinterface.h" - -class MDeclarativeCache; -class QApplication; -class QDeclarativeView; - - -class MDeclarativeCachePrivate -{ -public: - MDeclarativeCachePrivate(); - virtual ~MDeclarativeCachePrivate(); - void populate(); - QApplication* qApplication(int &argc, char **argv); - QDeclarativeView* qDeclarativeView(); - QString applicationDirPath(); - QString applicationFilePath(); - void testabilityInit(); - - static const int ARGV_LIMIT; - QApplication *qApplicationInstance; - QDeclarativeView *qDeclarativeViewInstance; - int initialArgc; - char **initialArgv; - QString appDirPath; - QString appFilePath; - bool cachePopulated; - TestabilityInterface *testabilityInterface; - - - -#ifdef UNIT_TEST - friend class Ut_MDeclarativeCache; -#endif -}; - - -#endif // MDECLARATIVECACHE_P_H diff --git a/src/qdeclarativebooster/pluginfactory.cpp b/src/qdeclarativebooster/pluginfactory.cpp deleted file mode 100644 index f7b2407..0000000 --- a/src/qdeclarativebooster/pluginfactory.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include -#include "qdeclarativebooster.h" - -extern "C" -{ - // Create a new plugin instance. - Q_DECL_EXPORT void * create() - { - return new QDeclarativeBooster; - } - - Q_DECL_EXPORT char type() - { - return QDeclarativeBooster::type(); - } - - Q_DECL_EXPORT const char * socketName() - { - return QDeclarativeBooster::socketName().c_str(); - } - - Q_DECL_EXPORT const char * temporaryProcessName() - { - return QDeclarativeBooster::temporaryProcessName().c_str(); - } -} diff --git a/src/qdeclarativebooster/qdeclarativebooster.cpp b/src/qdeclarativebooster/qdeclarativebooster.cpp deleted file mode 100644 index 1d1d90c..0000000 --- a/src/qdeclarativebooster/qdeclarativebooster.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include "qdeclarativebooster.h" -#include "mdeclarativecache.h" -#include "connection.h" - -const string QDeclarativeBooster::m_socketId = "/tmp/boostd"; -const string QDeclarativeBooster::m_temporaryProcessName = "booster-d"; - -const string & QDeclarativeBooster::socketId() const -{ - return m_socketId; -} - -const string & QDeclarativeBooster::socketName() -{ - return m_socketId; -} - -const string & QDeclarativeBooster::temporaryProcessName() -{ - return m_temporaryProcessName; -} - -const string & QDeclarativeBooster::boosterTemporaryProcessName() const -{ - return temporaryProcessName(); -} - -char QDeclarativeBooster::type() -{ - return 'd'; -} - -bool QDeclarativeBooster::preload() -{ - MDeclarativeCache::populate(); - return true; -} - -bool QDeclarativeBooster::receiveDataFromInvoker(int socketFd) -{ - // Use the default implementation if in boot mode - // (it won't require QApplication running). - - if (bootMode()) - { - return Booster::receiveDataFromInvoker(socketFd); - } - else - { - // Setup the conversation channel with the invoker. - setConnection(new Connection(socketFd)); - - EventHandler handler(this); - handler.runEventLoop(); - - if (!connection()->connected()) - { - return false; - } - - // Receive application data from the invoker - if(!connection()->receiveApplicationData(appData())) - { - connection()->close(); - return false; - } - - // Close the connection if exit status doesn't need - // to be sent back to invoker - if (!connection()->isReportAppExitStatusNeeded()) - { - connection()->close(); - } - - return true; - } -} - - -void QDeclarativeBooster::preinit() -{ - QString appName = QFileInfo(m_appData->argv()[0]).fileName(); - - QString appClass = appName.left(1).toUpper(); - if (appName.length() > 1) - appClass += appName.right(appName.length() - 1); - - // char* app_name = qstrdup(appName.toLatin1().data()); - // QApplication::setAppName(app_name); - - // char* app_class = qstrdup(appClass.toLatin1().data()); - // QApplication::setAppClass(app_class); -} diff --git a/src/qdeclarativebooster/qdeclarativebooster.h b/src/qdeclarativebooster/qdeclarativebooster.h deleted file mode 100644 index 8ce08a4..0000000 --- a/src/qdeclarativebooster/qdeclarativebooster.h +++ /dev/null @@ -1,98 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#ifndef QDECLARATIVEBOOSTER_H -#define QDECLARATIVEBOOSTER_H - -#include -#include "QFileInfo" - -#include "eventhandler.h" -#include "booster.h" - -/*! - * \class QDeclarativeBooster. - * \brief QDeclarative-specific version of the Booster. - */ -class QDeclarativeBooster : public Booster -{ -public: - - //! Constructor. - QDeclarativeBooster() {}; - - //! Destructor. - virtual ~QDeclarativeBooster() {}; - - /*! - * \brief Return the socket name common to all QDeclarativeBooster objects. - * \return Path to the socket file. - */ - static const string & socketName(); - - //! Return the process name to be used when booster is not - //! yet transformed into a running application - static const string & temporaryProcessName(); - - //! \reimp - virtual const string & boosterTemporaryProcessName() const; - - //! \reimp - virtual char boosterType() const { return type(); } - - /*! - * \brief Return a unique character ('d') represtenting the type of QDeclarativeBoosters. - * \return Type character. - */ - static char type(); - - //! \reimp - virtual bool preload(); - -protected: - - //! \reimp - virtual const string & socketId() const; - - //! \reimp - virtual bool receiveDataFromInvoker(int socketFd); - - //! \reimp - virtual void preinit(); - -private: - - //! Disable copy-constructor - QDeclarativeBooster(const QDeclarativeBooster & r); - - //! Disable assignment operator - QDeclarativeBooster & operator= (const QDeclarativeBooster & r); - - static const string m_socketId; - - //! Process name to be used when booster is not - //! yet transformed into a running application - static const string m_temporaryProcessName; - -#ifdef UNIT_TEST - friend class Ut_DBooster; -#endif -}; - -#endif //QDECLARATIVEBOOSTER_H diff --git a/src/qdeclarativebooster/testabilityinterface.h b/src/qdeclarativebooster/testabilityinterface.h deleted file mode 100644 index 8c9264e..0000000 --- a/src/qdeclarativebooster/testabilityinterface.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#ifndef DBOOSTERTESTABILITYINTERFACE_H -#define DBOOSTERTESTABILITYINTERFACE_H - -class TestabilityInterface -{ -public: - virtual ~TestabilityInterface() {} - - /*! - - Initializes the plugin once loaded. - - */ - virtual void Initialize() = 0; - - -}; - -Q_DECLARE_INTERFACE(TestabilityInterface, - "com.nokia.testability.TestabilityInterface/1.0") - -#endif // DBOOSTERTESTABILITYINTERFACE_H diff --git a/src/qtbooster/CMakeLists.txt b/src/qtbooster/CMakeLists.txt deleted file mode 100644 index cdd9f69..0000000 --- a/src/qtbooster/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# Find Qt4 -find_package(Qt4 4.6.0 REQUIRED) -include(${QT_USE_FILE}) -if (${QTVERSION} VERSION_LESS 4.6.0) - message(FATAL_ERROR "You need Qt4.6, found ${QTVERSION}.") -endif (${QTVERSION} VERSION_LESS 4.6.0) - -set(LAUNCHER "${CMAKE_HOME_DIRECTORY}/src/launcherlib") - -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER}) - -# Hide all symbols except the ones explicitly exported in the code (like main()) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") - -# Set sources -set(SRC qtbooster.cpp pluginfactory.cpp) - -# Set libraries to be linked. -link_libraries("-L../launcherlib -lapplauncherd" ${LIBDL} ${QT_QTCORE_LIBRARY}) - -# Set executable -add_library(qtbooster MODULE ${SRC}) -add_dependencies(qtbooster applauncherd) - -# Add install rule -install(TARGETS qtbooster DESTINATION /usr/lib/applauncherd/) - diff --git a/src/qtbooster/pluginfactory.cpp b/src/qtbooster/pluginfactory.cpp deleted file mode 100644 index b89ca48..0000000 --- a/src/qtbooster/pluginfactory.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include -#include "qtbooster.h" - -extern "C" -{ - // Create a new plugin instance. - Q_DECL_EXPORT void * create() - { - return new QtBooster; - } - - Q_DECL_EXPORT char type() - { - return QtBooster::type(); - } - - Q_DECL_EXPORT const char * socketName() - { - return QtBooster::socketName().c_str(); - } - - Q_DECL_EXPORT const char * temporaryProcessName() - { - return QtBooster::temporaryProcessName().c_str(); - } -} diff --git a/src/qtbooster/qtbooster.cpp b/src/qtbooster/qtbooster.cpp deleted file mode 100644 index 13af664..0000000 --- a/src/qtbooster/qtbooster.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include "qtbooster.h" - -const string QtBooster::m_socketId = "/tmp/boostq"; -const string QtBooster::m_temporaryProcessName = "booster-q"; - -const string & QtBooster::socketId() const -{ - return m_socketId; -} - -const string & QtBooster::socketName() -{ - return m_socketId; -} - -const string & QtBooster::temporaryProcessName() -{ - return m_temporaryProcessName; -} - -const string & QtBooster::boosterTemporaryProcessName() const -{ - return temporaryProcessName(); -} - -char QtBooster::type() -{ - return 'q'; -} - -bool QtBooster::preload() -{ - return true; -} diff --git a/src/qtbooster/qtbooster.h b/src/qtbooster/qtbooster.h deleted file mode 100644 index cf1b9ae..0000000 --- a/src/qtbooster/qtbooster.h +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#ifndef QTBOOSTER_H -#define QTBOOSTER_H - -#include "booster.h" - -/*! - * \class QtBooster. - * \brief Qt-specific version of the Booster. - */ -class QtBooster : public Booster -{ -public: - - //! Constructor. - QtBooster() {}; - - //! Destructor. - virtual ~QtBooster() {}; - - /*! - * \brief Return the socket name common to all QtBooster objects. - * \return Path to the socket file. - */ - static const string & socketName(); - - //! Return the process name to be used when booster is not - //! yet transformed into a running application - static const string & temporaryProcessName(); - - //! \reimp - virtual const string & boosterTemporaryProcessName() const; - - //! \reimp - virtual char boosterType() const { return type(); } - - /*! - * \brief Return a unique character ('q') represtenting the type of QtBoosters. - * \return Type character. - */ - static char type(); - -protected: - - //! \reimp - virtual bool preload(); - - //! \reimp - virtual const string & socketId() const; - -private: - - //! Disable copy-constructor - QtBooster(const QtBooster & r); - - //! Disable assignment operator - QtBooster & operator= (const QtBooster & r); - - static const string m_socketId; - - //! Process name to be used when booster is not - //! yet transformed into a running application - static const string m_temporaryProcessName; - -#ifdef UNIT_TEST - friend class Ut_QtBooster; -#endif -}; - -#endif //QTBOOSTER_H diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8838423..48f066e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,10 +1,3 @@ -# Find Qt4 -find_package(Qt4 4.6.0 REQUIRED) -include(${QT_USE_FILE}) -if (${QTVERSION} VERSION_LESS 4.6.0) - message(FATAL_ERROR "You need Qt4.6, found ${QTVERSION}.") -endif (${QTVERSION} VERSION_LESS 4.6.0) - # Sub build: meego/testscripts add_subdirectory(meego/testscripts) @@ -29,12 +22,6 @@ add_subdirectory(common/testapps/fala_status) # Sub build: common/testapps/fala_wait add_subdirectory(common/testapps/fala_wait) -# Sub build: common/testapps/focustest -add_subdirectory(common/testapps/focustest) - -# Sub build: common/testapps/testapp -add_subdirectory(common/testapps/testapp) - # Sub build: common/testapps/fala_gettime add_subdirectory(common/testapps/fala_gettime) @@ -47,15 +34,3 @@ add_subdirectory(common/testapps/pixelchanged) # Sub build: common/testapps/fala_windowid add_subdirectory(common/testapps/fala_windowid) -# Sub build: common/testapps/xsendevent -add_subdirectory(common/testapps/xsendevent) - -# Sub build: common/testapps/fala_qml_helloworld -add_subdirectory(common/testapps/fala_qml_helloworld) - -# Sub build: common/testapps/fala_windowless -add_subdirectory(common/testapps/fala_windowless) - -# Sub build: common/testapps/fala_dbus -add_subdirectory(common/testapps/fala_dbus) - diff --git a/tests/common/testapps/fala_dbus/CMakeLists.txt b/tests/common/testapps/fala_dbus/CMakeLists.txt deleted file mode 100644 index 5f131e8..0000000 --- a/tests/common/testapps/fala_dbus/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Set sources -set(SRC fala_dbus.cpp) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY}) - -include(${QT_USE_FILE}) - -SET (QT_USE_QTDBUS true) -INCLUDE_DIRECTORIES(${QT_QTDBUS_INCLUDE_DIR}) - -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_cflags - OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" "--libs" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_libs - OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${booster_cflags}") -set(CMAKE_EXE_LINKER_FLAGS ${booster_libs}) - -add_executable(fala_dbus ${SRC}) - -# Install -install(PROGRAMS fala_dbus DESTINATION /usr/bin/ ) - diff --git a/tests/common/testapps/fala_dbus/fala_dbus.cpp b/tests/common/testapps/fala_dbus/fala_dbus.cpp deleted file mode 100644 index 00e3907..0000000 --- a/tests/common/testapps/fala_dbus/fala_dbus.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -Q_DECL_EXPORT int main(int argc, char ** argv) -{ - QApplication app(argc, argv); - Q_UNUSED(app); - QDBusConnection bus = QDBusConnection::systemBus(); - QDBusMessage msg = QDBusMessage::createMethodCall("com.nokia.dsme", "/com/nokia/dsme/request", "com.nokia.dsme.request", "req_powerup"); - QDBusMessage reply = bus.call(msg,QDBus::AutoDetect, 5); - QString dbusReplyError = reply.errorName(); - openlog ("qfala_dbus", LOG_NDELAY | LOG_PID | LOG_PERROR, LOG_DAEMON); - syslog (LOG_DAEMON | LOG_NOTICE, "fala_dbus connection error: '%s'", dbusReplyError.toLocal8Bit().data()); - closelog(); - std::cerr << "fala_dbus connection error:" << dbusReplyError.toLocal8Bit().data() << "\n"; - _exit(0); -} diff --git a/tests/common/testapps/fala_qml_helloworld/CMakeLists.txt b/tests/common/testapps/fala_qml_helloworld/CMakeLists.txt deleted file mode 100644 index 552902c..0000000 --- a/tests/common/testapps/fala_qml_helloworld/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Set sources -set(SRC main.cpp) - -# Use the compiler and linker flags given in qdeclarative-boostable.pc -# in the source tree. -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "qdeclarative-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_cflags - OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" "--libs" - "qdeclarative-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_libs - OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${booster_cflags}") - -include_directories(${CMAKE_SOURCE_DIR}/src/qdeclarativebooster) - -# Compile resources -QT4_ADD_RESOURCES(RESOURCE_SRC main.qrc) - -# Enable Qt-support -include(${QT_USE_FILE}) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} "-L${CMAKE_SOURCE_DIR}/src/launcherlib -lapplauncherd -L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster ${booster_libs}") -add_executable(fala_qml ${SRC} ${RESOURCE_SRC}) -add_dependencies(fala_qml applauncherd mdeclarativecache) - -# Install -install(PROGRAMS fala_qml DESTINATION /usr/bin/ RENAME fala_qml_wol) -install(PROGRAMS fala_qml DESTINATION /usr/bin/ RENAME fala_qml_helloworld) -install(PROGRAMS fala_qml DESTINATION /usr/bin/ RENAME fala_qml_wl) -install(PROGRAMS fala_qml DESTINATION /usr/share/fala_images RENAME fala_qml_helloworld) -install(FILES fala_qml_wl.desktop DESTINATION /usr/share/applications) -install(FILES fala_qml_wol.desktop DESTINATION /usr/share/applications) -install(SCRIPT scripts/create_links.cmake) diff --git a/tests/common/testapps/fala_qml_helloworld/fala_qml_wl.desktop b/tests/common/testapps/fala_qml_helloworld/fala_qml_wl.desktop deleted file mode 100644 index 5535caa..0000000 --- a/tests/common/testapps/fala_qml_helloworld/fala_qml_wl.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Name=fala_qml_wl -Icon=icon-l-video -Exec=invoker --single-instance --type=d /usr/bin/fala_qml_wl -Categories=X-MeeGo;X-Demos; -OnlyShowIn=X-MeeGo; diff --git a/tests/common/testapps/fala_qml_helloworld/fala_qml_wol.desktop b/tests/common/testapps/fala_qml_helloworld/fala_qml_wol.desktop deleted file mode 100644 index cf53eaa..0000000 --- a/tests/common/testapps/fala_qml_helloworld/fala_qml_wol.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Name=fala_qml_wol -Icon=icon-l-video -Exec=single-instance /usr/bin/fala_qml_wol -Categories=X-MeeGo;X-Demos; -OnlyShowIn=X-MeeGo; diff --git a/tests/common/testapps/fala_qml_helloworld/main.cpp b/tests/common/testapps/fala_qml_helloworld/main.cpp deleted file mode 100644 index 4873d0c..0000000 --- a/tests/common/testapps/fala_qml_helloworld/main.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include -#include -#include -#include "mdeclarativecache.h" -#include - - -QString log_file = "/tmp/fala_qml_helloworld.log"; - -void FANGORNLOG(const char* s, bool eol = true) -{ - QFile f(log_file); - f.open(QIODevice::Append); - f.write(s, qstrlen(s)); - if (eol) { - f.write("\n", 1); - } - f.close(); -} - -void FANGORNLOG(const QString& s, bool eol = true) -{ - QByteArray ba = s.toLocal8Bit(); - char *p = new char[ba.size() + 1]; - strcpy(p, ba.data()); - FANGORNLOG(p, eol); -} - -void timestamp(const char *s) -{ - timeval tim; - char msg[80]; - gettimeofday(&tim, NULL); - snprintf(msg, 80, "%d%03d %s", - static_cast(tim.tv_sec), static_cast(tim.tv_usec/1000), s); - FANGORNLOG(msg); -} - -void timestamp(const QString& s) -{ - QByteArray ba = s.toLocal8Bit(); - char *p = new char[ba.size() + 1]; - strcpy(p, ba.data()); - timestamp(p); -} - - -Q_DECL_EXPORT int main(int argc, char **argv) -{ - QApplication *app; - try - { - - QString appName(argv[0]); - if (appName.endsWith("fala_qml_wl")) - { - log_file = "/tmp/fala_qml_wl.log"; - } - else if (appName.endsWith("fala_qml_wol")) - { - log_file = "/tmp/fala_qml_wol.log"; - } - timestamp("application main"); - - app = MDeclarativeCache::qApplication(argc, argv); - timestamp("QApplication from cache"); - - QDeclarativeView *window = NULL; - - bool bWindowNotFromCache = false; - const QString sWindowNotFromCache = "window-not-from-cache"; - for (int i = 1; i < argc; i++) { - QString sArg = QString(argv[i]); - if (sArg.contains(sWindowNotFromCache,Qt::CaseInsensitive)) { - bWindowNotFromCache = true; - break; - } - } - - if (bWindowNotFromCache) { - window = new QDeclarativeView(); - timestamp("QDeclarativeView NOT from cache"); - } else { - window = MDeclarativeCache::qDeclarativeView(); - timestamp("QDeclarativeView from cache"); - } - - timestamp(QString("applicationDirPath: ").append(QApplication::applicationDirPath())); - timestamp(QString("applicationFilePath: ").append(QApplication::applicationFilePath())); - - if (argc > 2 && QString(argv[1]) == QString("--log-args")) { - FANGORNLOG("argv:", false); - for (int i = 0; i < argc; i++) { - FANGORNLOG(" ", false); - FANGORNLOG(argv[i], false); - } - FANGORNLOG(""); - - FANGORNLOG("argv:", false); - QStringList args = QCoreApplication::arguments(); - for (int i = 0; i < args.size(); i++) { - FANGORNLOG(" ", false); - FANGORNLOG(args.at(i), false); - } - FANGORNLOG(""); - } - - window->setWindowTitle("Applauncherd QML testapp"); - - window->setResizeMode(QDeclarativeView::SizeRootObjectToView); - - //window->setSource(QUrl::fromLocalFile("/usr/share/fala_qml_helloworld/main.qml")); - window->setSource(QUrl("qrc:/main.qml")); - window->showFullScreen(); - - timestamp("Calling app->exec()"); - } - catch(std::exception& e) - { - return -1; - } - - _exit(app->exec()); -} - diff --git a/tests/common/testapps/fala_qml_helloworld/main.qml b/tests/common/testapps/fala_qml_helloworld/main.qml deleted file mode 100644 index a08dd40..0000000 --- a/tests/common/testapps/fala_qml_helloworld/main.qml +++ /dev/null @@ -1,12 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: 853 - height: 480 - Text { - id: text1 - anchors.centerIn: parent - text: "Hello QML World!" - font.pixelSize: 80 - } -} diff --git a/tests/common/testapps/fala_qml_helloworld/main.qrc b/tests/common/testapps/fala_qml_helloworld/main.qrc deleted file mode 100644 index 5f6483a..0000000 --- a/tests/common/testapps/fala_qml_helloworld/main.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - main.qml - - diff --git a/tests/common/testapps/fala_qml_helloworld/scripts/create_links.cmake b/tests/common/testapps/fala_qml_helloworld/scripts/create_links.cmake deleted file mode 100644 index 9f43f77..0000000 --- a/tests/common/testapps/fala_qml_helloworld/scripts/create_links.cmake +++ /dev/null @@ -1,4 +0,0 @@ -execute_process(COMMAND echo "Creating symlinks for fala_qml_helloworld..") -execute_process(COMMAND ln -v -s /usr/bin/fala_qml_helloworld $ENV{DESTDIR}/usr/bin/fala_qml_helloworld1) -execute_process(COMMAND ln -v -s /usr/bin/fala_qml_helloworld $ENV{DESTDIR}/usr/bin/fala_qml_helloworld2) - diff --git a/tests/common/testapps/fala_status/CMakeLists.txt b/tests/common/testapps/fala_status/CMakeLists.txt index 2086722..9176f9e 100644 --- a/tests/common/testapps/fala_status/CMakeLists.txt +++ b/tests/common/testapps/fala_status/CMakeLists.txt @@ -1,28 +1,6 @@ # Set sources set(SRC fala_status.cpp) -include(${QT_USE_FILE}) - -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_cflags - OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" "--libs" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_libs - OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${booster_cflags}") -set(CMAKE_EXE_LINKER_FLAGS ${booster_libs}) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) - add_executable(fala_status ${SRC}) # Install diff --git a/tests/common/testapps/fala_status/fala_status.cpp b/tests/common/testapps/fala_status/fala_status.cpp index 8858b79..396742e 100644 --- a/tests/common/testapps/fala_status/fala_status.cpp +++ b/tests/common/testapps/fala_status/fala_status.cpp @@ -17,19 +17,17 @@ ** ****************************************************************************/ -#include -#include #include +#include -Q_DECL_EXPORT int main(int argc, char ** argv) +int main(int argc, char ** argv) { - QApplication app(argc, argv); - QTimer::singleShot(5, &app, SLOT(quit())); int usr_id = getuid(); int grp_id = getgid(); std::cerr << "uid=" << usr_id <<"\n"; std::cerr << "gid=" << grp_id <<"\n"; - app.exec(); + + usleep(5000); _exit(29); } diff --git a/tests/common/testapps/fala_wait/CMakeLists.txt b/tests/common/testapps/fala_wait/CMakeLists.txt index e908bee..460ef7b 100644 --- a/tests/common/testapps/fala_wait/CMakeLists.txt +++ b/tests/common/testapps/fala_wait/CMakeLists.txt @@ -1,27 +1,6 @@ # Set sources set(SRC fala_wait.cpp) -include(${QT_USE_FILE}) - -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_cflags - OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" "--libs" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_libs - OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${booster_cflags}") -set(CMAKE_EXE_LINKER_FLAGS ${booster_libs}) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) add_executable(fala_wait ${SRC}) # Install diff --git a/tests/common/testapps/fala_wait/fala_wait.cpp b/tests/common/testapps/fala_wait/fala_wait.cpp index 62dcdbc..ada19ab 100644 --- a/tests/common/testapps/fala_wait/fala_wait.cpp +++ b/tests/common/testapps/fala_wait/fala_wait.cpp @@ -17,13 +17,11 @@ ** ****************************************************************************/ -#include -#include #include +#include -Q_DECL_EXPORT int main(int argc, char ** argv) +int main(int argc, char ** argv) { - QApplication app(argc, argv); - QTimer::singleShot(6000, &app, SLOT(quit())); - app.exec(); + sleep(6); + return 0; } diff --git a/tests/common/testapps/fala_windowless/CMakeLists.txt b/tests/common/testapps/fala_windowless/CMakeLists.txt deleted file mode 100644 index af2fc03..0000000 --- a/tests/common/testapps/fala_windowless/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# Set sources -set(SRC fala_windowless.cpp) - -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_cxxflags - OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" "--libs" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_libs - OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${booster_cxxflags}") -set(CMAKE_EXE_LINKER_FLAGS ${booster_libs}) - - -include(${QT_USE_FILE}) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) -add_executable(fala_windowless ${SRC}) - -install(PROGRAMS fala_windowless DESTINATION /usr/bin/) - - diff --git a/tests/common/testapps/fala_windowless/fala_windowless.cpp b/tests/common/testapps/fala_windowless/fala_windowless.cpp deleted file mode 100644 index 94d632c..0000000 --- a/tests/common/testapps/fala_windowless/fala_windowless.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include - -Q_DECL_EXPORT int main(int argc, char ** argv) -{ - QApplication app(argc, argv); - app.exec(); -} diff --git a/tests/common/testapps/focustest/CMakeLists.txt b/tests/common/testapps/focustest/CMakeLists.txt deleted file mode 100644 index 636b469..0000000 --- a/tests/common/testapps/focustest/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Install -install(PROGRAMS fala_focus DESTINATION /usr/bin/ ) -install(FILES view.qml DESTINATION /usr/share/applauncherd-testscripts/) - diff --git a/tests/common/testapps/focustest/fala_focus b/tests/common/testapps/focustest/fala_focus deleted file mode 100755 index 238152d..0000000 --- a/tests/common/testapps/focustest/fala_focus +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import sys -from PySide.QtCore import * -from PySide.QtGui import * -from PySide.QtDeclarative import QDeclarativeView - -# Create Qt application and the QDeclarative view -app = QApplication(sys.argv) -view = QDeclarativeView() -# Create an URL to the QML file -url = QUrl('/usr/share/applauncherd-testscripts/view.qml') -# Set the QML file and show -view.setSource(url) -view.show() -# Enter Qt main loop -sys.exit(app.exec_()) diff --git a/tests/common/testapps/focustest/view.qml b/tests/common/testapps/focustest/view.qml deleted file mode 100644 index 651ee13..0000000 --- a/tests/common/testapps/focustest/view.qml +++ /dev/null @@ -1,12 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: 200 - height: 200 - color: "red" - - Text { - text: "Hello World" - anchors.centerIn: parent - } -} diff --git a/tests/common/testapps/testapp/CMakeLists.txt b/tests/common/testapps/testapp/CMakeLists.txt deleted file mode 100644 index 59c320a..0000000 --- a/tests/common/testapps/testapp/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# Set sources -set(SRC main.cpp) - -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_cflags - OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" "--libs" - "qt-boostable" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE booster_libs - OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${booster_cflags}") -set(CMAKE_EXE_LINKER_FLAGS ${booster_libs}) - -# Enable Qt-support -include(${QT_USE_FILE}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) -add_executable(fala_testapp ${SRC}) - -# Install -install(PROGRAMS fala_testapp DESTINATION /usr/bin RENAME fala_wol) -install(PROGRAMS fala_testapp DESTINATION /usr/bin RENAME fala_wl) -install(FILES com.nokia.fala_testapp.service com.nokia.fala_wl.service com.nokia.fala_wol.service DESTINATION /usr/share/dbus-1/services) -install(FILES fala_wl.desktop fala_wol.desktop DESTINATION /usr/share/applications/) -install(FILES images/landscape.jpg DESTINATION /usr/share/fala_images/) -install(FILES images/portrait.jpg DESTINATION /usr/share/fala_images/) - diff --git a/tests/common/testapps/testapp/com.nokia.fala_testapp.service b/tests/common/testapps/testapp/com.nokia.fala_testapp.service deleted file mode 100644 index 48ea964..0000000 --- a/tests/common/testapps/testapp/com.nokia.fala_testapp.service +++ /dev/null @@ -1,4 +0,0 @@ -[D-BUS Service] -Name=com.nokia.fala_testapp -Exec=/usr/bin/fala_testapp -prestart - diff --git a/tests/common/testapps/testapp/com.nokia.fala_wl.service b/tests/common/testapps/testapp/com.nokia.fala_wl.service deleted file mode 100644 index 488ae41..0000000 --- a/tests/common/testapps/testapp/com.nokia.fala_wl.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=com.nokia.fala_wl -Exec=/usr/bin/fala_wl diff --git a/tests/common/testapps/testapp/com.nokia.fala_wol.service b/tests/common/testapps/testapp/com.nokia.fala_wol.service deleted file mode 100644 index a54a655..0000000 --- a/tests/common/testapps/testapp/com.nokia.fala_wol.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=com.nokia.fala_wol -Exec=/usr/bin/fala_wol.sh diff --git a/tests/common/testapps/testapp/fala_wl.desktop b/tests/common/testapps/testapp/fala_wl.desktop deleted file mode 100644 index 776e391..0000000 --- a/tests/common/testapps/testapp/fala_wl.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Name=fala_wl -Icon=icon-l-video -Exec=/usr/bin/invoker --test-mode --type=q /usr/bin/fala_wl -Categories=X-MeeGo;X-Demos; -OnlyShowIn=X-MeeGo; diff --git a/tests/common/testapps/testapp/fala_wol.desktop b/tests/common/testapps/testapp/fala_wol.desktop deleted file mode 100644 index 3cedfce..0000000 --- a/tests/common/testapps/testapp/fala_wol.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Name=fala_wol -Icon=icon-l-video -Exec=/usr/bin/fala_wol -Categories=X-MeeGo;X-Demos; -OnlyShowIn=X-MeeGo; diff --git a/tests/common/testapps/testapp/images/landscape.jpg b/tests/common/testapps/testapp/images/landscape.jpg deleted file mode 100644 index 76f3f837eb2dc517fe35fde2afb270f3b5c8f5e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10190 zcmeHsXH-+`)@~313+fKNt5g9MDFJC>As`?`AR!0@qza)(2}HW((1O7Y2uKi+B7p=F zDWN0+DpepLgaA@SdY9hevd`W3eEWQN-yiqS9pjF1<{D$YW6inVHrG3!S=M3S;Sa!X zhI$5i02US&z}=$@aCiXVzT@j`k8*apfObQZi zagv?w80+yr#FoDSSXhs-va)e-o;k(-&v#gkL`Rzdp5Wr<;k~GM>m;9mxT(Dlzml3h zEZ|wh>-S~#*KeCyI6U%w{*QP@_qc?lGCUzEE4#Q$S{Ll-SNfvlOWo1PJV$f>H~NDM z{NK6#0M4U{j{#YM03ATdr~lUJKac;>!2fd%TsU{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JRVzirII4783$=}_3`HFyix_WO~Y-Pl6rSd)Fus$B8&*aHFO95_-ms^}+Dq#-~E|da*IROG*HL9+1cw8O6=N!eQFY082gvBzJ40~x( z_C61j4j&EJwtTA8M*F@icTHuv$LhmJkpD8NsIamM>4e0aQAB@ILKcv+1y2FneYl24 z_2n8w(Ssp~Z#fertgSLX?AR$1XKdbriO#RaMB_UF_bR6xwLa3mO6dvG5Z;3w>&3_< z=)xLk_SGRkJqb}R*`#P#fNa?ECERF&mb>zXu@@f#W)VM5C=C^>KCFQnMaq3yTi&2@ zK;#bIV{2#KA3Q2CvQ4 z)9Li+wSaV-(9L7g^}D|zQZkb7B`AK?r>HUx7iT|l_k2rJ?RDAEaFHx%JL`^r9{;+m%)oU_ z(ijX^M{m)Yuy)^_?&(eql=eo)1DO8n>wNdrAbwL1rih_1V+V$}g}yp4KaJMj2`ti` zvrUKRnCl;z3FngQ<)R#V8{075xD_{rA!!hh?U2S%ZEE&b8lA~Y@(miF1J5w-=mH?t z+Vca5*VkvZ64I`zcVz_WcQH+`P)YNy@C!XcVsngnT zdy5-ySu}0l*4vmjEA>N%9{m#TMFeY5gH%4Tvy{fs4|4i`mU5$~IzsaLcf=s{x0&c5 z%giGa4WoLOF-(SQ;?nny7Rs(%)&t%t+pIkV@T~GH`)2Nh%Z~X}+HDHb@TWUSn=a{^ z*N!Rw64-Oy`@DDa&-RuJKthM*RpYC+^Y!QcZ22Ctjy*Ku584u|iwuOzPsVy`pSv`= o=<~!Bl(tJHEz+nngc-6`rqkac-G6xh(ZGK+@c*d>bPm7&4?NM#od5s; diff --git a/tests/common/testapps/testapp/images/portrait.jpg b/tests/common/testapps/testapp/images/portrait.jpg deleted file mode 100644 index 8bf61add53f03ccd81ce1d9b82f571af767f95fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6104 zcmd^Cdr*_twhtm;kF7R_hf*FMY(Ye@nDB<=^a#@0#2gGE6$q^$K>~!)KzIkMwa7zq zETSYBVnG8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S!!K^Fb$7?8JnXNdrBO%X)$z8-=R}{f>y($$#MTiGZF*%8jU75wS(Z=#+__SpFP3mdYqVNU=wg0@K#JdtISv6Gyhd{@^cwG;PkOxd$pAz9 zxz;fs&3MH6&5ge--3(;u0YAVbnW4=`bbXY!KCMpUSuNkZIQBtef>`bottt@q@OeVR zFP^H?j|X148?H{7W#*Bcfo{mn#yZVkNA7GFU(?C-fGV1`DlrB>%6nW>6yn_7Lb-QZ ztzgpdv{XI<{5Fo6Hco-Hebf~N(~+{*XF^1Oz|?o8@PC~_9kk{y(lOziT^>XTg7*wA z%xN92P=Mj6aQ_}(aWGLi;h;4B{tr0%|Me4F{qR2k>VcUt diff --git a/tests/common/testapps/testapp/main.cpp b/tests/common/testapps/testapp/main.cpp deleted file mode 100644 index e949a66..0000000 --- a/tests/common/testapps/testapp/main.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include -#include -#include -#include -#include - -#include - -QString log_file = "/tmp/fala_testapp.log"; - -void FANGORNLOG(const char* s, bool eol = true) -{ - QFile f(log_file); - f.open(QIODevice::Append); - f.write(s, qstrlen(s)); - if (eol) { - f.write("\n", 1); - } - f.close(); -} - -void FANGORNLOG(const QString& s, bool eol = true) -{ - QByteArray ba = s.toLocal8Bit(); - char *p = new char[ba.size() + 1]; - strcpy(p, ba.data()); - FANGORNLOG(p, eol); -} - -void timestamp(const char *s) -{ - timeval tim; - char msg[80]; - gettimeofday(&tim, NULL); - snprintf(msg, 80, "%d%03d %s", - static_cast(tim.tv_sec), static_cast(tim.tv_usec)/1000, s); - FANGORNLOG(msg); -} - -Q_DECL_EXPORT int main(int argc, char **argv) -{ - QApplication *app; - try - { - QString appName(argv[0]); - if (appName.endsWith("fala_wl")) - { - log_file = "/tmp/fala_wl.log"; - } - else if (appName.endsWith("fala_wol")) - { - log_file = "/tmp/fala_wol.log"; - } - timestamp("application main"); - - app = new QApplication(argc, argv); - timestamp("app created without cache"); - - if (argc > 2 && QString(argv[1]) == QString("--log-args")) { - FANGORNLOG("argv:", false); - for (int i = 0; i < argc; i++) { - FANGORNLOG(" ", false); - FANGORNLOG(argv[i], false); - } - FANGORNLOG(""); - - FANGORNLOG("argv:", false); - QStringList args = QCoreApplication::arguments(); - for (int i = 0; i < args.size(); i++) { - FANGORNLOG(" ", false); - FANGORNLOG(args.at(i), false); - } - FANGORNLOG(""); - } - } - catch(std::exception& e) - { - return -1; - } - - _exit(app->exec()); -} - diff --git a/tests/common/testapps/xsendevent/CMakeLists.txt b/tests/common/testapps/xsendevent/CMakeLists.txt deleted file mode 100644 index 8ffd5e7..0000000 --- a/tests/common/testapps/xsendevent/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Set sources -set(SRC main.cpp) -link_libraries(-lX11 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) - -add_executable(xsendevent ${SRC}) - -# Install -install(PROGRAMS xsendevent DESTINATION /usr/bin/) - diff --git a/tests/common/testapps/xsendevent/README b/tests/common/testapps/xsendevent/README deleted file mode 100644 index 0a584cc..0000000 --- a/tests/common/testapps/xsendevent/README +++ /dev/null @@ -1,10 +0,0 @@ -xsendevent - tool for sending various xevents to windows on command line - -# Usage: -# Close window -xsendevent close [windowId] - -# Move window to task switcher -xsendevent iconify [windowId] - - diff --git a/tests/common/testapps/xsendevent/main.cpp b/tests/common/testapps/xsendevent/main.cpp deleted file mode 100644 index f5b97fe..0000000 --- a/tests/common/testapps/xsendevent/main.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include -#include - -#include -#include -#include - -void printUsage() -{ - printf("Usage: xsendevent [event windowid]...\n"); - printf("Supported events:\n"); - printf(" close - sends _NET_CLOSE_WINDOW(windowid) the root window\n"); -} - -void sendCloseEvent(Window window) -{ - Display *display = QX11Info::display(); - - Window rootWin = QX11Info::appRootWindow(QX11Info::appScreen()); - - XEvent ev; - memset(&ev, 0, sizeof(ev)); - - Atom closeWindowAtom = XInternAtom(display, "_NET_CLOSE_WINDOW", False); - - ev.xclient.type = ClientMessage; - ev.xclient.window = window; - ev.xclient.message_type = closeWindowAtom; - ev.xclient.format = 32; - ev.xclient.data.l[0] = CurrentTime; - ev.xclient.data.l[1] = rootWin; - XSendEvent(display, rootWin, False, SubstructureRedirectMask, &ev); -} - -void iconifyWindow(Window window) -{ - Display *display = QX11Info::display(); - - Window rootWin = QX11Info::appRootWindow(QX11Info::appScreen()); - - XEvent e; - memset(&e, 0, sizeof(e)); - - Atom iconicAtom = XInternAtom(display, "WM_CHANGE_STATE", True); - - e.xclient.type = ClientMessage; - e.xclient.message_type = iconicAtom; - e.xclient.display = display; - e.xclient.window = window; - e.xclient.format = 32; - e.xclient.data.l[0] = IconicState; - XSendEvent(display, rootWin, False, SubstructureRedirectMask, &e); -} - -int main (int argc, char **argv) -{ - QApplication app(argc, argv); // connect to the X server - - for (int i = 1; i < argc; i++) - { - if (QString(argv[i]) == "-h" || - QString(argv[i]) == "-help" || - QString(argv[i]) == "--help" - ) { - printUsage(); - return 0; - } - - if (QString(argv[i]) == "close") { - Window window; - - // coverity[secure_coding] - sscanf(argv[++i], "%lx", &window); - - sendCloseEvent(window); - return 0; - } - - if (QString(argv[i]) == "iconify") { - Window window; - - // coverity[secure_coding] - sscanf(argv[++i], "%lx", &window); - - iconifyWindow(window); - return 0; - } - - } -} diff --git a/tests/common/unittests/CMakeLists.txt b/tests/common/unittests/CMakeLists.txt index 511d766..4948d2a 100644 --- a/tests/common/unittests/CMakeLists.txt +++ b/tests/common/unittests/CMakeLists.txt @@ -1,9 +1,14 @@ +# Find Qt4 +find_package(Qt4 4.6.0 REQUIRED) +include(${QT_USE_FILE}) +if (${QTVERSION} VERSION_LESS 4.6.0) + message(FATAL_ERROR "You need Qt4.6, found ${QTVERSION}.") +endif (${QTVERSION} VERSION_LESS 4.6.0) + add_subdirectory(ut_booster) add_subdirectory(ut_connection) add_subdirectory(ut_daemon) -add_subdirectory(ut_dbooster) add_subdirectory(ut_ebooster) -add_subdirectory(ut_qtbooster) add_subdirectory(ut_socketmanager) add_subdirectory(ut_singleinstance) add_subdirectory(ut_boosterpluginregistry) diff --git a/tests/common/unittests/tests.xml b/tests/common/unittests/tests.xml index 7069cf2..650d716 100644 --- a/tests/common/unittests/tests.xml +++ b/tests/common/unittests/tests.xml @@ -34,18 +34,10 @@ /usr/share/applauncherd-tests/ut_booster - - su - user -c 'source /tmp/session_bus_address.user && DISPLAY=:0 /usr/share/applauncherd-tests/ut_qtbooster' - - su - user -c 'source /tmp/session_bus_address.user && DISPLAY=:0 /usr/share/applauncherd-tests/ut_ebooster' - - su - user -c 'source /tmp/session_bus_address.user && DISPLAY=:0 /usr/share/applauncherd-tests/ut_dbooster' - - true true diff --git a/tests/common/unittests/ut_dbooster/CMakeLists.txt b/tests/common/unittests/ut_dbooster/CMakeLists.txt deleted file mode 100644 index ee84fce..0000000 --- a/tests/common/unittests/ut_dbooster/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -set(LAUNCHER ${CMAKE_HOME_DIRECTORY}/src/launcherlib) -set(DBOOSTER ${CMAKE_HOME_DIRECTORY}/src/qdeclarativebooster) - -# Set sources -set(SRC ut_dbooster.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp -${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp ${DBOOSTER}/qdeclarativebooster.cpp -${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp) - -# Set moc headers -set(MOC_HDRS ut_dbooster.h) - -# Run moc -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) - -# Enable test library -set(QT_USE_QTTEST TRUE) - -# Set include paths -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${LAUNCHER} ${CMAKE_HOME_DIRECTORY}/src/common ${DBOOSTER}) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} "-L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster -lmdeclarativecache" -ldl -lX11) - -# Enable Qt (may not be needed, because already defined on higher level) -include(${QT_USE_FILE}) - -add_executable(ut_dbooster ${SRC} ${MOC_SRC} ) -add_dependencies(ut_dbooster mdeclarativecache) - -# Install -install(PROGRAMS ut_dbooster DESTINATION /usr/share/applauncherd-tests/) - diff --git a/tests/common/unittests/ut_dbooster/ut_dbooster.cpp b/tests/common/unittests/ut_dbooster/ut_dbooster.cpp deleted file mode 100644 index ad90050..0000000 --- a/tests/common/unittests/ut_dbooster/ut_dbooster.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include "ut_dbooster.h" -#include "qdeclarativebooster.h" -#include "mdeclarativecache.h" - -Ut_DBooster::Ut_DBooster() : - m_subject(new QDeclarativeBooster) -{} - -Ut_DBooster::~Ut_DBooster() -{} - -void Ut_DBooster::initTestCase() -{} - -void Ut_DBooster::cleanupTestCase() -{} - -void Ut_DBooster::testSocketName() -{ - QVERIFY(QDeclarativeBooster::socketName() == QDeclarativeBooster::m_socketId); - QVERIFY(m_subject->socketId() == QDeclarativeBooster::m_socketId); -} - -void Ut_DBooster::testType() -{ - QVERIFY(QDeclarativeBooster::type() == 'd'); - QVERIFY(m_subject->boosterType() == 'd'); -} - -void Ut_DBooster::testPreload() -{ - m_subject->preload(); - - const char * argv[] = {"foo"}; - int argc = 1; - - // TODO: Somehow make sure that MDeclarativeCache really returns the cached - // QApplication instead of creating a new one here. - QApplication * app = MDeclarativeCache::qApplication(argc, const_cast(argv)); - QVERIFY(app); - - QStringList args = app->arguments(); - QVERIFY(args.length() == 1); - QVERIFY(args[0] == "foo"); - - QVERIFY(MDeclarativeCache::qDeclarativeView()); -} - -void Ut_DBooster::testTemporaryProcessName() -{ - QVERIFY(QDeclarativeBooster::temporaryProcessName() == QDeclarativeBooster::m_temporaryProcessName); - QVERIFY(m_subject->temporaryProcessName() == QDeclarativeBooster::m_temporaryProcessName); - QVERIFY(m_subject->boosterTemporaryProcessName() == QDeclarativeBooster::m_temporaryProcessName); -} - -void Ut_DBooster::testReceiveDataFromInvokerWithBadSocket() -{ - QVERIFY(m_subject->receiveDataFromInvoker(-100) == false); -} - -QTEST_APPLESS_MAIN(Ut_DBooster); - diff --git a/tests/common/unittests/ut_dbooster/ut_dbooster.h b/tests/common/unittests/ut_dbooster/ut_dbooster.h deleted file mode 100644 index baf5164..0000000 --- a/tests/common/unittests/ut_dbooster/ut_dbooster.h +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#ifndef UT_DBOOSTER_H -#define UT_DBOOSTER_H - -#include -#include - -#include - -#define UNIT_TEST - -class QDeclarativeBooster; - -class Ut_DBooster : public QObject -{ - Q_OBJECT - -public: - Ut_DBooster(); - virtual ~Ut_DBooster(); - -private Q_SLOTS: - void initTestCase(); - void cleanupTestCase(); - void testSocketName(); - void testType(); - void testPreload(); - void testTemporaryProcessName(); - void testReceiveDataFromInvokerWithBadSocket(); - -private: - std::tr1::shared_ptr m_subject; -}; - -#endif // UT_DBOOSTER_H diff --git a/tests/common/unittests/ut_qtbooster/CMakeLists.txt b/tests/common/unittests/ut_qtbooster/CMakeLists.txt deleted file mode 100644 index e6d0960..0000000 --- a/tests/common/unittests/ut_qtbooster/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -set(LAUNCHER ${CMAKE_HOME_DIRECTORY}/src/launcherlib) -set(QTBOOSTER ${CMAKE_HOME_DIRECTORY}/src/qtbooster) - -# Set sources -set(SRC ut_qtbooster.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp -${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp ${QTBOOSTER}/qtbooster.cpp -${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp) - -# Set moc headers -set(MOC_HDRS ut_qtbooster.h) - -# Run moc -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) - -# Enable test library -set(QT_USE_QTTEST TRUE) - -# Set include paths -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${QTBOOSTER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${X11_LIBRARIES} -ldl) - -# Enable Qt (may not be needed, because already defined on higher level) -include(${QT_USE_FILE}) -add_executable(ut_qtbooster ${SRC} ${MOC_SRC}) - -# Install -install(PROGRAMS ut_qtbooster DESTINATION /usr/share/applauncherd-tests/) diff --git a/tests/common/unittests/ut_qtbooster/ut_qtbooster.cpp b/tests/common/unittests/ut_qtbooster/ut_qtbooster.cpp deleted file mode 100644 index 3bcc801..0000000 --- a/tests/common/unittests/ut_qtbooster/ut_qtbooster.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#include "ut_qtbooster.h" -#include "qtbooster.h" - -Ut_QtBooster::Ut_QtBooster() : - m_subject(new QtBooster) -{} - -Ut_QtBooster::~Ut_QtBooster() -{} - -void Ut_QtBooster::initTestCase() -{} - -void Ut_QtBooster::cleanupTestCase() -{} - -void Ut_QtBooster::testSocketName() -{ - QVERIFY2(QtBooster::socketName() == QtBooster::m_socketId, "Failure"); - QVERIFY2(m_subject->socketId() == QtBooster::m_socketId, "Failure"); -} - -void Ut_QtBooster::testType() -{ - QVERIFY2(QtBooster::type() == 'q', "Failure"); - QVERIFY2(m_subject->boosterType() == 'q', "Failure"); -} - -void Ut_QtBooster::testTemporaryProcessName() -{ - QVERIFY(QtBooster::temporaryProcessName() == QtBooster::m_temporaryProcessName); - QVERIFY(m_subject->temporaryProcessName() == QtBooster::m_temporaryProcessName); - QVERIFY(m_subject->boosterTemporaryProcessName() == QtBooster::m_temporaryProcessName); -} - -QTEST_APPLESS_MAIN(Ut_QtBooster); - diff --git a/tests/common/unittests/ut_qtbooster/ut_qtbooster.h b/tests/common/unittests/ut_qtbooster/ut_qtbooster.h deleted file mode 100644 index 77344b8..0000000 --- a/tests/common/unittests/ut_qtbooster/ut_qtbooster.h +++ /dev/null @@ -1,51 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (directui@nokia.com) -** -** This file is part of applauncherd -** -** If you have questions regarding the use of this file, please contact -** Nokia at directui@nokia.com. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation -** and appearing in the file LICENSE.LGPL included in the packaging -** of this file. -** -****************************************************************************/ - -#ifndef UT_QTBOOSTER_H -#define UT_QTBOOSTER_H - -#include -#include - -#include - -#define UNIT_TEST - -class QtBooster; - -class Ut_QtBooster : public QObject -{ - Q_OBJECT - -public: - Ut_QtBooster(); - virtual ~Ut_QtBooster(); - -private Q_SLOTS: - void initTestCase(); - void cleanupTestCase(); - void testSocketName(); - void testType(); - void testTemporaryProcessName(); - -private: - std::tr1::shared_ptr m_subject; -}; - -#endif // UT_QTBOOSTER_H