Commit dbdf452b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove dependancy against KF5::Completion

parent eb1982fe
......@@ -28,7 +28,7 @@ include(ECMInstallIcons)
set(PIMCOMMON_LIB_VERSION ${PIM_VERSION})
set(AKONADICONTACT_LIB_VERSION "5.14.40")
set(LIBKDEPIM_LIB_VERSION "5.14.40")
set(LIBKDEPIM_LIB_VERSION "5.14.41")
set(QT_REQUIRED_VERSION "5.12.0")
set(KMIME_LIB_VERSION "5.14.40")
set(KIMAP_LIB_VERSION "5.14.40")
......@@ -39,7 +39,6 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Network Tes
find_package(KF5Archive ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
......
......@@ -174,7 +174,6 @@ target_link_libraries(KF5PimCommon
KF5::PimTextEdit
KF5::XmlGui
KF5::PimTextEdit
KF5::Completion
KF5::KIOWidgets
Qt5::PrintSupport
KF5::Purpose
......
......@@ -27,6 +27,7 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include "settings/pimcommonsettings.h"
#include <KPIMTextEdit/SelectSpecialCharDialog>
#include <Libkdepim/LineEditCatchReturnKey>
#include <KMessageBox>
#include <KLocalizedString>
......@@ -34,6 +35,7 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include <QTreeWidgetItem>
#include <QMenu>
#include <QFileDialog>
#include <QPointer>
using namespace PimCommon;
......@@ -73,6 +75,10 @@ AutoCorrectionWidget::AutoCorrectionWidget(QWidget *parent)
d->ui->add1->setEnabled(false);
d->ui->add2->setEnabled(false);
KPIM::LineEditCatchReturnKey(d->ui->find, this);
KPIM::LineEditCatchReturnKey(d->ui->replace, this);
KPIM::LineEditCatchReturnKey(d->ui->abbreviation, this);
KPIM::LineEditCatchReturnKey(d->ui->twoUpperLetter, this);
connect(d->ui->autoChangeFormat, &QCheckBox::clicked, this, &AutoCorrectionWidget::emitChanged);
connect(d->ui->autoFormatUrl, &QCheckBox::clicked, this, &AutoCorrectionWidget::emitChanged);
connect(d->ui->upperCase, &QCheckBox::clicked, this, &AutoCorrectionWidget::emitChanged);
......@@ -97,10 +103,10 @@ AutoCorrectionWidget::AutoCorrectionWidget(QWidget *parent)
connect(d->ui->treeWidget, &PimCommon::AutoCorrectionTreeWidget::itemClicked, this, &AutoCorrectionWidget::setFindReplaceText);
connect(d->ui->treeWidget, &PimCommon::AutoCorrectionTreeWidget::deleteSelectedItems, this, &AutoCorrectionWidget::removeAutocorrectEntry);
connect(d->ui->treeWidget, &PimCommon::AutoCorrectionTreeWidget::itemSelectionChanged, this, &AutoCorrectionWidget::updateAddRemoveButton);
connect(d->ui->find, &KLineEdit::textChanged, this, &AutoCorrectionWidget::enableAddRemoveButton);
connect(d->ui->replace, &KLineEdit::textChanged, this, &AutoCorrectionWidget::enableAddRemoveButton);
connect(d->ui->abbreviation, &KLineEdit::textChanged, this, &AutoCorrectionWidget::abbreviationChanged);
connect(d->ui->twoUpperLetter, &KLineEdit::textChanged, this, &AutoCorrectionWidget::twoUpperLetterChanged);
connect(d->ui->find, &QLineEdit::textChanged, this, &AutoCorrectionWidget::enableAddRemoveButton);
connect(d->ui->replace, &QLineEdit::textChanged, this, &AutoCorrectionWidget::enableAddRemoveButton);
connect(d->ui->abbreviation, &QLineEdit::textChanged, this, &AutoCorrectionWidget::abbreviationChanged);
connect(d->ui->twoUpperLetter, &QLineEdit::textChanged, this, &AutoCorrectionWidget::twoUpperLetterChanged);
connect(d->ui->add1, &QPushButton::clicked, this, &AutoCorrectionWidget::addAbbreviationEntry);
connect(d->ui->remove1, &QPushButton::clicked, this, &AutoCorrectionWidget::removeAbbreviationEntry);
connect(d->ui->add2, &QPushButton::clicked, this, &AutoCorrectionWidget::addTwoUpperLetterEntry);
......@@ -113,8 +119,8 @@ AutoCorrectionWidget::AutoCorrectionWidget(QWidget *parent)
connect(d->ui->twoUpperLetterList, &PimCommon::AutoCorrectionListWidget::deleteSelectedItems, this, &AutoCorrectionWidget::removeTwoUpperLetterEntry);
connect(d->ui->autocorrectionLanguage, QOverload<int>::of(&PimCommon::AutoCorrectionLanguage::activated), this, &AutoCorrectionWidget::changeLanguage);
connect(d->ui->addNonBreakingSpaceInFrench, &QCheckBox::clicked, this, &AutoCorrectionWidget::emitChanged);
connect(d->ui->twoUpperLetter, &KLineEdit::returnPressed, this, &AutoCorrectionWidget::addTwoUpperLetterEntry);
connect(d->ui->abbreviation, &KLineEdit::returnPressed, this, &AutoCorrectionWidget::addAbbreviationEntry);
connect(d->ui->twoUpperLetter, &QLineEdit::returnPressed, this, &AutoCorrectionWidget::addTwoUpperLetterEntry);
connect(d->ui->abbreviation, &QLineEdit::returnPressed, this, &AutoCorrectionWidget::addAbbreviationEntry);
slotEnableDisableAbreviationList();
slotEnableDisableTwoUpperEntry();
......
......@@ -335,10 +335,7 @@
</widget>
</item>
<item>
<widget class="KLineEdit" name="find">
<property name="trapEnterKeyEvent" stdset="0">
<bool>true</bool>
</property>
<widget class="QLineEdit" name="find">
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
......@@ -355,10 +352,7 @@
</widget>
</item>
<item>
<widget class="KLineEdit" name="replace">
<property name="trapEnterKeyEvent" stdset="0">
<bool>true</bool>
</property>
<widget class="QLineEdit" name="replace">
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
......@@ -412,10 +406,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="KLineEdit" name="abbreviation">
<property name="trapEnterKeyEvent" stdset="0">
<bool>true</bool>
</property>
<widget class="QLineEdit" name="abbreviation">
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
......@@ -480,10 +471,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="KLineEdit" name="twoUpperLetter">
<property name="trapEnterKeyEvent" stdset="0">
<bool>true</bool>
</property>
<widget class="QLineEdit" name="twoUpperLetter">
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
......@@ -576,11 +564,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>PimCommon::AutoCorrectionListWidget</class>
<extends>QListWidget</extends>
......
......@@ -19,9 +19,10 @@
#include "templateeditdialog.h"
#include <KPIMTextEdit/PlainTextEditorWidget>
#include <KPIMTextEdit/PlainTextEditor>
#include <Libkdepim/LineEditCatchReturnKey>
#include <KLocalizedString>
#include <KLineEdit>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QHBoxLayout>
......@@ -35,7 +36,6 @@ using namespace PimCommon;
TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
: QDialog(parent)
, mOkButton(nullptr)
{
setWindowTitle(defaultTemplate ? i18n("Default template") : i18n("Template"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
......@@ -63,8 +63,8 @@ TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
QLabel *label = new QLabel(i18n("Name:"));
hbox->addWidget(label);
mTemplateNameEdit = new KLineEdit;
mTemplateNameEdit->setTrapReturnKey(true);
mTemplateNameEdit = new QLineEdit;
new KPIM::LineEditCatchReturnKey(mTemplateNameEdit, this);
mTemplateNameEdit->setClearButtonEnabled(!defaultTemplate);
mTemplateNameEdit->setReadOnly(defaultTemplate);
hbox->addWidget(mTemplateNameEdit);
......
......@@ -21,7 +21,7 @@
#include <QDialog>
class KLineEdit;
class QLineEdit;
namespace KPIMTextEdit {
class PlainTextEditorWidget;
}
......@@ -44,7 +44,7 @@ private:
void readConfig();
void writeConfig();
KPIMTextEdit::PlainTextEditorWidget *mTextEdit = nullptr;
KLineEdit *mTemplateNameEdit = nullptr;
QLineEdit *mTemplateNameEdit = nullptr;
QPushButton *mOkButton = nullptr;
};
}
......
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