bug fixes

This commit is contained in:
Rick Lan
2024-07-17 19:53:20 +08:00
parent cb29e7ffc9
commit bde5f921eb
+5 -6
View File
@@ -64,12 +64,11 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) {
connect(targetBranchBtn, &ButtonControl::clicked, [=]() {
auto current = params.get("GitBranch");
QStringList branches = QString::fromStdString(params.get("UpdaterAvailableBranches")).split(",");
if (!branches.isEmpty()) {
QString current = QString::fromStdString(params.get("CurrentBranch"));
int currentIndex = branches.indexOf(current);
if (currentIndex >= 0) {
branches.removeAt(currentIndex);
branches.insert(0, current);
for (QString b : {current.c_str()}) {
auto i = branches.indexOf(b);
if (i >= 0) {
branches.removeAt(i);
branches.insert(0, b);
}
}