Index: python/plugins/fTools/tools/doDefineProj.py =================================================================== --- python/plugins/fTools/tools/doDefineProj.py (revision 13010) +++ python/plugins/fTools/tools/doDefineProj.py (working copy) @@ -34,12 +34,12 @@ def updateProj1(self, layerName): tempLayer = self.getVectorLayerByName(layerName) crs = tempLayer.dataProvider().crs().toProj4() - self.inRef.insert(unicode(crs)) + self.inRef.insert(unicode(crs)) def updateProj2(self, layerName): tempLayer = self.getVectorLayerByName(layerName) crs = tempLayer.dataProvider().crs().toProj4() - self.outRef.insert(unicode(crs)) + self.outRef.insert(unicode(crs)) def accept(self): if self.inShape.currentText() == "": @@ -81,11 +81,14 @@ self.progressBar.setValue(60) outputWkt = srsDefine.toWkt() self.progressBar.setValue(65) - outputPrj = open(inPath + ".prj", "w") + outputFile = QFile( inPath + ".prj" ) + outputFile.open( QIODevice.WriteOnly | QIODevice.Text ) + outputPrj = QTextStream( outputFile ) self.progressBar.setValue(70) - outputPrj.write(outputWkt) + outputPrj << outputWkt self.progressBar.setValue(75) - outputPrj.close() + outputPrj.flush() + outputFile.close() mLayer = self.getMapLayerByName(inName) self.progressBar.setValue(90) if not mLayer.isValid():