Skip to content

Commit dfeb19b

Browse files
committed
Merge remote branch 'pb/master'
2 parents 5b1a9f9 + 76751f6 commit dfeb19b

23 files changed

+356
-48
lines changed

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Build-Depends:
2424
python-dev,
2525
python-qt4-dev (>=4.1.0),
2626
python-sip-dev (>= 4.5.0) | python-sip4-dev (>= 4.5.0) | sip4 (>= 4.5),
27-
git,
27+
git-core | git,
2828
txt2tags,
2929
doxygen
3030
Build-Conflicts: libqgis-dev, qgis-dev

debian/control.hardy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
88
python-sip4 (>= 4.5.0), python-central (>=0.5), python, sip4 (>= 4.5),
99
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
1010
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
11-
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, fcgi-dev, git
11+
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, fcgi-dev, git-core
1212
Build-Conflicts: libqgis-dev, qgis-dev
1313
Standards-Version: 3.8.0
1414
XS-Python-Version: current

debian/control.intrepid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
99
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
1010
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
1111
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, libqwt5-qt4-dev, libfcgi-dev,
12-
git, doxygen, graphviz, txt2tags
12+
git-core, doxygen, graphviz, txt2tags
1313
Build-Conflicts: libqgis-dev, qgis-dev
1414
Standards-Version: 3.8.0
1515
XS-Python-Version: current

debian/control.jaunty

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
99
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
1010
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
1111
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, libqwt5-qt4-dev, libfcgi-dev,
12-
git, doxygen, graphviz, txt2tags
12+
git-core, doxygen, graphviz, txt2tags
1313
Build-Conflicts: libqgis-dev, qgis-dev
1414
Standards-Version: 3.8.0
1515
XS-Python-Version: current

debian/control.karmic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5.0.51~), libgdal1-dev, libpq-dev,
99
libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
1010
libqt4-sql (>=4.2.0), python-qt4 (>=4.1.0), python-qt4-dev (>=4.1.0),
1111
python-sip4-dev (>= 4.5.0), pyqt4-dev-tools, libqwt5-qt4-dev, libfcgi-dev,
12-
git, doxygen, graphviz, txt2tags
12+
git-core, doxygen, graphviz, txt2tags
1313
Build-Conflicts: libqgis-dev, qgis-dev
1414
Standards-Version: 3.8.0
1515
XS-Python-Version: current

debian/control.lenny

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Build-Depends:
2727
python-qt4-dev (>=4.1.0),
2828
python-sip4-dev (>= 4.5.0),
2929
sip4 (>= 4.5),
30-
git,
30+
git-core,
3131
doxygen,
3232
graphviz,
3333
txt2tags

debian/control.lucid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Build-Depends:
2828
python-qt4-dev (>=4.1.0),
2929
python-sip (>= 4.5.0),
3030
python-sip-dev (>= 4.5.0),
31-
git,
31+
git-core,
3232
doxygen,
3333
graphviz,
3434
txt2tags

python/plugins/fTools/tools/doMergeShapes.py

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ def __init__( self, iface ):
1919
self.mergeThread = None
2020
self.inputFiles = None
2121
self.outFileName = None
22+
self.inEncoding = None
2223

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

2627
QObject.connect( self.btnSelectDir, SIGNAL( "clicked()" ), self.inputDir )
2728
QObject.connect( self.btnSelectFile, SIGNAL( "clicked()" ), self.outFile )
2829
QObject.connect( self.chkListMode, SIGNAL( "stateChanged( int )" ), self.changeMode )
30+
QObject.connect( self.leOutShape, SIGNAL( "editingFinished()" ), self.updateOutFile )
2931

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

88+
def updateOutFile( self ):
89+
self.outFileName = self.leOutShape.text()
90+
settings = QSettings()
91+
self.outEncoding = settings.value( "/UI/encoding" ).toString()
92+
8693
def reject( self ):
8794
QDialog.reject( self )
8895

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

113-
# look for shapes with specified geometry type
114-
self.inputFiles = ftools_utils.getShapesByGeometryType( baseDir, self.inputFiles, self.cmbGeometry.currentIndex() )
115-
116-
self.progressFiles.setRange( 0, self.inputFiles.count() )
117-
118120
outFile = QFile( self.outFileName )
119121
if outFile.exists():
120122
if not QgsVectorFileWriter.deleteShapeFile( self.outFileName ):
121123
QMessageBox.warning( self, self.tr( "Delete error" ), self.tr( "Can't delete file %1" ).arg( outFileName ) )
122124
return
123125

126+
# look for shapes with specified geometry type
127+
self.inputFiles = ftools_utils.getShapesByGeometryType( baseDir, self.inputFiles, self.cmbGeometry.currentIndex() )
128+
self.progressFiles.setRange( 0, self.inputFiles.count() )
129+
130+
if self.inEncoding == None:
131+
self.inEncoding = "System"
132+
124133
QApplication.setOverrideCursor( QCursor( Qt.WaitCursor ) )
125134
self.btnOk.setEnabled( False )
126135

127-
self.mergeThread = ShapeMergeThread( baseDir, self.inputFiles, self.outFileName, self.encoding )
136+
self.mergeThread = ShapeMergeThread( baseDir, self.inputFiles, self.inEncoding, self.outFileName, self.encoding )
128137
QObject.connect( self.mergeThread, SIGNAL( "rangeChanged( PyQt_PyObject )" ), self.setProgressRange )
138+
QObject.connect( self.mergeThread, SIGNAL( "checkStarted()" ), self.setFeatureProgressFormat )
139+
QObject.connect( self.mergeThread, SIGNAL( "checkFinished()" ), self.resetFeatureProgressFormat )
140+
QObject.connect( self.mergeThread, SIGNAL( "fileNameChanged( PyQt_PyObject )" ), self.setShapeProgressFormat )
129141
QObject.connect( self.mergeThread, SIGNAL( "featureProcessed()" ), self.featureProcessed )
130142
QObject.connect( self.mergeThread, SIGNAL( "shapeProcessed()" ), self.shapeProcessed )
131143
QObject.connect( self.mergeThread, SIGNAL( "processingFinished()" ), self.processingFinished )
@@ -141,9 +153,18 @@ def setProgressRange( self, max ):
141153
self.progressFeatures.setRange( 0, max )
142154
self.progressFeatures.setValue( 0 )
143155

156+
def setFeatureProgressFormat( self ):
157+
self.progressFeatures.setFormat( "Checking files: %p% ")
158+
159+
def resetFeatureProgressFormat( self ):
160+
self.progressFeatures.setFormat( "%p% ")
161+
144162
def featureProcessed( self ):
145163
self.progressFeatures.setValue( self.progressFeatures.value() + 1 )
146164

165+
def setShapeProgressFormat( self, fileName ):
166+
self.progressFiles.setFormat( "%p% " + fileName )
167+
147168
def shapeProcessed( self ):
148169
self.progressFiles.setValue( self.progressFiles.value() + 1 )
149170

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

153174
if self.chkAddToCanvas.isChecked():
154175
if not ftools_utils.addShapeToCanvas( unicode( self.outFileName ) ):
155-
QMessageBox.warning( self, self.tr( "Merging" ), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.outFileName ) ) )
176+
QMessageBox.warning( self, self.tr( "Merging" ),
177+
self.tr( "Error loading output shapefile:\n%1" )
178+
.arg( unicode( self.outFileName ) ) )
156179

157180
self.restoreGui()
158181

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

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

176200
class ShapeMergeThread( QThread ):
177-
def __init__( self, dir, shapes, outputFileName, outputEncoding ):
201+
def __init__( self, dir, shapes, inputEncoding, outputFileName, outputEncoding ):
178202
QThread.__init__( self, QThread.currentThread() )
179203
self.baseDir = dir
180204
self.shapes = shapes
205+
self.inputEncoding = inputEncoding
181206
self.outputFileName = outputFileName
182207
self.outputEncoding = outputEncoding
183208

@@ -208,10 +233,12 @@ def run( self ):
208233
if not newLayer.isValid():
209234
continue
210235
vprovider = newLayer.dataProvider()
236+
vprovider.setEncoding( self.inputEncoding )
211237
allAttrs = vprovider.attributeIndexes()
212238
vprovider.select( allAttrs )
213239
nFeat = vprovider.featureCount()
214240
self.emit( SIGNAL( "rangeChanged( PyQt_PyObject )" ), nFeat )
241+
self.emit( SIGNAL( "fileNameChanged( PyQt_PyObject )" ), fileName )
215242
inFeat = QgsFeature()
216243
outFeat = QgsFeature()
217244
inGeom = QgsGeometry()

src/core/qgsvectorfilewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ QgsVectorFileWriter::QgsVectorFileWriter(
147147

148148
if ( !found )
149149
{
150-
vectorFileName += "." + exts[0];
150+
vectorFileName += "." + allExts[0];
151151
}
152152
}
153153

src/gui/qgsmapcanvas.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
8282
, mCanvasProperties( new CanvasProperties )
8383
, mNewSize( QSize() )
8484
, mPainting( false )
85+
, mAntiAliasing( false )
8586
{
8687
//disable the update that leads to the resize crash
87-
if( viewport() )
88+
if ( viewport() )
8889
{
8990
viewport()->setAttribute( Qt::WA_PaintOnScreen, true );
9091
}
@@ -163,6 +164,7 @@ QgsMapCanvas::~QgsMapCanvas()
163164

164165
void QgsMapCanvas::enableAntiAliasing( bool theFlag )
165166
{
167+
mAntiAliasing = theFlag;
166168
mMap->enableAntiAliasing( theFlag );
167169
if ( mMapOverview )
168170
mMapOverview->enableAntiAliasing( theFlag );

src/gui/qgsmapcanvas.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
244244
//! used to determine if anti-aliasing is enabled or not
245245
void enableAntiAliasing( bool theFlag );
246246

247+
//! true if antialising is enabled
248+
bool antiAliasingEnabled() const { return mAntiAliasing; }
249+
247250
//! Select which Qt class to render with
248251
void useImageToRender( bool theFlag );
249252

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

469+
//! indicates whether antialiasing will be used for rendering
470+
bool mAntiAliasing;
466471
}; // class QgsMapCanvas
467472

468473

src/gui/qgsmapcanvasitem.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ void QgsMapCanvasItem::paint( QPainter * painter,
4242
const QStyleOptionGraphicsItem * option,
4343
QWidget * widget )
4444
{
45+
if ( mMapCanvas->antiAliasingEnabled() )
46+
{
47+
painter->setRenderHint( QPainter::Antialiasing );
48+
}
4549
paint( painter ); // call the derived item's drawing routines
4650
}
4751

src/mac/Contents/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
SET(COMPLETE_VERSION_WITH_RELEASE_NAME \"${COMPLETE_VERSION}-${RELEASE_NAME}\")
66
7-
IF (NOT EXISTS SVN_MARKER)
8-
SET (SVN_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file
9-
ENDIF (NOT EXISTS SVN_MARKER)
7+
IF (NOT EXISTS GIT_MARKER)
8+
SET (GIT_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file
9+
ENDIF (NOT EXISTS GIT_MARKER)
1010
1111
ADD_CUSTOM_TARGET(Info.plist ALL
12-
DEPENDS ${SVN_MARKER}
12+
DEPENDS ${GIT_MARKER}
1313
COMMAND ${CMAKE_COMMAND}
1414
-D CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
1515
-D SOURCE_DIR=${CMAKE_SOURCE_DIR}

src/mac/Contents/Info.plist.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
SET(CMAKE_BACKWARDS_COMPATIBILITY "2.4")
22

3-
# See if we have svn installed
4-
FIND_PROGRAM(SVNVERSION svnversion)
3+
# See if we have git installed
4+
FIND_PROGRAM (GIT git)
55

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

1313
# Create Info.plist
1414
CONFIGURE_FILE (${CURRENT_SOURCE_DIR}/Info.plist.in

src/mac/Contents/Info.plist.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundleSignature</key>
1616
<string>QGIS</string>
1717
<key>CFBundleGetInfoString</key>
18-
<string>QGIS @VERSION@ (@REVISION@), © 2002-2010 QGIS Development Team</string>
18+
<string>QGIS @VERSION@ (@REVISION@), © 2002-2011 QGIS Development Team</string>
1919
<key>CFBundleShortVersionString</key>
2020
<string>@VERSION_NUM@</string>
2121
<key>CFBundleVersion</key>

src/mapserver/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo
1717

1818
SET ( qgis_mapserv_SRCS
1919
qgis_map_serv.cpp
20+
qgscapabilitiescache.cpp
2021
qgsconfigcache.cpp
2122
qgsconfigparser.cpp
2223
qgsepsgcache.cpp

src/mapserver/qgis_map_serv.cpp

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ map service syntax for SOAP/HTTP POST
1818
***************************************************************************/
1919

2020
#include "qgsapplication.h"
21+
#include "qgscapabilitiescache.h"
2122
#include "qgsconfigcache.h"
2223
#include "qgsgetrequesthandler.h"
2324
#include "qgssoaprequesthandler.h"
@@ -191,6 +192,9 @@ int main( int argc, char * argv[] )
191192
}
192193
}
193194

195+
//create cache for capabilities XML
196+
QgsCapabilitiesCache capabilitiesCache;
197+
194198
//creating QgsMapRenderer is expensive (access to srs.db), so we do it here before the fcgi loop
195199
QgsMapRenderer* theMapRenderer = new QgsMapRenderer();
196200

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

292296
if ( requestIt->second == "GetCapabilities" )
293297
{
294-
QDomDocument capabilitiesDocument;
295-
try
298+
const QDomDocument* capabilitiesDocument = capabilitiesCache.searchCapabilitiesDocument( configFilePath );
299+
if( !capabilitiesDocument ) //capabilities xml not in cache. Create a new one
300+
{
301+
QgsMSDebugMsg( "Capabilities document not found in cache" );
302+
QDomDocument doc;
303+
try
304+
{
305+
doc = theServer->getCapabilities();
306+
}
307+
catch ( QgsMapServiceException& ex )
308+
{
309+
theRequestHandler->sendServiceException( ex );
310+
delete theRequestHandler;
311+
delete theServer;
312+
continue;
313+
}
314+
capabilitiesCache.insertCapabilitiesDocument( configFilePath, &doc );
315+
capabilitiesDocument = capabilitiesCache.searchCapabilitiesDocument( configFilePath );
316+
}
317+
else
296318
{
297-
capabilitiesDocument = theServer->getCapabilities();
319+
QgsMSDebugMsg( "Found capabilities document in cache" );
298320
}
299-
catch ( QgsMapServiceException& ex )
321+
322+
if( capabilitiesDocument )
300323
{
301-
theRequestHandler->sendServiceException( ex );
302-
delete theRequestHandler;
303-
delete theServer;
304-
continue;
324+
theRequestHandler->sendGetCapabilitiesResponse( *capabilitiesDocument );
305325
}
306-
QgsMSDebugMsg( "sending GetCapabilities response" );
307-
theRequestHandler->sendGetCapabilitiesResponse( capabilitiesDocument );
308326
delete theRequestHandler;
309327
delete theServer;
310328
continue;

0 commit comments

Comments
 (0)