Move eventhandler to mdeclarativecache

EventHandler is only used by qdeclarativebooster and its derivatives
at the moment. It can't be included in libapplauncherd, because of the
Qt dependency, but it needs to be available for out-of-tree plugins.
Putting it into libmdeclarativecache seems like the most reasonable
option at present.
pull/1/head
John Brooks 13 years ago
parent e66dcb6959
commit 63ba6b77df

@ -1,7 +1,9 @@
# Qt support
include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common)
set(COMMON ${CMAKE_HOME_DIRECTORY}/src/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${COMMON})
# Hide all symbols except the ones explicitly exported in the code (like main())
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
@ -12,7 +14,8 @@ set(SRC appdata.cpp booster.cpp boosterfactory.cpp boosterpluginregistry.cpp
singleinstance.cpp socketmanager.cpp)
set(HEADERS appdata.h booster.h boosterfactory.h boosterpluginregistry.h
connection.h daemon.h logger.h launcherlib.h singleinstance.h socketmanager.h)
connection.h daemon.h logger.h launcherlib.h singleinstance.h socketmanager.h
${COMMON}/protocol.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.

@ -4,27 +4,26 @@ include(FindX11)
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})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${LAUNCHER} "${CMAKE_HOME_DIRECTORY}/src/common")
# Set sources
set(PLUGINSRC qdeclarativebooster.cpp pluginfactory.cpp ${COMMON}/eventhandler.cpp)
set(MOC_HDRS ${COMMON}/eventhandler.h)
qt4_wrap_cpp(MOC_SRC ${MOC_HDRS})
set(PLUGINSRC qdeclarativebooster.cpp pluginfactory.cpp)
set(LIBSRC mdeclarativecache.cpp mdeclarativecache.h mdeclarativecache_p.h)
set(LIBSRC mdeclarativecache.cpp mdeclarativecache.h mdeclarativecache_p.h eventhandler.cpp eventhandler.h)
set(MOC_HDRS eventhandler.h)
qt4_wrap_cpp(MOC_SRC ${MOC_HDRS})
# Set executables
add_library(mdeclarativecache SHARED ${LIBSRC})
add_library(mdeclarativecache SHARED ${LIBSRC} ${MOC_SRC})
set_target_properties(mdeclarativecache PROPERTIES
VERSION 0.1 SOVERSION 0)
if ($ENV{HARMATTAN})
set_target_properties(mdeclarativecache PROPERTIES COMPILE_FLAGS -DHAVE_PATH_REINIT)
endif ($ENV{HARMATTAN})
target_link_libraries(mdeclarativecache ${LIBDL} ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTGUI_LIBRARY} ${X11_LIBRARIES})
target_link_libraries(mdeclarativecache ${LIBDL} ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTGUI_LIBRARY} ${X11_LIBRARIES} "-L../launcherlib -lapplauncherd")
add_library(qdeclarativebooster MODULE ${PLUGINSRC} ${MOC_SRC})
add_library(qdeclarativebooster MODULE ${PLUGINSRC})
set_target_properties(qdeclarativebooster PROPERTIES
COMPILE_FLAGS -fvisibility=hidden)
target_link_libraries(qdeclarativebooster ${LIBDL} "-L. -lmdeclarativecache -L../launcherlib -lapplauncherd")
@ -33,6 +32,6 @@ add_dependencies(qdeclarativebooster applauncherd mdeclarativecache)
# Add install rule
install(TARGETS qdeclarativebooster DESTINATION /usr/lib/applauncherd/)
install(TARGETS mdeclarativecache DESTINATION /usr/lib)
install(FILES mdeclarativecache.h MDeclarativeCache DESTINATION /usr/include/applauncherd
install(FILES mdeclarativecache.h MDeclarativeCache eventhandler.h DESTINATION /usr/include/applauncherd
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)

@ -1,7 +1,6 @@
#include <QtConcurrentRun>
#include <QApplication>
#include "coverage.h"
#include "eventhandler.h"
#include "connection.h"
#include "logger.h"
@ -90,10 +89,6 @@ void EventHandler::hupSignalHandler(int)
void EventHandler::handleSigHup()
{
#ifdef WITH_COVERAGE
__gcov_flush();
#endif
QApplication::quit();
_exit(EXIT_SUCCESS);
}

@ -1,3 +1,6 @@
#ifndef EVENTHANDLER_H
#define EVENTHANDLER_H
#include <QObject>
#include <QSocketNotifier>
#include <signal.h>
@ -56,3 +59,5 @@ signals:
void connectionAccepted();
void connectionRejected();
};
#endif

@ -32,8 +32,6 @@
#include <X11/Xutil.h>
#endif
#include "coverage.h"
MDeclarativeCachePrivate * const MDeclarativeCache::d_ptr = new MDeclarativeCachePrivate;
const int MDeclarativeCachePrivate::ARGV_LIMIT = 32;
@ -53,10 +51,6 @@ MDeclarativeCachePrivate::~MDeclarativeCachePrivate()
{
delete qDeclarativeViewInstance;
delete[] initialArgv;
#ifdef WITH_COVERAGE
__gcov_flush();
#endif
}
void MDeclarativeCachePrivate::populate()
@ -178,10 +172,6 @@ QApplication* MDeclarativeCachePrivate::qApplication(int &argc, char **argv)
}
#ifdef WITH_COVERAGE
__gcov_flush();
#endif
#ifdef HAVE_PATH_REINIT
// Set the magic attribute so that paths are reinitialized
qApplicationInstance->setAttribute(Qt::AA_LinuxReinitPathsFromArgv0, true);
@ -223,10 +213,6 @@ QDeclarativeView* MDeclarativeCachePrivate::qDeclarativeView()
returnValue = new QDeclarativeView();
}
#ifdef WITH_COVERAGE
__gcov_flush();
#endif
return returnValue;
}
@ -253,10 +239,6 @@ QString MDeclarativeCachePrivate::applicationFilePath()
QDeclarativeView *MDeclarativeCache::populate()
{
d_ptr->populate();
#ifdef WITH_COVERAGE
__gcov_flush();
#endif
return d_ptr->qDeclarativeViewInstance;
}

@ -28,7 +28,7 @@ QT4_ADD_RESOURCES(RESOURCE_SRC main.qrc)
# Enable Qt-support
include(${QT_USE_FILE})
link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} "-L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster ${booster_libs}")
link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} "-L${CMAKE_SOURCE_DIR}/src/launcherlib -lapplauncherd -L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster ${booster_libs}")
add_executable(fala_qml ${SRC} ${RESOURCE_SRC})
# Install

@ -1,15 +1,13 @@
set(LAUNCHER ${CMAKE_HOME_DIRECTORY}/src/launcherlib)
set(DBOOSTER ${CMAKE_HOME_DIRECTORY}/src/qdeclarativebooster)
set(COMMON "${CMAKE_HOME_DIRECTORY}/src/common")
# Set sources
set(SRC ut_dbooster.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp
${LAUNCHER}/connection.cpp ${COMMON}/eventhandler.cpp
${LAUNCHER}/logger.cpp ${DBOOSTER}/qdeclarativebooster.cpp
${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp ${DBOOSTER}/qdeclarativebooster.cpp
${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp)
# Set moc headers
set(MOC_HDRS ut_dbooster.h ${COMMON}/eventhandler.h)
set(MOC_HDRS ut_dbooster.h)
# Run moc
qt4_wrap_cpp(MOC_SRC ${MOC_HDRS})
@ -18,7 +16,7 @@ qt4_wrap_cpp(MOC_SRC ${MOC_HDRS})
set(QT_USE_QTTEST TRUE)
# Set include paths
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${DBOOSTER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${LAUNCHER} ${CMAKE_HOME_DIRECTORY}/src/common ${DBOOSTER})
link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} "-L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster -lmdeclarativecache" -ldl -lX11)

Loading…
Cancel
Save