diff --git a/src/apps/marble-maps/MarbleMaps.cpp b/src/apps/marble-maps/MarbleMaps.cpp index d1aa09573..0a1ea3f9f 100644 --- a/src/apps/marble-maps/MarbleMaps.cpp +++ b/src/apps/marble-maps/MarbleMaps.cpp @@ -1,70 +1,71 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2015 Dennis Nienhüser // #include "MarbleMaps.h" +#include #include - #include #ifdef Q_OS_ANDROID #include #include #endif namespace Marble { MarbleMaps::MarbleMaps(QQuickItem *parent) : MarbleQuickItem(parent), m_suspended(false) { QGuiApplication* application = qobject_cast(QGuiApplication::instance()); if (application) { connect(application, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(handleApplicationStateChange(Qt::ApplicationState))); } #ifdef Q_OS_ANDROID // If a file is passed, open it. Possible file types are registered in package/AndroidManifest.xml QAndroidJniObject const activity = QtAndroid::androidActivity(); if (activity.isValid()) { QAndroidJniObject const intent = activity.callObjectMethod("getIntent", "()Landroid/content/Intent;"); if (intent.isValid()) { QAndroidJniObject const data = intent.callObjectMethod("getData", "()Landroid/net/Uri;"); if (data.isValid()) { QAndroidJniObject const path = data.callObjectMethod("getPath", "()Ljava/lang/String;"); if (path.isValid()) { model()->addGeoDataFile(path.toString()); + connect( model()->fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)), this, SLOT(centerOn(GeoDataLatLonBox)) ); } } } } #endif } bool MarbleMaps::isSuspended() const { return m_suspended; } void MarbleMaps::handleApplicationStateChange(Qt::ApplicationState state) { if (state == Qt::ApplicationSuspended) { m_suspended = true; emit isSuspendedChanged(m_suspended); } else if (state == Qt::ApplicationActive) { m_suspended = false; emit isSuspendedChanged(m_suspended); } } } #include "moc_MarbleMaps.cpp"