| 17 | } |
| 18 | |
| 19 | CMakeExtraArgumentsHistory::CMakeExtraArgumentsHistory(KComboBox* widget) |
| 20 | : m_arguments(widget) |
| 21 | { |
| 22 | if (m_arguments) { |
| 23 | KConfigGroup config = KSharedConfig::openConfig()->group(QStringLiteral("CMakeBuildDirChooser")); |
| 24 | QStringList lastExtraArguments = config.readEntry("LastExtraArguments", QStringList()); |
| 25 | m_arguments->addItem(QString()); |
| 26 | m_arguments->addItems(lastExtraArguments); |
| 27 | m_arguments->setInsertPolicy(QComboBox::InsertAtTop); |
| 28 | KCompletion *comp = m_arguments->completionObject(); |
| 29 | QObject::connect(m_arguments, QOverload<const QString&>::of(&KComboBox::returnPressed), |
| 30 | comp, QOverload<const QString&>::of(&KCompletion::addItem)); |
| 31 | comp->insertItems(lastExtraArguments); |
| 32 | } else { |
| 33 | qFatal("CMakeExtraArgumentsHistory initialised with invalid widget"); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | CMakeExtraArgumentsHistory::~CMakeExtraArgumentsHistory() |
| 38 | { |
nothing calls this directly
no test coverage detected