Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change != True to not + getComment and commentTable on main file if n…
…ot needed only
  • Loading branch information
Ailurupoda committed Feb 8, 2019
1 parent 9741515 commit db06040
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 35 deletions.
8 changes: 8 additions & 0 deletions python/plugins/db_manager/db_plugins/connector.py
Expand Up @@ -231,6 +231,14 @@ def getSqlDictionary(self):
except ImportError:
return []

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
pass

def getQueryBuilderDictionary(self):

return {}
7 changes: 0 additions & 7 deletions python/plugins/db_manager/db_plugins/gpkg/connector.py
Expand Up @@ -620,13 +620,6 @@ def runVacuum(self):
""" run vacuum on the db """
self._execute_and_commit("VACUUM")

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
""" add a column to table """
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/db_manager/db_plugins/oracle/connector.py
Expand Up @@ -1307,14 +1307,6 @@ def renameSchema(self, schema, new_schema):
# Unsupported in Oracle
pass

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
"""Add a column to a table."""
sql = u"ALTER TABLE {0} ADD {1}".format(self.quoteId(table),
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/db_manager/db_plugins/spatialite/connector.py
Expand Up @@ -571,14 +571,6 @@ def runVacuum(self):
c.execute('VACUUM')
self.connection.isolation_level = '' # reset to default isolation

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
""" add a column to table """
sql = u"ALTER TABLE %s ADD %s" % (self.quoteId(table), field_def)
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/db_manager/db_plugins/vlayers/connector.py
Expand Up @@ -342,14 +342,6 @@ def runVacuum(self):
print("**unimplemented** runVacuum")
return False

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
print("**unimplemented** addTableColumn")
return False
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/dlg_field_properties.py
Expand Up @@ -43,7 +43,7 @@ def __init__(self, parent=None, fld=None, table=None, db=None):
self.cboType.addItem(item)

supportCom = self.db.supportsComment()
if supportCom != True:
if not supportCom:
self.label_6.setVisible(False)
self.editCom.setVisible(False)

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/dlg_import_vector.py
Expand Up @@ -52,7 +52,7 @@ def __init__(self, inLayer, outDb, outUri, parent=None):
self.setupUi(self)

supportCom = self.db.supportsComment()
if supportCom != True:
if not supportCom:
self.chkCom.setVisible(False)
self.editCom.setVisible(False)

Expand Down Expand Up @@ -374,7 +374,7 @@ def accept(self):

# add comment on table
supportCom = self.db.supportsComment()
if self.chkCom.isEnabled() and self.chkCom.isChecked() and supportCom == True:
if self.chkCom.isEnabled() and self.chkCom.isChecked() and supportCom:
# using connector executing COMMENT ON TABLE query (with editCome.text() value)
com = self.editCome.text()
self.db.connector.commentTable(schema, table, com)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/dlg_table_properties.py
Expand Up @@ -51,7 +51,7 @@ def __init__(self, table, parent=None):
self.db = self.table.database()

supportCom = self.db.supportsComment()
if supportCom != True:
if not supportCom :
self.tabs.removeTab(3)

m = TableFieldsModel(self)
Expand Down

0 comments on commit db06040

Please sign in to comment.