diff --git a/src/catalog/catalog.cpp b/src/catalog/catalog.cpp --- a/src/catalog/catalog.cpp +++ b/src/catalog/catalog.cpp @@ -780,7 +780,7 @@ if (Project::instance()->targetLangCode() == targetLangCode()) { dbName = Project::instance()->projectID(); } else { - dbName = sourceLangCode() % '-' % targetLangCode(); + dbName = sourceLangCode() + '-' + targetLangCode(); qCInfo(LOKALIZE_LOG) << "updating" << dbName << "because target language of project db does not match" << Project::instance()->targetLangCode() << targetLangCode(); if (!TM::DBFilesModel::instance()->m_configurations.contains(dbName)) { TM::OpenDBJob* openDBJob = new TM::OpenDBJob(dbName, TM::Local, true); diff --git a/src/catalog/gettext/gettextexport.cpp b/src/catalog/gettext/gettextexport.cpp --- a/src/catalog/gettext/gettextexport.cpp +++ b/src/catalog/gettext/gettextexport.cpp @@ -113,7 +113,7 @@ //TODO check len of the actual stringlist?? const int forms = catalog->numberOfPluralForms(); for (int i = 0; i < forms; ++i) { - QString keyword = QStringLiteral("msgstr[") % QString::number(i) % ']'; + QString keyword = QStringLiteral("msgstr[") + QString::number(i) + ']'; writeKeyword(stream, keyword, catalogItem.msgstr(i), true, catalogItem.prependEmptyForMsgstr()); } } diff --git a/src/catalog/gettextheader.cpp b/src/catalog/gettextheader.cpp --- a/src/catalog/gettextheader.cpp +++ b/src/catalog/gettextheader.cpp @@ -241,9 +241,9 @@ const int offset_seconds = dt.offsetFromUtc(); const int offset_hours = abs(offset_seconds) / 3600; const int offset_minutes = abs(offset_seconds % 3600) / 60; - QString zoneOffsetString = (offset_seconds >= 0 ? '+' : '-') % (offset_hours < 10 ? QStringLiteral("0") : QStringLiteral("")) % QString::number(offset_hours) % (offset_minutes < 10 ? QStringLiteral("0") : QStringLiteral("")) % QString::number(offset_minutes); + QString zoneOffsetString = (offset_seconds >= 0 ? '+' : '-') + (offset_hours < 10 ? QStringLiteral("0") : QStringLiteral("")) + QString::number(offset_hours) + (offset_minutes < 10 ? QStringLiteral("0") : QStringLiteral("")) + QString::number(offset_minutes); - return dateTimeString % zoneOffsetString; + return dateTimeString + zoneOffsetString; } void updateHeader(QString& header, @@ -289,8 +289,8 @@ bool found = false; authorNameEmail = Settings::authorName(); if (!Settings::authorEmail().isEmpty()) - authorNameEmail += (QStringLiteral(" <") % Settings::authorEmail() % '>'); - temp = QStringLiteral("Last-Translator: ") % authorNameEmail % BACKSLASH_N; + authorNameEmail += (QStringLiteral(" <") + Settings::authorEmail() + '>'); + temp = QStringLiteral("Last-Translator: ") + authorNameEmail + BACKSLASH_N; QRegExp lt(QStringLiteral("^ *Last-Translator:.*")); for (it = headerList.begin(), found = false; it != headerList.end() && !found; ++it) { @@ -302,16 +302,16 @@ if (Q_UNLIKELY(!found)) headerList.append(temp); - temp = QStringLiteral("PO-Revision-Date: ") % formatGettextDate(QDateTime::currentDateTime()) % BACKSLASH_N; + temp = QStringLiteral("PO-Revision-Date: ") + formatGettextDate(QDateTime::currentDateTime()) + BACKSLASH_N; QRegExp poRevDate(QStringLiteral("^ *PO-Revision-Date:.*")); for (it = headerList.begin(), found = false; it != headerList.end() && !found; ++it) { found = it->contains(poRevDate); if (found && forSaving) *it = temp; } if (Q_UNLIKELY(!found)) headerList.append(temp); - temp = QStringLiteral("Project-Id-Version: ") % CatalogProjectId % BACKSLASH_N; + temp = QStringLiteral("Project-Id-Version: ") + CatalogProjectId + BACKSLASH_N; //temp.replace( "@PACKAGE@", packageName()); QRegExp projectIdVer(QStringLiteral("^ *Project-Id-Version:.*")); for (it = headerList.begin(), found = false; it != headerList.end() && !found; ++it) { @@ -371,21 +371,21 @@ Project::LangSource projLangSource = Project::instance()->languageSource(); QString projLT = Project::instance()->projLangTeam(); if (projLangSource == Project::LangSource::Project) { - temp = QStringLiteral("Language-Team: ")%projLT%QStringLiteral("\\n"); + temp = QStringLiteral("Language-Team: ")+projLT+QStringLiteral("\\n"); } else if ((projLangSource == Project::LangSource::Application) && (Settings::overrideLangTeam())) { - temp = QStringLiteral("Language-Team: ")%Settings::userLangTeam()%QStringLiteral("\\n"); + temp = QStringLiteral("Language-Team: ")+Settings::userLangTeam()+QStringLiteral("\\n"); } else { - temp = QStringLiteral("Language-Team: ")%language%QStringLiteral(" <")%mailingList%QStringLiteral(">\\n"); + temp = QStringLiteral("Language-Team: ")+language+QStringLiteral(" <")+mailingList+QStringLiteral(">\\n"); } if (Q_LIKELY(found)) (*ait) = temp; else headerList.append(temp); static QRegExp langCodeRegExp(QStringLiteral("^ *Language: *([^ \\\\]*)")); - temp = QStringLiteral("Language: ") % langCode % BACKSLASH_N; + temp = QStringLiteral("Language: ") + langCode + BACKSLASH_N; for (it = headerList.begin(), found = false; it != headerList.end() && !found; ++it) { found = (langCodeRegExp.indexIn(*it) != -1); if (found && langCodeRegExp.cap(1).isEmpty()) @@ -395,7 +395,7 @@ if (Q_UNLIKELY(!found)) headerList.append(temp); - temp = QStringLiteral("Content-Type: text/plain; charset=") % codec->name() % BACKSLASH_N; + temp = QStringLiteral("Content-Type: text/plain; charset=") + codec->name() + BACKSLASH_N; QRegExp ctRe(QStringLiteral("^ *Content-Type:.*")); for (it = headerList.begin(), found = false; it != headerList.end() && !found; ++it) { found = it->contains(ctRe); @@ -568,7 +568,7 @@ // return; QStringList foundAuthors; - temp = QStringLiteral("# ") % authorNameEmail % QStringLiteral(", ") % cLocale.toString(QDate::currentDate(), QStringLiteral("yyyy")) % '.'; + temp = QStringLiteral("# ") + authorNameEmail + QStringLiteral(", ") + cLocale.toString(QDate::currentDate(), QStringLiteral("yyyy")) + '.'; // ### TODO: it would be nice if the entry could start with "COPYRIGHT" and have the "(C)" symbol (both not mandatory) QRegExp regexpAuthorYear(QStringLiteral("^#.*(<.+@.+>)?,\\s*([\\d]+[\\d\\-, ]*|YEAR)")); @@ -631,9 +631,9 @@ //update years const int index = (*ait).lastIndexOf(QRegExp(QStringLiteral("[\\d]+[\\d\\-, ]*"))); if (index == -1) - (*ait) += QStringLiteral(", ") % cy; + (*ait) += QStringLiteral(", ") + cy; else - ait->insert(index + 1, QStringLiteral(", ") % cy); + ait->insert(index + 1, QStringLiteral(", ") + cy); } else qCDebug(LOKALIZE_LOG) << "INTERNAL ERROR: author found but iterator dangling!"; } diff --git a/src/catalog/xliff/xliffstorage.cpp b/src/catalog/xliff/xliffstorage.cpp --- a/src/catalog/xliff/xliffstorage.cpp +++ b/src/catalog/xliff/xliffstorage.cpp @@ -743,7 +743,7 @@ else if (contextType == QLatin1String("linenumber")) linenumber = context.text(); if (!(sourcefile.isEmpty() && linenumber.isEmpty())) - result.append(sourcefile % ':' % linenumber); + result.append(sourcefile + ':' + linenumber); context = context.nextSiblingElement(QStringLiteral("context")); } diff --git a/src/common/diff.cpp b/src/common/diff.cpp --- a/src/common/diff.cpp +++ b/src/common/diff.cpp @@ -361,7 +361,7 @@ //i tried that but it failed: if (!markup.isEmpty()) markup += '|'; - QRegExp rxSplit('(' % markup % QLatin1String("\\W+|\\d+)+")); + QRegExp rxSplit('(' + markup + QLatin1String("\\W+|\\d+)+")); main = str.split(rxSplit, QString::SkipEmptyParts); main.prepend("\t");//little hack @@ -424,9 +424,9 @@ res.remove(QStringLiteral("{/KBABELDEL}{KBABELDEL}")); if (options & Html) { - res.replace(QLatin1String("{KBABELADD}"), QLatin1String("")); + res.replace(QLatin1String("{KBABELADD}"), QLatin1String("")); res.replace(QLatin1String("{/KBABELADD}"), QLatin1String("")); - res.replace(QLatin1String("{KBABELDEL}"), QLatin1String("")); + res.replace(QLatin1String("{KBABELDEL}"), QLatin1String("")); res.replace(QLatin1String("{/KBABELDEL}"), QLatin1String("")); res.replace(QLatin1String("\\n"), QLatin1String("\\n
")); } diff --git a/src/common/fastsizehintitemdelegate.cpp b/src/common/fastsizehintitemdelegate.cpp --- a/src/common/fastsizehintitemdelegate.cpp +++ b/src/common/fastsizehintitemdelegate.cpp @@ -128,7 +128,7 @@ str = Qt::convertFromPlainText(str); //FIXME use another routine (this has bugs) if (italics) - str = "

" % QString::fromRawData(str.unicode() + 3, str.length() - 3 - 4) % "

"; + str = "

" + QString::fromRawData(str.unicode() + 3, str.length() - 3 - 4) + "

"; return str; } diff --git a/src/common/htmlhelpers.cpp b/src/common/htmlhelpers.cpp --- a/src/common/htmlhelpers.cpp +++ b/src/common/htmlhelpers.cpp @@ -37,7 +37,7 @@ while (i.hasNext()) { QRegularExpressionMatch match = i.next(); QString word = match.captured(0); - html += QStringLiteral("") % word.toHtmlEscaped() % QStringLiteral(""); + html += QStringLiteral("") + word.toHtmlEscaped() + QStringLiteral(""); if (parts.size()) html += parts.takeFirst().toHtmlEscaped(); } return html; diff --git a/src/common/languagelistmodel.cpp b/src/common/languagelistmodel.cpp --- a/src/common/languagelistmodel.cpp +++ b/src/common/languagelistmodel.cpp @@ -105,7 +105,7 @@ if (displayNames.at(index.row()).length()) return displayNames.at(index.row()); return QVariant::fromValue( - displayNames[index.row()] = KConfigGroup(m_systemLangList, code).readEntry("Name") % QStringLiteral(" (") % code % ')'); + displayNames[index.row()] = KConfigGroup(m_systemLangList, code).readEntry("Name") + QStringLiteral(" (") + code + ')'); } return QStringListModel::data(index, role); } diff --git a/src/common/stemming.cpp b/src/common/stemming.cpp --- a/src/common/stemming.cpp +++ b/src/common/stemming.cpp @@ -56,21 +56,21 @@ : speller(0), codec(0) { #ifdef Q_OS_MAC - QString dictPath = QStringLiteral("/Applications/LibreOffice.app/Contents/Resources/extensions/dict-") % langCode.leftRef(2) % '/'; + QString dictPath = QStringLiteral("/Applications/LibreOffice.app/Contents/Resources/extensions/dict-") + langCode.leftRef(2) + '/'; if (langCode == QLatin1String("pl_PL")) dictPath = QStringLiteral("/System/Library/Spelling/"); #elif defined(Q_OS_WIN) - QString dictPath = QStringLiteral("C:/Program Files (x86)/LibreOffice 5/share/extensions/dict-") % langCode.leftRef(2) % '/'; + QString dictPath = QStringLiteral("C:/Program Files (x86)/LibreOffice 5/share/extensions/dict-") + langCode.leftRef(2) + '/'; #else QString dictPath = QStringLiteral("/usr/share/hunspell/"); if (!QFileInfo::exists(dictPath)) dictPath = QStringLiteral("/usr/share/myspell/"); #endif - QString dic = dictPath % langCode % QLatin1String(".dic"); + QString dic = dictPath + langCode + QLatin1String(".dic"); if (!QFileInfo::exists(dic)) - dic = dictPath % enhanceLangCode(langCode) % QLatin1String(".dic"); + dic = dictPath + enhanceLangCode(langCode) + QLatin1String(".dic"); if (QFileInfo::exists(dic)) { - speller = new Hunspell(QString(dictPath % langCode % ".aff").toLatin1().constData(), dic.toLatin1().constData()); + speller = new Hunspell(QString(dictPath + langCode + ".aff").toLatin1().constData(), dic.toLatin1().constData()); codec = QTextCodec::codecForName(speller->get_dic_encoding()); if (!codec) codec = QTextCodec::codecForLocale(); diff --git a/src/common/termlabel.cpp b/src/common/termlabel.cpp --- a/src/common/termlabel.cpp +++ b/src/common/termlabel.cpp @@ -111,9 +111,9 @@ m_capFirst = capFirst; static const QString n = QStringLiteral(" \n "); - QLabel::setText(QString(term + QString(m_action ? QString(QStringLiteral(" [") % m_action->shortcut().toString(QKeySequence::NativeText) % QStringLiteral("] \n ")) : n) //m_shortcut - % Project::instance()->glossary()->terms(m_entryId, Project::instance()->targetLangCode()).join(n) - % n)); + QLabel::setText(QString(term + QString(m_action ? QString(QStringLiteral(" [") + m_action->shortcut().toString(QKeySequence::NativeText) + QStringLiteral("] \n ")) : n) //m_shortcut + + Project::instance()->glossary()->terms(m_entryId, Project::instance()->targetLangCode()).join(n) + + n)); } diff --git a/src/editortab.cpp b/src/editortab.cpp --- a/src/editortab.cpp +++ b/src/editortab.cpp @@ -1416,7 +1416,7 @@ //TODO in trans and fuzzy separately int sourceCount = 0; int targetCount = 0; - QRegExp rxClean(Project::instance()->markup() % '|' % Project::instance()->accel()); //cleaning regexp; NOTE isEmpty()? + QRegExp rxClean(Project::instance()->markup() + '|' + Project::instance()->accel()); //cleaning regexp; NOTE isEmpty()? QRegExp rxSplit(QStringLiteral("\\W|\\d"));//splitting regexp DocPosition pos(0); do { @@ -1621,7 +1621,7 @@ QString targetLangCode = m_catalog->targetLangCode(); QStringList args(m_catalog->url()); - args.append(xliffFolder % '/' % originalOdfFileInfo.baseName() % '-' % targetLangCode % '.' % originalOdfFileInfo.suffix()); + args.append(xliffFolder + '/' + originalOdfFileInfo.baseName() + '-' + targetLangCode + '.' + originalOdfFileInfo.suffix()); args.append(QStringLiteral("-t")); args.append(originalOdfFilePath); qCDebug(LOKALIZE_LOG) << args; diff --git a/src/editorview.cpp b/src/editorview.cpp --- a/src/editorview.cpp +++ b/src/editorview.cpp @@ -240,7 +240,7 @@ if (offset != -1) t.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, offset + 1); } else if (Q_UNLIKELY(targetString.startsWith(TAGRANGE_IMAGE_SYMBOL))) { - int offset = targetString.indexOf(QRegExp(QStringLiteral("[^") % QChar(TAGRANGE_IMAGE_SYMBOL) % ']')); + int offset = targetString.indexOf(QRegExp(QStringLiteral("[^") + QChar(TAGRANGE_IMAGE_SYMBOL) + ']')); if (offset != -1) t.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, offset + 1); } diff --git a/src/filesearch/filesearchtab.cpp b/src/filesearch/filesearchtab.cpp --- a/src/filesearch/filesearchtab.cpp +++ b/src/filesearch/filesearchtab.cpp @@ -416,7 +416,7 @@ void FileSearchModel::setReplacePreview(const QRegExp& s, const QString& r) { m_replaceWhat = s; - m_replaceWith = QLatin1String("_ST_") % r % QLatin1String("_END_"); + m_replaceWith = QLatin1String("_ST_") + r + QLatin1String("_END_"); emit dataChanged(index(0, Target), index(rowCount() - 1, Target)); } diff --git a/src/glossary/glossary.cpp b/src/glossary/glossary.cpp --- a/src/glossary/glossary.cpp +++ b/src/glossary/glossary.cpp @@ -293,7 +293,7 @@ QString authorId(Settings::authorName().toLower()); authorId.replace(' ', '_'); - QRegExp rx('^' % authorId % QStringLiteral("\\-([0-9]*)$")); + QRegExp rx('^' + authorId + QStringLiteral("\\-([0-9]*)$")); foreach (const QByteArray& id, m_idsForEntriesById) { diff --git a/src/glossary/glossaryview.cpp b/src/glossary/glossaryview.cpp --- a/src/glossary/glossaryview.cpp +++ b/src/glossary/glossaryview.cpp @@ -61,7 +61,7 @@ , m_catalog(catalog) , m_flowLayout(new FlowLayout(FlowLayout::glossary,/*who gets signals*/this, actions, 0, 10)) , m_glossary(Project::instance()->glossary()) - , m_rxClean(Project::instance()->markup() % '|' % Project::instance()->accel()) //cleaning regexp; NOTE isEmpty()? + , m_rxClean(Project::instance()->markup() + '|' + Project::instance()->accel()) //cleaning regexp; NOTE isEmpty()? , m_rxSplit(QStringLiteral("\\W|\\d"))//splitting regexp , m_currentIndex(-1) , m_normTitle(i18nc("@title:window", "Glossary")) diff --git a/src/lokalizemainwindow.cpp b/src/lokalizemainwindow.cpp --- a/src/lokalizemainwindow.cpp +++ b/src/lokalizemainwindow.cpp @@ -738,7 +738,7 @@ // KMessageBox::error(this, i18nc("@info","Error opening the following files:")+ // "
  • "+failedFiles.join("
  • ")+"
  • " ); KNotification* notification = new KNotification("FilesOpenError", this); - notification->setText(i18nc("@info", "Error opening the following files:\n\n") % "" % failedFiles.join("
    ") % ""); + notification->setText(i18nc("@info", "Error opening the following files:\n\n") + "" + failedFiles.join("
    ") + ""); notification->sendEvent(); } diff --git a/src/mergemode/mergeview.cpp b/src/mergemode/mergeview.cpp --- a/src/mergemode/mergeview.cpp +++ b/src/mergemode/mergeview.cpp @@ -361,7 +361,7 @@ { if (event->type() == QEvent::ToolTip && m_mergeCatalog) { QHelpEvent *helpEvent = static_cast(event); - QString text = QStringLiteral("") % QDir::toNativeSeparators(filePath()) % QStringLiteral("\n") % i18nc("@info:tooltip", "Different entries: %1\nUnmatched entries: %2", + QString text = QStringLiteral("") + QDir::toNativeSeparators(filePath()) + QStringLiteral("\n") + i18nc("@info:tooltip", "Different entries: %1\nUnmatched entries: %2", m_mergeCatalog->differentEntries().count(), m_mergeCatalog->unmatchedCount()); text.replace('\n', QStringLiteral("
    ")); QToolTip::showText(helpEvent->globalPos(), text); diff --git a/src/metadata/xliffextractor.cpp b/src/metadata/xliffextractor.cpp --- a/src/metadata/xliffextractor.cpp +++ b/src/metadata/xliffextractor.cpp @@ -94,7 +94,7 @@ QString currentLastTranslator; if (contactNameString.length() && contactEmailString.length()) - currentLastTranslator = contactNameString % " <" % contactEmailString % ">"; + currentLastTranslator = contactNameString + " <" + contactEmailString + ">"; else if (contactNameString.length()) currentLastTranslator = contactNameString; else if (contactEmailString.length()) diff --git a/src/noteeditor.cpp b/src/noteeditor.cpp --- a/src/noteeditor.cpp +++ b/src/noteeditor.cpp @@ -135,21 +135,21 @@ int i = 0; foreach (const Note& note, notes) { if (!note.from.isEmpty()) - t.insertHtml(QStringLiteral("") % note.from % QStringLiteral(": ")); + t.insertHtml(QStringLiteral("") + note.from + QStringLiteral(": ")); if (i == active) realOffset = t.position(); QString content = escapeWithLinks(note.content); if (!multiple && content.contains('\n')) content += '\n'; content.replace('\n', BR); - content += QString(QStringLiteral(" (")).arg(i) % i18nc("link to edit note", "edit...") % QStringLiteral(")
    "); + content += QString(QStringLiteral(" (")).arg(i) + i18nc("link to edit note", "edit...") + QStringLiteral(")
    "); t.insertHtml(content); i++; } if (multiple) - t.insertHtml(QStringLiteral("") % i18nc("link to add a note", "Add...") % QStringLiteral(" ")); + t.insertHtml(QStringLiteral("") + i18nc("link to add a note", "Add...") + QStringLiteral(" ")); } else - browser->insertHtml(QStringLiteral("") % i18nc("link to add a note", "Add a note...") % QStringLiteral(" ")); + browser->insertHtml(QStringLiteral("") + i18nc("link to add a note", "Add a note...") + QStringLiteral(" ")); return realOffset; } diff --git a/src/prefs/prefs.cpp b/src/prefs/prefs.cpp --- a/src/prefs/prefs.cpp +++ b/src/prefs/prefs.cpp @@ -250,7 +250,7 @@ //TODO ask-n-save QDir projectFolder = QFileInfo(path).absoluteDir(); QString projectId = projectFolder.dirName(); - if (projectFolder.cdUp()) projectId = projectFolder.dirName() % '-' % projectId;; + if (projectFolder.cdUp()) projectId = projectFolder.dirName() + '-' + projectId;; Project::instance()->load(path, QString(), projectId); //Project::instance()->setDefaults(); //NOTE will this be an obstacle? //Project::instance()->setProjectID(); diff --git a/src/project/project.cpp b/src/project/project.cpp --- a/src/project/project.cpp +++ b/src/project/project.cpp @@ -231,7 +231,7 @@ QString Project::absolutePath(const QString& possiblyRelPath) const { if (QFileInfo(possiblyRelPath).isRelative()) - return QDir::cleanPath(m_projectDir % QLatin1Char('/') % possiblyRelPath); + return QDir::cleanPath(m_projectDir + QLatin1Char('/') + possiblyRelPath); return possiblyRelPath; } @@ -482,16 +482,16 @@ fi.absoluteDir().mkdir(trFolderName); QStringList args(odfPath); - args.append(fi.absoluteDir().absoluteFilePath(trFolderName) % '/' % fi.baseName() % QLatin1String(".xlf")); + args.append(fi.absoluteDir().absoluteFilePath(trFolderName) + '/' + fi.baseName() + QLatin1String(".xlf")); qCDebug(LOKALIZE_LOG) << args; QProcess::execute(odf2xliff, args); if (!QFile::exists(args.at(1))) return; emit closed(); - Project::instance()->load(fi.absoluteDir().absoluteFilePath(trFolderName) + QLatin1String("/index.lokalize"), targetLangCode, fi.baseName() % '-' % targetLangCode); + Project::instance()->load(fi.absoluteDir().absoluteFilePath(trFolderName) + QLatin1String("/index.lokalize"), targetLangCode, fi.baseName() + '-' + targetLangCode); emit fileOpenRequested(args.at(1), true); } diff --git a/src/project/projectmodel.cpp b/src/project/projectmodel.cpp --- a/src/project/projectmodel.cpp +++ b/src/project/projectmodel.cpp @@ -955,7 +955,7 @@ pathToAdd += 't'; QUrl potPath = m_potUrl; - potPath.setPath(potPath.path() % '/' % pathToAdd); + potPath.setPath(potPath.path() + '/' + pathToAdd); //qCDebug(LOKALIZE_LOG) << "ProjectModel::poToPot("<< poPath.pathOrUrl() << +") = " << potPath.pathOrUrl(); return potPath; @@ -975,7 +975,7 @@ pathToAdd = pathToAdd.left(pathToAdd.length() - 1); QUrl poPath = m_poUrl; - poPath.setPath(poPath.path() % '/' % pathToAdd); + poPath.setPath(poPath.path() + '/' + pathToAdd); //qCDebug(LOKALIZE_LOG) << "ProjectModel::potToPo("<< potPath.pathOrUrl() << +") = " << poPath.pathOrUrl(); return poPath; diff --git a/src/project/projecttab.cpp b/src/project/projecttab.cpp --- a/src/project/projecttab.cpp +++ b/src/project/projecttab.cpp @@ -124,7 +124,7 @@ m_filterEdit->setClearButtonEnabled(true); m_filterEdit->setPlaceholderText(i18n("Quick search...")); - m_filterEdit->setToolTip(i18nc("@info:tooltip", "Activated by Ctrl+L.") % ' ' % i18nc("@info:tooltip", "Accepts regular expressions")); + m_filterEdit->setToolTip(i18nc("@info:tooltip", "Activated by Ctrl+L.") + ' ' + i18nc("@info:tooltip", "Accepts regular expressions")); connect(m_filterEdit, &QLineEdit::textChanged, this, &ProjectTab::setFilterRegExp, Qt::QueuedConnection); new QShortcut(Qt::CTRL + Qt::Key_L, this, SLOT(setFocus()), 0, Qt::WidgetWithChildrenShortcut); diff --git a/src/project/updatestatsjob.cpp b/src/project/updatestatsjob.cpp --- a/src/project/updatestatsjob.cpp +++ b/src/project/updatestatsjob.cpp @@ -72,7 +72,7 @@ QString dbName = QStringLiteral("metainfocache"); if (!QSqlDatabase::contains(dbName)) { QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), dbName); - db.setDatabaseName(QStandardPaths::writableLocation(QStandardPaths::DataLocation) % QLatin1Char('/') % dbName % QLatin1String(".sqlite")); + db.setDatabaseName(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + dbName + QLatin1String(".sqlite")); if (Q_UNLIKELY(!db.open())) return FileMetaData::extract(file.localPath()); initDataBase(db); diff --git a/src/syntaxhighlighter.cpp b/src/syntaxhighlighter.cpp --- a/src/syntaxhighlighter.cpp +++ b/src/syntaxhighlighter.cpp @@ -97,7 +97,7 @@ void SyntaxHighlighter::settingsChanged() { - QRegExp re(" +$|^ +|.?" % QChar(0x0000AD) % ".?"); //soft hyphen + QRegExp re(" +$|^ +|.?" + QChar(0x0000AD) + ".?"); //soft hyphen if (Settings::highlightSpaces() && highlightingRules.last().pattern != re) { HighlightingRule rule; rule.format.clearForeground(); diff --git a/src/tm/dbfilesmodel.cpp b/src/tm/dbfilesmodel.cpp --- a/src/tm/dbfilesmodel.cpp +++ b/src/tm/dbfilesmodel.cpp @@ -133,7 +133,7 @@ m_openingDbLock.unlock(); if (type == TM::Undefined) type = QFileInfo( - QStandardPaths::writableLocation(QStandardPaths::DataLocation) % QLatin1Char('/') % name % QStringLiteral(REMOTETM_DATABASE_EXTENSION)).exists() ? TM::Remote : TM::Local; + QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + name + QStringLiteral(REMOTETM_DATABASE_EXTENSION)).exists() ? TM::Remote : TM::Local; OpenDBJob* openDBJob = new OpenDBJob(name, type); if (forceCurrentProjectConfig) { openDBJob->m_setParams = true; @@ -202,7 +202,7 @@ void DBFilesModel::closeJobDone(CloseDBJob* j) { j->deleteLater(); - QString filename = m_fileSystemModel->rootPath() % '/' % j->dbName() % tmFileExtension; + QString filename = m_fileSystemModel->rootPath() + '/' + j->dbName() + tmFileExtension; qCWarning(LOKALIZE_LOG) << "removing file " << filename; QFile::remove(filename); } diff --git a/src/tm/jobs.cpp b/src/tm/jobs.cpp --- a/src/tm/jobs.cpp +++ b/src/tm/jobs.cpp @@ -119,11 +119,11 @@ QString escapedPath = path; escapedPath.replace(QLatin1Char('\''), QLatin1String("''")); - QString pathExpr = QStringLiteral("path='") % escapedPath % '\''; + QString pathExpr = QStringLiteral("path='") + escapedPath + '\''; if (path.isEmpty()) pathExpr = QStringLiteral("path ISNULL"); if (Q_UNLIKELY(!query1.exec(U("SELECT id FROM files WHERE " - "path='") % escapedPath % '\''))) + "path='") + escapedPath + '\''))) qCWarning(LOKALIZE_LOG) << "select db error: " << query1.lastError().text(); if (Q_LIKELY(query1.next())) { @@ -172,7 +172,7 @@ while (--j >= 0) { // insert word (if we do not have it) if (Q_UNLIKELY(!query1.exec(U("SELECT word, ids_short, ids_long FROM words WHERE " - "word='") % words.at(j) % '\''))) + "word='") + words.at(j) + '\''))) qCWarning(LOKALIZE_LOG) << "select error 3: " << query1.lastError().text(); //we _have_ it @@ -191,13 +191,13 @@ } query1.clear(); - if (arr.contains(' ' % sourceIdStr % ' ') + if (arr.contains(' ' + sourceIdStr + ' ') || arr.startsWith(sourceIdStr + ' ') || arr.endsWith(' ' + sourceIdStr) || arr == sourceIdStr) return;//this string is already indexed - query1.prepare(QStringLiteral("UPDATE words SET ") % field % QStringLiteral("=? WHERE word='") % words.at(j) % '\''); + query1.prepare(QStringLiteral("UPDATE words SET ") + field + QStringLiteral("=? WHERE word='") + words.at(j) + '\''); if (!arr.isEmpty()) arr += ' '; @@ -245,10 +245,10 @@ //BEGIN check //TM_NOTAPPROVED=4 if (Q_UNLIKELY(!query1.exec(U("SELECT count(*) FROM main, target_strings WHERE " - "main.source=") % QString::number(sourceId) % U(" AND " + "main.source=") + QString::number(sourceId) + U(" AND " "main.target=target_strings.id AND " "target_strings.target NOTNULL AND " - "main.id!=") % QString::number(mainId) % U(" AND " + "main.id!=") + QString::number(mainId) + U(" AND " "(main.bits&4)!=4")))) { qCWarning(LOKALIZE_LOG) << "select error 500: " << query1.lastError().text(); return; @@ -265,7 +265,7 @@ while (--j >= 0) { // remove from record for the word (if we do not have it) if (Q_UNLIKELY(!query1.exec(U("SELECT word, ids_short, ids_long FROM words WHERE " - "word='") % words.at(j) % '\''))) { + "word='") + words.at(j) + '\''))) { qCWarning(LOKALIZE_LOG) << "select error 3: " << query1.lastError().text(); return; } @@ -298,8 +298,8 @@ query1.prepare(U("UPDATE words " - "SET ") % field % U("=? " - "WHERE word='") % words.at(j) % '\''); + "SET ") + field + U("=? " + "WHERE word='") + words.at(j) + '\''); query1.bindValue(0, arr); @@ -502,7 +502,7 @@ if (Q_UNLIKELY(!query1.exec(QString(U("SELECT id, target, bits FROM main WHERE " "source=%1 AND file=%2 AND ctxt%3")).arg(sourceId).arg(fileId).arg - (escapedCtxt.isEmpty() ? QStringLiteral(" ISNULL") : QString("='" % escapedCtxt % '\''))))) { + (escapedCtxt.isEmpty() ? QStringLiteral(" ISNULL") : QString("='" + escapedCtxt + '\''))))) { qCWarning(LOKALIZE_LOG) << "doInsertEntry: select db main error: " << query1.lastError().text(); return false; } @@ -584,16 +584,16 @@ query1.prepare(U("UPDATE target_strings " "SET target=?, target_accel=?, target_markup=? " - "WHERE id=") % QString::number(targetId)); + "WHERE id=") + QString::number(targetId)); query1.bindValue(0, target.string.isEmpty() ? QVariant() : target.string); query1.bindValue(1, targetAccelPos != -1 ? QVariant(targetAccelPos) : QVariant()); query1.bindValue(2, target.tagsAsByteArray()); bool ok = query1.exec(); //note the RETURN!!!! if (!ok) qCWarning(LOKALIZE_LOG) << "doInsertEntry: target update failed" << query1.lastError().text(); else { - ok = query1.exec(QStringLiteral("UPDATE main SET change_date=CURRENT_DATE WHERE target=") % QString::number(targetId)); + ok = query1.exec(QStringLiteral("UPDATE main SET change_date=CURRENT_DATE WHERE target=") + QString::number(targetId)); if (!ok) qCWarning(LOKALIZE_LOG) << "doInsertEntry: main update failed" << query1.lastError().text(); } @@ -997,7 +997,7 @@ QString dbFolder = QStandardPaths::writableLocation(QStandardPaths::DataLocation); QFileInfo fileInfo(dbFolder); if (!fileInfo.exists(dbFolder)) fileInfo.absoluteDir().mkpath(fileInfo.fileName()); - db.setDatabaseName(dbFolder % QLatin1Char('/') % m_dbName % TM_DATABASE_EXTENSION); + db.setDatabaseName(dbFolder + QLatin1Char('/') + m_dbName + TM_DATABASE_EXTENSION); m_connectionSuccessful = db.open(); if (Q_UNLIKELY(!m_connectionSuccessful)) { qCDebug(LOKALIZE_LOG) << "failed to open db" << db.databaseName() << db.lastError().text(); @@ -1028,7 +1028,7 @@ } if (!m_connParams.isFilled()) { - QFile rdb(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + m_dbName % REMOTETM_DATABASE_EXTENSION); + QFile rdb(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + m_dbName + REMOTETM_DATABASE_EXTENSION); if (!rdb.open(QIODevice::ReadOnly | QIODevice::Text)) { emit done(this); return; @@ -1208,7 +1208,7 @@ QString tmp = c.markup; if (!c.markup.isEmpty()) tmp += '|'; - QRegExp rxSplit(QLatin1Char('(') % tmp % QStringLiteral("\\W+|\\d+)+")); + QRegExp rxSplit(QLatin1Char('(') + tmp + QStringLiteral("\\W+|\\d+)+")); QString sourceClean(m_source.string); sourceClean.remove(c.accel); @@ -1245,7 +1245,7 @@ //get records containing current word QSqlQuery queryFetch(U( "SELECT id, source, source_accel, source_markup FROM source_strings WHERE " - "source_strings.id IN (") % joined % ')', db); + "source_strings.id IN (") + joined + ')', db); TMEntry e; while (queryFetch.next()) { e.id = queryFetch.value(0).toLongLong(); @@ -1353,10 +1353,10 @@ QSqlQuery queryRest(U( "SELECT main.id, main.date, main.ctxt, main.bits, " "target_strings.target, target_strings.target_accel, target_strings.target_markup, " - "files.path, main.change_date ") % change_author_str % U( + "files.path, main.change_date ") + change_author_str + U( "FROM main JOIN target_strings ON (target_strings.id=main.target) JOIN files ON (files.id=main.file) ") - % authors_table_str % U("WHERE " - "main.source=") % QString::number(e.id) % U(" AND " + + authors_table_str + U("WHERE " + "main.source=") + QString::number(e.id) + U(" AND " "(main.bits&4)!=4 AND " "target_strings.target NOTNULL") , db); //ORDER BY tm_main.id ? @@ -1564,7 +1564,7 @@ */ ok = ok && doInsertEntry(catalog.sourceWithTags(ppos), catalog.targetWithTags(ppos), - catalog.context(ppos).first() % TM_DELIMITER % QString::number(ppos.form), + catalog.context(ppos).first() + TM_DELIMITER + QString::number(ppos.form), catalog.isApproved(ppos), fileId, db, rxClean1, c.accel, priorId, priorId); } diff --git a/src/tm/tmmanager.cpp b/src/tm/tmmanager.cpp --- a/src/tm/tmmanager.cpp +++ b/src/tm/tmmanager.cpp @@ -195,7 +195,7 @@ return; if (connectionBox->isVisible()) { - QFile rdb(QStandardPaths::writableLocation(QStandardPaths::DataLocation) % QLatin1Char('/') % name->text() % REMOTETM_DATABASE_EXTENSION); + QFile rdb(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + name->text() + REMOTETM_DATABASE_EXTENSION); if (!rdb.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) return; diff --git a/src/tm/tmtab.cpp b/src/tm/tmtab.cpp --- a/src/tm/tmtab.cpp +++ b/src/tm/tmtab.cpp @@ -90,8 +90,8 @@ QString sourceLangCode = DBFilesModel::instance()->m_configurations.value(str).sourceLangCode; QString targetLangCode = DBFilesModel::instance()->m_configurations.value(str).targetLangCode; - if (sourceLangCode.length()) setHeaderData(TMDBModel::Source, Qt::Horizontal, QString(i18nc("@title:column Original text", "Source") % QStringLiteral(": ") % sourceLangCode)); - if (targetLangCode.length()) setHeaderData(TMDBModel::Target, Qt::Horizontal, QString(i18nc("@title:column Text in target language", "Target") % QStringLiteral(": ") % targetLangCode)); + if (sourceLangCode.length()) setHeaderData(TMDBModel::Source, Qt::Horizontal, QString(i18nc("@title:column Original text", "Source") + QStringLiteral(": ") + sourceLangCode)); + if (targetLangCode.length()) setHeaderData(TMDBModel::Target, Qt::Horizontal, QString(i18nc("@title:column Text in target language", "Target") + QStringLiteral(": ") + targetLangCode)); } void TMDBModel::setQueryType(int type) @@ -117,38 +117,38 @@ escapedSource.replace('%', QStringLiteral("\b%")); escapedSource.replace('_', QStringLiteral("\b_")); escapedTarget.replace('%', QStringLiteral("\b%")); escapedTarget.replace('_', QStringLiteral("\b_")); if (!escapedSource.isEmpty()) - sourceQuery = QStringLiteral("AND source_strings.source ") % invertSourceStr % QStringLiteral("LIKE '%") % escapedSource % QStringLiteral("%' ESCAPE '\b' "); + sourceQuery = QStringLiteral("AND source_strings.source ") + invertSourceStr + QStringLiteral("LIKE '%") + escapedSource + QStringLiteral("%' ESCAPE '\b' "); if (!escapedTarget.isEmpty()) - targetQuery = QStringLiteral("AND target_strings.target ") % invertTargetStr % QStringLiteral("LIKE '%") % escapedTarget % QStringLiteral("%' ESCAPE '\b' "); + targetQuery = QStringLiteral("AND target_strings.target ") + invertTargetStr + QStringLiteral("LIKE '%") + escapedTarget + QStringLiteral("%' ESCAPE '\b' "); } else if (m_queryType == WordOrder) { /*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); if (!sourceList.isEmpty()) - sourceQuery = QStringLiteral("AND source_strings.source ") % invertSourceStr % QStringLiteral("LIKE '%") - % sourceList.join(QStringLiteral("%' AND source_strings.source ") % invertSourceStr % QStringLiteral("LIKE '%")) % QStringLiteral("%' "); + sourceQuery = QStringLiteral("AND source_strings.source ") + invertSourceStr + QStringLiteral("LIKE '%") + + sourceList.join(QStringLiteral("%' AND source_strings.source ") + invertSourceStr + QStringLiteral("LIKE '%")) + QStringLiteral("%' "); if (!targetList.isEmpty()) - targetQuery = QStringLiteral("AND target_strings.target ") % invertTargetStr % QStringLiteral("LIKE '%") - % targetList.join(QStringLiteral("%' AND target_strings.target ") % invertTargetStr % QStringLiteral("LIKE '%")) % QStringLiteral("%' "); + targetQuery = QStringLiteral("AND target_strings.target ") + invertTargetStr + QStringLiteral("LIKE '%") + + targetList.join(QStringLiteral("%' AND target_strings.target ") + invertTargetStr + QStringLiteral("LIKE '%")) + QStringLiteral("%' "); } else { if (!escapedSource.isEmpty()) - sourceQuery = QStringLiteral("AND source_strings.source ") % invertSourceStr % QStringLiteral("GLOB '") % escapedSource % QStringLiteral("' "); + sourceQuery = QStringLiteral("AND source_strings.source ") + invertSourceStr + QStringLiteral("GLOB '") + escapedSource + QStringLiteral("' "); if (!escapedTarget.isEmpty()) - targetQuery = QStringLiteral("AND target_strings.target ") % invertTargetStr % QStringLiteral("GLOB '") % escapedTarget % QStringLiteral("' "); + targetQuery = QStringLiteral("AND target_strings.target ") + invertTargetStr + QStringLiteral("GLOB '") + escapedTarget + QStringLiteral("' "); } if (!filemask.isEmpty()) - fileQuery = QStringLiteral("AND files.path GLOB '") % escapedFilemask % QStringLiteral("' "); + fileQuery = QStringLiteral("AND files.path GLOB '") + escapedFilemask + QStringLiteral("' "); QString fromPart = QStringLiteral("FROM main JOIN source_strings ON (source_strings.id=main.source) " "JOIN target_strings ON (target_strings.id=main.target), files " "WHERE files.id=main.file ") - % sourceQuery - % targetQuery - % fileQuery; + + sourceQuery + + targetQuery + + fileQuery; ExecQueryJob* job = new ExecQueryJob(QStringLiteral( "SELECT source_strings.source, target_strings.target, " @@ -336,7 +336,7 @@ foreach (const QRegExp& re, regExps) { int pos = re.indexIn(string); if (pos != -1) - return string.replace(pos, re.matchedLength(), QStringLiteral("") % re.cap(0) % QStringLiteral("")); + return string.replace(pos, re.matchedLength(), QStringLiteral("") + re.cap(0) + QStringLiteral("")); } //StartLen sl=m_highlightDataForSourceRow.value(source_row).at(index.column()); @@ -588,7 +588,7 @@ return performQuery(); } if (!filemask.isEmpty() && !filemask.contains('*')) { - ui_queryOptions->filemask->setText('*' % filemask % '*'); + ui_queryOptions->filemask->setText('*' + filemask + '*'); return performQuery(); } } @@ -785,7 +785,7 @@ source_target_query[tryNowPart == DocPosition::Source]->setText(text); ui_queryOptions->invertSource->setChecked(false); ui_queryOptions->invertTarget->setChecked(false); - if (!package.isEmpty()) package = '*' % package % '*'; + if (!package.isEmpty()) package = '*' + package + '*'; ui_queryOptions->filemask->setText(package); ui_queryOptions->queryStyle->setCurrentIndex(TMDBModel::Glob); performQuery(); diff --git a/src/tm/tmview.cpp b/src/tm/tmview.cpp --- a/src/tm/tmview.cpp +++ b/src/tm/tmview.cpp @@ -478,9 +478,9 @@ //result.replace("&","&"); //result.replace("<","<"); //result.replace(">",">"); - result.replace(QLatin1String("{KBABELADD}"), QStringLiteral("")); + result.replace(QLatin1String("{KBABELADD}"), QStringLiteral("")); result.replace(QLatin1String("{/KBABELADD}"), QLatin1String("")); - result.replace(QLatin1String("{KBABELDEL}"), QStringLiteral("")); + result.replace(QLatin1String("{KBABELDEL}"), QStringLiteral("")); result.replace(QLatin1String("{/KBABELDEL}"), QLatin1String("")); result.replace(QLatin1String("\\n"), QLatin1String("\\n
    ")); result.replace(QLatin1String("\\n"), QLatin1String("\\n
    ")); @@ -687,18 +687,18 @@ //QString english=entry.english; - QRegExp rxAdd(QLatin1String("]*") % Settings::addColor().name() % QLatin1String("[^>]*\">([^>]*)")); - QRegExp rxDel(QLatin1String("]*") % Settings::delColor().name() % QLatin1String("[^>]*\">([^>]*)")); + QRegExp rxAdd(QLatin1String("]*") + Settings::addColor().name() + QLatin1String("[^>]*\">([^>]*)")); + QRegExp rxDel(QLatin1String("]*") + Settings::delColor().name() + QLatin1String("[^>]*\">([^>]*)")); //rxAdd.setMinimal(true); //rxDel.setMinimal(true); //first things first int pos = 0; while ((pos = rxDel.indexIn(diff, pos)) != -1) - diff.replace(pos, rxDel.matchedLength(), "\tKBABELDEL\t" % rxDel.cap(1) % "\t/KBABELDEL\t"); + diff.replace(pos, rxDel.matchedLength(), "\tKBABELDEL\t" + rxDel.cap(1) + "\t/KBABELDEL\t"); pos = 0; while ((pos = rxAdd.indexIn(diff, pos)) != -1) - diff.replace(pos, rxAdd.matchedLength(), "\tKBABELADD\t" % rxAdd.cap(1) % "\t/KBABELADD\t"); + diff.replace(pos, rxAdd.matchedLength(), "\tKBABELADD\t" + rxAdd.cap(1) + "\t/KBABELADD\t"); diff.replace(QStringLiteral("<"), QStringLiteral("<")); diff.replace(QStringLiteral(">"), QStringLiteral(">")); @@ -768,7 +768,7 @@ //BEGIN BEGIN HANDLING QRegExp rxNonTranslatable; if (tryMarkup) - rxNonTranslatable.setPattern(QStringLiteral("^((") % entry.markupExpr % QStringLiteral(")|(\\W|\\d)+)+")); + rxNonTranslatable.setPattern(QStringLiteral("^((") + entry.markupExpr + QStringLiteral(")|(\\W|\\d)+)+")); else rxNonTranslatable.setPattern(QStringLiteral("^(\\W|\\d)+")); @@ -839,7 +839,7 @@ //END BEGIN HANDLING //BEGIN END HANDLING if (tryMarkup) - rxNonTranslatable.setPattern(QStringLiteral("((") % entry.markupExpr % QStringLiteral(")|(\\W|\\d)+)+$")); + rxNonTranslatable.setPattern(QStringLiteral("((") + entry.markupExpr + QStringLiteral(")|(\\W|\\d)+)+$")); else rxNonTranslatable.setPattern(QStringLiteral("(\\W|\\d)+$")); diff --git a/src/xlifftextedit.cpp b/src/xlifftextedit.cpp --- a/src/xlifftextedit.cpp +++ b/src/xlifftextedit.cpp @@ -1105,7 +1105,7 @@ tip += langCode; if (l.language() != QLocale::C) tip += ')'; if (nospell) - tip += QLatin1String(" - ") % i18n("no spellcheck available"); + tip += QLatin1String(" - ") + i18n("no spellcheck available"); QToolTip::showText(helpEvent->globalPos(), tip); } return KTextEdit::event(event); @@ -1212,13 +1212,13 @@ out = '\n'; out += QLatin1String("\n" "\n" - "
    ") % Settings::authorEmail() % QLatin1String("
    \n" + "
    ") + Settings::authorEmail() + QLatin1String("
    \n" "
    "); } else if (text.startsWith(QLatin1String("CREDIT_FOR_TRANSLATORS"))) { if (!document()->isEmpty()) out = '\n'; - out += QLatin1String("") % Settings::authorLocalizedName() % '\n' % - QLatin1String("") % Settings::authorEmail() % QLatin1String(""); + out += QLatin1String("") + Settings::authorLocalizedName() + '\n' + + QLatin1String("") + Settings::authorEmail() + QLatin1String(""); } //END KDE specific part