Skip to content
Permalink
Browse files
Fix for renaming of wms/wfs connections in dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8354 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 16, 2008
1 parent 98df26a commit d5bdd2b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
@@ -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()

0 comments on commit d5bdd2b

Please sign in to comment.