Showing with 14 additions and 11 deletions.
  1. +1 −1 python/plugins/GdalTools/tools/doOverview.py
  2. +5 −0 python/plugins/GdalTools/tools/widgetOverview.ui
  3. +8 −10 python/plugins/db_manager/db_plugins/postgis/plugin.py
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/doOverview.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GdalToolsDialog( QWidget, Ui_Widget, BaseBatchWidget ):
def __init__( self, iface ):
QWidget.__init__( self )
self.iface = iface
self.resampling_method = ('nearest', 'average', 'gauss', 'average_mp', 'average_magphase', 'mode')
self.resampling_method = ('nearest', 'average', 'gauss', 'cubic', 'average_mp', 'average_magphase', 'mode')

self.setupUi( self )
BaseBatchWidget.__init__( self, self.iface, "gdaladdo" )
Expand Down
5 changes: 5 additions & 0 deletions python/plugins/GdalTools/tools/widgetOverview.ui
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<string>gauss</string>
</property>
</item>
<item>
<property name="text">
<string>cubic</string>
</property>
</item>
<item>
<property name="text">
<string>average_mp</string>
Expand Down
18 changes: 8 additions & 10 deletions python/plugins/db_manager/db_plugins/postgis/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,14 @@ def __init__(self, row, table):
self.num, self.name, self.dataType, self.charMaxLen, self.modifier, self.notNull, self.hasDefault, self.default, typeStr = row
self.primaryKey = False

# convert the modifier to string (e.g. "precision,scale")
if self.modifier != None and self.modifier != -1:
trimmedTypeStr = QString(typeStr).trimmed()
if trimmedTypeStr.startsWith(self.dataType):
regex = QRegExp( "%s\s*\((.+)\)$" % QRegExp.escape(self.dataType) )
startpos = regex.indexIn( trimmedTypeStr )
if startpos >= 0:
self.modifier = regex.cap(1).trimmed()
else:
self.modifier = None
# get modifier (e.g. "precision,scale") from formatted type string
trimmedTypeStr = QString(typeStr).trimmed()
regex = QRegExp( "\((.+)\)$" )
startpos = regex.indexIn( trimmedTypeStr )
if startpos >= 0:
self.modifier = regex.cap(1).trimmed()
else:
self.modifier = None

# find out whether fields are part of primary key
for con in self.table().constraints():
Expand Down