summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mainwindow.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index baffed7..8a2e2cb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -368,19 +368,6 @@ void MainWindow::setCurrentQtRepo(const QString &repoName)
setCurrentProfile(currentProfile->name());
else
setCurrentProfile("");
-
- QString var = currentProfile->variant();
- if(var.isEmpty())
- currentProfile->setVariant(ui->qtvariants->currentText());
- else {
- int idx = ui->qtvariants->findText(var);
- if(idx >= 0)
- ui->qtvariants->setCurrentIndex(idx);
- else {
- ui->qtvariants->addItem(var);
- ui->qtvariants->setCurrentIndex(ui->qtvariants->count() -1);
- }
- }
}
/**************************************************************************************************
@@ -403,7 +390,7 @@ void MainWindow::setCurrentProfile(const QString &profileName)
}
testviews.clear();
- if (currentProfile && QString::compare(currentProfile->name(), QString("")) == 0) {
+ if (currentProfile && currentProfile->name().isEmpty()) {
ui->profiles->setItemText(0, "<New Profile>");
delete currentProfile;
currentProfile = 0;
@@ -416,6 +403,19 @@ void MainWindow::setCurrentProfile(const QString &profileName)
currentProfile = profile;
}
+ QString var = currentProfile->variant();
+ if (var.isEmpty()) {
+ currentProfile->setVariant(ui->qtvariants->currentText());
+ } else {
+ int idx = ui->qtvariants->findText(var);
+ if (idx >= 0) {
+ ui->qtvariants->setCurrentIndex(idx);
+ } else {
+ ui->qtvariants->addItem(var);
+ ui->qtvariants->setCurrentIndex(ui->qtvariants->count() - 1);
+ }
+ }
+
QStandardItem *rootItem = currentAutoTestModel->invisibleRootItem()->child(0);
// clear old selection
@@ -604,7 +604,7 @@ void MainWindow::on_profiles_currentIndexChanged(int index)
delete tview;
}
testviews.clear();
- if (currentProfile && QString::compare(currentProfile->name(), QString("")) == 0) {
+ if (currentProfile && currentProfile->name().isEmpty()) {
delete currentProfile;
}
currentProfile = 0;