Skip to content
Permalink
Browse files
Merge branch 'master' of github.com:qgis/Quantum-GIS
  • Loading branch information
timlinux committed Apr 13, 2012
2 parents cfcf12f + 1e193c3 commit 018071562cd1f45107637c8f1363bb2708d4580d
@@ -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
@@ -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@")

@@ -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@)
@@ -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

@@ -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")

#

@@ -1,4 +1,4 @@
%Module qgis.analysis 0
%Module(name=qgis.analysis, version=0)

%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
@@ -1,4 +1,4 @@
%Module qgis.core 0
%Module(name=qgis.core, version=0)

%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
@@ -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;

@@ -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
@@ -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 );

@@ -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
@@ -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 );

@@ -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;
@@ -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
{
@@ -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

0 comments on commit 0180715

Please sign in to comment.