[QGIS Commit] r13026 - trunk/qgis/python/plugins/fTools/tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Mar 8 15:25:51 EST 2010


Author: cfarmer
Date: 2010-03-08 15:25:51 -0500 (Mon, 08 Mar 2010)
New Revision: 13026

Modified:
   trunk/qgis/python/plugins/fTools/tools/doDefineProj.py
Log:
oops, didn't see patch, patch implementation more elegant (qt-ish), thanks alexbruy

Modified: trunk/qgis/python/plugins/fTools/tools/doDefineProj.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doDefineProj.py	2010-03-08 20:19:04 UTC (rev 13025)
+++ trunk/qgis/python/plugins/fTools/tools/doDefineProj.py	2010-03-08 20:25:51 UTC (rev 13026)
@@ -79,16 +79,14 @@
                         self.progressBar.setValue(60)
                         outputWkt = srsDefine.toWkt()
                         self.progressBar.setValue(65)
-                        outputPrj = open(unicode("%s.prj" % inPath), "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()
-                        #mLayer = self.getMapLayerByName(inName)
-                        #self.progressBar.setValue(90)
-                        #if not mLayer.isValid():
-                            #QMessageBox.information(self, self.tr("Define current projection"), self.tr("Unable to dynamically define projection.\nPlease reload layer manually for projection definition to take effect."))
-                        #else:
+                        outputPrj.flush()
+                        outputFile.close()
                         self.progressBar.setValue(95)
                         vLayer.setCrs(srsDefine)
                         self.progressBar.setValue(100)



More information about the QGIS-commit mailing list