Commit f9c996a6 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from deprecated QString enums

parent ecbd37f8
......@@ -253,7 +253,7 @@ QStringList CatalogItem::msgstrAsList() const
qCWarning(LOKALIZE_LOG) << "This should never happen!";
return QStringList();
}
QStringList list(d._msgstrPlural.first().split('\n', QString::SkipEmptyParts));
QStringList list(d._msgstrPlural.first().split('\n', Qt::SkipEmptyParts));
if (d._msgstrPlural.first() == QLatin1String("\n"))
list.prepend(QString());
......
......@@ -194,7 +194,7 @@ void GettextExportPlugin::writeKeyword(QTextStream& stream, const QString& keywo
#if 0
if (m_wrapWidth == -1) {
// Traditional KBabel wrapping
QStringList list = text.split('\n', QString::SkipEmptyParts);
QStringList list = text.split('\n', Qt::SkipEmptyParts);
if (text.startsWith('\n'))
list.prepend(QString());
......@@ -236,7 +236,7 @@ void GettextExportPlugin::writeKeyword(QTextStream& stream, const QString& keywo
}
// lazy wrapping
QStringList list = text.split('\n', QString::SkipEmptyParts);
QStringList list = text.split('\n', Qt::SkipEmptyParts);
if (text.startsWith('\n'))
list.prepend(QString());
......
......@@ -401,8 +401,8 @@ QStringList GettextStorage::matchData(const DocPosition& pos) const
//Splits @info:whatsthis and actual note
/* if (ctxt.startsWith('@') && ctxt.contains(' '))
{
QStringList result(ctxt.section(' ',0,0,QString::SectionSkipEmpty));
result<<ctxt.section(' ',1,-1,QString::SectionSkipEmpty);
QStringList result(ctxt.section(' ',0,0,Qt::SectionSkipEmpty));
result<<ctxt.section(' ',1,-1,Qt::SectionSkipEmpty);
return result;
}*/
return QStringList(ctxt);
......
......@@ -260,8 +260,8 @@ void updateHeader(QString& header,
{
askAuthorInfoIfEmpty();
QStringList headerList(header.split('\n', QString::SkipEmptyParts));
QStringList commentList(comment.split('\n', QString::SkipEmptyParts));
QStringList headerList(header.split('\n', Qt::SkipEmptyParts));
QStringList commentList(comment.split('\n', Qt::SkipEmptyParts));
//BEGIN header itself
QStringList::Iterator it, ait;
......
......@@ -363,7 +363,7 @@ static void prepareLists(QString str, QStringList& main, QStringList& space, con
markup += '|';
QRegExp rxSplit('(' + markup + QLatin1String("\\W+|\\d+)+"));
main = str.split(rxSplit, QString::SkipEmptyParts);
main = str.split(rxSplit, Qt::SkipEmptyParts);
main.prepend("\t");//little hack
......@@ -394,8 +394,8 @@ QString userVisibleWordDiff(const QString& str1ForMatching,
//QRegExp rxSpace("[^(\\W+|\\d+)]");
//i tried that but it failed:
//QRegExp rxSpace("[^("+Project::instance()->markup()+"|\\W+|\\d+)]");
//QStringList s1Space(str1ForMatching.split(rxSpace,QString::SkipEmptyParts));
//QStringList s2Space(str2ForMatching.split(rxSpace,QString::SkipEmptyParts));
//QStringList s1Space(str1ForMatching.split(rxSpace,Qt::SkipEmptyParts));
//QStringList s2Space(str2ForMatching.split(rxSpace,Qt::SkipEmptyParts));
QStringList result(calcLCS(s1, s2, s1Space, s2Space));
......
......@@ -66,7 +66,7 @@ void CompletionStorage::scanCatalog(Catalog* catalog)
QString string = catalog->targetWithTags(pos).string;
string.remove(accel);
const QStringList& words = string.toLower().split(rxSplit, QString::SkipEmptyParts);
const QStringList& words = string.toLower().split(rxSplit, Qt::SkipEmptyParts);
foreach (const QString& word, words) {
if (word.length() < wordCompletionLength)
continue;
......
......@@ -1433,12 +1433,12 @@ void EditorTab::displayWordCount()
do {
QString msg = m_catalog->source(pos);
msg.remove(rxClean);
QStringList words = msg.split(rxSplit, QString::SkipEmptyParts);
QStringList words = msg.split(rxSplit, Qt::SkipEmptyParts);
sourceCount += words.size();
msg = m_catalog->target(pos);
msg.remove(rxClean);
words = msg.split(rxSplit, QString::SkipEmptyParts);
words = msg.split(rxSplit, Qt::SkipEmptyParts);
targetCount += words.size();
} while (switchNext(m_catalog, pos));
......
......@@ -573,7 +573,7 @@ void Glossary::hashTermEntry(const QDomElement& termEntry)
QString sourceLangCode = Project::instance()->sourceLangCode();
foreach (const QString& termText, terms(entryId, sourceLangCode)) {
foreach (const QString& word, termText.split(' ', QString::SkipEmptyParts))
foreach (const QString& word, termText.split(' ', Qt::SkipEmptyParts))
idsByLangWord[sourceLangCode].insert(stem(sourceLangCode, word), entryId);
}
}
......@@ -585,7 +585,7 @@ void Glossary::unhashTermEntry(const QDomElement& termEntry)
QString sourceLangCode = Project::instance()->sourceLangCode();
foreach (const QString& termText, terms(entryId, sourceLangCode)) {
foreach (const QString& word, termText.split(' ', QString::SkipEmptyParts))
foreach (const QString& word, termText.split(' ', Qt::SkipEmptyParts))
idsByLangWord[sourceLangCode].remove(stem(sourceLangCode, word), entryId);
}
}
......@@ -595,7 +595,7 @@ void Glossary::hashTermEntry(int index)
{
Q_ASSERT(index < termList.size());
foreach (const QString& term, termList_.at(index).english) {
foreach (const QString& word, term.split(' ', QString::SkipEmptyParts))
foreach (const QString& word, term.split(' ', Qt::SkipEmptyParts))
wordHash_.insert(stem(Project::instance()->sourceLangCode(), word), index);
}
}
......@@ -604,7 +604,7 @@ void Glossary::unhashTermEntry(int index)
{
Q_ASSERT(index < termList.size());
foreach (const QString& term, termList_.at(index).english) {
foreach (const QString& word, term.split(' ', QString::SkipEmptyParts))
foreach (const QString& word, term.split(' ', Qt::SkipEmptyParts))
wordHash_.remove(stem(Project::instance()->sourceLangCode(), word), index);
}
}
......
......@@ -147,7 +147,7 @@ void GlossaryView::slotNewEntryDisplayed(DocPosition pos)
QString sourceLangCode = Project::instance()->sourceLangCode();
QList<QByteArray> termIds;
foreach (const QString& w, msg.split(m_rxSplit, QString::SkipEmptyParts)) {
foreach (const QString& w, msg.split(m_rxSplit, Qt::SkipEmptyParts)) {
QString word = stem(sourceLangCode, w);
QList<QByteArray> indexes = glossary.idsForLangWord(sourceLangCode, word);
//if (indexes.size())
......@@ -173,7 +173,7 @@ void GlossaryView::slotNewEntryDisplayed(DocPosition pos)
bool ok = msg.contains(enTerm); //,//Qt::CaseInsensitive //we lowered terms on load
if (!ok) {
QString enTermStemmed;
foreach (const QString& word, enTerm.split(m_rxSplit, QString::SkipEmptyParts))
foreach (const QString& word, enTerm.split(m_rxSplit, Qt::SkipEmptyParts))
enTermStemmed += stem(sourceLangCode, word) + ' ';
ok = msgStemmed.contains(enTermStemmed);
}
......
......@@ -219,7 +219,7 @@ void MsgCtxtView::pologyReceivedStandardOutput()
m_pologyStartedReceivingOutput = true;
}
const QString grossPologyOutput = m_pologyProcess->readAllStandardOutput();
const QStringList pologyTmpLines = grossPologyOutput.split('\n', QString::SkipEmptyParts);
const QStringList pologyTmpLines = grossPologyOutput.split('\n', Qt::SkipEmptyParts);
foreach (const QString pologyTmp, pologyTmpLines) {
if (pologyTmp.startsWith(QStringLiteral("[note]")))
m_pologyData += pologyTmp;
......@@ -243,7 +243,7 @@ void MsgCtxtView::pologyHasFinished()
if (!m_pologyStartedReceivingOutput) {
m_pologyStartedReceivingOutput = true;
const QString grossPologyOutput = m_pologyProcess->readAllStandardOutput();
const QStringList pologyTmpLines = grossPologyOutput.split('\n', QString::SkipEmptyParts);
const QStringList pologyTmpLines = grossPologyOutput.split('\n', Qt::SkipEmptyParts);
if (pologyTmpLines.count() == 0) {
m_pologyData += i18nc("@info The pology command didn't return anything", "(empty)");
} else {
......
......@@ -98,7 +98,7 @@ static void doSplit(QString& cleanEn,
cleanEn.replace(rxClean1, QStringLiteral(" "));
cleanEn.remove(accel);
words = cleanEn.toLower().split(rxSplit, QString::SkipEmptyParts);
words = cleanEn.toLower().split(rxSplit, Qt::SkipEmptyParts);
if (words.size() > 4) {
int i = 0;
for (; i < words.size(); ++i) {
......@@ -1221,7 +1221,7 @@ bool SelectJob::doSelect(QSqlDatabase& db,
QString sourceClean(m_source.string);
sourceClean.remove(c.accel);
//split m_english for use in wordDiff later--all words are needed so we cant use list we already have
QStringList englishList(sourceClean.toLower().split(rxSplit, QString::SkipEmptyParts));
QStringList englishList(sourceClean.toLower().split(rxSplit, Qt::SkipEmptyParts));
static QRegExp delPart(QStringLiteral("<KBABELDEL>*</KBABELDEL>"), Qt::CaseSensitive, QRegExp::Wildcard);
static QRegExp addPart(QStringLiteral("<KBABELADD>*</KBABELADD>"), Qt::CaseSensitive, QRegExp::Wildcard);
delPart.setMinimal(true);
......@@ -1266,7 +1266,7 @@ bool SelectJob::doSelect(QSqlDatabase& db,
qCWarning(LOKALIZE_LOG) << "problem:" << queryFetch.value(3).toByteArray().size() << queryFetch.value(3).toByteArray();
}
//e.target=queryFetch.value(2).toString();
//QStringList e_ctxt=queryFetch.value(3).toString().split('\b',QString::SkipEmptyParts);
//QStringList e_ctxt=queryFetch.value(3).toString().split('\b',Qt::SkipEmptyParts);
//e.date=queryFetch.value(4).toString();
e.markupExpr = c.markup;
e.accelExpr = c.accel;
......@@ -1277,7 +1277,7 @@ bool SelectJob::doSelect(QSqlDatabase& db,
QString str = e.source.string;
str.remove(c.accel);
QStringList englishSuggList(str.toLower().split(rxSplit, QString::SkipEmptyParts));
QStringList englishSuggList(str.toLower().split(rxSplit, Qt::SkipEmptyParts));
if (englishSuggList.size() > 10 * englishList.size())
continue;
//sugg is 'old' --translator has to adapt its translation to 'new'--current
......@@ -1378,7 +1378,7 @@ bool SelectJob::doSelect(QSqlDatabase& db,
e.target = CatalogString(makeAcceledString(queryRest.value(4).toString(), c.accel, queryRest.value(5)),
queryRest.value(6).toByteArray());
QStringList matchData = queryRest.value(2).toString().split(TM_DELIMITER, QString::KeepEmptyParts); //context|plural
QStringList matchData = queryRest.value(2).toString().split(TM_DELIMITER, Qt::KeepEmptyParts); //context|plural
e.file = queryRest.value(7).toString();
if (e.target.isEmpty())
continue;
......
......@@ -124,8 +124,8 @@ void TMDBModel::setFilter(const QString& source, const QString& target,
/*escapedSource.replace('%',"\b%");escapedSource.replace('_',"\b_");
escapedTarget.replace('%',"\b%");escapedTarget.replace('_',"\b_");*/
QRegExp wre(QStringLiteral("\\W"));
QStringList sourceList = escapedSource.split(wre, QString::SkipEmptyParts);
QStringList targetList = escapedTarget.split(wre, QString::SkipEmptyParts);
QStringList sourceList = escapedSource.split(wre, Qt::SkipEmptyParts);
QStringList targetList = escapedTarget.split(wre, Qt::SkipEmptyParts);
if (!sourceList.isEmpty())
sourceQuery = QStringLiteral("AND source_strings.source ") + invertSourceStr + QStringLiteral("LIKE '%")
......
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