Le dimanche 16 septembre 2012 13:01:38 Albert Astals Cid a écrit : > El Diumenge, 16 de setembre de 2012, a les 09:58:23, laurent Montel va > escriure: > > Le dimanche 16 septembre 2012 09:25:45 Cyrille Berger Skott a écrit : > > > On Saturday 15 Sep 2012, Albert Astals Cid wrote: > > > > I can move all the files to the correct location (and fix their > > > > CMakeLists.txt) if that is what is decided. > > > > > > > > Cheers, > > > > > > > > Albert > > > > > > > > P.S: Before promoting autocorrect much I suggest you have a look at the > > > > (probably fake) site of http://www.damnyouautocorrect.com/ > > > > > > To be honnest, they either have a very broken autocorrect system on thoses > > > phones, or a lot of dyslexic people are blamming their phones, for > > > autocorrect to go from swimming to sem**, there is something very very > > > wrong. It is also true that when using a phone in T9 mode can lead to > > > such words mistakes, but that is also something that does not affect > > > autocorrect. > > > > > > In fact, autocorrect (and it usually is) should be limited to very obvious > > > spelling mistakes ie, "conection" -> "connection", and so on. That is also > > > why I don't see why there would be a different dataset for kmail or > > > calligra. > > Exact. > > We must have the same dataset. > > Otherwise users will not understand why we have 2 datasets. > > Sure, I never said anything against that ;-) > > As said, once you've done the code change in > kdelibs/kdepim/calligra/koffice/wathever just tell me and i'll adapt all the > l10n-kde4 languages in trunk (I understand we are not touching stable, right?)
Sorry was in training last Week (so not time to create this patch). Now I think that you can move all in kdelibs/data/autocorrect And install them in ${DATA_INSTALL_DIR}/autocorrect Thanks a lot. Regards > Cheers, > Albert -- Laurent Montel | laurent.mon...@kdab.com | KDE/Qt Senior Software Engineer KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-independent software solutions
diff --git a/plugins/textediting/autocorrection/Autocorrect.cpp b/plugins/textediting/autocorrection/Autocorrect.cpp index cef9beb..53fdee6 100644 --- a/plugins/textediting/autocorrection/Autocorrect.cpp +++ b/plugins/textediting/autocorrection/Autocorrect.cpp @@ -684,18 +684,26 @@ void Autocorrect::readAutocorrectXmlEntry() QString kdelang = locale->languageList().first(); kdelang.remove(QRegExp("@.*")); + QStringList folders; + folders<<QLatin1String("/")<<QLatin1String("calligra/"); QString fname; - if (!m_autocorrectLang.isEmpty()) - fname = KGlobal::dirs()->findResource("data", "calligra/autocorrect/" + m_autocorrectLang + ".xml"); - if (m_autocorrectLang != "all_languages") { - if (fname.isEmpty() && !kdelang.isEmpty()) - fname = KGlobal::dirs()->findResource("data", "calligra/autocorrect/" + kdelang + ".xml"); - if (fname.isEmpty() && kdelang.contains("_")) { - kdelang.remove( QRegExp( "_.*" ) ); - fname = KGlobal::dirs()->findResource("data", "calligra/autocorrect/" + kdelang + ".xml"); + Q_FOREACH(const QString& path, folders) + { + if (!m_autocorrectLang.isEmpty()) + fname = KGlobal::dirs()->findResource("data", path + "autocorrect/" + m_autocorrectLang + ".xml"); + if (m_autocorrectLang != "all_languages") { + if (fname.isEmpty() && !kdelang.isEmpty()) + fname = KGlobal::dirs()->findResource("data", path + "autocorrect/" + kdelang + ".xml"); + if (fname.isEmpty() && kdelang.contains("_")) { + kdelang.remove( QRegExp( "_.*" ) ); + fname = KGlobal::dirs()->findResource("data", path + "autocorrect/" + kdelang + ".xml"); + } + if (fname.isEmpty()) + fname = KGlobal::dirs()->findResource("data", path + "autocorrect/autocorrect.xml"); + } + if(!fname.isEmpty()) { + break; } - if (fname.isEmpty()) - fname = KGlobal::dirs()->findResource("data", "calligra/autocorrect/autocorrect.xml"); } if (m_autocorrectLang.isEmpty()) m_autocorrectLang = kdelang; @@ -795,7 +803,7 @@ void Autocorrect::readAutocorrectXmlEntry() void Autocorrect::writeAutocorrectXmlEntry() { - const QString fname = KGlobal::dirs()->locateLocal("data", QLatin1String("calligra/autocorrect/autocorrect.xml")); + const QString fname = KGlobal::dirs()->locateLocal("data", QLatin1String("autocorrect/autocorrect.xml")); QFile file(fname); if( !file.open( QIODevice::WriteOnly | QIODevice::Text ) ) { qDebug()<<"We can't save in file :"<<fname;
_______________________________________________ calligra-devel mailing list calligra-devel@kde.org https://mail.kde.org/mailman/listinfo/calligra-devel