Skip to content

Commit

Permalink
avoid slashes in connection names (followup 30900e9; fixes #16624)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 26, 2017
1 parent dc5ba8f commit 8c873b1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/ogr/qgsnewogrconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* *
***************************************************************************/
#include <QMessageBox>
#include <QRegExpValidator>

#include "qgsnewogrconnection.h"
#include "qgscontexthelp.h"
Expand Down Expand Up @@ -62,6 +63,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 );
}
Expand Down
2 changes: 2 additions & 0 deletions src/providers/db2/qgsdb2newconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlError>
#include <QRegExpValidator>

#include "qgssettings.h"
#include "qgslogger.h"
Expand Down Expand Up @@ -72,6 +73,7 @@ QgsDb2NewConnection::QgsDb2NewConnection( QWidget *parent, const QString &connNa
}

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

Expand Down
2 changes: 2 additions & 0 deletions src/providers/mssql/qgsmssqlnewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlError>
#include <QRegExpValidator>

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

txtName->setText( connName );
txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
}
on_cb_trustedConnection_clicked();
}
Expand Down
2 changes: 2 additions & 0 deletions src/providers/oracle/qgsoraclenewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <QMessageBox>
#include <QInputDialog>
#include <QRegExpValidator>

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

txtName->setText( connName );
txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
}
}
//! Autoconnected SLOTS *
Expand Down
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspgnewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <QMessageBox>
#include <QInputDialog>
#include <QRegExpValidator>

#include "qgspgnewconnection.h"
#include "qgsauthmanager.h"
Expand Down Expand Up @@ -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 *
Expand Down

0 comments on commit 8c873b1

Please sign in to comment.