diff --git a/.gitignore b/.gitignore index 1071b60..ced4d8c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ CMakeFiles/ tests/unittests/ut_booster/ut_booster tests/unittests/ut_connection/ut_connection tests/unittests/ut_daemon/ut_daemon -tests/unittests/ut_mbooster/ut_mbooster tests/unittests/ut_qtbooster/ut_qtbooster src/invoker/invoker src/launcher/applauncherd.bin diff --git a/CMakeLists.txt b/CMakeLists.txt index d76db77..f768dae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,12 +15,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wextra -g -O3") set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") -set(CMAKE_SKIP_BUILD_RPATH FALSE) -set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -set(CMAKE_INSTALL_RPATH "/usr/lib/applauncherd/") -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) - - # Find libdl find_library(LIBDL NAMES dl) @@ -31,22 +25,6 @@ if (${QTVERSION} VERSION_LESS 4.6.0) message(FATAL_ERROR "You need Qt4.6, found ${QTVERSION}.") endif (${QTVERSION} VERSION_LESS 4.6.0) -# Find libmeegotouch for MBooster and the test programs -include(FindPkgConfig) -pkg_check_modules(MEEGOTOUCH meegotouch>=0.20 REQUIRED) -include_directories(${MEEGOTOUCH_INCLUDE_DIRS}) - -# Check if it's possible to compile MBooster with MComponentCache. If so, -# HAVE_MCOMPONENTCACHE is set. -message(STATUS "checking for mcomponentcache.h") -find_file(M_COMPONENT_CACHE NAMES mcomponentcache.h PATHS ${MEEGOTOUCH_INCLUDE_DIRS}) -if (EXISTS ${M_COMPONENT_CACHE}) - message(STATUS " found") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_MCOMPONENTCACHE") -else (EXISTS ${M_COMPONENT_CACHE}) - message(STATUS " not found") -endif (EXISTS ${M_COMPONENT_CACHE}) - if ($ENV{DEBUG_BUILD}) add_definitions(-DDEBUG_BUILD) endif ($ENV{DEBUG_BUILD}) @@ -56,11 +34,6 @@ add_definitions(-DPROG_NAME_INVOKER="invoker") add_definitions(-DPROG_NAME_LAUNCHER="applauncherd") add_definitions(-DPROG_NAME_SINGLE_INSTANCE="single-instance") -# Set gconf key definitions. These are used by MonitorBooster to get -# notifications when language / theme changes. -add_definitions(-DMEEGOTOUCH_THEME_GCONF_KEY="/meegotouch/theme/name") -add_definitions(-DMEEGOTOUCH_LANGUAGE_GCONF_KEY="/meegotouch/i18n/language") - # applauncherd will find lib*booster.so from here add_definitions(-DBOOSTER_PLUGIN_DIR="/usr/lib/applauncherd") @@ -110,15 +83,7 @@ else ($ENV{DEBUG_BUILD}) install(PROGRAMS src/scripts/applauncherd DESTINATION /usr/bin/) endif ($ENV{DEBUG_BUILD}) -# Install pkg-config and qmake feature files. Note that current packaging policy is such -# that applauncherd-dev installs only qt-boostable.pc which is intended for "all" -# non-MeeGo Touch applications. meegotouch-boostable.pc is installed by libmeegotouch-dev -# so as to make it easier for MeeGo Touch application developers. -# -# TODO: Should meegotouch-boostable.* be removed completely from here since it's already included -# in meegotouch-dev ? -install(FILES data/pkgconfig/meegotouch-boostable.pc DESTINATION /usr/lib/pkgconfig) -install(FILES data/mkspecs/features/meegotouch-boostable.prf DESTINATION /usr/share/qt4/mkspecs/features) +# 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) diff --git a/README b/README index 0a8e05e..d56c25e 100644 --- a/README +++ b/README @@ -29,7 +29,7 @@ is, at the same level as the desktop (MeeGo Touch homescreen). Applauncherd forks the will-be-application process, "booster", before knowing which application is going to be launched next. There can be different kinds of boosters optimized for different kinds of -applications, e.g. Qt, Meego Touch, QML. +applications, e.g. Qt or QML. In the current architecture boosters are loaded as plugins. Applauncherd searches for plugin libraries in /usr/lib/applaucherd/lib*booster.so and @@ -60,20 +60,17 @@ The launcher itself is a library that is loaded by a small C-program (/usr/bin/a launcher binary to any libraries. This allows us to fully control how (with which flags) the preloaded libraries are opened with dlopen(). -Each application type (currently Qt and MeeGo Touch) has its own booster +Each application type (currently Qt or QtDeclarative) has its own booster process. When booster launches the application by calling the "main()" function, applauncherd will create new booster process of that type. Booster processes do some initializations that cannot be shared among other processes and therefore have to be done after forking. This allows, -for instance, instantiating a MeeGo Touch application before knowing the +for instance, instantiating a application before knowing the name of the application. Then the booster process waits for a connection from the invoker with the information about which application should be launched. -With MeeGo Touch booster it's possible to fetch certain objects from a cache. This will significantly reduce the startup time of an application. - - Contributors ============================== diff --git a/data/mkspecs/features/meegotouch-boostable.prf b/data/mkspecs/features/meegotouch-boostable.prf deleted file mode 100644 index 7487b09..0000000 --- a/data/mkspecs/features/meegotouch-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 += meegotouch-boostable diff --git a/data/pkgconfig/DO-NOT-MOVE b/data/pkgconfig/DO-NOT-MOVE deleted file mode 100644 index ff491be..0000000 --- a/data/pkgconfig/DO-NOT-MOVE +++ /dev/null @@ -1,3 +0,0 @@ -Do not move meegotouch-boostable.pc unless you modify the CMakeLists.txt files of -the test applications accordingly. Building the test applications looks for the -.pc file in this directory to get correct linker flags. diff --git a/data/pkgconfig/meegotouch-boostable.pc b/data/pkgconfig/meegotouch-boostable.pc deleted file mode 100644 index ced3713..0000000 --- a/data/pkgconfig/meegotouch-boostable.pc +++ /dev/null @@ -1,5 +0,0 @@ -Name: meegotouch-boostable -Description: make application boostable by applauncherd -Version: 0.2.0 -Libs: -pie -rdynamic -Cflags: -fPIC -fvisibility=hidden -fvisibility-inlines-hidden diff --git a/doc/doxygen-userdoc.conf b/doc/doxygen-userdoc.conf index 44fb6ee..d1396aa 100644 --- a/doc/doxygen-userdoc.conf +++ b/doc/doxygen-userdoc.conf @@ -566,7 +566,6 @@ WARN_LOGFILE = INPUT = mainpage.dox \ qmlboost.dox \ - libmeegotouchboost.dox \ qtboost.dox \ eboost.dox \ usingqmake.dox \ diff --git a/doc/invokerparameters.dox b/doc/invokerparameters.dox index d59a227..ac98095 100644 --- a/doc/invokerparameters.dox +++ b/doc/invokerparameters.dox @@ -6,7 +6,6 @@ This section describes some of the invoker command line parameters. For a full l TYPE chooses the type of booster used. Qt booster may be used to launch anything. Possible values for TYPE: -- m = Launch a MeeGo Touch application. - q = Launch a Qt application. - d = Launch a Qt Declarative (QML) application. - e = Launch any application even if it is not a library. diff --git a/doc/libmeegotouchboost.dox b/doc/libmeegotouchboost.dox deleted file mode 100644 index b205ef2..0000000 --- a/doc/libmeegotouchboost.dox +++ /dev/null @@ -1,149 +0,0 @@ -/*! \page libmeegotouchboost Using the MeeGo Touch booster - -This section describes how to use the MeeGo Touch booster. The -booster provides the application with the key libraries already -present in the process, and instances of \c MApplication and -\c MApplicationWindow waiting in the cache. - -\section mtboostprereq Prerequisites - -The launcher can start an application if the following prerequisites are met: - -\li MApplication and MApplicationWindow instances are taken into use from -MComponentCache - -\li application is compiled and linked to a position-independent binary -(executable or library) - -\li application is started with the \c invoker command instead of executing the -executable file - -\section mtboostcompiling 1. Compiling and linking for launcher - -If you intend to run a binary with \c applauncherd, compile it -with \c -fPIC option to produce position independent code. It is -recommended to link them either as shared libraries, or, preferably, as -position-independent executables, which can be executed both traditionally and -with the launcher. The \c -pie and \c -rdynamic linker flags -accomplish this. - -To improve linking and loading times of shared object libraries, it is -recommended that you hide any unnecessary symbols from the resulting binary -by using \c -fvisibility=hidden and \c -fvisibility-inlines-hidden -flags as well. However, \c applauncherd needs to find the entry point -for your application, so the symbol \c main needs to be explicitly made -visible. This can be done as follows: - -\code -#include - -M_EXPORT int main(int argc, char **argv) -{ -... -} -\endcode - -If your application loads a plug-in that needs to access some symbols -in the main application, the symbols also need to be exported. In -addition, you must use the \c --global-syms invoker parameter, as -described in \ref invokerparameters "Advanced invoker command line parameters". - -Normally you do not need to worry about the compiler and linker -flags, as the \c libmeegotouch-dev package provides configuration -options for \c qmake, \c CMake, and \c pkg-config. If you are building -a Debian package, make your package build-depend on \c -libmeegotouch-dev and your application binary package depend on -\c applauncherd. - -For details on how to get the compiler and linker flags, see -\ref usingqmake "Using qmake", \ref usingcmake "Using CMake", or -\ref usingpkgconfig "Using pkg-config". - -\section mtboostcache 2. Utilising the booster cache - -Instantiating \c MApplication and \c MApplicationWindow is a relatively -expensive operation. The MeeGo Touch booster helps reduce application startup -latency by creating instances of the classes in \c MComponentCache. - -MApplication instance must be taken from the MComponentCache. It is -recommended to take MApplicationWindow from the cache as well. Thus, -if the classes are instantiated in the application as follows: - -\code - MApplication application(argc, argv); - MApplicationWindow window; -\endcode - -Modify the code as follows: - -\code -MApplication* application = MComponentCache::mApplication(argc, argv); -MApplicationWindow* window = MComponentCache::mApplicationWindow(); -\endcode - -The cache class works both with the booster and without it. In the -non-boosted case there are no pre-created instances, so the cache -class simply creates the instances on the fly. - -The ownership of the instances is transferred from the cache to the -application code. The instances need to be deleted in the correct -order, deleting the \c MApplication instance before the \c -MApplicationWindow instance is known to cause crashes. - -\section mtboostexit 3. Adapting application source code - -Making use of the cache is typically the only modification that you need to -make in the application. However, if the application has explicit calls to \c -exit(), change these to use \c _exit() instead. The brief -explanation is that this prevents cleanup actions related to shared -libraries to be performed multiple times. For more details, see -\ref limitations "Limitations and known issues". - -\section mtboostinvoker 4. Launching the application - -Now everything should be in place for launching the application. The -linker flags create a Position Independent Binary (PIE), so the -application can still be invoked from the command line. In order to -verify that the modifications done to the application and the build -scripts have not broken anything, it is a good idea at this point to -check that the application still starts and functions normally from -the command line: - -\code -$ ./myApp -\endcode - -The next step is to use the \c invoker to launch the application. In -order for this to work, you need to have \c applauncherd and \c -booster-m (the MeeGo Touch booster process) running. To check that this is the -case, you can do: - -\code -$ ps ax | grep booster-m -\endcode - -If you do not see the booster process, you need to start \c -applauncherd manually. In MeeGo 1.2 Harmattan, \c applauncherd should -be running as part of the UI session. - -Once you have verified that the booster process is running, you can -use the following command line to ask the booster process to turn into -your application: - -\code -invoker --type=m /usr/bin/myApp -\endcode - -\section mtboostfinishingtouch 5. Finishing touches - -The invoker can also provide single instance behaviour and a splash -screen for your application as follows. For more details, see -\ref singleinstance "Enabling single instance support for an application" and -\ref splash "Enabling a splash screen for an application". - -\code -/usr/bin/invoker --single-instance --splash=/usr/share/myApp/splash.jpg --type=m /usr/bin/myApp -\endcode - -*/ - diff --git a/doc/mainpage.dox b/doc/mainpage.dox index b5fb21d..b1afff8 100644 --- a/doc/mainpage.dox +++ b/doc/mainpage.dox @@ -19,7 +19,6 @@ of applications. boosting splash single instance QML x x x Qt x(1) x x -MeeGo Touchx x x other - x x @@ -68,10 +67,9 @@ with the template. In order to boost Qt Quick applications with \c invoker, some changes in the application and the way it is built are needed. The process is -similar for MeeGo Touch applications and plain Qt applications, for -details see appropriate documentation below. The \c applauncherd-dev -package needs to be installed to get the necessary headers and -libraries. +similar for plain Qt applications, for details see appropriate documentation +below. The \c applauncherd-dev package needs to be installed to get the necessary +headers and libraries. In the following example a QML application uses a simple C++ based runner. The first step is to modify the application so that it picks up instances @@ -113,7 +111,6 @@ via \ref usingcmake "CMake" or \ref usingqmake "qmake". It is also a good idea to hide any unnecessary symbols in the application binary to speed up opening it in the booster. For instructions, see \ref qmlboost "Using the QML booster" -and \ref libmeegotouchboost "Using the MeeGo Touch booster". \subsection gettingstartedebooster Splash screen and single instance @@ -157,7 +154,6 @@ invoker --type=e --single-instance --splash=/usr/share/images/myAppSplash.jpg /u - How to enable boosted startup for different types of applications: - \subpage qmlboost "Using the QML booster" - \subpage qtboost "Using the Qt booster" - - \subpage libmeegotouchboost "Using the MeeGo Touch booster" - \subpage eboost "Using the exec booster" - \subpage splash "Enabling a splash screen for an application" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b228eab..11d469e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,9 +10,6 @@ add_subdirectory(launcherlib) # Sub build: ebooster plugin add_subdirectory(ebooster) -# Sub build: mbooster plugin -add_subdirectory(mbooster) - # Sub build: qtbooster plugin add_subdirectory(qtbooster) diff --git a/src/common/eventhandler.cpp b/src/common/eventhandler.cpp index 974799b..0919a57 100644 --- a/src/common/eventhandler.cpp +++ b/src/common/eventhandler.cpp @@ -11,7 +11,8 @@ int EventHandler::m_sighupFd[2]; struct sigaction EventHandler::m_oldSigAction; -EventHandler::EventHandler(Booster* parent, EventHandlerType type) : m_item(0), m_parent(parent), m_type(type) +EventHandler::EventHandler(Booster* parent) + : m_parent(parent) { m_sighupFd[0] = -1; m_sighupFd[1] = -1; @@ -32,13 +33,6 @@ void EventHandler::runEventLoop() connect(this, SIGNAL(connectionAccepted()), QApplication::instance(), SLOT(quit())); connect(this, SIGNAL(connectionRejected()), QApplication::instance(), SLOT(quit())); - if (m_type == MEventHandler) - { - // Enable theme change handler - m_item = new MGConfItem(MEEGOTOUCH_THEME_GCONF_KEY, 0); - connect(m_item, SIGNAL(valueChanged()), this, SLOT(notifyThemeChange())); - } - // Start another thread to listen connection from invoker QtConcurrent::run(this, &EventHandler::accept); @@ -64,11 +58,6 @@ void EventHandler::runEventLoop() // Run event loop so application instance can receive notifications QApplication::exec(); - // Disable theme change handler - disconnect(m_item, 0, this, 0); - delete m_item; - m_item = NULL; - // Restore signal handlers to previous values if (handlerIsSet) { @@ -88,17 +77,6 @@ void EventHandler::accept() } } -void EventHandler::notifyThemeChange() -{ -#ifdef WITH_COVERAGE - __gcov_flush(); -#endif - - // only MApplication is connected to this signal - QApplication::quit(); - _exit(EXIT_SUCCESS); -} - // // All this signal handling code is taken from Qt's Best Practices: // http://doc.qt.nokia.com/latest/unix-signals.html diff --git a/src/common/eventhandler.h b/src/common/eventhandler.h index 4a23fa9..c0f2f50 100644 --- a/src/common/eventhandler.h +++ b/src/common/eventhandler.h @@ -2,7 +2,6 @@ #include #include #include -#include using std::tr1::shared_ptr; @@ -14,15 +13,8 @@ class EventHandler : public QObject Q_OBJECT public: - - enum EventHandlerType - { - QEventHandler, - MEventHandler - }; - //! \brief Constructor - EventHandler(Booster* parent, EventHandlerType type); + EventHandler(Booster* parent); //! \brief Destructor virtual ~EventHandler(); @@ -52,24 +44,14 @@ private: //! Old sigaction struct static struct sigaction m_oldSigAction; - //! GConf item to listen theme change - MGConfItem* m_item; - // Parent object Booster* m_parent; - // type of application's event loop - const EventHandlerType m_type; - private slots: //! Qt signal handler for SIGHUP. void handleSigHup(); - //! Qt signal handler for theme change - //! Deprecated in MeeGo 1.2 Harmattan - void notifyThemeChange(); - signals: void connectionAccepted(); void connectionRejected(); diff --git a/src/ebooster/CMakeLists.txt b/src/ebooster/CMakeLists.txt index 9fd2436..1ccac5a 100644 --- a/src/ebooster/CMakeLists.txt +++ b/src/ebooster/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") set(SRC ebooster.cpp pluginfactory.cpp) # Set libraries to be linked. -link_libraries("-L../launcherlib -lapplauncherd" ${MEEGOTOUCH_LIBRARIES} ${LIBDL} ${QT_QTCORE_LIBRARY}) +link_libraries("-L../launcherlib -lapplauncherd" ${LIBDL} ${QT_QTCORE_LIBRARY}) # Set executable add_library(ebooster MODULE ${SRC} ${MOC_SRC}) diff --git a/src/ebooster/ebooster.cpp b/src/ebooster/ebooster.cpp index fe911e4..d7f8829 100644 --- a/src/ebooster/ebooster.cpp +++ b/src/ebooster/ebooster.cpp @@ -19,13 +19,8 @@ #include "ebooster.h" #include "logger.h" - #include - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - +#include #include "coverage.h" const string EBooster::m_socketId = "/tmp/booste"; diff --git a/src/invoker/invokelib.h b/src/invoker/invokelib.h index 2268140..615799a 100644 --- a/src/invoker/invokelib.h +++ b/src/invoker/invokelib.h @@ -27,10 +27,6 @@ bool invoke_recv_msg(int fd, uint32_t *msg); void invoke_send_str(int fd, char *str); -#define INVOKER_M_SOCK "/tmp/boostm" -#define INVOKER_QT_SOCK "/tmp/boostq" -#define INVOKER_QDECL_SOCK "/tmp/boostd" -#define INVOKER_EXEC_SOCK "/tmp/booste" // Existence of the test mode control file is checked // to enable test mode. #define TEST_MODE_CONTROL_FILE "/root/.itm" diff --git a/src/invoker/invoker.c b/src/invoker/invoker.c index 4a8c10a..a64aaa3 100644 --- a/src/invoker/invoker.c +++ b/src/invoker/invoker.c @@ -43,7 +43,6 @@ #include "protocol.h" #include "invokelib.h" #include "search.h" -#include "whitelist.h" // Delay before exit. static const unsigned int EXIT_DELAY = 0; @@ -59,14 +58,6 @@ static const unsigned int MAX_RESPAWN_DELAY = 10; static const unsigned char EXIT_STATUS_APPLICATION_CONNECTION_LOST = 0xfa; static const unsigned char EXIT_STATUS_APPLICATION_NOT_FOUND = 0x7f; -// Enumeration of possible application types: -// M_APP : MeeGo Touch application -// QT_APP : Qt/generic application -// QDECL_APP : QDeclarative (QML) application -// EXEC_APP : Executable generic application (can be used with splash screen) -// -enum APP_TYPE { M_APP, QT_APP, QDECL_APP, EXEC_APP, UNKNOWN_APP }; - // Environment extern char ** environ; @@ -187,7 +178,7 @@ static bool invoke_recv_ack(int fd) } // Inits a socket connection for the given application type -static int invoker_init(enum APP_TYPE app_type) +static int invoker_init(char app_type) { int fd; struct sockaddr_un sun; @@ -202,29 +193,18 @@ static int invoker_init(enum APP_TYPE app_type) sun.sun_family = AF_UNIX; //AF_FILE; const int maxSize = sizeof(sun.sun_path) - 1; - if(app_type == M_APP) - { - strncpy(sun.sun_path, INVOKER_M_SOCK, maxSize); - } - else if (app_type == QT_APP) - { - strncpy(sun.sun_path, INVOKER_QT_SOCK, maxSize); - } - else if (app_type == QDECL_APP) - { - strncpy(sun.sun_path, INVOKER_QDECL_SOCK, maxSize); - } - else if (app_type == EXEC_APP) + if (app_type >= 'a' && app_type <= 'z') { - strncpy(sun.sun_path, INVOKER_EXEC_SOCK, maxSize); + strncpy(sun.sun_path, "/tmp/boost", maxSize - 1); + int len = strlen(sun.sun_path); + sun.sun_path[len++] = app_type; + sun.sun_path[len] = 0; } else { - die(1, "Unknown type of application: %d\n", app_type); + die(1, "Unknown type of application: %c\n", app_type); } - sun.sun_path[maxSize] = '\0'; - if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) < 0) { error("Failed to initiate connect on the socket.\n"); @@ -413,11 +393,10 @@ static void invoker_send_end(int fd) static void usage(int status) { printf("\nUsage: %s [options] [--type=TYPE] [file] [args]\n\n" - "Launch m, qt, or qdeclarative application compiled as a shared library (-shared) or\n" + "Launch applications compiled as a shared library (-shared) or\n" "a position independent executable (-pie) through %s.\n\n" "TYPE chooses the type of booster used. Qt-booster may be used to\n" "launch anything. Possible values for TYPE:\n" - " m Launch a MeeGo Touch application.\n" " q (or qt) Launch a Qt application.\n" " d Launch a Qt Declarative (QML) application.\n" " e Launch any application, even if it's not a library.\n" @@ -633,35 +612,9 @@ static void invoke_fallback(char **prog_argv, char *prog_name, bool wait_term) exit(EXIT_FAILURE); } -//Check if application (MeeGo Touch) is allowed to be boosted -static bool is_application_whitelisted(const char *const prog_name) -{ - bool result = false; - - if (prog_name == 0) - { - return result; - } - - unsigned int list_size = sizeof(app_whitelist) / sizeof(char *); - unsigned int i; - - for (i = 0; i < list_size; i++) - { - const char * app = app_whitelist[i]; - if (strcmp(app, prog_name) == 0) - { - result = true; - break; - } - } - - return result; -} - // Invokes the given application static int invoke(int prog_argc, char **prog_argv, char *prog_name, - enum APP_TYPE app_type, uint32_t magic_options, bool wait_term, unsigned int respawn_delay, + char app_type, uint32_t magic_options, bool wait_term, unsigned int respawn_delay, char *splash_file, char *landscape_splash_file, bool test_mode) { int status = 0; @@ -674,12 +627,6 @@ static int invoke(int prog_argc, char **prog_argv, char *prog_name, info("Invoker test mode is not enabled.\n"); } - // This is a check if MeeGo Touch application is not allowed to be boosted - if (app_type == M_APP && !test_mode && !is_application_whitelisted(prog_name)) - { - info("Application '%s' is not allowed to use booster '--type=m', '--type=q' will be used instead.\n", prog_name); - app_type = QT_APP; - } // This is a fallback if connection with the launcher // process is broken int fd = invoker_init(app_type); @@ -702,7 +649,7 @@ static int invoke(int prog_argc, char **prog_argv, char *prog_name, int main(int argc, char *argv[]) { - enum APP_TYPE app_type = UNKNOWN_APP; + const char *app_type = NULL; int prog_argc = 0; uint32_t magic_options = 0; bool wait_term = true; @@ -784,19 +731,7 @@ int main(int argc, char *argv[]) break; case 't': - if (strcmp(optarg, "m") == 0) - app_type = M_APP; - else if (strcmp(optarg, "q") == 0 || strcmp(optarg, "qt") == 0) - app_type = QT_APP; - else if (strcmp(optarg, "d") == 0) - app_type = QDECL_APP; - else if (strcmp(optarg, "e") == 0) - app_type = EXEC_APP; - else - { - report(report_error, "Unknown application type: %s \n", optarg); - usage(1); - } + app_type = optarg; break; case 'd': @@ -856,8 +791,12 @@ int main(int argc, char *argv[]) return EXIT_STATUS_APPLICATION_NOT_FOUND; } - // Check if application type is unknown - if (app_type == UNKNOWN_APP) + // Translate 'qt' and 'm' types to 'q' for compatibility + if (!strcmp(app_type, "qt") || !strcmp(app_type, "m")) + app_type = "q"; + + // Check if application type is unknown. Only accept one character types. + if (!app_type || !app_type[0] || app_type[1]) { report(report_error, "Application's type is unknown.\n"); usage(1); @@ -869,10 +808,9 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - // Send commands to the launcher daemon info("Invoking execution: '%s'\n", prog_name); - int ret_val = invoke(prog_argc, prog_argv, prog_name, app_type, magic_options, wait_term, respawn_delay, splash_file, landscape_splash_file, test_mode); + int ret_val = invoke(prog_argc, prog_argv, prog_name, *app_type, magic_options, wait_term, respawn_delay, splash_file, landscape_splash_file, test_mode); // Sleep for delay before exiting if (delay) diff --git a/src/invoker/whitelist.h b/src/invoker/whitelist.h deleted file mode 100644 index f538592..0000000 --- a/src/invoker/whitelist.h +++ /dev/null @@ -1,49 +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. -** -****************************************************************************/ - -#ifndef WHITELIST_H -#define WHITELIST_H - -const char * const app_whitelist[] = -{ - "/usr/bin/conndlgs", - "/usr/bin/call-ui", - "/usr/bin/accounts-ui", - "/usr/bin/grob", - "/usr/bin/calc", - "/usr/bin/organiser", - "/usr/bin/call-history", - "/usr/bin/camera-ui", - "/usr/bin/contacts", - "/usr/bin/duicontrolpanel.launch", - "/usr/bin/gallery", - "/usr/bin/fenix", - "/usr/bin/mediaviewer", - "/usr/bin/messaging-ui", - "/usr/bin/music-suite", - "/usr/bin/notes", - "/usr/bin/office-tools", - "/usr/bin/search", - "/usr/bin/sync-ui", - "/usr/bin/userguide", - "/usr/bin/video-suite", - "/usr/bin/videosheetplayer" -}; - -#endif // WHITELIST_H diff --git a/src/launcher/CMakeLists.txt b/src/launcher/CMakeLists.txt index 8ed60a8..a487558 100644 --- a/src/launcher/CMakeLists.txt +++ b/src/launcher/CMakeLists.txt @@ -23,7 +23,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_POSIX_C_SOURCE=200112L -Wl,--no- # Set precompiler flags add_definitions(-DLIBRARIES_CONFIG_FILE="/etc/applauncherd.conf") -add_definitions(-DLAUNCHER_LIBRARY="/usr/lib/applauncherd/libapplauncherd.so") +add_definitions(-DLAUNCHER_LIBRARY="/usr/lib/libapplauncherd.so.0") link_libraries(${LIBDL}) diff --git a/src/launcherlib/CMakeLists.txt b/src/launcherlib/CMakeLists.txt index 8c14d80..93e060a 100644 --- a/src/launcherlib/CMakeLists.txt +++ b/src/launcherlib/CMakeLists.txt @@ -11,7 +11,8 @@ set(SRC appdata.cpp booster.cpp boosterfactory.cpp boosterpluginregistry.cpp connection.cpp daemon.cpp logger.cpp main.cpp singleinstance.cpp socketmanager.cpp) -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) +set(HEADERS appdata.h booster.h boosterfactory.h boosterpluginregistry.h + connection.h daemon.h logger.h launcherlib.h singleinstance.h socketmanager.h) # Set libraries to be linked. Shared libraries to be preloaded are not linked in anymore, # but dlopen():ed and listed in src/launcher/preload.h instead. @@ -19,7 +20,9 @@ link_libraries(${LIBDL} ${X11_LIBRARIES}) # Set executable add_library(applauncherd MODULE ${SRC} ${MOC_SRC}) +set_target_properties(applauncherd PROPERTIES VERSION 0.1 SOVERSION 0) # Add install rule -install(FILES libapplauncherd.so DESTINATION /usr/lib/applauncherd/) - +install(TARGETS applauncherd DESTINATION /usr/lib) +install(FILES ${HEADERS} DESTINATION /usr/include/applauncherd + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) diff --git a/src/mbooster/CMakeLists.txt b/src/mbooster/CMakeLists.txt deleted file mode 100644 index 1b2a3cf..0000000 --- a/src/mbooster/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Qt support -include(${QT_USE_FILE}) - -set(LAUNCHER "${CMAKE_HOME_DIRECTORY}/src/launcherlib") -set(COMMON "${CMAKE_HOME_DIRECTORY}/src/common") - -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${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 mbooster.cpp pluginfactory.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp -${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp -${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp -${COMMON}/eventhandler.cpp) - -set(MOC_HDRS ${COMMON}/eventhandler.h) -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) - -# Set libraries to be linked. -link_libraries(${MEEGOTOUCH_LIBRARIES} ${LIBDL} ${QT_QTCORE_LIBRARY}) - -# Set executable -add_library(mbooster MODULE ${SRC} ${MOC_SRC}) - -# Add install rule -install(TARGETS mbooster DESTINATION /usr/lib/applauncherd/) diff --git a/src/mbooster/mbooster.cpp b/src/mbooster/mbooster.cpp deleted file mode 100644 index e5bf32e..0000000 --- a/src/mbooster/mbooster.cpp +++ /dev/null @@ -1,123 +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 "mbooster.h" -#include "logger.h" -#include "connection.h" - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - -const string MBooster::m_socketId = "/tmp/boostm"; -const string MBooster::m_temporaryProcessName = "booster-m"; - -const string & MBooster::socketId() const -{ - return m_socketId; -} - -bool MBooster::preload() -{ -#ifdef HAVE_MCOMPONENTCACHE - // Populate the cache (instantiates an MApplicationWindow and - // an MApplication) - MComponentCache::populateForMApplication(); -#endif - - return true; -} - -const string & MBooster::socketName() -{ - return m_socketId; -} - -const string & MBooster::temporaryProcessName() -{ - return m_temporaryProcessName; -} - -const string & MBooster::boosterTemporaryProcessName() const -{ - return temporaryProcessName(); -} - -char MBooster::type() -{ - return 'm'; -} - -bool MBooster::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, EventHandler::MEventHandler); - 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 MBooster::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); - - // Set the magic attribute so that paths are reinitialized - // QApplication::setAttribute(Qt::AA_LinuxReinitPathsFromArgv0, true); -} diff --git a/src/mbooster/mbooster.h b/src/mbooster/mbooster.h deleted file mode 100644 index 35f6148..0000000 --- a/src/mbooster/mbooster.h +++ /dev/null @@ -1,117 +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 MBOOSTER_H -#define MBOOSTER_H - -#include -#include "QFileInfo" - -#include "eventhandler.h" -#include "booster.h" - -#include - -/*! - \class MBooster - \brief MeeGo Touch -specific version of the Booster. - - MBooster effectively fills MComponentCache with fresh objects. - MeeGo Touch applications can then try to use already initialized objects - from MComponentCache. This can significantly reduce the startup time of a - MeeGo Touch application. - */ -class MBooster : public Booster -{ -public: - - //! \brief Constructor - MBooster() {} - - //! \brief Destructor - virtual ~MBooster() {} - - /*! - * \brief Return the socket name common to all MBooster 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 ('m') represtenting the type of MBoosters. - * \return Type character. - */ - static char type(); - - //! \reimp - virtual const string & socketId() const; - -protected: - - //! \reimp - virtual bool preload(); - - //! \reimp - virtual bool receiveDataFromInvoker(int socketFd); - - //! \reimp - virtual void preinit(); - -private: - - //! Disable copy-constructor - MBooster(const MBooster & r); - - //! Disable assignment operator - MBooster & operator= (const MBooster & 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; - - //! wait for socket connection - void accept(); - -private slots: - - //! Qt signal handler for SIGHUP. - void handleSigHup(); - - //! Qt signal handler for theme change - void notifyThemeChange(); - - -#ifdef UNIT_TEST - friend class Ut_MBooster; -#endif -}; - -#endif // MBOOSTER_H diff --git a/src/mbooster/pluginfactory.cpp b/src/mbooster/pluginfactory.cpp deleted file mode 100644 index e8ad388..0000000 --- a/src/mbooster/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 "mbooster.h" - -extern "C" -{ - // Create a new plugin instance. - Q_DECL_EXPORT void * create() - { - return new MBooster; - } - - Q_DECL_EXPORT char type() - { - return MBooster::type(); - } - - Q_DECL_EXPORT const char * socketName() - { - return MBooster::socketName().c_str(); - } - - Q_DECL_EXPORT const char * temporaryProcessName() - { - return MBooster::temporaryProcessName().c_str(); - } -} diff --git a/src/qdeclarativebooster/CMakeLists.txt b/src/qdeclarativebooster/CMakeLists.txt index 497b0ea..15c1a52 100644 --- a/src/qdeclarativebooster/CMakeLists.txt +++ b/src/qdeclarativebooster/CMakeLists.txt @@ -9,9 +9,7 @@ set(COMMON "${CMAKE_HOME_DIRECTORY}/src/common") include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${COMMON} ${LAUNCHER}) # Set sources -set(PLUGINSRC qdeclarativebooster.cpp pluginfactory.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp -${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp -${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp ${COMMON}/eventhandler.cpp) +set(PLUGINSRC qdeclarativebooster.cpp pluginfactory.cpp ${COMMON}/eventhandler.cpp) set(MOC_HDRS ${COMMON}/eventhandler.h) qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) @@ -29,7 +27,7 @@ target_link_libraries(mdeclarativecache ${LIBDL} ${QT_QTCORE_LIBRARY} ${QT_QTDEC add_library(qdeclarativebooster MODULE ${PLUGINSRC} ${MOC_SRC}) set_target_properties(qdeclarativebooster PROPERTIES COMPILE_FLAGS -fvisibility=hidden) -target_link_libraries(qdeclarativebooster ${LIBDL} "-L. -lmdeclarativecache") +target_link_libraries(qdeclarativebooster ${LIBDL} "-L. -lmdeclarativecache -L../launcherlib -lapplauncherd") add_dependencies(qdeclarativebooster mdeclarativecache) # Add install rule diff --git a/src/qdeclarativebooster/qdeclarativebooster.cpp b/src/qdeclarativebooster/qdeclarativebooster.cpp index 27889b8..1d1d90c 100644 --- a/src/qdeclarativebooster/qdeclarativebooster.cpp +++ b/src/qdeclarativebooster/qdeclarativebooster.cpp @@ -69,7 +69,7 @@ bool QDeclarativeBooster::receiveDataFromInvoker(int socketFd) // Setup the conversation channel with the invoker. setConnection(new Connection(socketFd)); - EventHandler handler(this, EventHandler::QEventHandler); + EventHandler handler(this); handler.runEventLoop(); if (!connection()->connected()) diff --git a/src/qtbooster/CMakeLists.txt b/src/qtbooster/CMakeLists.txt index 1ba3de8..3d1ad1c 100644 --- a/src/qtbooster/CMakeLists.txt +++ b/src/qtbooster/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") set(SRC qtbooster.cpp pluginfactory.cpp) # Set libraries to be linked. -link_libraries("-L../launcherlib -lapplauncherd" ${MEEGOTOUCH_LIBRARIES} ${LIBDL} ${QT_QTCORE_LIBRARY}) +link_libraries("-L../launcherlib -lapplauncherd" ${LIBDL} ${QT_QTCORE_LIBRARY}) # Set executable add_library(qtbooster MODULE ${SRC}) diff --git a/src/single-instance/CMakeLists.txt b/src/single-instance/CMakeLists.txt index 18ce2f0..5707385 100644 --- a/src/single-instance/CMakeLists.txt +++ b/src/single-instance/CMakeLists.txt @@ -4,6 +4,7 @@ set(COMMON "${CMAKE_HOME_DIRECTORY}/src/common") set(SRC main.cpp ${COMMON}/report.c) # Find X11 +include(FindPkgConfig) pkg_check_modules(X11 x11 REQUIRED) # Set include dirs diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 707b24f..2677730 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,30 +22,18 @@ add_subdirectory(common/testapps/fala_status) # Sub build: common/testapps/fala_wait add_subdirectory(common/testapps/fala_wait) -# Sub build: common/testapps/fala_exit -add_subdirectory(common/testapps/fala_exit) - # Sub build: common/testapps/focustest add_subdirectory(common/testapps/focustest) # Sub build: common/testapps/testapp add_subdirectory(common/testapps/testapp) -# Sub build: common/testapps/themetest -add_subdirectory(common/testapps/themetest) - # Sub build: common/testapps/fala_gettime add_subdirectory(common/testapps/fala_gettime) # Sub build: common/testapps/fala_gettime_ms add_subdirectory(common/testapps/fala_gettime_ms) -# Sub build: common/testapps/fala_multi-instance -add_subdirectory(common/testapps/fala_multi-instance) - -# Sub build: common/testapps/helloworld -add_subdirectory(common/testapps/helloworld) - # Sub build: common/testapps/pixelchanged add_subdirectory(common/testapps/pixelchanged) @@ -58,9 +46,6 @@ add_subdirectory(common/testapps/xsendevent) # Sub build: common/testapps/fala_qml_helloworld add_subdirectory(common/testapps/fala_qml_helloworld) -# Sub build: common/testapps/fala_multiwindow -add_subdirectory(common/testapps/fala_multiwindow) - # Sub build: common/testapps/fala_windowless add_subdirectory(common/testapps/fala_windowless) diff --git a/tests/common/testapps/fala_dbus/CMakeLists.txt b/tests/common/testapps/fala_dbus/CMakeLists.txt index 0b67c51..5f131e8 100644 --- a/tests/common/testapps/fala_dbus/CMakeLists.txt +++ b/tests/common/testapps/fala_dbus/CMakeLists.txt @@ -1,27 +1,25 @@ # Set sources set(SRC fala_dbus.cpp) -link_libraries(${MEEGOTOUCH_LIBRARIES} ${QT_QTDBUS_LIBRARY}) +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}) -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. execute_process(COMMAND "env" "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" "/usr/bin/pkg-config" "--cflags" - "meegotouch-boostable" + "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" - "meegotouch-boostable" + "qt-boostable" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE booster_libs OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/tests/common/testapps/fala_dbus/fala_dbus.cpp b/tests/common/testapps/fala_dbus/fala_dbus.cpp index 05faa3f..00e3907 100644 --- a/tests/common/testapps/fala_dbus/fala_dbus.cpp +++ b/tests/common/testapps/fala_dbus/fala_dbus.cpp @@ -17,26 +17,16 @@ ** ****************************************************************************/ -#include +#include #include #include #include #include #include -#include - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - -M_EXPORT int main(int argc, char ** argv) +Q_DECL_EXPORT int main(int argc, char ** argv) { -#ifdef HAVE_MCOMPONENTCACHE - MApplication *app = MComponentCache::mApplication(argc, argv); -#else - MApplication *app = new MApplication(argc, argv); -#endif + 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"); diff --git a/tests/common/testapps/fala_exit/CMakeLists.txt b/tests/common/testapps/fala_exit/CMakeLists.txt deleted file mode 100644 index b38b84e..0000000 --- a/tests/common/testapps/fala_exit/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# Set sources -set(SRC fala_exit.cpp) - -link_libraries(${MEEGOTOUCH_LIBRARIES}) - -include(${QT_USE_FILE}) - -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "meegotouch-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" - "meegotouch-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_exit ${SRC}) - -install(PROGRAMS fala_exit DESTINATION /usr/bin/) - diff --git a/tests/common/testapps/fala_exit/fala_exit.cpp b/tests/common/testapps/fala_exit/fala_exit.cpp deleted file mode 100644 index d072b44..0000000 --- a/tests/common/testapps/fala_exit/fala_exit.cpp +++ /dev/null @@ -1,46 +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 - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - -M_EXPORT int main(int argc, char ** argv) -{ -#ifdef HAVE_MCOMPONENTCACHE - MApplication *app = MComponentCache::mApplication(argc, argv); - MApplicationWindow *window = MComponentCache::mApplicationWindow(); -#else - MApplication *app = new MApplication(argc, argv); - MApplicationWindow *window = new MApplicationWindow; -#endif - - MApplicationPage *mainPage = new MApplicationPage; - window->show(); - mainPage->appear(window); - QTimer::singleShot(3000, app, SLOT(quit())); - exit(app->exec()); -} diff --git a/tests/common/testapps/fala_multi-instance/CMakeLists.txt b/tests/common/testapps/fala_multi-instance/CMakeLists.txt deleted file mode 100644 index 02a20ad..0000000 --- a/tests/common/testapps/fala_multi-instance/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Set sources -set(SRC fala_multi-instance.cpp mainpage.cpp mainwindow.cpp) -set(MOC_HDRS mainpage.h mainwindow.h) -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) - -link_libraries(${MEEGOTOUCH_LIBRARIES}) - -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "meegotouch-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" - "meegotouch-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}) - -# Enable Qt-support -include(${QT_USE_FILE}) - -add_executable(fala_multi-instance ${SRC} ${MOC_SRC}) - -# Install -install(PROGRAMS fala_multi-instance DESTINATION /usr/bin/) - diff --git a/tests/common/testapps/fala_multi-instance/fala_multi-instance.cpp b/tests/common/testapps/fala_multi-instance/fala_multi-instance.cpp deleted file mode 100644 index 15a248a..0000000 --- a/tests/common/testapps/fala_multi-instance/fala_multi-instance.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "mainpage.h" -#include "mainwindow.h" - -M_EXPORT int main(int argc, char ** argv) -{ - QString servicename(QString("com.nokia.multihello") + QString(argv[1])); - QString title(QString("App ")+ QString(argv[1])); - MApplicationService *mService = new MApplicationService(servicename, 0); - MApplication * app = MComponentCache::mApplication(argc, argv, "multihello", mService); - MainWindow window; - MainPage mainPage; - mainPage.setName(title); - - window.show(); - - mainPage.appear(); - - _exit(app->exec()); -} - diff --git a/tests/common/testapps/fala_multi-instance/mainpage.cpp b/tests/common/testapps/fala_multi-instance/mainpage.cpp deleted file mode 100644 index 8aa86f5..0000000 --- a/tests/common/testapps/fala_multi-instance/mainpage.cpp +++ /dev/null @@ -1,65 +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 libmeegotouch. -** -** 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 "mainpage.h" - - -MainPage::MainPage() -{ -} - -MainPage::~MainPage() -{ -} - -void MainPage::setName(QString name) -{ - myName = name; -} - -void MainPage::createContent() -{ - MLayout *layout = new MLayout(centralWidget()); - MGridLayoutPolicy *policy = new MGridLayoutPolicy(layout); - policy->setSpacing(20.0); - - MLabel *label1 = new MLabel(myName); - label1->setAlignment(Qt::AlignCenter); - policy->addItem(label1, 1, 1); - - layout->setLandscapePolicy(policy); - layout->setPortraitPolicy(policy); -} - -void MainPage::exitDisplayEvent() -{ - std::cerr << myName.toStdString() << " MainPage hidden" << std::endl; -} - -void MainPage::enterDisplayEvent() -{ - std::cerr << myName.toStdString() << " MainPage visible" << std::endl; -} - diff --git a/tests/common/testapps/fala_multi-instance/mainpage.h b/tests/common/testapps/fala_multi-instance/mainpage.h deleted file mode 100644 index 18d111b..0000000 --- a/tests/common/testapps/fala_multi-instance/mainpage.h +++ /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 libmeegotouch. -** -** 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 MAINPAGE_H -#define MAINPAGE_H - -#include -#include - -class MainPage : public MApplicationPage -{ - Q_OBJECT - -public: - MainPage(); - virtual ~MainPage(); - virtual void createContent(); - void setName(QString name); - -protected: - //! Visibility re-imps - virtual void exitDisplayEvent(); - virtual void enterDisplayEvent(); - -private: - QString myName; -}; - -#endif // MAINPAGE_H diff --git a/tests/common/testapps/fala_multi-instance/mainwindow.cpp b/tests/common/testapps/fala_multi-instance/mainwindow.cpp deleted file mode 100644 index 51de900..0000000 --- a/tests/common/testapps/fala_multi-instance/mainwindow.cpp +++ /dev/null @@ -1,76 +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 libmeegotouch. -** -** 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 "mainwindow.h" - -#include -#include -#include -#include - -void FANGORNLOG(const char* s) -{ - QFile f("/tmp/fala_multi-instance.log"); - f.open(QIODevice::Append); - f.write(s, qstrlen(s)); - f.close(); -} - -void timestamp(const char *s) -{ - timeval tim; - char msg[80]; - gettimeofday(&tim, NULL); - snprintf(msg, 80, "%d%03d %s\n", - static_cast(tim.tv_sec), static_cast(tim.tv_usec/1000), s); - FANGORNLOG(msg); -} - -MainWindow::MainWindow() -{ -} - -MainWindow::~MainWindow() -{ -} - -bool MainWindow::event(QEvent *event) -{ - bool retVal = MApplicationWindow::event(event); - if (event->type() == QEvent::WindowStateChange) - { - char message[32]; - if (isMinimized()) - { - std::cerr << "Minimized" << std::endl; - snprintf(message, 32, "%i Minimized", getpid()); - timestamp(message); - } - else - { - std::cerr << "Maximized" << std::endl; - snprintf(message, 32, "%i Maximized", getpid()); - timestamp(message); - } - } - return retVal; -} - diff --git a/tests/common/testapps/fala_multi-instance/mainwindow.h b/tests/common/testapps/fala_multi-instance/mainwindow.h deleted file mode 100644 index 196f8c2..0000000 --- a/tests/common/testapps/fala_multi-instance/mainwindow.h +++ /dev/null @@ -1,39 +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 libmeegotouch. -** -** 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 MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include - -class MainWindow : public MApplicationWindow -{ - Q_OBJECT - -public: - MainWindow(); - virtual ~MainWindow(); - -protected: - bool event(QEvent *event); -}; - -#endif // MAINWINDOW_H diff --git a/tests/common/testapps/fala_multiwindow/CMakeLists.txt b/tests/common/testapps/fala_multiwindow/CMakeLists.txt deleted file mode 100644 index 11e2c09..0000000 --- a/tests/common/testapps/fala_multiwindow/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Set sources -set(SRC main.cpp mainpage.cpp multiwindowcontent.cpp) - -# Set moc headers -set(MOC_HDRS mainpage.h multiwindowcontent.h) -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) - -link_libraries(${MEEGOTOUCH_LIBRARIES}) - -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "meegotouch-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" - "meegotouch-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}) - -# Enable Qt-support -include(${QT_USE_FILE}) - - -# Enable Qt-support -include(${QT_USE_FILE}) - -set(NAME fala_multi-window) - -add_executable(${NAME} ${SRC} ${MOC_SRC}) - -# Install -install(PROGRAMS ${NAME} DESTINATION /usr/bin) - diff --git a/tests/common/testapps/fala_multiwindow/README b/tests/common/testapps/fala_multiwindow/README deleted file mode 100644 index 2d66015..0000000 --- a/tests/common/testapps/fala_multiwindow/README +++ /dev/null @@ -1,12 +0,0 @@ -README ------- - -Multiwindow test application. - -Command to launch application - -invoker --test-mode --type=m /usr/bin/fala_multi-window [-window-not-from-cache] - -Application can be started with the switch "-output-level debug" to get information what happens inside it. - - diff --git a/tests/common/testapps/fala_multiwindow/fala_multiwindow.pro b/tests/common/testapps/fala_multiwindow/fala_multiwindow.pro deleted file mode 100644 index a5fa84b..0000000 --- a/tests/common/testapps/fala_multiwindow/fala_multiwindow.pro +++ /dev/null @@ -1,21 +0,0 @@ -TEMPLATE = app -TARGET = fala_multi-window -target.path = /usr/bin -OBJECTS_DIR = ./.obj -MOC_DIR = ./.moc -DEPENDPATH += $$INCLUDEPATH -CONFIG -= app_bundle -CONFIG += meegotouch-boostable - -SOURCES += main.cpp \ - mainpage.cpp \ - multiwindowcontent.cpp - -HEADERS += mainpage.h \ - multiwindowcontent.h - -# Install instructions -INSTALLS += target - - -DEFINES += HAVE_MCOMPONENTCACHE diff --git a/tests/common/testapps/fala_multiwindow/main.cpp b/tests/common/testapps/fala_multiwindow/main.cpp deleted file mode 100644 index fa319ac..0000000 --- a/tests/common/testapps/fala_multiwindow/main.cpp +++ /dev/null @@ -1,74 +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 applifed. -** -** 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 "multiwindowcontent.h" -#include -#include -#include - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - - -M_EXPORT int main(int argc, char **argv) -{ - MApplication *app; - - try - { -#ifdef HAVE_MCOMPONENTCACHE - app = MComponentCache::mApplication(argc, argv); - - 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) { - MultiWindowContent mwContent(false); - mwContent.createWindows(); - mwContent.activateWindow(1); - } else { - MultiWindowContent mwContent(true); - mwContent.createWindows(); - mwContent.activateWindow(1); - } - -#else - app = new MApplication(argc, argv); - MultiWindowContent mwContent(false); - mwContent.createWindows(); - mwContent.activateWindow(1); -#endif - } - - catch(std::exception& e) - { - return -1; - } - - return app->exec(); -} diff --git a/tests/common/testapps/fala_multiwindow/mainpage.cpp b/tests/common/testapps/fala_multiwindow/mainpage.cpp deleted file mode 100644 index 82349e9..0000000 --- a/tests/common/testapps/fala_multiwindow/mainpage.cpp +++ /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 applifed. -** -** 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 "mainpage.h" - -MainPage::MainPage(QString windowName) : - m_windowName(windowName) -{ - setTitle(windowName); - - m_layout = new MLayout(centralWidget()); - m_policy = new MGridLayoutPolicy(m_layout); - m_policy->setSpacing(20.0); - - m_label = new MLabel(m_windowName); - m_label->setAlignment(Qt::AlignCenter); - m_policy->addItem(m_label, 0, 0); - -} - -MainPage::~MainPage() -{ - delete m_policy; - m_policy = NULL; -} - -void MainPage::createContent() -{} - - diff --git a/tests/common/testapps/fala_multiwindow/mainpage.h b/tests/common/testapps/fala_multiwindow/mainpage.h deleted file mode 100644 index 5ec398a..0000000 --- a/tests/common/testapps/fala_multiwindow/mainpage.h +++ /dev/null @@ -1,46 +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 applifed. -** -** 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 MAINPAGE_H -#define MAINPAGE_H - -#include -#include - -class MLabel; -class MLayout; -class MGridLayoutPolicy; - -class MainPage : public MApplicationPage -{ - Q_OBJECT - -public: - MainPage(QString windowName); - virtual ~MainPage(); - virtual void createContent(); - -private: - QString m_windowName; - MLabel * m_label; - MLayout * m_layout; - MGridLayoutPolicy * m_policy; -}; - -#endif // MAINPAGE_H diff --git a/tests/common/testapps/fala_multiwindow/multiwindowcontent.cpp b/tests/common/testapps/fala_multiwindow/multiwindowcontent.cpp deleted file mode 100644 index d96a9f6..0000000 --- a/tests/common/testapps/fala_multiwindow/multiwindowcontent.cpp +++ /dev/null @@ -1,72 +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 applifed. -** -** 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 "multiwindowcontent.h" -#include "mainpage.h" - -#include -#include - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - - -MultiWindowContent::MultiWindowContent(bool windowFromCache): - m_windowFromCache(windowFromCache) -{ -} - -void MultiWindowContent::createWindows() -{ - // Create windows - for (int i = 0; i < NUM_WINDOWS; i++) { -#ifdef HAVE_MCOMPONENTCACHE - m_window[i] = m_windowFromCache? MComponentCache::mApplicationWindow() : new MApplicationWindow; -#else - m_window[i] = new MApplicationWindow; -#endif - m_window[i]->setWindowTitle(QString("Window %1").arg(i + 1)); - m_window[i]->setObjectName(QString("Window %1").arg(i + 1)); - } - - // Create pages - for (int i = 0; i < NUM_WINDOWS; i++) - m_mainPage[i] = new MainPage(QString("Window %1").arg(i + 1)); -} - -void MultiWindowContent::activateWindow(int index) -{ - index--; - if (index >= 0 && index < NUM_WINDOWS) { - - // Show the desired window - m_window[index]->show(); - m_window[index]->activateWindow(); - m_window[index]->raise(); - - m_mainPage[index]->appear(m_window[index]); - } -} - - -MultiWindowContent::~MultiWindowContent() -{ -} - diff --git a/tests/common/testapps/fala_multiwindow/multiwindowcontent.h b/tests/common/testapps/fala_multiwindow/multiwindowcontent.h deleted file mode 100644 index b42d101..0000000 --- a/tests/common/testapps/fala_multiwindow/multiwindowcontent.h +++ /dev/null @@ -1,44 +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 applifed. -** -** 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 MULTIWINDOWCONTENT_H -#define MULTIWINDOWCONTENT_H - -#include - -#include "mainpage.h" - -class MultiWindowContent -{ -public: - static const int NUM_WINDOWS = 3; - - MultiWindowContent(bool windowFromCache); - virtual ~MultiWindowContent(); - void activateWindow(int index); - - void createWindows(); - -private: - MApplicationWindow *m_window[NUM_WINDOWS]; - MainPage *m_mainPage[NUM_WINDOWS]; - bool m_windowFromCache; -}; - -#endif // MULTIWINDOWCONTENT_H diff --git a/tests/common/testapps/fala_status/CMakeLists.txt b/tests/common/testapps/fala_status/CMakeLists.txt index 2c61ae5..2086722 100644 --- a/tests/common/testapps/fala_status/CMakeLists.txt +++ b/tests/common/testapps/fala_status/CMakeLists.txt @@ -1,30 +1,28 @@ # Set sources set(SRC fala_status.cpp) -link_libraries(${MEEGOTOUCH_LIBRARIES}) - include(${QT_USE_FILE}) -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. execute_process(COMMAND "env" "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" "/usr/bin/pkg-config" "--cflags" - "meegotouch-boostable" + "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" - "meegotouch-boostable" + "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 011e074..8858b79 100644 --- a/tests/common/testapps/fala_status/fala_status.cpp +++ b/tests/common/testapps/fala_status/fala_status.cpp @@ -17,28 +17,19 @@ ** ****************************************************************************/ -#include -#include -#include -#include +#include #include #include -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - -M_EXPORT int main(int argc, char ** argv) +Q_DECL_EXPORT int main(int argc, char ** argv) { -#ifdef HAVE_MCOMPONENTCACHE - MApplication *app = MComponentCache::mApplication(argc, argv); -#endif - QTimer::singleShot(5, app, SLOT(quit())); + 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(); + app.exec(); _exit(29); } diff --git a/tests/common/testapps/fala_wait/CMakeLists.txt b/tests/common/testapps/fala_wait/CMakeLists.txt index bf92277..e908bee 100644 --- a/tests/common/testapps/fala_wait/CMakeLists.txt +++ b/tests/common/testapps/fala_wait/CMakeLists.txt @@ -1,30 +1,27 @@ # Set sources set(SRC fala_wait.cpp) -link_libraries(${MEEGOTOUCH_LIBRARIES}) - include(${QT_USE_FILE}) -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. execute_process(COMMAND "env" "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" "/usr/bin/pkg-config" "--cflags" - "meegotouch-boostable" + "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" - "meegotouch-boostable" + "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 02705fd..62dcdbc 100644 --- a/tests/common/testapps/fala_wait/fala_wait.cpp +++ b/tests/common/testapps/fala_wait/fala_wait.cpp @@ -17,20 +17,13 @@ ** ****************************************************************************/ -#include -#include +#include #include #include -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - -M_EXPORT int main(int argc, char ** argv) +Q_DECL_EXPORT int main(int argc, char ** argv) { -#ifdef HAVE_MCOMPONENTCACHE - MApplication *app = MComponentCache::mApplication(argc, argv); -#endif - QTimer::singleShot(6000, app, SLOT(quit())); - app->exec(); + QApplication app(argc, argv); + QTimer::singleShot(6000, &app, SLOT(quit())); + app.exec(); } diff --git a/tests/common/testapps/fala_windowid/CMakeLists.txt b/tests/common/testapps/fala_windowid/CMakeLists.txt index 1dfe34c..322e4d7 100644 --- a/tests/common/testapps/fala_windowid/CMakeLists.txt +++ b/tests/common/testapps/fala_windowid/CMakeLists.txt @@ -1,6 +1,7 @@ # Set sources set(SRC main.cpp) +include(FindPkgConfig) pkg_check_modules(X11 x11 REQUIRED) include_directories(${X11_INCLUDE_DIRS}) diff --git a/tests/common/testapps/fala_windowless/CMakeLists.txt b/tests/common/testapps/fala_windowless/CMakeLists.txt index eed979d..af2fc03 100644 --- a/tests/common/testapps/fala_windowless/CMakeLists.txt +++ b/tests/common/testapps/fala_windowless/CMakeLists.txt @@ -1,22 +1,18 @@ # Set sources set(SRC fala_windowless.cpp) -link_libraries(${MEEGOTOUCH_LIBRARIES}) - -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. execute_process(COMMAND "env" "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" "/usr/bin/pkg-config" "--cflags" - "meegotouch-boostable" + "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" - "meegotouch-boostable" + "qt-boostable" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE booster_libs OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -26,6 +22,7 @@ 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 index 2e1ca43..94d632c 100644 --- a/tests/common/testapps/fala_windowless/fala_windowless.cpp +++ b/tests/common/testapps/fala_windowless/fala_windowless.cpp @@ -17,11 +17,10 @@ ** ****************************************************************************/ -#include -#include +#include -M_EXPORT int main(int argc, char ** argv) +Q_DECL_EXPORT int main(int argc, char ** argv) { - MApplication *app = new MApplication(argc, argv); - app->exec(); + QApplication app(argc, argv); + app.exec(); } diff --git a/tests/common/testapps/helloworld/CMakeLists.txt b/tests/common/testapps/helloworld/CMakeLists.txt deleted file mode 100644 index 3f11a22..0000000 --- a/tests/common/testapps/helloworld/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Set sources -set(SRC helloworld.cpp) - -link_libraries(${MEEGOTOUCH_LIBRARIES}) - -include(${QT_USE_FILE}) - -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "meegotouch-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" - "meegotouch-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_hello ${SRC}) - -install(PROGRAMS fala_hello DESTINATION /usr/bin/ RENAME fala_ft_hello) -install(PROGRAMS fala_hello DESTINATION /usr/share/fala_images) -install(SCRIPT scripts/create_links.cmake) - diff --git a/tests/common/testapps/helloworld/helloworld.cpp b/tests/common/testapps/helloworld/helloworld.cpp deleted file mode 100644 index 99d8007..0000000 --- a/tests/common/testapps/helloworld/helloworld.cpp +++ /dev/null @@ -1,136 +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 -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - -QString log_file = "/tmp/fala_hello.log"; - -void FANGORNLOG(const char *s) -{ - QFile f(log_file); - f.open(QIODevice::Append); - f.write(s, qstrlen(s)); - f.write("\n", 1); - f.close(); -} - -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); -} - -M_EXPORT int main(int argc, char ** argv) -{ - MApplication *app; - try - { - -#ifdef HAVE_MCOMPONENTCACHE - app = MComponentCache::mApplication(argc, argv); - MApplicationWindow *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 MApplicationWindow(); - timestamp("MApplicationWindow NOT from cache"); - } else { - window = MComponentCache::mApplicationWindow(); - timestamp("MApplicationWindow from cache"); - } -#else - app = new MApplication(argc, argv); - MApplicationWindow *window = new MApplicationWindow; -#endif - - timestamp(QString("applicationDirPath: ").append(QApplication::applicationDirPath())); - timestamp(QString("applicationFilePath: ").append(QApplication::applicationFilePath())); - - MApplicationPage *mainPage = new MApplicationPage; - mainPage->setTitle("Hello World! (Now supports Launcher)"); - mainPage->centralWidget()->setObjectName("centralWidget"); - - MLayout *layout = new MLayout(mainPage->centralWidget()); - MLinearLayoutPolicy *linearPolicy = new MLinearLayoutPolicy(layout, - Qt::Vertical); - - linearPolicy->addItem(new MLabel("I'm a label")); - linearPolicy->addItem(new MButton("Click me!")); - linearPolicy->addItem(new MSlider); - - window->show(); - - const char *foobar = "foo!"; - for (int i = 0; i < argc; ++i) - { - if (QString(argv[i]) == "-segfault") - { - const_cast(foobar)[3] = 'z'; - } - } - - // Explicitly state where to appear, just to be sure :-) - mainPage->appear(window); - - } - catch(std::exception& e) - { - return -1; - } - _exit(app->exec()); -} diff --git a/tests/common/testapps/helloworld/scripts/create_links.cmake b/tests/common/testapps/helloworld/scripts/create_links.cmake deleted file mode 100644 index 9c5486c..0000000 --- a/tests/common/testapps/helloworld/scripts/create_links.cmake +++ /dev/null @@ -1,6 +0,0 @@ -execute_process(COMMAND echo "Creating symlinks for fala_ft_hello..") -execute_process(COMMAND ln -v -s /usr/bin/fala_ft_hello $ENV{DESTDIR}/usr/bin/fala_ft_hello1) -execute_process(COMMAND ln -v -s /usr/bin/fala_e_helloworld $ENV{DESTDIR}/usr/bin/fala_e_helloworld1) -execute_process(COMMAND ln -v -s /usr/bin/fala_e_helloworld $ENV{DESTDIR}/usr/bin/fala_e_helloworld2) -execute_process(COMMAND ln -v -s /usr/bin/fala_ft_hello $ENV{DESTDIR}/usr/bin/fala_ft_hello2) - diff --git a/tests/common/testapps/pixelchanged/CMakeLists.txt b/tests/common/testapps/pixelchanged/CMakeLists.txt index e5a5ecc..f518436 100644 --- a/tests/common/testapps/pixelchanged/CMakeLists.txt +++ b/tests/common/testapps/pixelchanged/CMakeLists.txt @@ -1,6 +1,8 @@ # Set sources set(SRC main.c) +include(FindPkgConfig) + # This is needed for MeeGo only? pkg_check_modules(XI xi REQUIRED) include_directories(${XI_INCLUDE_DIRS}) diff --git a/tests/common/testapps/testapp/CMakeLists.txt b/tests/common/testapps/testapp/CMakeLists.txt index fbba061..59c320a 100644 --- a/tests/common/testapps/testapp/CMakeLists.txt +++ b/tests/common/testapps/testapp/CMakeLists.txt @@ -1,21 +1,18 @@ # Set sources set(SRC main.cpp) -link_libraries(${MEEGOTOUCH_LIBRARIES}) -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. execute_process(COMMAND "env" "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" "/usr/bin/pkg-config" "--cflags" - "meegotouch-boostable" + "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" - "meegotouch-boostable" + "qt-boostable" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE booster_libs OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -24,6 +21,7 @@ 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 diff --git a/tests/common/testapps/testapp/fala_wl.desktop b/tests/common/testapps/testapp/fala_wl.desktop index dc1d7b4..776e391 100644 --- a/tests/common/testapps/testapp/fala_wl.desktop +++ b/tests/common/testapps/testapp/fala_wl.desktop @@ -2,6 +2,6 @@ Type=Application Name=fala_wl Icon=icon-l-video -Exec=/usr/bin/invoker --test-mode --type=m /usr/bin/fala_wl +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/main.cpp b/tests/common/testapps/testapp/main.cpp index 2870c2b..e949a66 100644 --- a/tests/common/testapps/testapp/main.cpp +++ b/tests/common/testapps/testapp/main.cpp @@ -17,15 +17,7 @@ ** ****************************************************************************/ -#include -#include -#include - -#ifdef HAVE_MCOMPONENTCACHE - #include -#endif - -#include +#include #include #include #include @@ -64,24 +56,11 @@ void timestamp(const char *s) FANGORNLOG(msg); } -class MyApplicationPage: public MApplicationPage +Q_DECL_EXPORT int main(int argc, char **argv) { -public: - MyApplicationPage(): MApplicationPage() {} - virtual ~MyApplicationPage() {} - void enterDisplayEvent() { - timestamp("MyApplicationPage::enterDisplayEvent"); - } -}; - -M_EXPORT int main(int, char**); - -int main(int argc, char **argv) { - - MApplication *app; + QApplication *app; try { - QString appName(argv[0]); if (appName.endsWith("fala_wl")) { @@ -92,20 +71,10 @@ int main(int argc, char **argv) { log_file = "/tmp/fala_wol.log"; } timestamp("application main"); -#ifdef HAVE_MCOMPONENTCACHE - app = MComponentCache::mApplication(argc, argv); - timestamp("app from cache"); - MApplicationWindow* w = MComponentCache::mApplicationWindow(); - timestamp("win from cache"); -#else - app = new MApplication(argc, argv); + app = new QApplication(argc, argv); timestamp("app created without cache"); - MApplicationWindow* w = new MApplicationWindow; - timestamp("win created without cache"); -#endif - if (argc > 2 && QString(argv[1]) == QString("--log-args")) { FANGORNLOG("argv:", false); for (int i = 0; i < argc; i++) { @@ -122,22 +91,6 @@ int main(int argc, char **argv) { } FANGORNLOG(""); } - - MyApplicationPage p; - timestamp("page created"); - - MApplication::setPrestartMode(M::LazyShutdown); - p.setTitle("Applauncherd testapp"); - - p.appear(); - timestamp("page.appear() called"); - - //set background color - QBrush brush(QColor(0, 115, 125, 255)); - w->setBackgroundBrush(brush); - - w->show(); - timestamp("w->show() called"); } catch(std::exception& e) { diff --git a/tests/common/testapps/themetest/CMakeLists.txt b/tests/common/testapps/themetest/CMakeLists.txt deleted file mode 100644 index 26a67a3..0000000 --- a/tests/common/testapps/themetest/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(src) - -# Install themes -install(DIRECTORY themes/ DESTINATION /usr/share/themes/base/meegotouch/fala_ft_themetest) - diff --git a/tests/common/testapps/themetest/src/CMakeLists.txt b/tests/common/testapps/themetest/src/CMakeLists.txt deleted file mode 100644 index 17315f6..0000000 --- a/tests/common/testapps/themetest/src/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# Set sources -set(SRC themetest.cpp) - -link_libraries(${MEEGOTOUCH_LIBRARIES}) - -include(${QT_USE_FILE}) - -# Use the compiler and linker flags given in meegotouch-boostable.pc -# in the source tree. -execute_process(COMMAND "env" - "PKG_CONFIG_PATH=${CMAKE_SOURCE_DIR}/data/pkgconfig" - "/usr/bin/pkg-config" - "--cflags" - "meegotouch-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" - "meegotouch-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_themetest ${SRC}) - -# Install -install(PROGRAMS fala_themetest DESTINATION /usr/bin/ RENAME fala_ft_themetest ) diff --git a/tests/common/testapps/themetest/src/themetest.cpp b/tests/common/testapps/themetest/src/themetest.cpp deleted file mode 100644 index e147cdd..0000000 --- a/tests/common/testapps/themetest/src/themetest.cpp +++ /dev/null @@ -1,68 +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 -#include -#include -#include -#include - -#include - -extern "C" __attribute__((visibility("default"))) int main(int, char**); - -int main(int argc, char ** argv) -{ - MApplication *app; - try - { - MApplication *app = MComponentCache::mApplication(argc, argv, "fala_ft_themetest"); - MApplicationWindow *window = MComponentCache::mApplicationWindow(); - MApplicationPage page; - page.setTitle("fala_ft_themetest"); - - MLayout *layout = new MLayout; - MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical); - policy->setSpacing(10); - - MLabel *label = new MLabel(QString("Hello, themed world!")); - label->setObjectName("themedlabel"); - label->setAlignment(Qt::AlignCenter); - policy->addItem(label); - - label = new MLabel(QString("With sheep")); - label->setObjectName("themedlabelwithgraphics"); - label->setAlignment(Qt::AlignLeft); - policy->addItem(label); - - page.centralWidget()->setLayout(layout); - page.appear(); - window->show(); - } - catch(std::exception& e) - { - return -1; - } - _exit(app->exec()); -} diff --git a/tests/common/testapps/themetest/themes/style/fala_ft_themetest.css b/tests/common/testapps/themetest/themes/style/fala_ft_themetest.css deleted file mode 100644 index 646a922..0000000 --- a/tests/common/testapps/themetest/themes/style/fala_ft_themetest.css +++ /dev/null @@ -1,55 +0,0 @@ -#themedlabel.Landscape { - preferred-size: 300 79; - minimum-size: 128 79; - maximum-size: 300 79; - - text-color: $COLOR_INVERTED_FOREGROUND; - background-color: #D4F5D0; - font: $FONT_XLARGE; - text-margin-left: 20px; - margin-left: $MARGIN_DOUBLE; - margin-top:$MARGIN_DOUBLE; -} - -#themedlabel.Portrait { - preferred-size: 300 93; - minimum-size: 105 93; - maximum-size: 300 93; - - text-color: $COLOR_INVERTED_FOREGROUND; - background-color: #D4F5D0; - font: $FONT_XLARGE; - text-margin-left: 20px; - - margin-left: $MARGIN_DOUBLE; - margin-top:$MARGIN_DOUBLE; - -} - -#themedlabelwithgraphics.Landscape { - preferred-size: 300 79; - minimum-size: 128 79; - maximum-size: 300 79; - - text-color: $COLOR_INVERTED_FOREGROUND; - background-image: "baa"; - font: $FONT_XLARGE; - text-margin-left: 20px; - margin-left: $MARGIN_DOUBLE; - margin-top:$MARGIN_DOUBLE; -} - -#themedlabelwithgraphics.Portrait { - preferred-size: 300 93; - minimum-size: 105 93; - maximum-size: 300 93; - - text-color: $COLOR_INVERTED_FOREGROUND; - background-image: "baa"; - font: $FONT_XLARGE; - text-margin-left: 20px; - - margin-left: $MARGIN_DOUBLE; - margin-top:$MARGIN_DOUBLE; - -} diff --git a/tests/common/testapps/themetest/themes/svg/baa.svg b/tests/common/testapps/themetest/themes/svg/baa.svg deleted file mode 100644 index d204f8e..0000000 --- a/tests/common/testapps/themetest/themes/svg/baa.svg +++ /dev/null @@ -1,711 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/common/testapps/xsendevent/CMakeLists.txt b/tests/common/testapps/xsendevent/CMakeLists.txt index d5834dd..8ffd5e7 100644 --- a/tests/common/testapps/xsendevent/CMakeLists.txt +++ b/tests/common/testapps/xsendevent/CMakeLists.txt @@ -1,6 +1,6 @@ # Set sources set(SRC main.cpp) -link_libraries(${MEEGOTOUCH_LIBRARIES} -lX11) +link_libraries(-lX11 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) add_executable(xsendevent ${SRC}) diff --git a/tests/common/unittests/CMakeLists.txt b/tests/common/unittests/CMakeLists.txt index 992715a..511d766 100644 --- a/tests/common/unittests/CMakeLists.txt +++ b/tests/common/unittests/CMakeLists.txt @@ -1,10 +1,8 @@ add_subdirectory(ut_booster) -add_subdirectory(ut_boosterfactory) add_subdirectory(ut_connection) add_subdirectory(ut_daemon) add_subdirectory(ut_dbooster) add_subdirectory(ut_ebooster) -add_subdirectory(ut_mbooster) add_subdirectory(ut_qtbooster) add_subdirectory(ut_socketmanager) add_subdirectory(ut_singleinstance) diff --git a/tests/common/unittests/tests.xml b/tests/common/unittests/tests.xml index c3fd70b..7069cf2 100644 --- a/tests/common/unittests/tests.xml +++ b/tests/common/unittests/tests.xml @@ -30,18 +30,10 @@ - - /usr/share/applauncherd-tests/ut_boosterfactory - - /usr/share/applauncherd-tests/ut_booster - - su - user -c 'source /tmp/session_bus_address.user && DISPLAY=:0 /usr/share/applauncherd-tests/ut_mbooster' - - su - user -c 'source /tmp/session_bus_address.user && DISPLAY=:0 /usr/share/applauncherd-tests/ut_qtbooster' diff --git a/tests/common/unittests/ut_boosterfactory/CMakeLists.txt b/tests/common/unittests/ut_boosterfactory/CMakeLists.txt deleted file mode 100644 index 84e6c2f..0000000 --- a/tests/common/unittests/ut_boosterfactory/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -set(LAUNCHER ${CMAKE_HOME_DIRECTORY}/src/launcherlib) - -# Set sources -set(SRC ut_boosterfactory.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp -${LAUNCHER}/boosterfactory.cpp ${LAUNCHER}/boosterpluginregistry.cpp -${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp -${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp) - -# Set moc headers -set(MOC_HDRS ut_boosterfactory.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}) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${X11_LIBRARIES} -ldl) - -# Enable Qt (may not be needed, because already defined on higher level) -include(${QT_USE_FILE}) - -add_executable(ut_boosterfactory ${SRC} ${MOC_SRC}) - -# Install -install(PROGRAMS ut_boosterfactory DESTINATION /usr/share/applauncherd-tests/) - diff --git a/tests/common/unittests/ut_boosterfactory/ut_boosterfactory.cpp b/tests/common/unittests/ut_boosterfactory/ut_boosterfactory.cpp deleted file mode 100644 index a006f7c..0000000 --- a/tests/common/unittests/ut_boosterfactory/ut_boosterfactory.cpp +++ /dev/null @@ -1,30 +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_boosterfactory.h" -#include "boosterfactory.h" -#include "booster.h" - -void Ut_BoosterFactory::initTestCase() -{} - -void Ut_BoosterFactory::cleanupTestCase() -{} - -QTEST_APPLESS_MAIN(Ut_BoosterFactory); diff --git a/tests/common/unittests/ut_boosterfactory/ut_boosterfactory.h b/tests/common/unittests/ut_boosterfactory/ut_boosterfactory.h deleted file mode 100644 index 57e44ba..0000000 --- a/tests/common/unittests/ut_boosterfactory/ut_boosterfactory.h +++ /dev/null @@ -1,40 +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_BOOSTERFACTORY_H -#define UT_BOOSTERFACTORY_H - -#include -#include - -#define UNIT_TEST - -class BoosterFactory; - -class Ut_BoosterFactory : public QObject -{ - Q_OBJECT - -private Q_SLOTS: - - void initTestCase(); - void cleanupTestCase(); -}; - -#endif // UT_BOOSTERFACTORY_H diff --git a/tests/common/unittests/ut_connection/CMakeLists.txt b/tests/common/unittests/ut_connection/CMakeLists.txt index 463dc98..c9e6d58 100644 --- a/tests/common/unittests/ut_connection/CMakeLists.txt +++ b/tests/common/unittests/ut_connection/CMakeLists.txt @@ -20,7 +20,7 @@ set(QT_USE_QTTEST TRUE) # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${X11_LIBRARIES} -ldl) +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}) diff --git a/tests/common/unittests/ut_daemon/CMakeLists.txt b/tests/common/unittests/ut_daemon/CMakeLists.txt index e4382fd..2d63ea5 100644 --- a/tests/common/unittests/ut_daemon/CMakeLists.txt +++ b/tests/common/unittests/ut_daemon/CMakeLists.txt @@ -20,7 +20,7 @@ set(QT_USE_QTTEST TRUE) # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${X11_LIBRARIES} -ldl) +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}) diff --git a/tests/common/unittests/ut_dbooster/CMakeLists.txt b/tests/common/unittests/ut_dbooster/CMakeLists.txt index cc03bff..0afcf9c 100644 --- a/tests/common/unittests/ut_dbooster/CMakeLists.txt +++ b/tests/common/unittests/ut_dbooster/CMakeLists.txt @@ -20,7 +20,7 @@ set(QT_USE_QTTEST TRUE) # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${DBOOSTER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} "-L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster -lmdeclarativecache" -ldl -lX11) +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}) diff --git a/tests/common/unittests/ut_ebooster/CMakeLists.txt b/tests/common/unittests/ut_ebooster/CMakeLists.txt index c27b5f0..3c706ae 100644 --- a/tests/common/unittests/ut_ebooster/CMakeLists.txt +++ b/tests/common/unittests/ut_ebooster/CMakeLists.txt @@ -20,7 +20,7 @@ set(QT_USE_QTTEST TRUE) # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${EBOOSTER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${X11_LIBRARIES} -ldl) +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}) diff --git a/tests/common/unittests/ut_mbooster/CMakeLists.txt b/tests/common/unittests/ut_mbooster/CMakeLists.txt deleted file mode 100644 index 8e0a9a8..0000000 --- a/tests/common/unittests/ut_mbooster/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -set(LAUNCHER ${CMAKE_HOME_DIRECTORY}/src/launcherlib) -set(MBOOSTER ${CMAKE_HOME_DIRECTORY}/src/mbooster) -set(COMMON "${CMAKE_HOME_DIRECTORY}/src/common") - -# Set sources -set(SRC ut_mbooster.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp -${LAUNCHER}/connection.cpp -${LAUNCHER}/logger.cpp -${MBOOSTER}/mbooster.cpp ${COMMON}/eventhandler.cpp -${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp) - -# Set moc headers -set(MOC_HDRS ut_mbooster.h ${COMMON}/eventhandler.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} ${MBOOSTER}) - -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} -ldl -lX11) - -# Enable Qt (may not be needed, because already defined on higher level) -include(${QT_USE_FILE}) - -add_executable(ut_mbooster ${SRC} ${MOC_SRC} ) - -# Install -install(PROGRAMS ut_mbooster DESTINATION /usr/share/applauncherd-tests/) - diff --git a/tests/common/unittests/ut_mbooster/ut_mbooster.cpp b/tests/common/unittests/ut_mbooster/ut_mbooster.cpp deleted file mode 100644 index 70289a3..0000000 --- a/tests/common/unittests/ut_mbooster/ut_mbooster.cpp +++ /dev/null @@ -1,80 +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_mbooster.h" -#include "mbooster.h" - -#ifdef HAVE_MCOMPONENTCACHE -#include -#endif - -Ut_MBooster::Ut_MBooster() : - m_subject(new MBooster) -{} - -Ut_MBooster::~Ut_MBooster() -{} - -void Ut_MBooster::initTestCase() -{} - -void Ut_MBooster::cleanupTestCase() -{} - -void Ut_MBooster::testSocketName() -{ - QVERIFY(MBooster::socketName() == MBooster::m_socketId); - QVERIFY(m_subject->socketId() == MBooster::m_socketId); -} - -void Ut_MBooster::testType() -{ - QVERIFY(MBooster::type() == 'm'); - QVERIFY(m_subject->boosterType() == 'm'); -} - -void Ut_MBooster::testPreload() -{ -#ifdef HAVE_MCOMPONENTCACHE - - m_subject->preload(); - - const char * argv[] = {"foo"}; - int argc = 1; - - QVERIFY(MComponentCache::mApplication(argc, const_cast(argv))); - QVERIFY(MComponentCache::mApplicationWindow()); - -#endif -} - -void Ut_MBooster::testTemporaryProcessName() -{ - QVERIFY(MBooster::temporaryProcessName() == MBooster::m_temporaryProcessName); - QVERIFY(m_subject->temporaryProcessName() == MBooster::m_temporaryProcessName); - QVERIFY(m_subject->boosterTemporaryProcessName() == MBooster::m_temporaryProcessName); -} - -void Ut_MBooster::testReceiveDataFromInvokerWithBadSocket() -{ - QVERIFY(m_subject->receiveDataFromInvoker(-100) == false); -} - -QTEST_APPLESS_MAIN(Ut_MBooster); - diff --git a/tests/common/unittests/ut_mbooster/ut_mbooster.h b/tests/common/unittests/ut_mbooster/ut_mbooster.h deleted file mode 100644 index f6cfc5b..0000000 --- a/tests/common/unittests/ut_mbooster/ut_mbooster.h +++ /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. -** -****************************************************************************/ - -#ifndef UT_MBOOSTER_H -#define UT_MBOOSTER_H - -#include -#include - -#include - -#define UNIT_TEST - -class MBooster; - -class Ut_MBooster : public QObject -{ - Q_OBJECT - -public: - Ut_MBooster(); - virtual ~Ut_MBooster(); - -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_MBOOSTER_H diff --git a/tests/common/unittests/ut_socketmanager/CMakeLists.txt b/tests/common/unittests/ut_socketmanager/CMakeLists.txt index cd24fa0..99a28b1 100644 --- a/tests/common/unittests/ut_socketmanager/CMakeLists.txt +++ b/tests/common/unittests/ut_socketmanager/CMakeLists.txt @@ -17,7 +17,7 @@ set(QT_USE_QTTEST TRUE) # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES}) +link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY}) # Enable Qt (may not be needed, because already defined on higher level) include(${QT_USE_FILE}) diff --git a/tests/meego/perftests/tests.xml b/tests/meego/perftests/tests.xml index a24dd37..4d550aa 100644 --- a/tests/meego/perftests/tests.xml +++ b/tests/meego/perftests/tests.xml @@ -5,25 +5,6 @@ - - - /usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120 - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-M-testscripts/test-perf-mbooster.py test_001 > /tmp/launcher_perf.txt - - - - false - true - - - - /tmp/launcher_perf.txt - - -