Skip to content
Permalink
Browse files

Merge remote branch 'pb/master'

  • Loading branch information
Sergey Yakushevs
Sergey Yakushevs committed May 12, 2011
2 parents 5b1a9f9 + 76751f6 commit dfeb19b453d1aa2ed71f4fe58e1b20002c1d0a10
@@ -24,7 +24,7 @@ Build-Depends:
python-dev,
python-qt4-dev (>=4.1.0),
python-sip-dev (>= 4.5.0) | python-sip4-dev (>= 4.5.0) | sip4 (>= 4.5),
git,
git-core | git,
txt2tags,
doxygen
Build-Conflicts: libqgis-dev, qgis-dev
@@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
python-sip4 (>= 4.5.0), python-central (>=0.5), python, sip4 (>= 4.5),
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, fcgi-dev, git
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, fcgi-dev, git-core
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.0
XS-Python-Version: current
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, libqwt5-qt4-dev, libfcgi-dev,
git, doxygen, graphviz, txt2tags
git-core, doxygen, graphviz, txt2tags
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.0
XS-Python-Version: current
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, libqwt5-qt4-dev, libfcgi-dev,
git, doxygen, graphviz, txt2tags
git-core, doxygen, graphviz, txt2tags
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.0
XS-Python-Version: current
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, libqwt5-qt4-dev, libfcgi-dev,
git, doxygen, graphviz, txt2tags
git-core, doxygen, graphviz, txt2tags
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.0
XS-Python-Version: current
@@ -27,7 +27,7 @@ Build-Depends:
python-qt4-dev (>=4.1.0),
python-sip4-dev (>= 4.5.0),
sip4 (>= 4.5),
git,
git-core,
doxygen,
graphviz,
txt2tags
@@ -28,7 +28,7 @@ Build-Depends:
python-qt4-dev (>=4.1.0),
python-sip (>= 4.5.0),
python-sip-dev (>= 4.5.0),
git,
git-core,
doxygen,
graphviz,
txt2tags
@@ -19,13 +19,15 @@ def __init__( self, iface ):
self.mergeThread = None
self.inputFiles = None
self.outFileName = None
self.inEncoding = None

self.btnOk = self.buttonBox.button( QDialogButtonBox.Ok )
self.btnClose = self.buttonBox.button( QDialogButtonBox.Close )

QObject.connect( self.btnSelectDir, SIGNAL( "clicked()" ), self.inputDir )
QObject.connect( self.btnSelectFile, SIGNAL( "clicked()" ), self.outFile )
QObject.connect( self.chkListMode, SIGNAL( "stateChanged( int )" ), self.changeMode )
QObject.connect( self.leOutShape, SIGNAL( "editingFinished()" ), self.updateOutFile )

def inputDir( self ):
inDir = QFileDialog.getExistingDirectory( self,
@@ -83,6 +85,11 @@ def changeMode( self ):
self.lblGeometry.setEnabled( True )
self.cmbGeometry.setEnabled( True )

def updateOutFile( self ):
self.outFileName = self.leOutShape.text()
settings = QSettings()
self.outEncoding = settings.value( "/UI/encoding" ).toString()

def reject( self ):
QDialog.reject( self )

@@ -110,22 +117,27 @@ def accept( self ):
else:
baseDir = self.leInputDir.text()

# look for shapes with specified geometry type
self.inputFiles = ftools_utils.getShapesByGeometryType( baseDir, self.inputFiles, self.cmbGeometry.currentIndex() )

self.progressFiles.setRange( 0, self.inputFiles.count() )

outFile = QFile( self.outFileName )
if outFile.exists():
if not QgsVectorFileWriter.deleteShapeFile( self.outFileName ):
QMessageBox.warning( self, self.tr( "Delete error" ), self.tr( "Can't delete file %1" ).arg( outFileName ) )
return

# look for shapes with specified geometry type
self.inputFiles = ftools_utils.getShapesByGeometryType( baseDir, self.inputFiles, self.cmbGeometry.currentIndex() )
self.progressFiles.setRange( 0, self.inputFiles.count() )

if self.inEncoding == None:
self.inEncoding = "System"

QApplication.setOverrideCursor( QCursor( Qt.WaitCursor ) )
self.btnOk.setEnabled( False )

self.mergeThread = ShapeMergeThread( baseDir, self.inputFiles, self.outFileName, self.encoding )
self.mergeThread = ShapeMergeThread( baseDir, self.inputFiles, self.inEncoding, self.outFileName, self.encoding )
QObject.connect( self.mergeThread, SIGNAL( "rangeChanged( PyQt_PyObject )" ), self.setProgressRange )
QObject.connect( self.mergeThread, SIGNAL( "checkStarted()" ), self.setFeatureProgressFormat )
QObject.connect( self.mergeThread, SIGNAL( "checkFinished()" ), self.resetFeatureProgressFormat )
QObject.connect( self.mergeThread, SIGNAL( "fileNameChanged( PyQt_PyObject )" ), self.setShapeProgressFormat )
QObject.connect( self.mergeThread, SIGNAL( "featureProcessed()" ), self.featureProcessed )
QObject.connect( self.mergeThread, SIGNAL( "shapeProcessed()" ), self.shapeProcessed )
QObject.connect( self.mergeThread, SIGNAL( "processingFinished()" ), self.processingFinished )
@@ -141,9 +153,18 @@ def setProgressRange( self, max ):
self.progressFeatures.setRange( 0, max )
self.progressFeatures.setValue( 0 )

def setFeatureProgressFormat( self ):
self.progressFeatures.setFormat( "Checking files: %p% ")

def resetFeatureProgressFormat( self ):
self.progressFeatures.setFormat( "%p% ")

def featureProcessed( self ):
self.progressFeatures.setValue( self.progressFeatures.value() + 1 )

def setShapeProgressFormat( self, fileName ):
self.progressFiles.setFormat( "%p% " + fileName )

def shapeProcessed( self ):
self.progressFiles.setValue( self.progressFiles.value() + 1 )

@@ -152,7 +173,9 @@ def processingFinished( self ):

if self.chkAddToCanvas.isChecked():
if not ftools_utils.addShapeToCanvas( unicode( self.outFileName ) ):
QMessageBox.warning( self, self.tr( "Merging" ), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.outFileName ) ) )
QMessageBox.warning( self, self.tr( "Merging" ),
self.tr( "Error loading output shapefile:\n%1" )
.arg( unicode( self.outFileName ) ) )

self.restoreGui()

@@ -165,6 +188,7 @@ def stopProcessing( self ):
self.mergeThread = None

def restoreGui( self ):
self.progressFiles.setFormat( "%p%" )
self.progressFeatures.setRange( 0, 100 )
self.progressFeatures.setValue( 0 )
self.progressFiles.setValue( 0 )
@@ -174,10 +198,11 @@ def restoreGui( self ):
self.btnOk.setEnabled( True )

class ShapeMergeThread( QThread ):
def __init__( self, dir, shapes, outputFileName, outputEncoding ):
def __init__( self, dir, shapes, inputEncoding, outputFileName, outputEncoding ):
QThread.__init__( self, QThread.currentThread() )
self.baseDir = dir
self.shapes = shapes
self.inputEncoding = inputEncoding
self.outputFileName = outputFileName
self.outputEncoding = outputEncoding

@@ -208,10 +233,12 @@ def run( self ):
if not newLayer.isValid():
continue
vprovider = newLayer.dataProvider()
vprovider.setEncoding( self.inputEncoding )
allAttrs = vprovider.attributeIndexes()
vprovider.select( allAttrs )
nFeat = vprovider.featureCount()
self.emit( SIGNAL( "rangeChanged( PyQt_PyObject )" ), nFeat )
self.emit( SIGNAL( "fileNameChanged( PyQt_PyObject )" ), fileName )
inFeat = QgsFeature()
outFeat = QgsFeature()
inGeom = QgsGeometry()
@@ -147,7 +147,7 @@ QgsVectorFileWriter::QgsVectorFileWriter(

if ( !found )
{
vectorFileName += "." + exts[0];
vectorFileName += "." + allExts[0];
}
}

@@ -82,9 +82,10 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
, mCanvasProperties( new CanvasProperties )
, mNewSize( QSize() )
, mPainting( false )
, mAntiAliasing( false )
{
//disable the update that leads to the resize crash
if( viewport() )
if ( viewport() )
{
viewport()->setAttribute( Qt::WA_PaintOnScreen, true );
}
@@ -163,6 +164,7 @@ QgsMapCanvas::~QgsMapCanvas()

void QgsMapCanvas::enableAntiAliasing( bool theFlag )
{
mAntiAliasing = theFlag;
mMap->enableAntiAliasing( theFlag );
if ( mMapOverview )
mMapOverview->enableAntiAliasing( theFlag );
@@ -244,6 +244,9 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! used to determine if anti-aliasing is enabled or not
void enableAntiAliasing( bool theFlag );

//! true if antialising is enabled
bool antiAliasingEnabled() const { return mAntiAliasing; }

//! Select which Qt class to render with
void useImageToRender( bool theFlag );

@@ -463,6 +466,8 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! currently in paint event
bool mPainting;

//! indicates whether antialiasing will be used for rendering
bool mAntiAliasing;
}; // class QgsMapCanvas


@@ -42,6 +42,10 @@ void QgsMapCanvasItem::paint( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget )
{
if ( mMapCanvas->antiAliasingEnabled() )
{
painter->setRenderHint( QPainter::Antialiasing );
}
paint( painter ); // call the derived item's drawing routines
}

@@ -4,12 +4,12 @@

SET(COMPLETE_VERSION_WITH_RELEASE_NAME \"${COMPLETE_VERSION}-${RELEASE_NAME}\")

IF (NOT EXISTS SVN_MARKER)
SET (SVN_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file
ENDIF (NOT EXISTS SVN_MARKER)
IF (NOT EXISTS GIT_MARKER)
SET (GIT_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file
ENDIF (NOT EXISTS GIT_MARKER)

ADD_CUSTOM_TARGET(Info.plist ALL
DEPENDS ${SVN_MARKER}
DEPENDS ${GIT_MARKER}
COMMAND ${CMAKE_COMMAND}
-D CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-D SOURCE_DIR=${CMAKE_SOURCE_DIR}
@@ -1,14 +1,14 @@
SET(CMAKE_BACKWARDS_COMPATIBILITY "2.4")

# See if we have svn installed
FIND_PROGRAM(SVNVERSION svnversion)
# See if we have git installed
FIND_PROGRAM (GIT git)

# Read the revision if installed, else set to "unknown"
IF (SVNVERSION)
EXEC_PROGRAM (${SVNVERSION} ARGS ${SOURCE_DIR} OUTPUT_VARIABLE REVISION)
ELSE (SVNVERSION)
IF (GIT)
EXEC_PROGRAM (${GIT} ${SOURCE_DIR} ARGS "log -n1 --pretty=%h" OUTPUT_VARIABLE REVISION)
ELSE (GIT)
SET (REVISION unknown)
ENDIF (SVNVERSION)
ENDIF (GIT)

# Create Info.plist
CONFIGURE_FILE (${CURRENT_SOURCE_DIR}/Info.plist.in
@@ -15,7 +15,7 @@
<key>CFBundleSignature</key>
<string>QGIS</string>
<key>CFBundleGetInfoString</key>
<string>QGIS @VERSION@ (@REVISION@), © 2002-2010 QGIS Development Team</string>
<string>QGIS @VERSION@ (@REVISION@), © 2002-2011 QGIS Development Team</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION_NUM@</string>
<key>CFBundleVersion</key>
@@ -17,6 +17,7 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo

SET ( qgis_mapserv_SRCS
qgis_map_serv.cpp
qgscapabilitiescache.cpp
qgsconfigcache.cpp
qgsconfigparser.cpp
qgsepsgcache.cpp
@@ -18,6 +18,7 @@ map service syntax for SOAP/HTTP POST
***************************************************************************/

#include "qgsapplication.h"
#include "qgscapabilitiescache.h"
#include "qgsconfigcache.h"
#include "qgsgetrequesthandler.h"
#include "qgssoaprequesthandler.h"
@@ -191,6 +192,9 @@ int main( int argc, char * argv[] )
}
}

//create cache for capabilities XML
QgsCapabilitiesCache capabilitiesCache;

//creating QgsMapRenderer is expensive (access to srs.db), so we do it here before the fcgi loop
QgsMapRenderer* theMapRenderer = new QgsMapRenderer();

@@ -291,20 +295,34 @@ int main( int argc, char * argv[] )

if ( requestIt->second == "GetCapabilities" )
{
QDomDocument capabilitiesDocument;
try
const QDomDocument* capabilitiesDocument = capabilitiesCache.searchCapabilitiesDocument( configFilePath );
if( !capabilitiesDocument ) //capabilities xml not in cache. Create a new one
{
QgsMSDebugMsg( "Capabilities document not found in cache" );
QDomDocument doc;
try
{
doc = theServer->getCapabilities();
}
catch ( QgsMapServiceException& ex )
{
theRequestHandler->sendServiceException( ex );
delete theRequestHandler;
delete theServer;
continue;
}
capabilitiesCache.insertCapabilitiesDocument( configFilePath, &doc );
capabilitiesDocument = capabilitiesCache.searchCapabilitiesDocument( configFilePath );
}
else
{
capabilitiesDocument = theServer->getCapabilities();
QgsMSDebugMsg( "Found capabilities document in cache" );
}
catch ( QgsMapServiceException& ex )

if( capabilitiesDocument )
{
theRequestHandler->sendServiceException( ex );
delete theRequestHandler;
delete theServer;
continue;
theRequestHandler->sendGetCapabilitiesResponse( *capabilitiesDocument );
}
QgsMSDebugMsg( "sending GetCapabilities response" );
theRequestHandler->sendGetCapabilitiesResponse( capabilitiesDocument );
delete theRequestHandler;
delete theServer;
continue;

0 comments on commit dfeb19b

Please sign in to comment.
You can’t perform that action at this time.