Skip to content

Commit

Permalink
[boostable] make it boostable
Browse files Browse the repository at this point in the history
  • Loading branch information
sledges committed Aug 6, 2013
1 parent ad1190e commit a67cc6a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
24 changes: 18 additions & 6 deletions main.cpp
Expand Up @@ -7,12 +7,24 @@
#include <QOrganizerManager>
#include <QOrganizerAbstractRequest>

#ifdef HAS_BOOSTER
#include <MDeclarativeCache>
#endif

using namespace QtOrganizer;

#ifdef HAS_BOOSTER
Q_DECL_EXPORT
#endif
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView view;
#ifdef HAS_BOOSTER
QScopedPointer<QGuiApplication> app(MDeclarativeCache::qApplication(argc, argv));
QScopedPointer<QQuickView> view(MDeclarativeCache::qQuickView());
#else
QScopedPointer<QGuiApplication> app(new QGuiApplication(argc, argv));
QScopedPointer<QQuickView> view(new QQuickView);
#endif

qRegisterMetaType<QOrganizerAbstractRequest::State>("QOrganizerAbstractRequest::State");
qRegisterMetaType<QList<QOrganizerItemId> >("QList<QOrganizerItemId>");
Expand All @@ -21,9 +33,9 @@ int main(int argc, char *argv[])
qRegisterMetaType<QOrganizerItemId>("QOrganizerItemId");
qRegisterMetaType<QOrganizerCollectionId>("QOrganizerCollectionId");

view.setSource(QUrl("/opt/qmlcalendar/qml/qmlcalendar/main.qml"));
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.showFullScreen();
view->setSource(QUrl("/opt/qmlcalendar/qml/qmlcalendar/main.qml"));
view->setResizeMode(QQuickView::SizeRootObjectToView);
view->showFullScreen();

return app.exec();
return app->exec();
}
10 changes: 10 additions & 0 deletions qmlcalendar.pro
Expand Up @@ -41,3 +41,13 @@ icon.files = qmlcalendar.png
icon.path = /usr/share/icons/hicolor/80x80/apps
INSTALLS += icon

CONFIG += link_pkgconfig

packagesExist(qdeclarative5-boostable) {
message("Building with qdeclarative5-boostable support")
DEFINES += HAS_BOOSTER
PKGCONFIG += qdeclarative5-boostable
} else {
warning("qdeclarative5-boostable not available; startup times will be slower")
}

2 changes: 2 additions & 0 deletions rpm/qmlcalendar.spec
Expand Up @@ -20,6 +20,7 @@ Requires: libdeclarative-organizer
Requires: qt5-qtdeclarative-pim-organizer
Requires: mkcal >= 0.3.11
Requires: qt-components-qt5
Requires: mapplauncherd-booster-qtcomponents-qt5
Requires: systemd
Requires(preun): systemd
Requires(post): systemd
Expand All @@ -28,6 +29,7 @@ BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Organizer)
BuildRequires: pkgconfig(qdeclarative5-boostable)
BuildRequires: desktop-file-utils

%description
Expand Down
2 changes: 2 additions & 0 deletions rpm/qmlcalendar.yaml
Expand Up @@ -14,11 +14,13 @@ PkgConfigBR:
- Qt5Quick
- Qt5Qml
- Qt5Organizer
- qdeclarative5-boostable
Requires:
- libdeclarative-organizer
- qt5-qtdeclarative-pim-organizer
- mkcal >= 0.3.11
- qt-components-qt5
- mapplauncherd-booster-qtcomponents-qt5
Configure: none
Builder: qmake5
Files:
Expand Down

0 comments on commit a67cc6a

Please sign in to comment.