Skip to content

Commit

Permalink
move HAVE_TOUCH to qgsconfig.h - fixes vtable of QgsMapCanvas/QgsMapT…
Browse files Browse the repository at this point in the history
…ool for plugins
  • Loading branch information
jef-n committed Jul 17, 2012
1 parent 03b0526 commit 0cfe094
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -221,7 +221,8 @@ ELSE ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_M
SET (WITH_TOUCH FALSE)
ENDIF ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_MAJOR GREATER 4 )
IF (WITH_TOUCH)
ADD_DEFINITIONS(-DHAVE_TOUCH)
# following variable is used in qgsconfig.h
SET (HAVE_TOUCH TRUE)
MESSAGE (STATUS "Touch support enabled")
ELSE (WITH_TOUCH)
MESSAGE (STATUS "Touch support disabled")
Expand Down
2 changes: 2 additions & 0 deletions cmake_templates/qgsconfig.h.in
Expand Up @@ -35,5 +35,7 @@

#cmakedefine HAVE_PYTHON

#cmakedefine HAVE_TOUCH

#endif

7 changes: 2 additions & 5 deletions src/app/qgisapp.cpp
Expand Up @@ -1779,9 +1779,6 @@ void QgisApp::createCanvasTools()
mMapTools.mChangeLabelProperties->setAction( mActionChangeLabelProperties );
//ensure that non edit tool is initialised or we will get crashes in some situations
mNonEditMapTool = mMapTools.mPan;
//#ifdef HAVE_TOUCH
// mNonEditMapTool = mMapTools.mTouch;
//#endif
}

void QgisApp::createOverview()
Expand Down Expand Up @@ -2969,10 +2966,10 @@ void QgisApp::fileNew( bool thePromptToSaveFlag )
updateCRSStatusBar();

// set the initial map tool
#ifndef HAVE_TOUCH
mMapCanvas->setMapTool( mMapTools.mPan );
mNonEditMapTool = mMapTools.mPan; // signals are not yet setup to catch this

#ifdef HAVE_TOUCH
#else
mMapCanvas->setMapTool( mMapTools.mTouch );
mNonEditMapTool = mMapTools.mTouch; // signals are not yet setup to catch this
#endif
Expand Down
10 changes: 5 additions & 5 deletions src/app/qgisapp.h
Expand Up @@ -84,18 +84,18 @@ class QgsTileScaleWidget;
#include <QPointer>
#include <QSslError>

#ifdef HAVE_TOUCH
#include <QGestureEvent>
#include <QTapAndHoldGesture>
#endif

#include "qgsconfig.h"
#include "qgsfeature.h"
#include "qgspoint.h"
#include "qgssnappingdialog.h"

#include "ui_qgisapp.h"

#ifdef HAVE_TOUCH
#include <QGestureEvent>
#include <QTapAndHoldGesture>
#endif

/*! \class QgisApp
* \brief Main window for the Qgis application
*/
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsmapcanvas.h
Expand Up @@ -18,6 +18,8 @@
#ifndef QGSMAPCANVAS_H
#define QGSMAPCANVAS_H

#include "qgsconfig.h"

#include <list>
#include <memory>
#include <deque>
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsmaptool.h
Expand Up @@ -16,6 +16,8 @@
#ifndef QGSMAPTOOL_H
#define QGSMAPTOOL_H

#include "qgsconfig.h"

#include <QCursor>
#include <QString>
#include <QObject>
Expand Down

0 comments on commit 0cfe094

Please sign in to comment.