[QGIS Commit] r8354 - in trunk/qgis/src: app plugins/wfs
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Apr 16 11:41:24 EDT 2008
Author: mhugent
Date: 2008-04-16 11:41:24 -0400 (Wed, 16 Apr 2008)
New Revision: 8354
Modified:
trunk/qgis/src/app/qgsnewhttpconnection.cpp
trunk/qgis/src/app/qgsnewhttpconnection.h
trunk/qgis/src/app/qgsserversourceselect.cpp
trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp
Log:
Fix for renaming of wms/wfs connections in dialog
Modified: trunk/qgis/src/app/qgsnewhttpconnection.cpp
===================================================================
--- trunk/qgis/src/app/qgsnewhttpconnection.cpp 2008-04-15 16:43:49 UTC (rev 8353)
+++ trunk/qgis/src/app/qgsnewhttpconnection.cpp 2008-04-16 15:41:24 UTC (rev 8354)
@@ -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 @@
{
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());
Modified: trunk/qgis/src/app/qgsnewhttpconnection.h
===================================================================
--- trunk/qgis/src/app/qgsnewhttpconnection.h 2008-04-15 16:43:49 UTC (rev 8353)
+++ trunk/qgis/src/app/qgsnewhttpconnection.h 2008-04-16 15:41:24 UTC (rev 8354)
@@ -40,6 +40,7 @@
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;
};
Modified: trunk/qgis/src/app/qgsserversourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsserversourceselect.cpp 2008-04-15 16:43:49 UTC (rev 8353)
+++ trunk/qgis/src/app/qgsserversourceselect.cpp 2008-04-16 15:41:24 UTC (rev 8354)
@@ -159,7 +159,7 @@
if (nc->exec())
{
- nc->saveConnection();
+ populateConnectionList();
}
}
Modified: trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp
===================================================================
--- trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp 2008-04-15 16:43:49 UTC (rev 8353)
+++ trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp 2008-04-16 15:41:24 UTC (rev 8354)
@@ -246,9 +246,8 @@
if (nc.exec())
{
- nc.saveConnection();
+ populateConnectionList();
}
- populateConnectionList();
}
void QgsWFSSourceSelect::deleteEntryOfServerList()
More information about the QGIS-commit
mailing list