Hello community,

here is the log from the commit of package pimcommon for openSUSE:Factory 
checked in at 2016-09-14 23:05:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pimcommon (Old)
 and      /work/SRC/openSUSE:Factory/.pimcommon.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pimcommon"

Changes:
--------
--- /work/SRC/openSUSE:Factory/pimcommon/pimcommon.changes      2016-08-29 
15:22:03.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.pimcommon.new/pimcommon.changes 2016-09-14 
23:05:32.000000000 +0200
@@ -1,0 +2,8 @@
+Fri Sep  9 08:10:05 UTC 2016 - [email protected]
+
+- Update to KDE Applications 16.08.1
+   * KDE Applications 16.08.1
+   * https://www.kde.org/announcements/announce-applications-16.08.1.php
+
+
+-------------------------------------------------------------------

Old:
----
  pimcommon-16.08.0.tar.xz

New:
----
  pimcommon-16.08.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pimcommon.spec ++++++
--- /var/tmp/diff_new_pack.GHDqTN/_old  2016-09-14 23:05:33.000000000 +0200
+++ /var/tmp/diff_new_pack.GHDqTN/_new  2016-09-14 23:05:33.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           pimcommon
-Version:        16.08.0
+Version:        16.08.1
 Release:        0
 Summary:        Base package of KDE PIM PimCommon library
 License:        GPL-2.0 and LGPL-2.1+
@@ -56,7 +56,7 @@
 BuildRequires:  kwidgetsaddons-devel
 BuildRequires:  kwindowsystem-devel
 BuildRequires:  kxmlgui-devel
-BuildRequires:  libkdepim-devel
+BuildRequires:  libkdepim-devel >= %{version}
 BuildRequires:  libxslt-devel
 BuildRequires:  cmake(Qt5Designer)
 BuildRequires:  pkgconfig(Qt5DBus) >= 5.6.0

++++++ pimcommon-16.08.0.tar.xz -> pimcommon-16.08.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pimcommon-16.08.0/CMakeLists.txt 
new/pimcommon-16.08.1/CMakeLists.txt
--- old/pimcommon-16.08.0/CMakeLists.txt        2016-08-11 22:49:27.000000000 
+0200
+++ new/pimcommon-16.08.1/CMakeLists.txt        2016-08-26 08:24:36.000000000 
+0200
@@ -21,18 +21,18 @@
 include(ECMAddTests)
 include(ECMInstallIcons)
 
-set(PIM_VERSION "5.3.0")
+set(PIM_VERSION "5.3.1")
 
 set(PIMCOMMON_LIB_VERSION ${PIM_VERSION})
-set(AKONADIMIME_LIB_VERSION "5.3.0")
-set(AKONADICONTACT_LIB_VERSION "5.3.0")
-set(LIBKDEPIM_LIB_VERSION "5.3.0")
+set(AKONADIMIME_LIB_VERSION "5.3.1")
+set(AKONADICONTACT_LIB_VERSION "5.3.1")
+set(LIBKDEPIM_LIB_VERSION "5.3.1")
 set(QT_REQUIRED_VERSION "5.6.0")
-set(KMIME_LIB_VERSION "5.3.0")
-set(KIMAP_LIB_VERSION "5.3.0")
-set(KCONTACTS_LIB_VERSION "5.3.0")
-set(KPIMTEXTEDIT_LIB_VERSION "5.3.0")
-set(AKONADI_VERSION "5.3.0")
+set(KMIME_LIB_VERSION "5.3.1")
+set(KIMAP_LIB_VERSION "5.3.1")
+set(KCONTACTS_LIB_VERSION "5.3.1")
+set(KPIMTEXTEDIT_LIB_VERSION "5.3.1")
+set(AKONADI_VERSION "5.3.1")
 
 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Network 
Test WebEngineWidgets Xml)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pimcommon-16.08.0/src/acl/aclmodifyjob.cpp 
new/pimcommon-16.08.1/src/acl/aclmodifyjob.cpp
--- old/pimcommon-16.08.0/src/acl/aclmodifyjob.cpp      2016-08-11 
22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/acl/aclmodifyjob.cpp      2016-08-26 
08:24:36.000000000 +0200
@@ -81,7 +81,7 @@
         }
     }
     OrgKdeAkonadiImapSettingsInterface *imapSettingsInterface =
-            PimCommon::Util::createImapSettingsInterface(resource);
+        PimCommon::Util::createImapSettingsInterface(resource);
 
     QString loginName;
     QString serverName;
@@ -176,10 +176,10 @@
         }
     }
     folderNames.sort();
-    if ( KMessageBox::Continue != KMessageBox::warningContinueCancelList(0,
-                                                                         i18n( 
"Do you really want to apply this folders permissions on the subdirectories:" ),
-                                                                         
folderNames,
-                                                                         i18n( 
"Apply Permissions" ) ) ) {
+    if (KMessageBox::Continue != KMessageBox::warningContinueCancelList(0,
+            i18n("Do you really want to apply this folders permissions on the 
subdirectories:"),
+            folderNames,
+            i18n("Apply Permissions"))) {
         deleteLater();
         qCDebug(PIMCOMMON_LOG) << "AclModifyJob: User canceled .";
         return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pimcommon-16.08.0/src/autocorrection/autocorrection.cpp 
new/pimcommon-16.08.1/src/autocorrection/autocorrection.cpp
--- old/pimcommon-16.08.0/src/autocorrection/autocorrection.cpp 2016-08-11 
22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/autocorrection/autocorrection.cpp 2016-08-26 
08:24:36.000000000 +0200
@@ -47,6 +47,7 @@
       mMaxFindStringLenght(0),
       mMinFindStringLenght(0)
 {
+    mNonBreakingSpace = QChar(QChar::Nbsp);
     // default double quote open 0x201c
     // default double quote close 0x201d
     // default single quote open 0x2018
@@ -80,9 +81,7 @@
     //TODO if not => check if pos -1 is a space => not a piece of word
     //TODO otherwise move cursor until we detect a space
     //TODO otherwise we must not autoconvert it.
-    if (pos == block.position()) {
-        //it's ok
-    } else {
+    if (pos != block.position()) {
         const QString text = block.text();
         const int currentPos = (pos - block.position());
         if (!text.at(currentPos - 1).isSpace()) {
@@ -179,7 +178,9 @@
             fixTwoUppercaseChars();
             capitalizeWeekDays();
             replaceTypographicQuotes();
-            addNonBreakingSpace();
+            if (mWord.length() <= 2) {
+                addNonBreakingSpace();
+            }
         }
 
         if (mCursor.selectedText() != mWord) {
@@ -188,7 +189,7 @@
         position = oldPosition;
 
         if (!done) {
-            selectStringOnMaximumSearchString(mCursor, oldPosition);
+            selectStringOnMaximumSearchString(mCursor, position);
             mWord = mCursor.selectedText();
             if (!mWord.isEmpty()) {
                 const int newPos = advancedAutocorrect();
@@ -417,8 +418,11 @@
                 QString::ConstIterator constIter = number.constBegin();
                 bool found = true;
                 // don't apply superscript to 1th, 2th and 3th
-                if (number.length() == 1 &&
-                        (*constIter == QLatin1Char('1') || *constIter == 
QLatin1Char('2') || *constIter == QLatin1Char('3'))) {
+                const int numberLength(number.length());
+                if (numberLength == 1 &&
+                        (*constIter == QLatin1Char('1') ||
+                         *constIter == QLatin1Char('2') ||
+                         *constIter == QLatin1Char('3'))) {
                     found = false;
                 }
                 if (found) {
@@ -430,7 +434,7 @@
                         ++constIter;
                     }
                 }
-                if (found && number.length() + i.value().length() == 
trimmedLenght) {
+                if (found && numberLength + i.value().length() == 
trimmedLenght) {
                     startPos = mCursor.selectionStart() + pos;
                     endPos = startPos - pos + trimmedLenght;
                     break;
@@ -454,7 +458,42 @@
 void AutoCorrection::addNonBreakingSpace()
 {
     if (mAddNonBreakingSpace && isFrenchLanguage()) {
-        if (mWord.length() == 1) {
+        const QTextBlock block = mCursor.block();
+        const QString text = block.text();
+        const QChar lastChar = text.at(mCursor.position() - 1 - 
block.position());
+
+        if (lastChar == QLatin1Char(':') ||
+                lastChar == QLatin1Char(';') ||
+                lastChar == QLatin1Char('!') ||
+                lastChar == QLatin1Char('?') ||
+                lastChar == QLatin1Char('%')) {
+            const int pos = mCursor.position() - 2 - block.position();
+            if (pos >= 0) {
+                const QChar previousChar = text.at(pos);
+                if (previousChar.isSpace()) {
+                    QTextCursor cursor(mCursor);
+                    cursor.setPosition(pos);
+                    cursor.setPosition(pos + 1, QTextCursor::KeepAnchor);
+                    cursor.deleteChar();
+                    mCursor.insertText(mNonBreakingSpace);
+                }
+            }
+        } else {
+            //°C (degres)
+            const QChar previousChar = text.at(mCursor.position() - 2 - 
block.position());
+            if (lastChar == QLatin1Char('C') && previousChar == 
QChar(0x000B0)) {
+                const int pos = mCursor.position() - 3 - block.position();
+                if (pos >= 0) {
+                    const QChar previousChar = text.at(pos);
+                    if (previousChar.isSpace()) {
+                        QTextCursor cursor(mCursor);
+                        cursor.setPosition(pos);
+                        cursor.setPosition(pos + 1, QTextCursor::KeepAnchor);
+                        cursor.deleteChar();
+                        mCursor.insertText(mNonBreakingSpace);
+                    }
+                }
+            }
         }
     }
 }
@@ -716,6 +755,11 @@
     return false;
 }
 
+void AutoCorrection::setNonBreakingSpace(const QChar &nonBreakingSpace)
+{
+    mNonBreakingSpace = nonBreakingSpace;
+}
+
 void AutoCorrection::uppercaseFirstCharOfSentence()
 {
     if (!mUppercaseFirstCharOfSentence) {
@@ -815,16 +859,13 @@
         return -1;
     }
 
-    const int startPos = mCursor.selectionStart();
-    const int length = mWord.length();
-
     const QString trimmedWord = mWord.trimmed();
-    QString actualWord = trimmedWord;
-
-    if (actualWord.isEmpty()) {
+    if (trimmedWord.isEmpty()) {
         return -1;
     }
 
+    QString actualWord = trimmedWord;
+
     const int actualWordLength(actualWord.length());
     if (actualWordLength < mMinFindStringLenght) {
         return -1;
@@ -833,6 +874,8 @@
         return -1;
     }
 
+    const int startPos = mCursor.selectionStart();
+    const int length = mWord.length();
     // If the last char is punctuation, drop it for now
     bool hasPunctuation = false;
     const QChar lastChar = actualWord.at(actualWord.length() - 1);
@@ -918,7 +961,6 @@
     //     b. and the previous quote of a different kind (so that we get empty 
quotations right)
 
     bool ending = true;
-    const QChar nbsp = QChar(QChar::Nbsp);
     for (int i = mWord.length(); i > 1; --i) {
         const QChar c = mWord.at(i - 1);
         if (c == QLatin1Char('"') || c == QLatin1Char('\'')) {
@@ -955,31 +997,31 @@
             }
 
             if (doubleQuotes && mReplaceDoubleQuotes) {
-                if (!ending) {
+                if (ending) {
                     if (addNonBreakingSpace) {
-                        mWord.replace(i - 1, 2, QString(nbsp + 
mTypographicDoubleQuotes.begin));
+                        mWord.replace(i - 1, 2, QString(mNonBreakingSpace + 
mTypographicDoubleQuotes.end));
                     } else {
-                        mWord[i - 1] = mTypographicDoubleQuotes.begin;
+                        mWord[i - 1] = mTypographicDoubleQuotes.end;
                     }
                 } else {
                     if (addNonBreakingSpace) {
-                        mWord.replace(i - 1, 2, QString(nbsp + 
mTypographicDoubleQuotes.end));
+                        mWord.replace(i - 1, 2, QString(mNonBreakingSpace + 
mTypographicDoubleQuotes.begin));
                     } else {
-                        mWord[i - 1] = mTypographicDoubleQuotes.end;
+                        mWord[i - 1] = mTypographicDoubleQuotes.begin;
                     }
                 }
             } else if (mReplaceSingleQuotes) {
-                if (!ending) {
+                if (ending) {
                     if (addNonBreakingSpace) {
-                        mWord.replace(i - 1, 2, QString(nbsp + 
mTypographicSingleQuotes.begin));
+                        mWord.replace(i - 1, 2, QString(mNonBreakingSpace + 
mTypographicSingleQuotes.end));
                     } else {
-                        mWord[i - 1] = mTypographicSingleQuotes.begin;
+                        mWord[i - 1] = mTypographicSingleQuotes.end;
                     }
                 } else {
                     if (addNonBreakingSpace) {
-                        mWord.replace(i - 1, 2, QString(nbsp + 
mTypographicSingleQuotes.end));
+                        mWord.replace(i - 1, 2, QString(mNonBreakingSpace + 
mTypographicSingleQuotes.begin));
                     } else {
-                        mWord[i - 1] = mTypographicSingleQuotes.end;
+                        mWord[i - 1] = mTypographicSingleQuotes.begin;
                     }
                 }
             }
@@ -988,16 +1030,14 @@
 
     // first character
     if (mWord.at(0) == QLatin1Char('"') && mReplaceDoubleQuotes) {
+        mWord[0] = mTypographicDoubleQuotes.begin;
         if (addNonBreakingSpace) {
-            mWord.replace(0, 2, QString(mTypographicDoubleQuotes.begin + 
nbsp));
-        } else {
-            mWord[0] = mTypographicDoubleQuotes.begin;
+            mWord.insert(1, mNonBreakingSpace);
         }
     } else if (mWord.at(0) == QLatin1Char('\'') && mReplaceSingleQuotes) {
+        mWord[0] = mTypographicSingleQuotes.begin;
         if (addNonBreakingSpace) {
-            mWord.replace(0, 2, QString(mTypographicSingleQuotes.begin + 
nbsp));
-        } else {
-            mWord[0] = mTypographicSingleQuotes.begin;
+            mWord.insert(1, mNonBreakingSpace);
         }
     }
 }
@@ -1005,8 +1045,9 @@
 void AutoCorrection::readAutoCorrectionXmlFile(bool forceGlobal)
 {
     auto kdelang = QLocale::system().uiLanguages().at(0);
-    if (kdelang == QLatin1String("C"))
+    if (kdelang == QLatin1String("C")) {
         kdelang = QStringLiteral("en_US");
+    }
     kdelang.remove(QRegularExpression(QStringLiteral("@.*")));
 
     mUpperCaseExceptions.clear();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pimcommon-16.08.0/src/autocorrection/autocorrection.h 
new/pimcommon-16.08.1/src/autocorrection/autocorrection.h
--- old/pimcommon-16.08.0/src/autocorrection/autocorrection.h   2016-08-11 
22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/autocorrection/autocorrection.h   2016-08-26 
08:24:36.000000000 +0200
@@ -88,6 +88,8 @@
 
     void writeAutoCorrectionXmlFile(const QString &filename = QString());
 
+    void setNonBreakingSpace(const QChar &nonBreakingSpace);
+
 private:
     bool isFrenchLanguage() const;
     void readConfig();
@@ -132,6 +134,7 @@
     int mMinFindStringLenght;
     QString mWord;
     QTextCursor mCursor;
+    QChar mNonBreakingSpace;
 
     QString mAutoCorrectLang;
     QStringList mCacheNameOfDays;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pimcommon-16.08.0/src/autocorrection/autocorrectionlanguage.cpp 
new/pimcommon-16.08.1/src/autocorrection/autocorrectionlanguage.cpp
--- old/pimcommon-16.08.0/src/autocorrection/autocorrectionlanguage.cpp 
2016-08-11 22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/autocorrection/autocorrectionlanguage.cpp 
2016-08-26 08:24:36.000000000 +0200
@@ -25,13 +25,18 @@
     for (int i = QLocale::Abkhazian; i <= QLocale::LastLanguage; ++i) {
         const auto lang = static_cast<QLocale::Language>(i);
         QLocale locale(lang);
-        if (locale.name() == QLatin1String("C"))
+        if (locale.name() == QLatin1String("C")) {
             continue;
+        }
         addItem(QLocale::system().languageToString(lang), locale.name());
     }
-    auto defaultLang = QLocale::system().uiLanguages().at(0);
-    if (defaultLang == QLatin1String("C"))
-        defaultLang = QStringLiteral("en_US");
+    QString defaultLang;
+    if (!QLocale::system().uiLanguages().isEmpty()) {
+        defaultLang = QLocale::system().uiLanguages().at(0);
+        if (defaultLang == QLatin1String("C")) {
+            defaultLang = QStringLiteral("en_US");
+        }
+    }
     const int index = findData(defaultLang);
     setCurrentIndex(index);
     model()->sort(0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pimcommon-16.08.0/src/autocorrection/autotests/autocorrectiontest.cpp 
new/pimcommon-16.08.1/src/autocorrection/autotests/autocorrectiontest.cpp
--- old/pimcommon-16.08.0/src/autocorrection/autotests/autocorrectiontest.cpp   
2016-08-11 22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/autocorrection/autotests/autocorrectiontest.cpp   
2016-08-26 08:24:36.000000000 +0200
@@ -420,6 +420,7 @@
     QCOMPARE(doc.toPlainText(), result);
 
 }
+
 typedef QHash<QString, QString> mapAutoCorrect;
 Q_DECLARE_METATYPE(mapAutoCorrect)
 
@@ -449,12 +450,10 @@
     map.insert(QStringLiteral("a boo"), QStringLiteral("b bla"));
     QTest::newRow("multiword-2 with uppercase") << QStringLiteral("toto. A 
boo") << QStringLiteral("toto. B bla") << map;
 
-
     map.clear();
     map.insert(QStringLiteral("a boo1111111111"), QStringLiteral("b bla"));
     QTest::newRow("multiword-3") << QStringLiteral("a boo") << 
QStringLiteral("a boo") << map;
 
-
     map.clear();
     map.insert(QStringLiteral("boo"), QStringLiteral("Bla"));
     QTest::newRow("withuppercase") << QStringLiteral("Boo") << 
QStringLiteral("Bla") << map;
@@ -471,7 +470,6 @@
     map.insert(QStringLiteral("boo"), QStringLiteral("Bla"));
     QTest::newRow("withuppercase-4") << QStringLiteral("boo") << 
QStringLiteral("bla") << map;
 
-
     map.clear();
     map.insert(QStringLiteral("booooo"), QStringLiteral("bla"));
     QTest::newRow("nofindtext") << QStringLiteral("boo") << 
QStringLiteral("boo") << map;
@@ -490,7 +488,6 @@
     map.insert(QStringLiteral("boo"), QStringLiteral("bla"));
     QTest::newRow("dontreplaceinpieceofword") << QStringLiteral("voitureboo") 
<< QStringLiteral("voitureboo") << map;
 
-
     map.clear();
     map.insert(QStringLiteral("boo"), QStringLiteral("bla"));
     
map.insert(QStringLiteral("booOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo"),
 QStringLiteral("bla"));
@@ -515,13 +512,160 @@
     QCOMPARE(doc.toPlainText(), convertedString);
 }
 
+void AutoCorrectionTest::shouldAddNonBreakingSpace_data()
+{
+    QTest::addColumn<QString>("originalString");
+    QTest::addColumn<QString>("convertedString");
+    QTest::addColumn<QString>("language");
+    QTest::addColumn<bool>("enableAddNonBreakingSpace");
+    QTest::newRow("convert1") << QStringLiteral("boo !") << 
QStringLiteral("boob!") << QStringLiteral("fr") << true;
+    QTest::newRow("disable") << QStringLiteral("boo !") << QStringLiteral("boo 
!") << QStringLiteral("fr") << false;
+    QTest::newRow("nonchanges") << QStringLiteral("boo") << 
QStringLiteral("boo") << QStringLiteral("fr") << true;
+    QTest::newRow("convert2") << QStringLiteral("boo ;") << 
QStringLiteral("boob;") << QStringLiteral("fr") << true;
+    QTest::newRow("convert3") << QStringLiteral("boo ?") << 
QStringLiteral("boob?") << QStringLiteral("fr") << true;
+    QTest::newRow("convert4") << QStringLiteral("boo :") << 
QStringLiteral("boob:") << QStringLiteral("fr") << true;
+    QTest::newRow("nonfrenchlanguage") << QStringLiteral("boo :") << 
QStringLiteral("boo :") << QStringLiteral("ge") << true;
+    QTest::newRow("onecharacter") << QStringLiteral(":") << 
QStringLiteral(":") << QStringLiteral("fr") << true;
+    QTest::newRow("onecharacter2") << QStringLiteral(" ") << QStringLiteral(" 
") << QStringLiteral("fr") << true;
+    QTest::newRow("percentage") << QStringLiteral("50 %") << 
QStringLiteral("50b%") << QStringLiteral("fr") << true;
+    QTest::newRow("degres") << QStringLiteral("50 °C") << 
QStringLiteral("50b°C") << QStringLiteral("fr") << true;
+    QTest::newRow("simplespace") << QStringLiteral(" ") << QStringLiteral(" ") 
<< QStringLiteral("fr") << true;
+}
+
 void AutoCorrectionTest::shouldAddNonBreakingSpace()
 {
+    QFETCH(QString, originalString);
+    QFETCH(QString, convertedString);
+    QFETCH(QString, language);
+    QFETCH(bool, enableAddNonBreakingSpace);
+
     PimCommon::AutoCorrection autocorrection;
     autocorrection.setEnabledAutoCorrection(true);
+    autocorrection.setAddNonBreakingSpace(enableAddNonBreakingSpace);
+    autocorrection.setLanguage(language);
+    autocorrection.setNonBreakingSpace(QChar(QLatin1Char('b')));
+
+    QTextDocument doc;
+    doc.setPlainText(originalString);
+    int position = originalString.length();
+    autocorrection.autocorrect(false, doc, position);
+    QCOMPARE(doc.toPlainText(), convertedString);
+}
+
+void AutoCorrectionTest::shouldReplaceWithMultiOption_data()
+{
+    QTest::addColumn<QString>("originalString");
+    QTest::addColumn<QString>("convertedString");
+    QTest::addColumn<mapAutoCorrect>("convertStringHash");
+
+    QTest::addColumn<bool>("enable");
+    QTest::addColumn<bool>("uppercaseFirstCharOfSentence");
+    QTest::addColumn<bool>("advancedAutocorrect");
+    QTest::addColumn<bool>("fixtoouppercase");
+    mapAutoCorrect map;
+    map.insert(QStringLiteral("boo"), QStringLiteral("bla"));
+
+    QTest::newRow("disable") << QStringLiteral("Boo boo boo") << 
QStringLiteral("Boo boo boo") << map << false << false << false << false;
+    QTest::newRow("enablebutdisablealloptions") << QStringLiteral("Boo boo 
boo") << QStringLiteral("Boo boo boo") << map << true << false << false << 
false;
+    QTest::newRow("enableandenableuppercase") << QStringLiteral("Boo boo boo") 
<< QStringLiteral("Boo boo boo") << map << true << true << false << false;
+    QTest::newRow("enableandenableuppercaseandadvanced") << 
QStringLiteral("Boo boo boo") << QStringLiteral("Boo boo bla") << map << true 
<< true << true << false;
+
+    QTest::newRow("enableandenableuppercaseandadvanced-2") << 
QStringLiteral("Boo boo. boo") << QStringLiteral("Boo boo. Bla") << map << true 
<< true << true << false;
+    QTest::newRow("enableandenableuppercaseandadvanced-3") << 
QStringLiteral("blablobli") << QStringLiteral("Blablobli") << map << true << 
true << true << false;
+    QTest::newRow("enableandenableuppercaseandadvanced-4") << 
QStringLiteral("blablobli. foo") << QStringLiteral("blablobli. Foo") << map << 
true << true << true << false;
+
+    QTest::newRow("enableandenablefixtouppercase") << QStringLiteral("Boo boo. 
BOo") << QStringLiteral("Boo boo. Boo") << map << true << true << false << true;
+    QTest::newRow("enableandenablefixtouppercase-2") << QStringLiteral("Boo 
BOo") << QStringLiteral("Boo Boo") << map << true << true << false << true;
+    //TODO add more
+}
+
+void AutoCorrectionTest::shouldReplaceWithMultiOption()
+{
+    QFETCH(QString, originalString);
+    QFETCH(QString, convertedString);
+    QFETCH(mapAutoCorrect, convertStringHash);
+    QFETCH(bool, enable);
+    QFETCH(bool, uppercaseFirstCharOfSentence);
+    QFETCH(bool, advancedAutocorrect);
+    QFETCH(bool, fixtoouppercase);
+
+    PimCommon::AutoCorrection autocorrection;
+    autocorrection.setEnabledAutoCorrection(enable);
+    autocorrection.setAdvancedAutocorrect(advancedAutocorrect);
+    autocorrection.setAutocorrectEntries(convertStringHash);
+    
autocorrection.setUppercaseFirstCharOfSentence(uppercaseFirstCharOfSentence);
+    autocorrection.setFixTwoUppercaseChars(fixtoouppercase);
+
+    QTextDocument doc;
+    doc.setPlainText(originalString);
+    int position = originalString.length();
+    autocorrection.autocorrect(false, doc, position);
+    QCOMPARE(doc.toPlainText(), convertedString);
+}
+
+void AutoCorrectionTest::shouldAddNonBreakingSpaceBeforeAfterQuote()
+{
+    PimCommon::AutoCorrection autocorrection;
+    autocorrection.setEnabledAutoCorrection(true);
+    autocorrection.setReplaceDoubleQuotes(true);
+    autocorrection.setReplaceSingleQuotes(true);
     autocorrection.setLanguage(QStringLiteral("fr"));
     autocorrection.setAddNonBreakingSpace(true);
-    //TODO
+    //TODO fix me verify why it doesn't use no breaking space
+    const QChar nbsp = QChar(/*QChar::Nbsp*/QLatin1Char('b'));
+    autocorrection.setNonBreakingSpace(nbsp);
+
+    PimCommon::AutoCorrection::TypographicQuotes doubleQuote;
+    doubleQuote.begin = QLatin1Char('A');
+    doubleQuote.end = QLatin1Char('B');
+    autocorrection.setTypographicDoubleQuotes(doubleQuote);
+
+    PimCommon::AutoCorrection::TypographicQuotes simpleQuote;
+    simpleQuote.begin = QLatin1Char('A');
+    simpleQuote.end = QLatin1Char('B');
+
+    autocorrection.setTypographicSingleQuotes(simpleQuote);
+
+    QTextDocument doc;
+    QString text = QStringLiteral("sss");
+
+    doc.setPlainText(QLatin1Char('"') + text);
+    int position = text.length();
+    autocorrection.autocorrect(false, doc, position);
+
+    QCOMPARE(doc.toPlainText(), QString(doubleQuote.begin + nbsp + text));
+
+    text = QStringLiteral("sss");
+    doc.setPlainText(text + QStringLiteral("\""));
+    position = text.length();
+    autocorrection.autocorrect(false, doc, position);
+    QCOMPARE(doc.toPlainText(), QString(text + nbsp + doubleQuote.end));
+
+    //Simple quote
+    text = QStringLiteral("sss");
+    doc.setPlainText(text + QStringLiteral("\'"));
+    position = text.length();
+    autocorrection.autocorrect(false, doc, position);
+    QCOMPARE(doc.toPlainText(), QString(text + nbsp + simpleQuote.end));
+
+    text = QStringLiteral("sss");
+    doc.setPlainText(QStringLiteral("\"") + text + QStringLiteral("\""));
+    position = text.length();
+    autocorrection.autocorrect(false, doc, position);
+    QCOMPARE(doc.toPlainText(), QString(doubleQuote.begin + nbsp + text + nbsp 
+ doubleQuote.end));
+
+    //Simple quote
+    text = QStringLiteral("sss");
+    doc.setPlainText(QStringLiteral("\'") + text + QStringLiteral("\'"));
+    position = text.length();
+    autocorrection.autocorrect(false, doc, position);
+    QCOMPARE(doc.toPlainText(), QString(simpleQuote.begin + nbsp + text + nbsp 
+ simpleQuote.end));
+
+    text = QStringLiteral("(");
+    doc.setPlainText(QStringLiteral("\"") + text + QStringLiteral("\""));
+    position = text.length();
+    autocorrection.autocorrect(false, doc, position);
+    QCOMPARE(doc.toPlainText(), QString(doubleQuote.begin + nbsp + text + nbsp 
+ doubleQuote.end));
 }
 
 QTEST_MAIN(AutoCorrectionTest)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pimcommon-16.08.0/src/autocorrection/autotests/autocorrectiontest.h 
new/pimcommon-16.08.1/src/autocorrection/autotests/autocorrectiontest.h
--- old/pimcommon-16.08.0/src/autocorrection/autotests/autocorrectiontest.h     
2016-08-11 22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/autocorrection/autotests/autocorrectiontest.h     
2016-08-26 08:24:36.000000000 +0200
@@ -44,8 +44,14 @@
     void shouldAutocorrectMultiWord_data();
     void shouldAutocorrectMultiWord();
 
+    void shouldAddNonBreakingSpace_data();
     void shouldAddNonBreakingSpace();
 
+    void shouldReplaceWithMultiOption_data();
+    void shouldReplaceWithMultiOption();
+
+    void shouldAddNonBreakingSpaceBeforeAfterQuote();
+
 private:
     KSharedConfig::Ptr mConfig;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pimcommon-16.08.0/src/storageservice/authdialog/logindialog.cpp 
new/pimcommon-16.08.1/src/storageservice/authdialog/logindialog.cpp
--- old/pimcommon-16.08.0/src/storageservice/authdialog/logindialog.cpp 
2016-08-11 22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/storageservice/authdialog/logindialog.cpp 
2016-08-26 08:24:36.000000000 +0200
@@ -32,15 +32,13 @@
     : QDialog(parent)
 {
     setWindowTitle(i18n("Authorize"));
-    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | 
QDialogButtonBox::Cancel);
-    QVBoxLayout *mainLayout = new QVBoxLayout;
-    setLayout(mainLayout);
+    QVBoxLayout *mainLayout = new QVBoxLayout(this);
+    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | 
QDialogButtonBox::Cancel, this);
     mOkButton = buttonBox->button(QDialogButtonBox::Ok);
     mOkButton->setDefault(true);
     mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
     connect(buttonBox, &QDialogButtonBox::accepted, this, 
&LoginDialog::accept);
     connect(buttonBox, &QDialogButtonBox::rejected, this, 
&LoginDialog::reject);
-    mOkButton->setDefault(true);
 
     QWidget *w = new QWidget;
     mainLayout->addWidget(w);
@@ -49,16 +47,16 @@
     QGridLayout *grid = new QGridLayout;
     w->setLayout(grid);
 
-    mLabUsername = new QLabel(i18n("Username:"));
+    mLabUsername = new QLabel(i18n("Username:"), this);
     grid->addWidget(mLabUsername, 0, 0);
 
-    mUsername = new QLineEdit;
+    mUsername = new QLineEdit(this);
     mUsername->setClearButtonEnabled(true);
     grid->addWidget(mUsername, 0, 1);
 
-    QLabel *lab = new QLabel(i18n("Password:"));
+    QLabel *lab = new QLabel(i18n("Password:"), this);
     grid->addWidget(lab, 1, 0);
-    mPassword = new QLineEdit;
+    mPassword = new QLineEdit(this);
     grid->addWidget(mPassword, 1, 1);
     mPassword->setEchoMode(QLineEdit::Password);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pimcommon-16.08.0/src/storageservice/box/boxjob.cpp 
new/pimcommon-16.08.1/src/storageservice/box/boxjob.cpp
--- old/pimcommon-16.08.0/src/storageservice/box/boxjob.cpp     2016-08-11 
22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/storageservice/box/boxjob.cpp     2016-08-26 
08:24:36.000000000 +0200
@@ -527,7 +527,7 @@
     bool ok;
 
     const QMap<QString, QVariant> info = parser.parse(data.toUtf8(), 
&ok).toMap();
-    qCDebug(PIMCOMMON_LOG)<<" info"<<info;
+    qCDebug(PIMCOMMON_LOG) << " info" << info;
 #else
     Q_UNUSED(data);
 #endif
@@ -541,7 +541,7 @@
     bool ok;
 
     const QMap<QString, QVariant> info = parser.parse(data.toUtf8(), 
&ok).toMap();
-    qCDebug(PIMCOMMON_LOG)<<" info"<<info;
+    qCDebug(PIMCOMMON_LOG) << " info" << info;
 #else
     Q_UNUSED(data);
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pimcommon-16.08.0/src/storageservice/hubic/hubicjob.cpp 
new/pimcommon-16.08.1/src/storageservice/hubic/hubicjob.cpp
--- old/pimcommon-16.08.0/src/storageservice/hubic/hubicjob.cpp 2016-08-11 
22:49:27.000000000 +0200
+++ new/pimcommon-16.08.1/src/storageservice/hubic/hubicjob.cpp 2016-08-26 
08:24:36.000000000 +0200
@@ -459,7 +459,7 @@
     bool ok;
 
     const QMap<QString, QVariant> info = parser.parse(data.toUtf8(), 
&ok).toMap();
-    qCDebug(PIMCOMMON_LOG)<<" info"<<info;
+    qCDebug(PIMCOMMON_LOG) << " info" << info;
 #else
     Q_UNUSED(data);
 #endif
@@ -473,7 +473,7 @@
     bool ok;
 
     const QMap<QString, QVariant> info = parser.parse(data.toUtf8(), 
&ok).toMap();
-    qCDebug(PIMCOMMON_LOG)<<" info"<<info;
+    qCDebug(PIMCOMMON_LOG) << " info" << info;
 #else
     Q_UNUSED(data);
 #endif


Reply via email to