Skip to content
Permalink
Browse files

More cleaning

  • Loading branch information
pblottiere committed Mar 2, 2018
1 parent a948f1b commit ad630094c1908936e7ee33db2185cd78c12c28bf
@@ -152,19 +152,16 @@ class SqlResultModelAsync(QObject):

done = pyqtSignal()

def __init__(self, db, sql, parent=None):
def __init__(self):
QObject.__init__(self)
self.db = db
self.sql = sql
self.parent = parent
self.error = BaseError('')
self.status = None
self.model = None
self.task = None

def cancel(self):
if self.task:
self.task.cancelQuery()
self.task.cancel()

def modelDone(self):
if self.task:
@@ -97,15 +97,15 @@ def run(self):
return False
return True

def cancelQuery(self):
def cancel(self):
self.db.connector.cancel()
self.cancel()
SqlResultModelTask.cancel(self)


class PGSqlResultModelAsync(SqlResultModelAsync):

def __init__(self, db, sql, parent):
SqlResultModelAsync.__init__(self, db, sql, parent)
SqlResultModelAsync.__init__(self)

self.task = PGSqlResultModelTask(db, sql, parent)
self.task.taskCompleted.connect(self.modelDone)
@@ -87,16 +87,16 @@ def run(self):

return True

def cancelQuery(self):
def cancel(self):
if self.clone:
self.clone.connector.cancel()
self.cancel()
SqlResultModelTask.cancel(self)


class SLSqlResultModelAsync(SqlResultModelAsync):

def __init__(self, db, sql, parent):
SqlResultModelAsync.__init__(self, db, sql, parent)
SqlResultModelAsync.__init__(self)

self.task = SLSqlResultModelTask(db, sql, parent)
self.task.taskCompleted.connect(self.modelDone)
@@ -97,15 +97,15 @@ def run(self):
return False
return True

def cancelQuery(self):
def cancel(self):
self.subtask.cancel()
self.cancel()
SqlResultModelTask.cancel(self)


class LSqlResultModelAsync(SqlResultModelAsync):

def __init__(self, db, sql, parent=None):
SqlResultModelAsync.__init__(self, db, sql, parent)
SqlResultModelAsync.__init__(self)

self.task = LSqlResultModelTask(db, sql, parent)
self.task.taskCompleted.connect(self.modelDone)
@@ -58,8 +58,8 @@ def show(self):
self.mGif.start()
self.mCancelButton.setEnabled(True)
self.mLabel.setText("Executing SQL...")
super(QDialog, self).show()
QDialog.show(self)

def hide(self):
self.mGif.stop()
super(QDialog, self).hide()
QDialog.hide(self)

0 comments on commit ad63009

Please sign in to comment.
You can’t perform that action at this time.