← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2630: fix fav hub group selection

 

------------------------------------------------------------
revno: 2630
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2011-10-10 21:45:51 +0200
message:
  fix fav hub group selection
modified:
  win32/FavHubProperties.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/FavHubProperties.cpp'
--- win32/FavHubProperties.cpp	2011-05-04 19:32:00 +0000
+++ win32/FavHubProperties.cpp	2011-10-10 19:45:51 +0000
@@ -188,7 +188,7 @@
 
 void FavHubProperties::fillGroups() {
 	const string& entryGroup = entry->getGroup();
-	int sel = 0;
+	bool needSel = true;
 
 	groups->addValue(_T(""));
 
@@ -196,9 +196,12 @@
 	for(FavHubGroups::const_iterator i = favHubGroups.begin(), iend = favHubGroups.end(); i != iend; ++i) {
 		const string& name = i->first;
 		auto pos = groups->addValue(Text::toT(name));
-		if(!sel && name == entryGroup)
-			sel = pos;
+		if(needSel && name == entryGroup) {
+			groups->setSelected(pos);
+			needSel = false;
+		}
 	}
 
-	groups->setSelected(sel);
+	if(needSel)
+		groups->setSelected(0);
 }