Commit db94d888 authored by Laurent Montel's avatar Laurent Montel
Browse files

Adapt to new api

parent db1392c5
Pipeline #263574 passed with stage
in 16 minutes and 43 seconds
......@@ -31,7 +31,7 @@ set(KMIME_LIB_VERSION "5.21.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.21.40")
set(LIBKDEPIM_LIB_VERSION "5.21.40")
set(LIBKLEO_LIB_VERSION "5.21.40")
set(PIMCOMMON_LIB_VERSION "5.21.44")
set(PIMCOMMON_LIB_VERSION "5.21.71")
set(GPGME_LIB_VERSION "1.16.0")
set(AKONADI_SEARCH_VERSION "5.21.40")
......
......@@ -51,9 +51,9 @@ void RichTextComposerNgTest::shouldForceAutoCorrection()
richtextComposerNg.setPlainText(original);
PimCommon::AutoCorrection autocorrection;
PimCommon::AutoCorrectionSettings settings;
settings.setEnabledAutoCorrection(true);
settings.setUppercaseFirstCharOfSentence(true);
auto settings = new PimCommon::AutoCorrectionSettings;
settings->setEnabledAutoCorrection(true);
settings->setUppercaseFirstCharOfSentence(true);
autocorrection.setAutoCorrectionSettings(settings);
richtextComposerNg.setAutocorrection(&autocorrection);
richtextComposerNg.forceAutoCorrection(false);
......@@ -90,10 +90,10 @@ void RichTextComposerNgTest::shouldForceAutoCorrectionWithSelection()
cur.setPosition(selectionEnd, QTextCursor::KeepAnchor);
richtextComposerNg.setTextCursor(cur);
PimCommon::AutoCorrection autocorrection;
PimCommon::AutoCorrectionSettings settings;
settings.setEnabledAutoCorrection(true);
settings.setUppercaseFirstCharOfSentence(true);
settings.setFixTwoUppercaseChars(true);
auto settings = new PimCommon::AutoCorrectionSettings;
settings->setEnabledAutoCorrection(true);
settings->setUppercaseFirstCharOfSentence(true);
settings->setFixTwoUppercaseChars(true);
autocorrection.setAutoCorrectionSettings(settings);
richtextComposerNg.setAutocorrection(&autocorrection);
richtextComposerNg.forceAutoCorrection(true);
......
......@@ -65,8 +65,8 @@ void RichTextComposerNg::setAutocorrection(PimCommon::AutoCorrection *autocorrec
void RichTextComposerNg::setAutocorrectionLanguage(const QString &lang)
{
if (d->autoCorrection) {
PimCommon::AutoCorrectionSettings settings = d->autoCorrection->autoCorrectionSettings();
settings.setLanguage(lang);
PimCommon::AutoCorrectionSettings *settings = d->autoCorrection->autoCorrectionSettings();
settings->setLanguage(lang);
d->autoCorrection->setAutoCorrectionSettings(settings);
}
}
......@@ -79,7 +79,7 @@ static bool isSpecial(const QTextCharFormat &charFormat)
bool RichTextComposerNg::processModifyText(QKeyEvent *e)
{
if (d->autoCorrection && d->autoCorrection->autoCorrectionSettings().isEnabledAutoCorrection()) {
if (d->autoCorrection && d->autoCorrection->autoCorrectionSettings()->isEnabledAutoCorrection()) {
if ((e->key() == Qt::Key_Space) || (e->key() == Qt::Key_Enter) || (e->key() == Qt::Key_Return)) {
if (!isLineQuoted(textCursor().block().text()) && !textCursor().hasSelection()) {
const QTextCharFormat initialTextFormat = textCursor().charFormat();
......@@ -393,7 +393,7 @@ void RichTextComposerNg::forceAutoCorrection(bool selectedText)
if (document()->isEmpty()) {
return;
}
if (d->autoCorrection && d->autoCorrection->autoCorrectionSettings().isEnabledAutoCorrection()) {
if (d->autoCorrection && d->autoCorrection->autoCorrectionSettings()->isEnabledAutoCorrection()) {
const bool richText = (textMode() == RichTextComposer::Rich);
const int initialPosition = textCursor().position();
QTextCursor cur = textCursor();
......
Supports Markdown
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