@@ -59,8 +59,8 @@ def escapeAndJoin(strList):
59
59
# Retrieves last used dir from persistent settings
60
60
def getLastUsedDir ():
61
61
settings = QSettings ()
62
- lastProjectDir = settings .value ( "/UI/lastProjectDir" , "." , type = str )
63
- return settings .value ( "/GdalTools/lastUsedDir" , lastProjectDir , type = str )
62
+ lastProjectDir = settings .value ( "/UI/lastProjectDir" , u "." , type = unicode )
63
+ return settings .value ( "/GdalTools/lastUsedDir" , lastProjectDir , type = unicode )
64
64
65
65
# Stores last used dir in persistent settings
66
66
def setLastUsedDir (filePath ):
@@ -75,7 +75,7 @@ def setLastUsedDir(filePath):
75
75
# Retrieves GDAL binaries location
76
76
def getGdalBinPath ():
77
77
settings = QSettings ()
78
- return settings .value ( "/GdalTools/gdalPath" , u"" )
78
+ return settings .value ( "/GdalTools/gdalPath" , u"" , type = unicode )
79
79
80
80
# Stores GDAL binaries location
81
81
def setGdalBinPath ( path ):
@@ -85,7 +85,7 @@ def setGdalBinPath( path ):
85
85
# Retrieves GDAL python modules location
86
86
def getGdalPymodPath ():
87
87
settings = QSettings ()
88
- return settings .value ( "/GdalTools/gdalPymodPath" , u"" )
88
+ return settings .value ( "/GdalTools/gdalPymodPath" , u"" , type = unicode )
89
89
90
90
# Stores GDAL python modules location
91
91
def setGdalPymodPath ( path ):
@@ -95,7 +95,7 @@ def setGdalPymodPath( path ):
95
95
# Retrieves GDAL help files location
96
96
def getHelpPath ():
97
97
settings = QSettings ()
98
- return settings .value ( "/GdalTools/helpPath" , u"" )
98
+ return settings .value ( "/GdalTools/helpPath" , u"" , type = unicode )
99
99
100
100
# Stores GDAL help files location
101
101
def setHelpPath ( path ):
@@ -105,7 +105,7 @@ def setHelpPath( path ):
105
105
# Retrieves last used encoding from persistent settings
106
106
def getLastUsedEncoding ():
107
107
settings = QSettings ()
108
- return settings .value ( "/UI/encoding" , u"System" )
108
+ return settings .value ( "/UI/encoding" , u"System" , type = unicode )
109
109
110
110
# Stores last used encoding in persistent settings
111
111
def setLastUsedEncoding (encoding ):
@@ -347,7 +347,7 @@ def getDialog(self, parent = None, caption = '', acceptMode = QFileDialog.Accept
347
347
dialog .setFileMode (fileMode )
348
348
dialog .setAcceptMode (acceptMode )
349
349
350
- if selectedFilter != None :
350
+ if selectedFilter is not None :
351
351
dialog .selectNameFilter (selectedFilter [0 ])
352
352
353
353
if not dialog .exec_ ():
@@ -356,7 +356,7 @@ def getDialog(self, parent = None, caption = '', acceptMode = QFileDialog.Accept
356
356
return ''
357
357
358
358
# change the selected filter value
359
- if selectedFilter != None :
359
+ if selectedFilter is not None :
360
360
selectedFilter [0 ] = dialog .selectedNameFilter ()
361
361
362
362
# save the last used dir and return the selected files
@@ -409,7 +409,7 @@ class FileFilter:
409
409
@classmethod
410
410
def getFilter (self , typeName ):
411
411
settings = QSettings ()
412
- return settings .value ( "/GdalTools/" + typeName + "FileFilter" , u"" )
412
+ return settings .value ( "/GdalTools/" + typeName + "FileFilter" , u"" , type = unicode )
413
413
414
414
@classmethod
415
415
def setFilter (self , typeName , aFilter ):
0 commit comments