mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix for renaming of wms/wfs connections in dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk@8354 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
ed93065099
commit
44b97a3a7d
@ -19,7 +19,7 @@
|
||||
#include "qgscontexthelp.h"
|
||||
#include <QSettings>
|
||||
|
||||
QgsNewHttpConnection::QgsNewHttpConnection(QWidget *parent, const QString& baseKey, const QString& connName, Qt::WFlags fl): QDialog(parent, fl), mBaseKey(baseKey)
|
||||
QgsNewHttpConnection::QgsNewHttpConnection(QWidget *parent, const QString& baseKey, const QString& connName, Qt::WFlags fl): QDialog(parent, fl), mBaseKey(baseKey), mOriginalConnName(connName)
|
||||
{
|
||||
setupUi(this);
|
||||
connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||
@ -58,6 +58,12 @@ void QgsNewHttpConnection::saveConnection()
|
||||
{
|
||||
QSettings settings;
|
||||
QString key = mBaseKey + txtName->text();
|
||||
|
||||
//delete original entry first
|
||||
if(!mOriginalConnName.isNull() && mOriginalConnName != key)
|
||||
{
|
||||
settings.remove(mBaseKey + mOriginalConnName);
|
||||
}
|
||||
settings.writeEntry(key + "/url", txtUrl->text().trimmed());
|
||||
settings.writeEntry(key + "/proxyhost", txtProxyHost->text().trimmed());
|
||||
settings.writeEntry(key + "/proxyport", txtProxyPort->text().trimmed());
|
||||
|
@ -40,6 +40,7 @@ class QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBas
|
||||
void on_btnHelp_clicked();
|
||||
private:
|
||||
QString mBaseKey;
|
||||
QString mOriginalConnName; //store initial name to delete entry in case of rename
|
||||
static const int context_id = 308026563;
|
||||
};
|
||||
|
||||
|
@ -159,7 +159,7 @@ void QgsServerSourceSelect::on_btnEdit_clicked()
|
||||
|
||||
if (nc->exec())
|
||||
{
|
||||
nc->saveConnection();
|
||||
populateConnectionList();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,9 +246,8 @@ void QgsWFSSourceSelect::modifyEntryOfServerList()
|
||||
|
||||
if (nc.exec())
|
||||
{
|
||||
nc.saveConnection();
|
||||
populateConnectionList();
|
||||
}
|
||||
populateConnectionList();
|
||||
}
|
||||
|
||||
void QgsWFSSourceSelect::deleteEntryOfServerList()
|
||||
|
Loading…
x
Reference in New Issue
Block a user