Skip to content

Commit

Permalink
DBManager: more SIP API update (fix #8132)
Browse files Browse the repository at this point in the history
  • Loading branch information
brushtyler committed Jun 22, 2013
1 parent d1e4105 commit 49970b0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/data_model.py
Expand Up @@ -292,8 +292,8 @@ def _getNewObject(self):
def getObject(self, row):
val = self.data(self.index(row, 0), Qt.UserRole)
idx = val.toPyObject() if val.isValid() else self._getNewObject()
idx.name = self.data(self.index(row, 0)).toString()
idx.columns = self.data(self.index(row, 1), Qt.UserRole).toList()
idx.name = self.data(self.index(row, 0))
idx.columns = self.data(self.index(row, 1), Qt.UserRole)
return idx

def getIndexes(self):
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -757,16 +757,16 @@ def updateTableColumn(self, table, column, new_name=None, data_type=None, not_nu
c = self._get_cursor()

# update column definition
col_actions = QStringList()
col_actions = []
if data_type != None:
col_actions << u"TYPE %s" % data_type
col_actions.append( u"TYPE %s" % data_type )
if not_null != None:
col_actions << (u"SET NOT NULL" if not_null else u"DROP NOT NULL")
col_actions.append( u"SET NOT NULL" if not_null else u"DROP NOT NULL" )
if default != None:
if default and default != '':
col_actions << u"SET DEFAULT %s" % default
col_actions.append( u"SET DEFAULT %s" % default )
else:
col_actions << u"DROP DEFAULT"
col_actions.append( u"DROP DEFAULT" )
if len(col_actions) > 0:
sql = u"ALTER TABLE %s" % self.quoteId(table)
alter_col_str = u"ALTER %s" % self.quoteId(column)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/spatialite/connector.py
Expand Up @@ -314,7 +314,7 @@ def getTableExtent(self, table, geom):
c = self._get_cursor()

if self.isRasterTable(table):
tablename = QString(tablename).replace('_rasters', '_metadata')
tablename = tablename.replace('_rasters', '_metadata')
geom = u'geometry'

sql = u"""SELECT Min(MbrMinX(%(geom)s)), Min(MbrMinY(%(geom)s)), Max(MbrMaxX(%(geom)s)), Max(MbrMaxY(%(geom)s))
Expand Down Expand Up @@ -348,7 +348,7 @@ def isVectorTable(self, table):
def isRasterTable(self, table):
if self.has_geometry_columns and self.has_raster:
schema, tablename = self.getSchemaTableName(table)
if not QString(tablename).endsWith( "_rasters" ):
if not tablename.endswith( "_rasters" ):
return False

sql = u"""SELECT count(*)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/dlg_import_vector.py
Expand Up @@ -273,10 +273,10 @@ def accept(self):
geom = self.outUri.geometryColumn() if not self.chkGeomColumn.isChecked() else self.editGeomColumn.text()
geom = geom if geom != "" else self.default_geom
else:
geom = QString()
geom = ""

# get output params, update output URI
self.outUri.setDataSource( schema, table, geom, QString(), pk )
self.outUri.setDataSource( schema, table, geom, "", pk )
uri = self.outUri.uri()

providerName = self.db.dbplugin().providerName()
Expand Down

0 comments on commit 49970b0

Please sign in to comment.