- string branch(controller().params().branch);
- if (all_branches.find(branch) != string::npos && branch != "none")
- fl_set_choice_text(dialog_->choice_branch, branch.c_str());
+ const_iterator const begin = branchlist.begin();
+ const_iterator const end = branchlist.end();
+ int id = 1;
+ int count = 1;
+ for (const_iterator it = begin; it != end; ++it, ++count) {
+ string const & branch = it->getBranch();
+ fl_addto_choice(dialog_->choice_branch, branch.c_str());
+
+ if (cur_branch == branch)
+ id = count;
+ }
+ fl_set_choice(dialog_->choice_branch, id);