Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Sep 21, 2020
1 parent 3e5be25 commit 6d866e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/dlg_sql_window.py
Expand Up @@ -381,7 +381,7 @@ def updateUiWhileSqlExecution(self, status):

def executeSqlCanceled(self):
self.btnCancel.setEnabled(False)
self.btnCancel.setText(self.tr("Canceling, please wait ..."))
self.btnCancel.setText(self.tr("Canceling"))
self.modelAsync.cancel()

def executeSqlCompleted(self):
Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresproviderconnection.cpp
Expand Up @@ -223,10 +223,10 @@ QList<QVariantList> QgsPostgresProviderConnection::executeSqlPrivate( const QStr
}

// This is gross but I tried with both conn and a context QObject without success: the lambda is never called.
QMetaObject::Connection moConn;
QMetaObject::Connection qtConnection;
if ( feedback )
{
moConn = QObject::connect( feedback, &QgsFeedback::canceled, [ &conn ]
qtConnection = QObject::connect( feedback, &QgsFeedback::canceled, [ &conn ]
{
conn->PQCancel();
} );
Expand All @@ -235,7 +235,7 @@ QList<QVariantList> QgsPostgresProviderConnection::executeSqlPrivate( const QStr
QgsPostgresResult res( conn->PQexec( sql ) );
if ( feedback )
{
QObject::disconnect( moConn );
QObject::disconnect( qtConnection );
}

QString errCause;
Expand Down

0 comments on commit 6d866e3

Please sign in to comment.