Skip to content

Commit

Permalink
Add proper offline editing support
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 5, 2016
1 parent 0aaee8e commit 0be702d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/qgismobileapp.cpp
Expand Up @@ -47,6 +47,7 @@
#include "modelhelper.h"
#include "rubberband.h"
#include "rubberbandmodel.h"
#include "qgsofflineediting.h"

QgisMobileapp::QgisMobileapp( QgsApplication *app, QWindow *parent )
: QQuickView( parent )
Expand Down Expand Up @@ -93,6 +94,8 @@ QgisMobileapp::QgisMobileapp( QgsApplication *app, QWindow *parent )
connect( this, SIGNAL( loadProjectEnded() ), mIface, SIGNAL( loadProjectEnded() ) );
connect( this, SIGNAL( afterRendering() ), SLOT( onAfterFirstRendering() ), Qt::QueuedConnection );

mOfflineEditing = new QgsOfflineEditing();

mSettings.setValue( "/Map/searchRadiusMM", 5 );

show();
Expand Down Expand Up @@ -231,6 +234,7 @@ void QgisMobileapp::loadProjectFile( const QString& path )

QgisMobileapp::~QgisMobileapp()
{
delete mOfflineEditing;
QgsMapLayerRegistry::instance()->removeAllMapLayers();
// Reintroduce when created on the heap
// delete QgsEditorWidgetRegistry::instance();
Expand Down
2 changes: 2 additions & 0 deletions src/qgismobileapp.h
Expand Up @@ -39,6 +39,7 @@
#endif

class AppInterface;
class QgsOfflineEditing;

class QgisMobileapp : public QQuickView
{
Expand Down Expand Up @@ -93,6 +94,7 @@ class QgisMobileapp : public QQuickView

void loadProjectQuirks();

QgsOfflineEditing* mOfflineEditing;
QgsMapCanvas* mMapCanvas;
QgsLayerTreeMapCanvasBridge* mLayerTreeCanvasBridge;
QgsLayerTreeModel* mLayerTree;
Expand Down

0 comments on commit 0be702d

Please sign in to comment.