Commit 4b5dbd01 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QLineEdit where it"s possible

parent 4801efec
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.14.41")
set(PIM_VERSION "5.14.42")
project(mailcommon VERSION ${PIM_VERSION})
......@@ -34,7 +34,7 @@ set(MESSAGELIB_LIB_VERSION "5.14.42")
set(KMIME_LIB_VERSION "5.14.40")
set(KMAILTRANSPORT_LIB_VERSION "5.14.40")
set(MAILIMPORTER_LIB_VERSION "5.14.40")
set(LIBKDEPIM_LIB_VERSION "5.14.40")
set(LIBKDEPIM_LIB_VERSION "5.14.41")
set(PIMCOMMON_LIB_VERSION "5.14.40")
set(PHONON_LIB_VERSION "4.10.60")
......
......@@ -31,10 +31,11 @@
#include "folderselectiondialog.h"
#include "util/mailutil.h"
#include "kernel/mailkernel.h"
#include <Libkdepim/LineEditCatchReturnKey>
#include <CollectionFetchJob>
#include <KLineEdit>
#include <QPointer>
#include <QLineEdit>
#include <KLocalizedString>
#include <QIcon>
......@@ -51,7 +52,7 @@ public:
}
Akonadi::Collection mCollection;
KLineEdit *mEdit = nullptr;
QLineEdit *mEdit = nullptr;
bool mMustBeReadWrite = false;
bool mShowOutbox = false;
bool mNotCreateNewFolder = false;
......@@ -64,9 +65,9 @@ FolderRequester::FolderRequester(QWidget *parent)
QHBoxLayout *hlay = new QHBoxLayout(this);
hlay->setContentsMargins(0, 0, 0, 0);
d->mEdit = new KLineEdit(this);
d->mEdit = new QLineEdit(this);
d->mEdit->setPlaceholderText(i18n("Select Folder"));
d->mEdit->setTrapReturnKey(true);
new KPIM::LineEditCatchReturnKey(d->mEdit, this);
d->mEdit->setReadOnly(true);
hlay->addWidget(d->mEdit);
......
......@@ -33,7 +33,6 @@
#include <Collection>
#include <KLineEdit>
#include <QWidget>
......@@ -43,7 +42,7 @@ class KJob;
namespace MailCommon {
/**
* A widget that contains a KLineEdit which shows the current folder
* A widget that contains a QLineEdit which shows the current folder
* and a button that fires a FolderSelectionDialog
* The dialog is set to disable readonly folders by default
* Search folders are excluded
......
......@@ -22,9 +22,10 @@
using MailCommon::RuleWidgetHandlerManager;
#include "mailcommon_debug.h"
#include <Libkdepim/LineEditCatchReturnKey>
#include <KLocalizedString>
#include <QPushButton>
#include <KLineEdit>
#include <QLineEdit>
#include <QIcon>
#include <KComboBox>
#include <QButtonGroup>
......@@ -154,7 +155,8 @@ void SearchRuleWidget::initWidget(SearchPatternEdit::SearchModeType modeType)
mRuleField->setMinimumWidth(50);
mRuleField->setObjectName(QStringLiteral("mRuleField"));
mRuleField->setEditable(true);
KLineEdit *edit = new KLineEdit;
QLineEdit *edit = new QLineEdit;
new KPIM::LineEditCatchReturnKey(edit, this);
edit->setPlaceholderText(i18n("Choose or type your own criteria"));
mRuleField->setToolTip(i18n("Choose or type your own criteria"));
edit->setClearButtonEnabled(true);
......
......@@ -31,7 +31,7 @@
#include <QVBoxLayout>
using namespace MailCommon;
class SnippetWidgetPrivate
class Q_DECL_HIDDEN SnippetWidgetPrivate
{
public:
Ui::SnippetWidget mUi;
......
......@@ -21,7 +21,7 @@
#include "mailcommon_debug.h"
#include <KLocalizedString>
#include <KLineEdit>
#include <QLineEdit>
#include <KMessageBox>
#include <KJob>
......@@ -58,7 +58,7 @@ AddTagDialog::AddTagDialog(const QList<KActionCollection *> &actions, QWidget *p
d->mTagWidget = new MailCommon::TagWidget(actions, this);
mainLayout->addWidget(d->mTagWidget);
connect(d->mTagWidget->tagNameLineEdit(), &KLineEdit::textChanged, this, &AddTagDialog::slotTagNameChanged);
connect(d->mTagWidget->tagNameLineEdit(), &QLineEdit::textChanged, this, &AddTagDialog::slotTagNameChanged);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
d->mOkButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -18,6 +18,8 @@
#include "tagwidget.h"
#include <Libkdepim/LineEditCatchReturnKey>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QLabel>
......@@ -26,7 +28,7 @@
#include <KIconButton>
#include <KKeySequenceWidget>
#include <KActionCollection>
#include <KLineEdit>
#include <QLineEdit>
#include <KLocalizedString>
#include <QIcon>
using namespace MailCommon;
......@@ -34,21 +36,10 @@ class MailCommon::TagWidgetPrivate
{
public:
TagWidgetPrivate()
: mTagNameLineEdit(nullptr)
, mTextColorCheck(nullptr)
, mBackgroundColorCheck(nullptr)
, mTextFontCheck(nullptr)
, mInToolbarCheck(nullptr)
, mTextColorCombo(nullptr)
, mBackgroundColorCombo(nullptr)
, mBoldCheckBox(nullptr)
, mItalicCheckBox(nullptr)
, mIconButton(nullptr)
, mKeySequenceWidget(nullptr)
{
}
KLineEdit *mTagNameLineEdit = nullptr;
QLineEdit *mTagNameLineEdit = nullptr;
QCheckBox *mTextColorCheck = nullptr;
QCheckBox *mBackgroundColorCheck = nullptr;
......@@ -78,9 +69,9 @@ TagWidget::TagWidget(const QList<KActionCollection *> &actionCollections, QWidge
settings->addLayout(spacer, 0, 0, 1, 2);
//First row for renaming
d->mTagNameLineEdit = new KLineEdit(this);
d->mTagNameLineEdit = new QLineEdit(this);
d->mTagNameLineEdit->setClearButtonEnabled(true);
d->mTagNameLineEdit->setTrapReturnKey(true);
new KPIM::LineEditCatchReturnKey(d->mTagNameLineEdit, this);
settings->addWidget(d->mTagNameLineEdit, 1, 1);
QLabel *namelabel = new QLabel(i18nc("@label:listbox Name of the tag", "Name:"),
......@@ -88,7 +79,7 @@ TagWidget::TagWidget(const QList<KActionCollection *> &actionCollections, QWidge
namelabel->setBuddy(d->mTagNameLineEdit);
settings->addWidget(namelabel, 1, 0);
connect(d->mTagNameLineEdit, &KLineEdit::textChanged, this, &TagWidget::slotEmitChangeCheck);
connect(d->mTagNameLineEdit, &QLineEdit::textChanged, this, &TagWidget::slotEmitChangeCheck);
//Second row for text color
d->mTextColorCheck = new QCheckBox(i18n("Change te&xt color:"),
......@@ -250,7 +241,7 @@ void TagWidget::recordTagSettings(MailCommon::Tag::Ptr tag)
tag->inToolbar = d->mInToolbarCheck->isChecked();
}
KLineEdit *TagWidget::tagNameLineEdit() const
QLineEdit *TagWidget::tagNameLineEdit() const
{
return d->mTagNameLineEdit;
}
......
......@@ -25,7 +25,7 @@
#include <QWidget>
class KLineEdit;
class QLineEdit;
class KColorCombo;
class KIconButton;
class KKeySequenceWidget;
......@@ -43,7 +43,7 @@ public:
void recordTagSettings(MailCommon::Tag::Ptr tag);
Q_REQUIRED_RESULT KLineEdit *tagNameLineEdit() const;
Q_REQUIRED_RESULT QLineEdit *tagNameLineEdit() const;
Q_REQUIRED_RESULT QCheckBox *textColorCheck() const;
Q_REQUIRED_RESULT QCheckBox *textFontCheck() const;
Q_REQUIRED_RESULT QCheckBox *backgroundColorCheck() const;
......
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