Skip to content
Permalink
Browse files

avoid slashes in connection names (followup 30900e9; fixes #16624)

(cherry picked from commit 8c873b1)
  • Loading branch information
jef-n committed May 29, 2017
1 parent dae921c commit dcd99ad597b8fdc782cf09e88135eac7d712571c
@@ -16,6 +16,7 @@
***************************************************************************/
#include <QSettings>
#include <QMessageBox>
#include <QRegExpValidator>

#include "qgsnewogrconnection.h"
#include "qgscontexthelp.h"
@@ -66,6 +67,7 @@ QgsNewOgrConnection::QgsNewOgrConnection( QWidget *parent, const QString& connTy
}
cmbDatabaseTypes->setCurrentIndex( cmbDatabaseTypes->findText( connType ) );
txtName->setText( connName );
txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
txtName->setEnabled( false );
cmbDatabaseTypes->setEnabled( false );
}
@@ -19,12 +19,9 @@
#include <QSettings>
#include <QInputDialog>
#include <QMessageBox>
#include <QLabel>
#include <qgslogger.h>
#include <qlistwidget.h>

#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>
#include <QSqlDatabase>
#include <QSqlError>
#include <QRegExpValidator>

#include "qgsdb2newconnection.h"
#include "qgsdb2dataitems.h"
@@ -76,6 +73,7 @@ QgsDb2NewConnection::QgsDb2NewConnection( QWidget *parent, const QString& connNa
}

txtName->setText( connName );
txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
}
}

@@ -18,9 +18,9 @@
#include <QSettings>
#include <QInputDialog>
#include <QMessageBox>

#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>
#include <QSqlDatabase>
#include <QSqlError>
#include <QRegExpValidator>

#include "qgsmssqlnewconnection.h"
#include "qgsmssqlprovider.h"
@@ -63,6 +63,7 @@ QgsMssqlNewConnection::QgsMssqlNewConnection( QWidget *parent, const QString& co
}

txtName->setText( connName );
txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
}
on_cb_trustedConnection_clicked();
}
@@ -18,6 +18,7 @@
#include <QSettings>
#include <QMessageBox>
#include <QInputDialog>
#include <QRegExpValidator>

#include "qgsoraclenewconnection.h"
#include "qgscontexthelp.h"
@@ -79,6 +80,7 @@ QgsOracleNewConnection::QgsOracleNewConnection( QWidget *parent, const QString&
}

txtName->setText( connName );
txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
}
}
/** Autoconnected SLOTS **/
@@ -18,6 +18,7 @@
#include <QSettings>
#include <QMessageBox>
#include <QInputDialog>
#include <QRegExpValidator>

#include "qgspgnewconnection.h"
#include "qgsauthmanager.h"
@@ -100,8 +101,8 @@ QgsPgNewConnection::QgsPgNewConnection( QWidget *parent, const QString& connName
tabAuthentication->setCurrentIndex( tabAuthentication->indexOf( mAuthConfigSelect ) );
}


txtName->setText( connName );
txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
}
}
/** Autoconnected SLOTS **/

0 comments on commit dcd99ad

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