Commit 7c739feb authored by Michael Reeves's avatar Michael Reeves

Fix EBN issue single character string

parent 5fa8b97f
......@@ -93,7 +93,7 @@ QString MergeFileInfos::fullNameA() const
if(existsInA())
return getFileInfoA()->absoluteFilePath();
return m_dirInfo->dirA().absoluteFilePath() + "/" + subPath();
return m_dirInfo->dirA().absoluteFilePath() + '/' + subPath();
}
QString MergeFileInfos::fullNameB() const
......@@ -101,7 +101,7 @@ QString MergeFileInfos::fullNameB() const
if(existsInB())
return getFileInfoB()->absoluteFilePath();
return m_dirInfo->dirB().absoluteFilePath() + "/" + subPath();
return m_dirInfo->dirB().absoluteFilePath() + '/' + subPath();
}
QString MergeFileInfos::fullNameC() const
......@@ -109,7 +109,7 @@ QString MergeFileInfos::fullNameC() const
if(existsInC())
return getFileInfoC()->absoluteFilePath();
return m_dirInfo->dirC().absoluteFilePath() + "/" + subPath();
return m_dirInfo->dirC().absoluteFilePath() + '/' + subPath();
}
void MergeFileInfos::sort(Qt::SortOrder order)
......@@ -127,5 +127,5 @@ QString MergeFileInfos::fullNameDest() const
else if(m_dirInfo->destDir().prettyAbsPath() == m_dirInfo->dirB().prettyAbsPath())
return fullNameB();
else
return m_dirInfo->destDir().absoluteFilePath() + "/" + subPath();
return m_dirInfo->destDir().absoluteFilePath() + '/' + subPath();
}
......@@ -106,7 +106,7 @@ bool Utils::wildcardMultiMatch(const QString& wildcard, const QString& testStrin
{
static QHash<QString, QRegExp> s_patternMap;
QStringList sl = wildcard.split(";");
QStringList sl = wildcard.split(QChar(';'));
for(QStringList::Iterator it = sl.begin(); it != sl.end(); ++it)
{
......
......@@ -54,7 +54,7 @@ QString ValueMap::getAsString()
{
QString key = i->first;
QString val = i->second;
result += key + "=" + val + "\n";
result += key + '=' + val + '\n';
}
return result;
}
......
......@@ -612,7 +612,7 @@ QStringList SourceData::readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetec
ppProcess.waitForFinished(-1);
}
else
errorReason = "\n(" + errorReason + ")";
errorReason = "\n(" + errorReason + ')';
bool bSuccess = errorReason.isEmpty() && m_normalData.readFile(fileNameOut1);
if(fileInSize > 0 && (!bSuccess || m_normalData.m_size == 0))
......@@ -664,7 +664,7 @@ QStringList SourceData::readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetec
ppProcess.waitForFinished(-1);
}
else
errorReason = "\n(" + errorReason + ")";
errorReason = "\n(" + errorReason + ')';
bool bSuccess = errorReason.isEmpty() && m_lmppData.readFile(fileNameOut2);
if(FileAccess(fileNameIn2).size() > 0 && (!bSuccess || m_lmppData.m_size == 0))
......
......@@ -1851,7 +1851,7 @@ void DiffTextWindowFrame::init()
QString s = QDir::toNativeSeparators(pDTW->d->m_filename);
d->m_pFileSelection->setText(s);
QString winId = pDTW->d->m_winIdx == 1 ? (pDTW->d->m_bTriple ? i18n("A (Base)") : i18n("A")) : (pDTW->d->m_winIdx == 2 ? i18n("B") : i18n("C"));
d->m_pLabel->setText(winId + ":");
d->m_pLabel->setText(winId + ':');
d->m_pEncoding->setText(i18n("Encoding: %1", pDTW->d->m_pTextCodec != nullptr ? QLatin1String(pDTW->d->m_pTextCodec->name()) : QString()));
d->m_pLineEndStyle->setText(i18n("Line end style: %1", pDTW->d->m_eLineEndStyle == eLineEndStyleDos ? i18n("DOS") : i18n("Unix")));
}
......@@ -1881,13 +1881,13 @@ void DiffTextWindowFrame::setFirstLine(int firstLine)
int l = pDTW->calcTopLineInFile(firstLine);
int w = d->m_pTopLine->fontMetrics().width(
s + " " + QString().fill('0', lineNumberWidth));
s + ' ' + QString().fill('0', lineNumberWidth));
d->m_pTopLine->setMinimumWidth(w);
if(l == -1)
s = i18n("End");
else
s += " " + QString::number(l + 1);
s += ' ' + QString::number(l + 1);
d->m_pTopLine->setText(s);
d->m_pTopLine->repaint();
......
......@@ -1102,7 +1102,7 @@ bool DirectoryMergeWindow::DirectoryMergeWindowPrivate::init(
if(!bListDirSuccessA) s += "\nA: " + dirA.prettyAbsPath();
if(!bListDirSuccessB) s += "\nB: " + dirB.prettyAbsPath();
if(!bListDirSuccessC) s += "\nC: " + dirC.prettyAbsPath();
s += "\n";
s += '\n';
s += i18n("Check the permissions of the subdirectories.");
bContinue = KMessageBox::Continue == KMessageBox::warningContinueCancel(q, s);
}
......@@ -1162,7 +1162,7 @@ bool DirectoryMergeWindow::DirectoryMergeWindowPrivate::init(
nofDirs, nofEqualFiles, nofFiles - nofEqualFiles);
if(dirC.isValid())
s += "\n" + i18n("Number of manual merges: %1", nofManualMerges);
s += '\n' + i18n("Number of manual merges: %1", nofManualMerges);
KMessageBox::information(q, s);
//
//TODO
......
......@@ -425,7 +425,7 @@ QString FileAccess::fileRelPath() const
{
QString basePath = m_baseDir.canonicalPath();
QString filePath = m_fileInfo.canonicalFilePath();
QString path = filePath.replace(basePath + "/", QLatin1String(""));
QString path = filePath.replace(basePath + '/', QLatin1String(""));
return path;
}
......@@ -1156,7 +1156,7 @@ void FileAccessJobHandler::slotListDirProcessNewEntries(KIO::Job*, const KIO::UD
if(fa.fileName() != "." && fa.fileName() != "..")
{
QUrl url = parentUrl.adjusted(QUrl::StripTrailingSlash);
url.setPath(url.path() + "/" + fa.fileName());
url.setPath(url.path() + '/' + fa.fileName());
fa.setUrl(url);
//fa.m_absoluteFilePath = fa.url().url();
m_pDirList->push_back(fa);
......
......@@ -475,11 +475,11 @@ void KDiff3App::completeInit(const QString& fn1, const QString& fn2, const QStri
QString text(i18n("Opening of these files failed:"));
text += "\n\n";
if(!m_sd1.isEmpty() && !m_sd1.hasData())
text += " - " + m_sd1.getAliasName() + "\n";
text += " - " + m_sd1.getAliasName() + '\n';
if(!m_sd2.isEmpty() && !m_sd2.hasData())
text += " - " + m_sd2.getAliasName() + "\n";
text += " - " + m_sd2.getAliasName() + '\n';
if(!m_sd3.isEmpty() && !m_sd3.hasData())
text += " - " + m_sd3.getAliasName() + "\n";
text += " - " + m_sd3.getAliasName() + '\n';
KMessageBox::sorry(this, text, i18n("File Open Error"));
bFileOpenError = true;
......@@ -980,7 +980,7 @@ void KDiff3App::slotFilePrint()
painter.setPen(m_pOptions->m_fgColor);
painter.drawLine(0, view.bottom() + 3, view.width(), view.bottom() + 3);
QString s = bPrintCurrentPage ? QString("")
: QString::number(page) + "/" + QString::number(totalNofPages);
: QString::number(page) + '/' + QString::number(totalNofPages);
if(bPrintSelection) s += i18n(" (Selection)");
painter.drawText((view.right() - painter.fontMetrics().width(s)) / 2,
view.bottom() + painter.fontMetrics().ascent() + 5, s);
......
......@@ -159,7 +159,7 @@ bool KDiff3Part::openFile()
QString version2;
while(!stream.atEnd() && (fileName1.isEmpty() || fileName2.isEmpty()))
{
str = stream.readLine() + "\n";
str = stream.readLine() + '\n';
getNameAndVersion(str, "---", fileName1, version1);
getNameAndVersion(str, "+++", fileName2, version2);
}
......@@ -195,7 +195,7 @@ bool KDiff3Part::openFile()
process.waitForFinished(-1);
m_widget->slotFileOpen2(fileName1, tempFileName, "", "",
"", version2.isEmpty() ? fileName2 : "REV:" + version2 + ":" + fileName2, "", nullptr); // alias names // std::cerr << "KDiff3: f1:" << fileName1.toLatin1() <<"<->"<<tempFileName.toLatin1()<< std::endl;
"", version2.isEmpty() ? fileName2 : "REV:" + version2 + ':' + fileName2, "", nullptr); // alias names // std::cerr << "KDiff3: f1:" << fileName1.toLatin1() <<"<->"<<tempFileName.toLatin1()<< std::endl;
}
else if(version2.isEmpty() && f2.exists())
{
......@@ -212,7 +212,7 @@ bool KDiff3Part::openFile()
process.waitForFinished(-1);
m_widget->slotFileOpen2(tempFileName, fileName2, "", "",
version1.isEmpty() ? fileName1 : "REV:" + version1 + ":" + fileName1, "", "", nullptr); // alias name
version1.isEmpty() ? fileName1 : "REV:" + version1 + ':' + fileName1, "", "", nullptr); // alias name
// std::cerr << "KDiff3: f2:" << fileName2.toLatin1() <<"<->"<<tempFileName.toLatin1()<< std::endl;
}
else if(!version1.isEmpty() && !version2.isEmpty())
......@@ -238,8 +238,8 @@ bool KDiff3Part::openFile()
process2.waitForFinished(-1);
m_widget->slotFileOpen2(tempFileName1, tempFileName2, "", "",
"REV:" + version1 + ":" + fileName1,
"REV:" + version2 + ":" + fileName2,
"REV:" + version1 + ':' + fileName1,
"REV:" + version2 + ':' + fileName2,
"", nullptr);
// std::cerr << "KDiff3: f1/2:" << tempFileName1.toLatin1() <<"<->"<<tempFileName2.toLatin1()<< std::endl;
......
......@@ -158,7 +158,7 @@ int main(int argc, char* argv[])
#if !defined(Q_OS_WIN)
fputs(qPrintable(errorMessage), stderr);
fputs("\n\n", stderr);
fputs(qPrintable(helpText + "\n"), stderr);
fputs(qPrintable(helpText + '\n'), stderr);
fputs("\n", stderr);
#endif
exit(1);
......
......@@ -1176,7 +1176,7 @@ QString calcHistorySortKey(const QString& keyOrder, QRegExp& matchedRegExpr, con
QString s = matchedRegExpr.cap(groupIdx);
if(groupIdx == 0)
{
key += s + " ";
key += s + ' ';
continue;
}
......@@ -1187,7 +1187,7 @@ QString calcHistorySortKey(const QString& keyOrder, QRegExp& matchedRegExpr, con
int i = s.toInt(&bOk);
if(bOk && i >= 0 && i < 10000)
s.sprintf("%04d", i); // This should help for correct sorting of numbers.
key += s + " ";
key += s + ' ';
}
else
{
......@@ -1204,7 +1204,7 @@ QString calcHistorySortKey(const QString& keyOrder, QRegExp& matchedRegExpr, con
{
QString sIdx;
sIdx.sprintf("%02d", idx + 1); // Up to 99 words in the groupRegExp (more than 12 aren't expected)
key += sIdx + " ";
key += sIdx + ' ';
}
}
}
......@@ -1774,9 +1774,9 @@ void MergeResultWindow::writeLine(
yOffset += topLineYOffset;
QString srcName = " ";
QString srcName = QChar(' ');
if(bUserModified)
srcName = "m";
srcName = QChar('m');
else if(srcSelect == A && mergeDetails != eNoChange)
srcName = i18n("A");
else if(srcSelect == B)
......
......@@ -1095,7 +1095,7 @@ void OptionDialog::setupMergePage()
pWhiteSpace3FileMergeDefault->insertItem(0, i18n("Manual Choice"));
pWhiteSpace3FileMergeDefault->insertItem(1, i18n("A"));
pWhiteSpace3FileMergeDefault->insertItem(2, i18n("B"));
pWhiteSpace3FileMergeDefault->insertItem(3, "C");
pWhiteSpace3FileMergeDefault->insertItem(3, i18n("C"));
label->setToolTip(i18n(
"Allow the merge algorithm to automatically select an input for "
"white-space-only changes."));
......
......@@ -120,7 +120,7 @@ void KDiff3App::mainInit(QSharedPointer<TotalDiffStatus> pTotalDiffStatus, bool
if(!m_pOptions->m_PreProcessorCmd.isEmpty())
{
msg += "- " + i18n("PreprocessorCmd: ") + m_pOptions->m_PreProcessorCmd + "\n";
msg += "- " + i18n("PreprocessorCmd: ") + m_pOptions->m_PreProcessorCmd + '\n';
}
if(!msg.isEmpty())
{
......@@ -1081,11 +1081,11 @@ void KDiff3App::slotFileOpen()
QString text(i18n("Opening of these files failed:"));
text += "\n\n";
if(!m_sd1.isEmpty() && !m_sd1.hasData())
text += " - " + m_sd1.getAliasName() + "\n";
text += " - " + m_sd1.getAliasName() + '\n';
if(!m_sd2.isEmpty() && !m_sd2.hasData())
text += " - " + m_sd2.getAliasName() + "\n";
text += " - " + m_sd2.getAliasName() + '\n';
if(!m_sd3.isEmpty() && !m_sd3.hasData())
text += " - " + m_sd3.getAliasName() + "\n";
text += " - " + m_sd3.getAliasName() + '\n';
KMessageBox::sorry(this, text, i18n("File open error"));
continue;
......@@ -1152,11 +1152,11 @@ void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn
QString text(i18n("Opening of these files failed:"));
text += "\n\n";
if(!m_sd1.isEmpty() && !m_sd1.hasData())
text += " - " + m_sd1.getAliasName() + "\n";
text += " - " + m_sd1.getAliasName() + '\n';
if(!m_sd2.isEmpty() && !m_sd2.hasData())
text += " - " + m_sd2.getAliasName() + "\n";
text += " - " + m_sd2.getAliasName() + '\n';
if(!m_sd3.isEmpty() && !m_sd3.hasData())
text += " - " + m_sd3.getAliasName() + "\n";
text += " - " + m_sd3.getAliasName() + '\n';
KMessageBox::sorry(this, text, i18n("File open error"));
}
......
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