diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp index 8e54e1d7255..191ffc82c29 100644 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -95,14 +95,14 @@ GTestFramework::GTestFramework() // avoid problems if user messes around with the settings file bool ok = false; const int tmp = savedValue.toInt(&ok); - return ok ? groupMode.indexForItemValue(tmp) : GTest::Constants::Directory; + return groupMode.indexForItemValue(ok ? tmp : GTest::Constants::Directory); }); groupMode.setToSettingsTransformation([this](const QVariant &value) { return groupMode.itemValueForIndex(value.toInt()); }); groupMode.addOption({Tr::tr("Directory"), {}, GTest::Constants::Directory}); groupMode.addOption({Tr::tr("GTest Filter"), {}, GTest::Constants::GTestFilter}); - groupMode.setDefaultValue(GTest::Constants::Directory); + groupMode.setDefaultValue(groupMode.indexForItemValue(GTest::Constants::Directory)); groupMode.setLabelText(Tr::tr("Group mode:")); groupMode.setToolTip(Tr::tr("Select on what grouping the tests should be based.")); @@ -144,6 +144,12 @@ ITestTreeItem *GTestFramework::createRootNode() return new GTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); } +void GTestFramework::readSettings() +{ + Utils::AspectContainer::readSettings(); + gtestFilter.setEnabled(groupMode.itemValue() == GTest::Constants::GTestFilter); +} + QString GTestFramework::currentGTestFilter() { return theGTestFramework().gtestFilter(); diff --git a/src/plugins/autotest/gtest/gtestframework.h b/src/plugins/autotest/gtest/gtestframework.h index ff9e2766b58..80052980b1d 100644 --- a/src/plugins/autotest/gtest/gtestframework.h +++ b/src/plugins/autotest/gtest/gtestframework.h @@ -32,6 +32,8 @@ public: QString groupingToolTip() const override; ITestParser *createTestParser() override; ITestTreeItem *createRootNode() override; + + void readSettings() final; }; GTestFramework &theGTestFramework();