Skip to content

Commit 0180715

Browse files
committed
Merge branch 'master' of github.com:qgis/Quantum-GIS
2 parents cfcf12f + 1e193c3 commit 0180715

File tree

11 files changed

+61
-22
lines changed

11 files changed

+61
-22
lines changed

mac/cmake/0qgis.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# kill boolean warnings
77
CMAKE_POLICY (SET CMP0012 NEW)
88

9-
INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
10-
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
9+
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
10+
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")
1111

1212
# assume all install_names start with CMAKE_INSTALL_NAME_DIR
1313
# so we don't have to extract it from binaries

mac/cmake/1osg.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ CMAKE_POLICY (SET CMP0012 NEW)
88

99
IF (@OSGEARTH_FOUND@)
1010

11-
INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
12-
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
11+
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
12+
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")
1313

1414
SET (OSG_PLUGINS_PATH "@OSG_PLUGINS_PATH@")
1515

mac/cmake/1qt.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# kill boolean warnings
77
CMAKE_POLICY (SET CMP0012 NEW)
88

9-
INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
10-
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
9+
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
10+
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")
1111

1212
# Qt framework version is major version
1313
SET (QT_FWVER @QT_VERSION_MAJOR@)

mac/cmake/2lib.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# kill boolean warnings
1111
CMAKE_POLICY (SET CMP0012 NEW)
1212

13-
INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
14-
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
13+
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
14+
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")
1515

1616
# Postgres
1717

mac/cmake/3fw.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ MESSAGE (STATUS "Bundling other frameworks is not functional yet, skipping...")
88
# kill boolean warnings
99
CMAKE_POLICY (SET CMP0012 NEW)
1010

11-
INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
12-
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
11+
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
12+
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")
1313

1414
#
1515

python/analysis/analysis.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%Module qgis.analysis 0
1+
%Module(name=qgis.analysis, version=0)
22

33
%Import QtCore/QtCoremod.sip
44
%Import QtGui/QtGuimod.sip

python/core/core.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%Module qgis.core 0
1+
%Module(name=qgis.core, version=0)
22

33
%Import QtCore/QtCoremod.sip
44
%Import QtGui/QtGuimod.sip

src/app/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ int main( int argc, char *argv[] )
241241
int mySnapshotHeight = 600;
242242

243243
bool myHideSplash = false;
244+
#if defined(ANDROID)
245+
QgsDebugMsg( QString( "Android: Splash hidden" ) );
246+
myHideSplash = true;
247+
#endif
248+
244249
bool myRestorePlugins = true;
245250
bool myCustomization = true;
246251

src/app/qgisapp.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,10 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
645645
#ifdef HAVE_TOUCH
646646
//add reacting to long click in android
647647
grabGesture( Qt::TapAndHoldGesture );
648+
#else
649+
//remove mActionTouch button
650+
delete mActionTouch;
651+
mActionTouch=0;
648652
#endif
649653

650654
// update windows
@@ -2286,12 +2290,16 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
22862290

22872291
// since the layer is bad, stomp on it
22882292
delete layer;
2289-
2290-
// XXX should we return false here, or just grind through
2291-
// XXX the remaining arguments?
22922293
}
22932294

22942295
}
2296+
2297+
// make sure at least one layer was succesfully added
2298+
if ( myList.count() == 0 )
2299+
{
2300+
return false;
2301+
}
2302+
22952303
// Register this layer with the layers registry
22962304
QgsMapLayerRegistry::instance()->addMapLayers( myList );
22972305

@@ -2785,6 +2793,7 @@ void QgisApp::fileNew( bool thePromptToSaveFlag )
27852793
// set the initial map tool
27862794
mMapCanvas->setMapTool( mMapTools.mPan );
27872795
mNonEditMapTool = mMapTools.mPan; // signals are not yet setup to catch this
2796+
27882797
#ifdef HAVE_TOUCH
27892798
mMapCanvas->setMapTool( mMapTools.mTouch );
27902799
mNonEditMapTool = mMapTools.mTouch; // signals are not yet setup to catch this

src/mapserver/qgswmsserver.cpp

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,26 @@ QImage* QgsWMSServer::getLegendGraphics()
297297
return 0;
298298
}
299299

300+
//scale
301+
double scaleDenominator = -1;
302+
QMap<QString, QString>::const_iterator scaleIt = mParameterMap.find( "SCALE" );
303+
if ( scaleIt != mParameterMap.constEnd() )
304+
{
305+
bool conversionSuccess;
306+
double scaleValue = scaleIt.value().toDouble( &conversionSuccess );
307+
if ( conversionSuccess )
308+
{
309+
scaleDenominator = scaleValue;
310+
}
311+
}
312+
300313
QgsCoordinateReferenceSystem dummyCRS;
301-
QStringList layerIds = layerSet( layersList, stylesList, dummyCRS );
314+
QStringList layerIds = layerSet( layersList, stylesList, dummyCRS, scaleDenominator );
315+
if ( layerIds.size() < 1 )
316+
{
317+
return 0;
318+
}
319+
302320
QgsLegendModel legendModel;
303321
legendModel.setLayerSet( layerIds );
304322

@@ -1394,7 +1412,7 @@ int QgsWMSServer::featureInfoFromRasterLayer( QgsRasterLayer* layer,
13941412

13951413
QStringList QgsWMSServer::layerSet( const QStringList &layersList,
13961414
const QStringList &stylesList,
1397-
const QgsCoordinateReferenceSystem &destCRS ) const
1415+
const QgsCoordinateReferenceSystem &destCRS, double scaleDenominator ) const
13981416
{
13991417
Q_UNUSED( destCRS );
14001418
QStringList layerKeys;
@@ -1430,9 +1448,15 @@ QStringList QgsWMSServer::layerSet( const QStringList &layersList,
14301448
QgsDebugMsg( QString( "Checking layer: %1" ).arg( theMapLayer->name() ) );
14311449
if ( theMapLayer )
14321450
{
1433-
layerKeys.push_front( theMapLayer->id() );
1434-
QgsMapLayerRegistry::instance()->addMapLayers(
1435-
QList<QgsMapLayer *>() << theMapLayer, false );
1451+
//test if layer is visible in requested scale
1452+
bool useScaleConstraint = ( scaleDenominator > 0 && theMapLayer->hasScaleBasedVisibility() );
1453+
if ( !useScaleConstraint ||
1454+
( theMapLayer->minimumScale() <= scaleDenominator && theMapLayer->maximumScale() >= scaleDenominator ) )
1455+
{
1456+
layerKeys.push_front( theMapLayer->id() );
1457+
QgsMapLayerRegistry::instance()->addMapLayers(
1458+
QList<QgsMapLayer *>() << theMapLayer, false );
1459+
}
14361460
}
14371461
else
14381462
{

src/mapserver/qgswmsserver.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ class QgsWMSServer
119119
/**Appends feature info xml for the layer to the layer element of the dom document*/
120120
int featureInfoFromRasterLayer( QgsRasterLayer* layer, const QgsPoint* infoPoint, QDomDocument& infoDocument, QDomElement& layerElement, QString version ) const;
121121

122-
/**Creates a layer set and returns a stringlist with layer ids that can be passed to a QgsMapRenderer. Usually used in conjunction with readLayersAndStyles*/
123-
QStringList layerSet( const QStringList& layersList, const QStringList& stylesList, const QgsCoordinateReferenceSystem& destCRS ) const;
122+
/**Creates a layer set and returns a stringlist with layer ids that can be passed to a QgsMapRenderer. Usually used in conjunction with readLayersAndStyles
123+
@param scaleDenominator Filter out layer if scale based visibility does not match (or use -1 if no scale restriction)*/
124+
QStringList layerSet( const QStringList& layersList, const QStringList& stylesList, const QgsCoordinateReferenceSystem& destCRS, double scaleDenominator = -1 ) const;
124125

125126
//helper functions for GetLegendGraphics
126127
/**Draws layer item and subitems

0 commit comments

Comments
 (0)