Commit 9c8b641f authored by Laurent Montel's avatar Laurent Montel 😁

Use directly QComboBox

parent c423c589
......@@ -18,7 +18,7 @@
#include "identityaddvcarddialogtest.h"
#include "../identity/identityaddvcarddialog.h"
#include <KComboBox>
#include <QComboBox>
#include <KUrlRequester>
#include <QButtonGroup>
......@@ -31,7 +31,7 @@ identityaddvcarddialogtest::identityaddvcarddialogtest()
void identityaddvcarddialogtest::shouldHaveDefaultValue()
{
IdentityAddVcardDialog dlg(QStringList(), nullptr);
KComboBox *identityComboBox = dlg.findChild<KComboBox *>(QStringLiteral("identity_combobox"));
QComboBox *identityComboBox = dlg.findChild<QComboBox *>(QStringLiteral("identity_combobox"));
QVERIFY(identityComboBox);
QCOMPARE(identityComboBox->isEnabled(), false);
......@@ -55,7 +55,7 @@ void identityaddvcarddialogtest::shouldEnabledUrlRequesterWhenSelectFromExisting
buttonGroup->button(IdentityAddVcardDialog::FromExistingVCard)->toggle();
QCOMPARE(dlg.duplicateMode(), IdentityAddVcardDialog::FromExistingVCard);
KComboBox *identityComboBox = dlg.findChild<KComboBox *>(QStringLiteral("identity_combobox"));
QComboBox *identityComboBox = dlg.findChild<QComboBox *>(QStringLiteral("identity_combobox"));
QCOMPARE(identityComboBox->isEnabled(), false);
KUrlRequester *urlRequester = dlg.findChild<KUrlRequester *>(QStringLiteral("kurlrequester_vcardpath"));
......@@ -69,7 +69,7 @@ void identityaddvcarddialogtest::shouldEnabledComboboxWhenSelectDuplicateVCard()
buttonGroup->button(IdentityAddVcardDialog::ExistingEntry)->toggle();
QCOMPARE(dlg.duplicateMode(), IdentityAddVcardDialog::ExistingEntry);
KComboBox *identityComboBox = dlg.findChild<KComboBox *>(QStringLiteral("identity_combobox"));
QComboBox *identityComboBox = dlg.findChild<QComboBox *>(QStringLiteral("identity_combobox"));
QCOMPARE(identityComboBox->isEnabled(), true);
KUrlRequester *urlRequester = dlg.findChild<KUrlRequester *>(QStringLiteral("kurlrequester_vcardpath"));
......@@ -83,7 +83,7 @@ void identityaddvcarddialogtest::shouldEnabledComboboxWhenSelectFromExistingVCar
buttonGroup->button(IdentityAddVcardDialog::FromExistingVCard)->toggle();
QCOMPARE(dlg.duplicateMode(), IdentityAddVcardDialog::FromExistingVCard);
KComboBox *identityComboBox = dlg.findChild<KComboBox *>(QStringLiteral("identity_combobox"));
QComboBox *identityComboBox = dlg.findChild<QComboBox *>(QStringLiteral("identity_combobox"));
KUrlRequester *urlRequester = dlg.findChild<KUrlRequester *>(QStringLiteral("kurlrequester_vcardpath"));
......
......@@ -17,7 +17,7 @@
#include "identityaddvcarddialog.h"
#include <KComboBox>
#include <QComboBox>
#include <KLocalizedString>
#include <KSeparator>
#include <KUrlRequester>
......@@ -91,7 +91,7 @@ IdentityAddVcardDialog::IdentityAddVcardDialog(const QStringList &shadowIdentiti
// row 5: combobox with existing identities and label
hlay = new QHBoxLayout(); // inherits spacing
vlay->addLayout(hlay);
mComboBox = new KComboBox(this);
mComboBox = new QComboBox(this);
mComboBox->setObjectName(QStringLiteral("identity_combobox"));
mComboBox->setEditable(false);
......@@ -109,7 +109,7 @@ IdentityAddVcardDialog::IdentityAddVcardDialog(const QStringList &shadowIdentiti
// enable/disable combobox and label depending on the third radio
// button's state:
connect(duplicateExistingVCard, &QRadioButton::toggled, label, &QLabel::setEnabled);
connect(duplicateExistingVCard, &QRadioButton::toggled, mComboBox, &KComboBox::setEnabled);
connect(duplicateExistingVCard, &QRadioButton::toggled, mComboBox, &QComboBox::setEnabled);
resize(350, 130);
}
......
......@@ -20,7 +20,7 @@
#include <QDialog>
#include <QUrl>
class QButtonGroup;
class KComboBox;
class QComboBox;
class KUrlRequester;
class IdentityAddVcardDialog : public QDialog
......@@ -42,7 +42,7 @@ public:
private:
QButtonGroup *mButtonGroup;
KComboBox *mComboBox;
QComboBox *mComboBox;
KUrlRequester *mVCardPath;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment