[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r3834: If a configuration key has multiple values (e.g., a QMultiHa (vidalia/trunk/src/torcontrol)
Author: edmanm
Date: 2009-06-10 20:18:21 -0400 (Wed, 10 Jun 2009)
New Revision: 3834
Modified:
vidalia/trunk/src/torcontrol/TorControl.cpp
Log:
If a configuration key has multiple values (e.g., a QMultiHash), they are
stored in order from most recently inserted to least recently inserted.
So, walk the list in reverse so that we append the configuration
values to the SETCONF command in the same order they were inserted
into the QHash. Fixes ticket #491.
Modified: vidalia/trunk/src/torcontrol/TorControl.cpp
===================================================================
--- vidalia/trunk/src/torcontrol/TorControl.cpp 2009-06-10 17:45:41 UTC (rev 3833)
+++ vidalia/trunk/src/torcontrol/TorControl.cpp 2009-06-11 00:18:21 UTC (rev 3834)
@@ -656,7 +656,14 @@
/* Add each keyvalue to the argument list */
foreach (QString key, map.uniqueKeys()) {
- foreach (QString value, map.values(key)) {
+ /* If a key has multiple values (e.g., a QMultiHash), they are stored
+ * in order from most recently inserted to least recently inserted.
+ * So, walk the list in reverse so that we append the configuration
+ * values to the SETCONF command in the same order they were inserted
+ * into the QHash. */
+ QList<QString> values = map.values(key);
+ for (int i = values.size()-1; i >= 0; i--) {
+ QString value = values.at(i);
if (value.length() > 0)
cmd.addArgument(key + "=" + string_escape(value));
else