Skip to content

Commit

Permalink
qt4 -> qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
timohannukkala committed Aug 27, 2013
1 parent 13e74c6 commit 6218069
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 176 deletions.
5 changes: 1 addition & 4 deletions data/data.pro
Expand Up @@ -10,7 +10,4 @@ service.path = $${INSTALL_ROOT}/usr/share/dbus-1/services
service.files = org.freedesktop.Telepathy.Client.qmlmessages.service \
org.nemomobile.qmlmessages.service

context.path = $${INSTALL_ROOT}/usr/share/contextkit/providers
context.files = org.nemomobile.qmlmessages.context.context

INSTALLS += desktop client service context
INSTALLS += desktop client service
5 changes: 0 additions & 5 deletions data/org.nemomobile.qmlmessages.context.context

This file was deleted.

3 changes: 2 additions & 1 deletion data/org.nemomobile.qmlmessages.service
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=org.nemomobile.qmlmessages
Exec=/usr/bin/invoker --no-wait -d 10 --type=d /usr/bin/qmlmessages -prestart
Exec=/usr/bin/invoker --no-wait -d 10 --type=qtcomponents-qt5 /usr/bin/qmlmessages -prestart

2 changes: 1 addition & 1 deletion data/qmlmessages.desktop
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=Messages
Icon=icons-Applications-sms
Exec=invoker --type=d /usr/bin/qmlmessages
Exec=invoker --type=qtcomponents-qt5 /usr/bin/qmlmessages
Comment=Nemo messaging application
X-Desktop-File-Install-Version=0.19
X-Maemo-Service=org.nemomobile.qmlmessages
Expand Down
4 changes: 2 additions & 2 deletions qml/AccountSelector.qml
Expand Up @@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.messages.internal 1.0

Rectangle {
Expand Down
4 changes: 2 additions & 2 deletions qml/ChatTextInput.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

BorderImage {
id: textArea
Expand Down
4 changes: 2 additions & 2 deletions qml/ConversationListDelegate.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.qmlcontacts 1.0

MouseArea {
Expand Down
4 changes: 2 additions & 2 deletions qml/ConversationListPage.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

Page {
PageHeader {
Expand Down
4 changes: 2 additions & 2 deletions qml/ConversationListWidget.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.2
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.messages.internal 1.0

Item {
Expand Down
4 changes: 2 additions & 2 deletions qml/ConversationPage.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.messages.internal 1.0
import org.nemomobile.qmlcontacts 1.0
import org.nemomobile.commhistory 1.0
Expand Down
4 changes: 2 additions & 2 deletions qml/MessagesView.qml
Expand Up @@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.messages.internal 1.0
import org.nemomobile.commhistory 1.0

Expand Down
4 changes: 2 additions & 2 deletions qml/PageHeader.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

Rectangle {
id: detailHeader
Expand Down
4 changes: 2 additions & 2 deletions qml/TargetEditBox.qml
Expand Up @@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

Rectangle {
color: "white"
Expand Down
2 changes: 1 addition & 1 deletion qml/common/CommHistoryService.qml
@@ -1,4 +1,4 @@
import QtQuick 1.1
import QtQuick 2.0
import org.nemomobile.dbus 1.0

DBusInterface {
Expand Down
6 changes: 3 additions & 3 deletions qml/main.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.messages.internal 1.0
import org.nemomobile.contacts 1.0
import org.nemomobile.commhistory 1.0
Expand Down Expand Up @@ -89,7 +89,7 @@ PageStackWindow {
groupManager.readyChanged.disconnect(delayedShow)
}
}
groupManager.readyChanged.connect(delayedShow)
groupManager.modelReady.connect(delayedShow)
return
}

Expand Down
26 changes: 13 additions & 13 deletions rpm/qmlmessages.spec
Expand Up @@ -16,18 +16,20 @@ License: BSD
URL: https://github.com/nemomobile/qmlmessages
Source0: %{name}-%{version}.tar.bz2
Source100: qmlmessages.yaml
Requires: qt-components >= 1.4.8
Requires: nemo-qml-plugin-messages-internal >= 0.1.1
Requires: libcommhistory-declarative >= 1.5.1
Requires: qt-components-qt5
Requires: nemo-qml-plugin-messages-internal-qt5
Requires: libcommhistory-qt5-declarative
Requires: commhistory-daemon
Requires: nemo-qml-plugin-contacts
Requires: nemo-qml-plugin-dbus
Requires: nemo-qml-plugin-contacts-qt5
Requires: nemo-qml-plugin-dbus-qt5
Requires: qmlcontacts
BuildRequires: pkgconfig(QtCore) >= 4.7.0
BuildRequires: pkgconfig(QtDeclarative)
BuildRequires: pkgconfig(QtContacts)
BuildRequires: pkgconfig(qdeclarative-boostable)
BuildRequires: pkgconfig(TelepathyQt4)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Contacts)
BuildRequires: pkgconfig(qdeclarative5-boostable)
BuildRequires: pkgconfig(TelepathyQt5)
BuildRequires: desktop-file-utils
Provides: meego-handset-sms > 0.1.2
Provides: meego-handset-sms-branding-upstream > 0.1.2
Expand Down Expand Up @@ -57,7 +59,7 @@ Messaging application using Qt Quick for Nemo Mobile.
# >> build pre
# << build pre

%qmake
qmake -qt=5 -recursive

make %{?jobs:-j%jobs}

Expand All @@ -79,7 +81,6 @@ desktop-file-install --delete-original \

%post
# >> post
update-contextkit-providers
# << post

%files
Expand All @@ -89,6 +90,5 @@ update-contextkit-providers
%{_datadir}/telepathy/clients/qmlmessages.client
%{_datadir}/dbus-1/services/org.freedesktop.Telepathy.Client.qmlmessages.service
%{_datadir}/dbus-1/services/org.nemomobile.qmlmessages.service
%{_datadir}/contextkit/providers/org.nemomobile.qmlmessages.context.context
# >> files
# << files
22 changes: 11 additions & 11 deletions rpm/qmlmessages.yaml
Expand Up @@ -34,20 +34,20 @@ Provides:
- peregrine-qml-starter = 1.1.7
- peregrine-tablet-common = 1.1.7
PkgConfigBR:
- QtCore >= 4.7.0
- QtDeclarative
- QtContacts
- qdeclarative-boostable
- TelepathyQt4
- Qt5Core
- Qt5Quick
- Qt5Contacts
- qdeclarative5-boostable
- TelepathyQt5

Requires:
- qt-components >= 1.4.8
- nemo-qml-plugin-messages-internal >= 0.1.7
- libcommhistory-declarative >= 1.5.1
- qt-components-qt5 >= 1.4.8
- nemo-qml-plugin-messages-internal-qt5
- libcommhistory-qt5-declarative
- commhistory-daemon
# C++ contacts APIs
- nemo-qml-plugin-contacts
- nemo-qml-plugin-dbus
- nemo-qml-plugin-contacts-qt5
- nemo-qml-plugin-dbus-qt5
# QML contacts APIs
- qmlcontacts

Expand All @@ -57,4 +57,4 @@ Files:
- "%{_datadir}/telepathy/clients/qmlmessages.client"
- "%{_datadir}/dbus-1/services/org.freedesktop.Telepathy.Client.qmlmessages.service"
- "%{_datadir}/dbus-1/services/org.nemomobile.qmlmessages.service"
- "%{_datadir}/contextkit/providers/org.nemomobile.qmlmessages.context.context"

36 changes: 24 additions & 12 deletions src/main.cpp
Expand Up @@ -29,12 +29,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <QApplication>
#include <QGuiApplication>
#include <QDBusConnection>
#ifdef HAS_BOOSTER
#include <applauncherd/MDeclarativeCache>
#include <MDeclarativeCache>
#endif

#include <QQuickView>
#include <QQmlEngine>
#include <QQmlContext>
#include <TelepathyQt/Constants>
#include <TelepathyQt/Debug>
#include <TelepathyQt/Types>
Expand All @@ -46,13 +49,19 @@ Q_DECL_EXPORT
#endif
int main(int argc, char **argv)
{
#ifdef HAS_BOOSTER
MDeclarativeCache::qApplication(argc, argv);
QQuickView *view;
#ifdef HAS_BOOSTER
QGuiApplication *application;
application = MDeclarativeCache::qApplication(argc, argv);
view = MDeclarativeCache::qQuickView();
#else
QGuiApplication *application;
qWarning() << Q_FUNC_INFO << "Warning! Running without booster. This may be a bit slower.";
QApplication a(argc, argv);
QGuiApplication stackApp(argc, argv);
QQuickView stackView;
application = &stackApp;
view = &stackView;
#endif

// Set up Telepathy
Tp::registerTypes();
Tp::enableWarnings(true);
Expand All @@ -67,13 +76,16 @@ int main(int argc, char **argv)
showWindow = false;
}

// Set up QML
WindowManager *wm = WindowManager::instance();
QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit()));
view->setSource(QUrl("qrc:/qml/main.qml"));

QObject *object = (QObject *)view->rootObject();
WindowManager *wm = WindowManager::instance( object, view );
view->rootContext()->setContextProperty("wManager", wm);
if (showWindow)
{
wm->showGroupsWindow();
else
// Stay open persistently if not started with UI
qApp->setQuitOnLastWindowClosed(false);
}

return qApp->exec();
return application->exec();
}
8 changes: 4 additions & 4 deletions src/src.pro
@@ -1,8 +1,8 @@
PROJECT_NAME = qmlmessages
QT += dbus declarative svg
QT += dbus quick svg

CONFIG += link_pkgconfig
PKGCONFIG += TelepathyQt4
PKGCONFIG += TelepathyQt5

target.path = $$INSTALL_ROOT/usr/bin
INSTALLS += target
Expand All @@ -23,10 +23,10 @@ TARGET = $$PROJECT_NAME

CONFIG += link_pkgconfig

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

0 comments on commit 6218069

Please sign in to comment.