Address PR comments

This commit is contained in:
Alessandro Pasotti 2020-09-21 13:53:53 +02:00
parent 3e5be258cb
commit 6d866e3341
2 changed files with 4 additions and 4 deletions

View File

@ -381,7 +381,7 @@ class DlgSqlWindow(QWidget, Ui_Dialog):
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):

View File

@ -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();
} );
@ -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;