Changes: Rename qdeclarativeboostercache -> mdeclarativecache.

RevBy: TrustMe
pull/1/head
Pertti Kellomäki 15 years ago
parent fa1166260a
commit fd11d995ca

@ -1,5 +1,5 @@
Name: qdeclarative-boostable Name: qdeclarative-boostable
Description: make application boostable by applauncherd Description: make application boostable by applauncherd
Version: 0.2.0 Version: 0.2.0
Libs: -pie -rdynamic -lqdeclarativeboostercache Libs: -pie -rdynamic -lmdeclarativecache
Cflags: -fPIC -fvisibility=hidden -fvisibility-inlines-hidden Cflags: -fPIC -fvisibility=hidden -fvisibility-inlines-hidden

@ -1,5 +1,5 @@
usr/lib/pkgconfig/qt-boostable.pc usr/lib/pkgconfig/qt-boostable.pc
usr/share/qt4/mkspecs/features/qt-boostable.prf usr/share/qt4/mkspecs/features/qt-boostable.prf
usr/include/applauncherd/qdeclarativeboostercache.h usr/include/applauncherd/mdeclarativecache.h
usr/lib/pkgconfig/qdeclarative-boostable.pc usr/lib/pkgconfig/qdeclarative-boostable.pc
usr/share/qt4/mkspecs/features/qdeclarative-boostable.prf usr/share/qt4/mkspecs/features/qdeclarative-boostable.prf

@ -4,5 +4,5 @@ usr/bin/applauncherd
usr/lib/applauncherd/libmbooster.so usr/lib/applauncherd/libmbooster.so
usr/lib/applauncherd/libqtbooster.so usr/lib/applauncherd/libqtbooster.so
usr/lib/applauncherd/libqdeclarativebooster.so usr/lib/applauncherd/libqdeclarativebooster.so
usr/lib/libqdeclarativeboostercache.so usr/lib/libmdeclarativecache.so
usr/lib/libqdeclarativeboostercache.so.* usr/lib/libmdeclarativecache.so.*

@ -11,22 +11,22 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/comm
set(PLUGINSRC qdeclarativebooster.cpp pluginfactory.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp set(PLUGINSRC qdeclarativebooster.cpp pluginfactory.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp
${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp ${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp
${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp) ${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp)
set(LIBSRC qdeclarativeboostercache.cpp qdeclarativeboostercache.h qdeclarativeboostercache_p.h) set(LIBSRC mdeclarativecache.cpp mdeclarativecache.h mdeclarativecache_p.h)
# Set executables # Set executables
add_library(qdeclarativeboostercache SHARED ${LIBSRC}) add_library(mdeclarativecache SHARED ${LIBSRC})
set_target_properties(qdeclarativeboostercache PROPERTIES set_target_properties(mdeclarativecache PROPERTIES
VERSION 0.1 SOVERSION 0) VERSION 0.1 SOVERSION 0)
target_link_libraries(qdeclarativeboostercache ${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})
add_library(qdeclarativebooster MODULE ${PLUGINSRC}) add_library(qdeclarativebooster MODULE ${PLUGINSRC})
set_target_properties(qdeclarativebooster PROPERTIES set_target_properties(qdeclarativebooster PROPERTIES
COMPILE_FLAGS -fvisibility=hidden) COMPILE_FLAGS -fvisibility=hidden)
target_link_libraries(qdeclarativebooster ${LIBDL} "-L. -lqdeclarativeboostercache") target_link_libraries(qdeclarativebooster ${LIBDL} "-L. -lmdeclarativecache")
add_dependencies(qdeclarativebooster qdeclarativeboostercache) add_dependencies(qdeclarativebooster mdeclarativecache)
# Add install rule # Add install rule
install(TARGETS qdeclarativebooster DESTINATION /usr/lib/applauncherd/) install(TARGETS qdeclarativebooster DESTINATION /usr/lib/applauncherd/)
install(TARGETS qdeclarativeboostercache DESTINATION /usr/lib) install(TARGETS mdeclarativecache DESTINATION /usr/lib)
install(FILES qdeclarativeboostercache.h DESTINATION /usr/include/applauncherd install(FILES mdeclarativecache.h DESTINATION /usr/include/applauncherd
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)

@ -19,18 +19,18 @@
#include <Qt/QtDeclarative> #include <Qt/QtDeclarative>
#include <QX11Info> #include <QX11Info>
#include "qdeclarativeboostercache.h" #include "mdeclarativecache.h"
#include "qdeclarativeboostercache_p.h" #include "mdeclarativecache_p.h"
#ifdef Q_WS_X11 #ifdef Q_WS_X11
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#endif #endif
QDeclarativeBoosterCachePrivate * const QDeclarativeBoosterCache::d_ptr = new QDeclarativeBoosterCachePrivate; MDeclarativeCachePrivate * const MDeclarativeCache::d_ptr = new MDeclarativeCachePrivate;
const int QDeclarativeBoosterCachePrivate::ARGV_LIMIT = 32; const int MDeclarativeCachePrivate::ARGV_LIMIT = 32;
QDeclarativeBoosterCachePrivate::QDeclarativeBoosterCachePrivate() : MDeclarativeCachePrivate::MDeclarativeCachePrivate() :
qApplicationInstance(0), qApplicationInstance(0),
qDeclarativeViewInstance(0), qDeclarativeViewInstance(0),
initialArgc(ARGV_LIMIT), initialArgc(ARGV_LIMIT),
@ -38,17 +38,17 @@ QDeclarativeBoosterCachePrivate::QDeclarativeBoosterCachePrivate() :
{ {
} }
QDeclarativeBoosterCachePrivate::~QDeclarativeBoosterCachePrivate() MDeclarativeCachePrivate::~MDeclarativeCachePrivate()
{ {
delete qDeclarativeViewInstance; delete qDeclarativeViewInstance;
delete[] initialArgv; delete[] initialArgv;
} }
void QDeclarativeBoosterCachePrivate::populate() void MDeclarativeCachePrivate::populate()
{ {
static const char *const emptyString = ""; static const char *const emptyString = "";
static const char *const appNameFormat = "qdeclarativeboostercache_pre_initialized_qapplication%d"; static const char *const appNameFormat = "mdeclarativecache_pre_initialized_qapplication%d";
static char appName[strlen(appNameFormat) + 8]; static char appName[strlen(appNameFormat) + 8];
// Append pid to appName to make it unique. This is required because the // Append pid to appName to make it unique. This is required because the
@ -57,7 +57,7 @@ void QDeclarativeBoosterCachePrivate::populate()
sprintf(appName, appNameFormat, getpid()); sprintf(appName, appNameFormat, getpid());
// We support at most ARGV_LIMIT arguments in QCoreApplication. These will be set when real // We support at most ARGV_LIMIT arguments in QCoreApplication. These will be set when real
// arguments are known (in QDeclarativeBoosterCachePrivate::qApplication). // arguments are known (in MDeclarativeCachePrivate::qApplication).
initialArgv[0] = const_cast<char *>(appName); initialArgv[0] = const_cast<char *>(appName);
for (int i = 1; i < initialArgc; i++) { for (int i = 1; i < initialArgc; i++) {
initialArgv[i] = const_cast<char *>(emptyString); initialArgv[i] = const_cast<char *>(emptyString);
@ -75,7 +75,7 @@ void QDeclarativeBoosterCachePrivate::populate()
qDeclarativeViewInstance = new QDeclarativeView(); qDeclarativeViewInstance = new QDeclarativeView();
} }
QApplication* QDeclarativeBoosterCachePrivate::qApplication(int &argc, char **argv) QApplication* MDeclarativeCachePrivate::qApplication(int &argc, char **argv)
{ {
if (qApplicationInstance == 0) { if (qApplicationInstance == 0) {
qApplicationInstance = new QApplication(argc, argv); qApplicationInstance = new QApplication(argc, argv);
@ -121,7 +121,7 @@ QApplication* QDeclarativeBoosterCachePrivate::qApplication(int &argc, char **ar
return qApplicationInstance; return qApplicationInstance;
} }
QDeclarativeView* QDeclarativeBoosterCachePrivate::qDeclarativeView() QDeclarativeView* MDeclarativeCachePrivate::qDeclarativeView()
{ {
QDeclarativeView *returnValue; QDeclarativeView *returnValue;
if (qDeclarativeViewInstance != 0) { if (qDeclarativeViewInstance != 0) {
@ -133,17 +133,17 @@ QDeclarativeView* QDeclarativeBoosterCachePrivate::qDeclarativeView()
return returnValue; return returnValue;
} }
void QDeclarativeBoosterCache::populate() void MDeclarativeCache::populate()
{ {
d_ptr->populate(); d_ptr->populate();
} }
QApplication* QDeclarativeBoosterCache::qApplication(int &argc, char **argv) QApplication* MDeclarativeCache::qApplication(int &argc, char **argv)
{ {
return d_ptr->qApplication(argc, argv); return d_ptr->qApplication(argc, argv);
} }
QDeclarativeView* QDeclarativeBoosterCache::qDeclarativeView() QDeclarativeView* MDeclarativeCache::qDeclarativeView()
{ {
return d_ptr->qDeclarativeView(); return d_ptr->qDeclarativeView();
} }

@ -17,26 +17,26 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QDECLARATIVEBOOSTERCACHE_H #ifndef MDECLARATIVECACHE_H
#define QDECLARATIVEBOOSTERCACHE_H #define MDECLARATIVECACHE_H
class QDeclarativeBoosterCachePrivate; class MDeclarativeCachePrivate;
class QApplication; class QApplication;
class QDeclarativeView; class QDeclarativeView;
/*! /*!
* \class QDeclarativeBoosterCache. * \class MDeclarativeCache.
* \brief Cache class for QDeclarativeBooster. * \brief Cache class for QDeclarativeBooster.
*/ */
class QDeclarativeBoosterCache class MDeclarativeCache
{ {
public: public:
//! Constructor. //! Constructor.
QDeclarativeBoosterCache() {}; MDeclarativeCache() {};
//! Destructor. //! Destructor.
virtual ~QDeclarativeBoosterCache() {}; virtual ~MDeclarativeCache() {};
//! Populate cache with QApplication and QDeclarativeView //! Populate cache with QApplication and QDeclarativeView
static void populate(); static void populate();
@ -55,20 +55,20 @@ public:
protected: protected:
static QDeclarativeBoosterCachePrivate* const d_ptr; static MDeclarativeCachePrivate* const d_ptr;
private: private:
//! Disable copy-constructor //! Disable copy-constructor
QDeclarativeBoosterCache(const QDeclarativeBoosterCache & r); MDeclarativeCache(const MDeclarativeCache & r);
//! Disable assignment operator //! Disable assignment operator
QDeclarativeBoosterCache & operator= (const QDeclarativeBoosterCache & r); MDeclarativeCache & operator= (const MDeclarativeCache & r);
#ifdef UNIT_TEST #ifdef UNIT_TEST
friend class Ut_QDeclarativeBoosterCache; friend class Ut_MDeclarativeCache;
#endif #endif
}; };
#endif //QDECLARATIVEBOOSTERCACHE_H #endif //MDECLARATIVECACHE_H

@ -17,18 +17,18 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QDECLARATIVEBOOSTERCACHE_P_H #ifndef MDECLARATIVECACHE_P_H
#define QDECLARATIVEBOOSTERCACHE_P_H #define MDECLARATIVECACHE_P_H
class QDeclarativeBoosterCache; class MDeclarativeCache;
class QApplication; class QApplication;
class QDeclarativeView; class QDeclarativeView;
class QDeclarativeBoosterCachePrivate class MDeclarativeCachePrivate
{ {
public: public:
QDeclarativeBoosterCachePrivate(); MDeclarativeCachePrivate();
virtual ~QDeclarativeBoosterCachePrivate(); virtual ~MDeclarativeCachePrivate();
void populate(); void populate();
QApplication* qApplication(int &argc, char **argv); QApplication* qApplication(int &argc, char **argv);
QDeclarativeView* qDeclarativeView(); QDeclarativeView* qDeclarativeView();
@ -40,8 +40,8 @@ public:
char **initialArgv; char **initialArgv;
#ifdef UNIT_TEST #ifdef UNIT_TEST
friend class Ut_QDeclarativeBoosterCache; friend class Ut_MDeclarativeCache;
#endif #endif
}; };
#endif // QDECLARATIVEBOOSTERCACHE_P_H #endif // MDECLARATIVECACHE_P_H

@ -18,7 +18,7 @@
****************************************************************************/ ****************************************************************************/
#include "qdeclarativebooster.h" #include "qdeclarativebooster.h"
#include "qdeclarativeboostercache.h" #include "mdeclarativecache.h"
const string QDeclarativeBooster::m_socketId = "/tmp/boostd"; const string QDeclarativeBooster::m_socketId = "/tmp/boostd";
const string QDeclarativeBooster::m_temporaryProcessName = "booster-d"; const string QDeclarativeBooster::m_temporaryProcessName = "booster-d";
@ -50,6 +50,6 @@ char QDeclarativeBooster::type()
bool QDeclarativeBooster::preload() bool QDeclarativeBooster::preload()
{ {
QDeclarativeBoosterCache::populate(); MDeclarativeCache::populate();
return true; return true;
} }

@ -20,7 +20,7 @@
#include <Qt/QtDeclarative> #include <Qt/QtDeclarative>
#include <QFile> #include <QFile>
#include <sys/time.h> #include <sys/time.h>
#include "qdeclarativeboostercache.h" #include "mdeclarativecache.h"
void FANGORNLOG(const char* s) void FANGORNLOG(const char* s)
{ {
@ -45,10 +45,10 @@ Q_DECL_EXPORT int main(int argc, char **argv)
{ {
timestamp("application main"); timestamp("application main");
QApplication *app = QDeclarativeBoosterCache::qApplication(argc, argv); QApplication *app = MDeclarativeCache::qApplication(argc, argv);
timestamp("QApplication from cache"); timestamp("QApplication from cache");
QDeclarativeView *window = QDeclarativeBoosterCache::qDeclarativeView(); QDeclarativeView *window = MDeclarativeCache::qDeclarativeView();
timestamp("QDeclarativeView from cache"); timestamp("QDeclarativeView from cache");
window->setWindowTitle("Applauncherd QML testapp"); window->setWindowTitle("Applauncherd QML testapp");

@ -19,7 +19,7 @@ set(QT_USE_QTTEST TRUE)
# Set include paths # Set include paths
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${DBOOSTER}) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${DBOOSTER})
link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${LIBCREDS} "-L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster -lqdeclarativeboostercache") link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${LIBCREDS} "-L${CMAKE_SOURCE_DIR}/src/qdeclarativebooster -lmdeclarativecache")
# Enable Qt (may not be needed, because already defined on higher level) # Enable Qt (may not be needed, because already defined on higher level)
include(${QT_USE_FILE}) include(${QT_USE_FILE})

@ -19,7 +19,7 @@
#include "ut_dbooster.h" #include "ut_dbooster.h"
#include "qdeclarativebooster.h" #include "qdeclarativebooster.h"
#include "qdeclarativeboostercache.h" #include "mdeclarativecache.h"
Ut_DBooster::Ut_DBooster() : Ut_DBooster::Ut_DBooster() :
m_subject(new QDeclarativeBooster) m_subject(new QDeclarativeBooster)
@ -53,8 +53,8 @@ void Ut_DBooster::testPreload()
const char * argv[] = {"foo"}; const char * argv[] = {"foo"};
int argc = 1; int argc = 1;
QVERIFY(QDeclarativeBoosterCache::qApplication(argc, const_cast<char **>(argv))); QVERIFY(MDeclarativeCache::qApplication(argc, const_cast<char **>(argv)));
QVERIFY(QDeclarativeBoosterCache::qDeclarativeView()); QVERIFY(MDeclarativeCache::qDeclarativeView());
} }
QTEST_APPLESS_MAIN(Ut_DBooster); QTEST_APPLESS_MAIN(Ut_DBooster);

Loading…
Cancel
Save