Skip to content

Commit 1def2d3

Browse files
author
cfarmer
committed
oops, didn't see patch, patch implementation more elegant (qt-ish), thanks alexbruy
git-svn-id: http://svn.osgeo.org/qgis/trunk@13026 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4fa5e8f commit 1def2d3

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

python/plugins/fTools/tools/doDefineProj.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,14 @@ def accept(self):
7979
self.progressBar.setValue(60)
8080
outputWkt = srsDefine.toWkt()
8181
self.progressBar.setValue(65)
82-
outputPrj = open(unicode("%s.prj" % inPath), "w")
82+
outputFile = QFile( inPath + ".prj" )
83+
outputFile.open( QIODevice.WriteOnly | QIODevice.Text )
84+
outputPrj = QTextStream( outputFile )
8385
self.progressBar.setValue(70)
84-
outputPrj.write(outputWkt)
86+
outputPrj << outputWkt
8587
self.progressBar.setValue(75)
86-
outputPrj.close()
87-
#mLayer = self.getMapLayerByName(inName)
88-
#self.progressBar.setValue(90)
89-
#if not mLayer.isValid():
90-
#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."))
91-
#else:
88+
outputPrj.flush()
89+
outputFile.close()
9290
self.progressBar.setValue(95)
9391
vLayer.setCrs(srsDefine)
9492
self.progressBar.setValue(100)

0 commit comments

Comments
 (0)