Skip to content

Commit

Permalink
Merge branch 'master' of github.com:qgis/Quantum-GIS
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Apr 13, 2012
2 parents cfcf12f + 1e193c3 commit 0180715
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 22 deletions.
4 changes: 2 additions & 2 deletions mac/cmake/0qgis.cmake.in
Expand Up @@ -6,8 +6,8 @@
# kill boolean warnings
CMAKE_POLICY (SET CMP0012 NEW)

INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")

# assume all install_names start with CMAKE_INSTALL_NAME_DIR
# so we don't have to extract it from binaries
Expand Down
4 changes: 2 additions & 2 deletions mac/cmake/1osg.cmake.in
Expand Up @@ -8,8 +8,8 @@ CMAKE_POLICY (SET CMP0012 NEW)

IF (@OSGEARTH_FOUND@)

INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")

SET (OSG_PLUGINS_PATH "@OSG_PLUGINS_PATH@")

Expand Down
4 changes: 2 additions & 2 deletions mac/cmake/1qt.cmake.in
Expand Up @@ -6,8 +6,8 @@
# kill boolean warnings
CMAKE_POLICY (SET CMP0012 NEW)

INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")

# Qt framework version is major version
SET (QT_FWVER @QT_VERSION_MAJOR@)
Expand Down
4 changes: 2 additions & 2 deletions mac/cmake/2lib.cmake.in
Expand Up @@ -10,8 +10,8 @@
# kill boolean warnings
CMAKE_POLICY (SET CMP0012 NEW)

INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")

# Postgres

Expand Down
4 changes: 2 additions & 2 deletions mac/cmake/3fw.cmake.in
Expand Up @@ -8,8 +8,8 @@ MESSAGE (STATUS "Bundling other frameworks is not functional yet, skipping...")
# kill boolean warnings
CMAKE_POLICY (SET CMP0012 NEW)

INCLUDE (@CMAKE_BINARY_DIR@/mac/0vars.cmake)
INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake)
INCLUDE ("@CMAKE_BINARY_DIR@/mac/0vars.cmake")
INCLUDE ("@CMAKE_SOURCE_DIR@/cmake/MacBundleMacros.cmake")

#

2 changes: 1 addition & 1 deletion python/analysis/analysis.sip
@@ -1,4 +1,4 @@
%Module qgis.analysis 0
%Module(name=qgis.analysis, version=0)

%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
Expand Down
2 changes: 1 addition & 1 deletion python/core/core.sip
@@ -1,4 +1,4 @@
%Module qgis.core 0
%Module(name=qgis.core, version=0)

%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
Expand Down
5 changes: 5 additions & 0 deletions src/app/main.cpp
Expand Up @@ -241,6 +241,11 @@ int main( int argc, char *argv[] )
int mySnapshotHeight = 600;

bool myHideSplash = false;
#if defined(ANDROID)
QgsDebugMsg( QString( "Android: Splash hidden" ) );
myHideSplash = true;
#endif

bool myRestorePlugins = true;
bool myCustomization = true;

Expand Down
15 changes: 12 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -645,6 +645,10 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
#ifdef HAVE_TOUCH
//add reacting to long click in android
grabGesture( Qt::TapAndHoldGesture );
#else
//remove mActionTouch button
delete mActionTouch;
mActionTouch=0;
#endif

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

// since the layer is bad, stomp on it
delete layer;

// XXX should we return false here, or just grind through
// XXX the remaining arguments?
}

}

// make sure at least one layer was succesfully added
if ( myList.count() == 0 )
{
return false;
}

// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayers( myList );

Expand Down Expand Up @@ -2785,6 +2793,7 @@ void QgisApp::fileNew( bool thePromptToSaveFlag )
// set the initial map tool
mMapCanvas->setMapTool( mMapTools.mPan );
mNonEditMapTool = mMapTools.mPan; // signals are not yet setup to catch this

#ifdef HAVE_TOUCH
mMapCanvas->setMapTool( mMapTools.mTouch );
mNonEditMapTool = mMapTools.mTouch; // signals are not yet setup to catch this
Expand Down
34 changes: 29 additions & 5 deletions src/mapserver/qgswmsserver.cpp
Expand Up @@ -297,8 +297,26 @@ QImage* QgsWMSServer::getLegendGraphics()
return 0;
}

//scale
double scaleDenominator = -1;
QMap<QString, QString>::const_iterator scaleIt = mParameterMap.find( "SCALE" );
if ( scaleIt != mParameterMap.constEnd() )
{
bool conversionSuccess;
double scaleValue = scaleIt.value().toDouble( &conversionSuccess );
if ( conversionSuccess )
{
scaleDenominator = scaleValue;
}
}

QgsCoordinateReferenceSystem dummyCRS;
QStringList layerIds = layerSet( layersList, stylesList, dummyCRS );
QStringList layerIds = layerSet( layersList, stylesList, dummyCRS, scaleDenominator );
if ( layerIds.size() < 1 )
{
return 0;
}

QgsLegendModel legendModel;
legendModel.setLayerSet( layerIds );

Expand Down Expand Up @@ -1394,7 +1412,7 @@ int QgsWMSServer::featureInfoFromRasterLayer( QgsRasterLayer* layer,

QStringList QgsWMSServer::layerSet( const QStringList &layersList,
const QStringList &stylesList,
const QgsCoordinateReferenceSystem &destCRS ) const
const QgsCoordinateReferenceSystem &destCRS, double scaleDenominator ) const
{
Q_UNUSED( destCRS );
QStringList layerKeys;
Expand Down Expand Up @@ -1430,9 +1448,15 @@ QStringList QgsWMSServer::layerSet( const QStringList &layersList,
QgsDebugMsg( QString( "Checking layer: %1" ).arg( theMapLayer->name() ) );
if ( theMapLayer )
{
layerKeys.push_front( theMapLayer->id() );
QgsMapLayerRegistry::instance()->addMapLayers(
QList<QgsMapLayer *>() << theMapLayer, false );
//test if layer is visible in requested scale
bool useScaleConstraint = ( scaleDenominator > 0 && theMapLayer->hasScaleBasedVisibility() );
if ( !useScaleConstraint ||
( theMapLayer->minimumScale() <= scaleDenominator && theMapLayer->maximumScale() >= scaleDenominator ) )
{
layerKeys.push_front( theMapLayer->id() );
QgsMapLayerRegistry::instance()->addMapLayers(
QList<QgsMapLayer *>() << theMapLayer, false );
}
}
else
{
Expand Down
5 changes: 3 additions & 2 deletions src/mapserver/qgswmsserver.h
Expand Up @@ -119,8 +119,9 @@ class QgsWMSServer
/**Appends feature info xml for the layer to the layer element of the dom document*/
int featureInfoFromRasterLayer( QgsRasterLayer* layer, const QgsPoint* infoPoint, QDomDocument& infoDocument, QDomElement& layerElement, QString version ) const;

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

//helper functions for GetLegendGraphics
/**Draws layer item and subitems
Expand Down

0 comments on commit 0180715

Please sign in to comment.