diff options
| author | Kevin Smith <git@kismith.co.uk> | 2011-02-11 11:25:42 (GMT) | 
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2011-02-11 11:25:42 (GMT) | 
| commit | b8a73b1d16afd4f3aa0e8e39447024ec541df4c8 (patch) | |
| tree | 503acb56c355ac0cca5dc13d89a9e4a3804ab813 /Swift/QtUI/QtSettingsProvider.cpp | |
| parent | 4dde3a55c46c95d89a7564738e132ad23bc946ee (diff) | |
| download | swift-b8a73b1d16afd4f3aa0e8e39447024ec541df4c8.zip swift-b8a73b1d16afd4f3aa0e8e39447024ec541df4c8.tar.bz2  | |
Allow deletion of items from login list.
Resolves: #711
Release-Notes: Highlighting an item in the login account list and pressing detele will now prompt you to remove the cached credentials for that account.
Diffstat (limited to 'Swift/QtUI/QtSettingsProvider.cpp')
| -rw-r--r-- | Swift/QtUI/QtSettingsProvider.cpp | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSettingsProvider.cpp b/Swift/QtUI/QtSettingsProvider.cpp index ea0013a..4bddce3 100644 --- a/Swift/QtUI/QtSettingsProvider.cpp +++ b/Swift/QtUI/QtSettingsProvider.cpp @@ -60,6 +60,18 @@ void QtSettingsProvider::createProfile(const String& profile) {  	settings_.setValue("profileList", stringList);  } +void QtSettingsProvider::removeProfile(const String& profile) { +	QString profileStart(P2QSTRING(profile) + ":"); +	foreach (QString key, settings_.allKeys()) { +		if (key.startsWith(profileStart)) { +			settings_.remove(key); +		} +	} +	QStringList stringList = settings_.value("profileList").toStringList(); +	stringList.removeAll(P2QSTRING(profile)); +	settings_.setValue("profileList", stringList); +} +  QSettings* QtSettingsProvider::getQSettings() {  	return &settings_;  }  | 
 Swift