Commit 79c40529 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Build with strict definition.

Minor optimization.
Assign parent directly
parent e06c8252
......@@ -37,6 +37,11 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}")
configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_subdirectory(src)
......
......@@ -9,8 +9,6 @@ endif ()
configure_file (config-drkonqi.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-drkonqi.h )
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1410)
add_subdirectory( data )
add_subdirectory( parser )
if ( WIN32 )
......
......@@ -40,7 +40,6 @@ AboutBugReportingDialog::AboutBugReportingDialog(QWidget * parent):
setWindowTitle(i18nc("@title title of the dialog", "About Bug Reporting - Help"));
QVBoxLayout* layout = new QVBoxLayout(this);
setLayout(layout);
m_textBrowser = new QTextBrowser(this);
m_textBrowser->setMinimumSize(QSize(600, 300));
connect(m_textBrowser, &QTextBrowser::anchorClicked, this, &AboutBugReportingDialog::handleInternalLinks);
......
......@@ -386,16 +386,15 @@ void BacktraceWidget::extraDetailsLinkActivated(QString link)
missingDbgForFiles.insert(0, DrKonqi::crashedApplication()->executable().absoluteFilePath());
//HTML message
QString message;
message = QLatin1String("<html>");
QString message = QStringLiteral("<html>");
message += i18n("The packages containing debug information for the following application and libraries are missing:");
message += QLatin1String("<br /><ul>");
message += QStringLiteral("<br /><ul>");
Q_FOREACH(const QString & string, missingDbgForFiles) {
message += "<li>" + string + "</li>";
message += QStringLiteral("<li>") + string + QStringLiteral("</li>");
}
message += QLatin1String("</ul></html>");
message += QStringLiteral("</ul></html>");
KMessageBox::information(this, message, i18nc("messagebox title","Missing debug information packages"));
}
......
......@@ -36,7 +36,7 @@ public:
inline bool isEmail() const
{
return contains('@');
return contains(QLatin1Char('@'));
}
};
......
......@@ -62,7 +62,7 @@ BugzillaManager::BugzillaManager(const QString &bugTrackerUrl, QObject *parent)
, m_logged(false)
, m_searchJob(nullptr)
{
m_xmlRpcClient = new KXmlRpc::Client(QUrl(m_bugTrackerUrl + "xmlrpc.cgi"), this);
m_xmlRpcClient = new KXmlRpc::Client(QUrl(m_bugTrackerUrl + QStringLiteral("xmlrpc.cgi")), this);
m_xmlRpcClient->setUserAgent(QLatin1String("DrKonqi"));
// Allow constructors for ReportInterface and assistant dialogs to finish.
// We do not want them to be racing the remote Bugzilla database.
......@@ -183,7 +183,7 @@ QString BugzillaManager::getUsername() const
//BEGIN Bugzilla Action methods
void BugzillaManager::fetchBugReport(int bugnumber, QObject * jobOwner)
{
QUrl url(m_bugTrackerUrl + QString(fetchBugUrl).arg(bugnumber));
QUrl url(m_bugTrackerUrl + QString::fromLatin1(fetchBugUrl).arg(bugnumber));
if (!jobOwner) {
jobOwner = this;
......@@ -205,15 +205,15 @@ void BugzillaManager::searchBugs(const QStringList & products,
product = products.at(0);
} else {
Q_FOREACH(const QString & p, products) {
product += p + "&product=";
product += p + QStringLiteral("&product=");
}
product = product.mid(0,product.size()-9);
}
}
QString url = QString(m_bugTrackerUrl) +
QString(searchUrl).arg(product, comment.replace(' ' , '+'), date_start,
date_end, severity, QString(columns));
QString::fromLatin1(searchUrl).arg(product, comment.replace(QLatin1Char(' ') , QLatin1Char('+')), date_start,
date_end, severity, QString::fromLatin1(columns));
stopCurrentSearch();
......@@ -288,7 +288,7 @@ void BugzillaManager::fetchProductInfo(const QString & product)
//BEGIN Misc methods
QString BugzillaManager::urlForBug(int bug_number) const
{
return QString(m_bugTrackerUrl) + QString(showBugUrl).arg(bug_number);
return QString(m_bugTrackerUrl) + QString::fromLatin1(showBugUrl).arg(bug_number);
}
void BugzillaManager::stopCurrentSearch()
......@@ -508,10 +508,10 @@ BugMapList BugListCSVParser::parse()
//Parse buglist CSV
QTextStream ts(&m_data);
QString headersLine = ts.readLine().remove(QLatin1Char('\"')) ; //Discard headers
QString expectedHeadersLine = QString(columns);
QString expectedHeadersLine = QString::fromLatin1(columns);
if (headersLine == (QStringLiteral("bug_id,") + expectedHeadersLine)) {
QStringList headers = expectedHeadersLine.split(',', QString::KeepEmptyParts);
QStringList headers = expectedHeadersLine.split(QLatin1Char(','), QString::KeepEmptyParts);
int headersCount = headers.count();
while (!ts.atEnd()) {
......@@ -520,7 +520,7 @@ BugMapList BugListCSVParser::parse()
QString line = ts.readLine();
//Get bug_id (always at first column)
int bug_id_index = line.indexOf(',');
int bug_id_index = line.indexOf(QLatin1Char(','));
QString bug_id = line.left(bug_id_index);
bug.insert(QStringLiteral("bug_id"), bug_id);
......
......@@ -165,7 +165,7 @@ public:
setData(QStringLiteral("keywords"), keywords.join(QStringLiteral(",")));
}
QStringList keywords() const {
return getData(QStringLiteral("keywords")).split(',');
return getData(QStringLiteral("keywords")).split(QLatin1Char(','));
}
void setDescription(const QString & desc) {
......
......@@ -138,7 +138,7 @@ void ParseBugBacktraces::parse(const QString &comment)
int end = -1;
do {
start = end + 1;
end = comment.indexOf('\n', start);
end = comment.indexOf(QLatin1Char('\n'), start);
emit newLine(comment.mid(start, (end != -1 ? end - start + 1 : end)));
} while (end != -1);
......
......@@ -37,8 +37,8 @@ ProductMapping::ProductMapping(const CrashedApplication * crashedApp, BugzillaMa
{
//Default "fallback" values
m_bugzillaProduct = crashedApp->fakeExecutableBaseName();
m_bugzillaComponent = QLatin1String("general");
m_bugzillaVersionString = QLatin1String("unspecified");
m_bugzillaComponent = QStringLiteral("general");
m_bugzillaVersionString = QStringLiteral("unspecified");
m_relatedBugzillaProducts = QStringList() << m_bugzillaProduct;
map(crashedApp->fakeExecutableBaseName());
......@@ -62,7 +62,7 @@ void ProductMapping::mapUsingInternalFile(const QString & appName)
if (mappings.hasKey(appName)) {
QString mappingString = mappings.readEntry(appName);
if (!mappingString.isEmpty()) {
QStringList list = mappingString.split('|', QString::SkipEmptyParts);
QStringList list = mappingString.split(QLatin1Char('|'), QString::SkipEmptyParts);
if (list.count()==2) {
m_bugzillaProduct = list.at(0);
m_bugzillaComponent = list.at(1);
......@@ -94,7 +94,7 @@ void ProductMapping::getRelatedProductsUsingInternalFile(const QString & bugzill
"(or there was an error when reading)";
return;
}
groups = group.split('|', QString::SkipEmptyParts);
groups = group.split(QLatin1Char('|'), QString::SkipEmptyParts);
}
//All KDE apps use the KDE Platform (basic libs)
......@@ -109,7 +109,7 @@ void ProductMapping::getRelatedProductsUsingInternalFile(const QString & bugzill
if (bzGroups.hasKey(group)) {
QString bzGroup = bzGroups.readEntry(group);
if (!bzGroup.isEmpty()) {
QStringList relatedGroups = bzGroup.split('|', QString::SkipEmptyParts);
QStringList relatedGroups = bzGroup.split(QLatin1Char('|'), QString::SkipEmptyParts);
if (relatedGroups.size()>0) {
m_relatedBugzillaProducts.append(relatedGroups);
}
......
......@@ -59,7 +59,7 @@ static const char kWalletEntryName[] = "drkonqi_bugzilla";
static const char kWalletEntryUsername[] = "username";
static const char kWalletEntryPassword[] = "password";
static QString konquerorKWalletEntryName = KDE_BUGZILLA_URL + "index.cgi#login";
static QString konquerorKWalletEntryName = KDE_BUGZILLA_URL + QStringLiteral("index.cgi#login");
static const char konquerorKWalletEntryUsername[] = "Bugzilla_login";
static const char konquerorKWalletEntryPassword[] = "Bugzilla_password";
......@@ -238,11 +238,11 @@ bool BugzillaLoginPage::canSetCookies()
qDebug() << "Bugzilla software no longer issues cookies.";
return false;
}
QDBusInterface kded(QLatin1String("org.kde.kded5"),
QLatin1String("/kded"),
QLatin1String("org.kde.kded5"));
QDBusReply<bool> kcookiejarLoaded = kded.call(QLatin1String("loadModule"),
QLatin1String("kcookiejar"));
QDBusInterface kded(QStringLiteral("org.kde.kded5"),
QStringLiteral("/kded"),
QStringLiteral("org.kde.kded5"));
QDBusReply<bool> kcookiejarLoaded = kded.call(QStringLiteral("loadModule"),
QStringLiteral("kcookiejar"));
if (!kcookiejarLoaded.isValid()) {
KMessageBox::error(this, i18n("Failed to communicate with kded. Make sure it is running."));
return false;
......@@ -252,10 +252,10 @@ bool BugzillaLoginPage::canSetCookies()
}
QDBusInterface kcookiejar(QLatin1String("org.kde.kded5"),
QLatin1String("/modules/kcookiejar"),
QLatin1String("org.kde.KCookieServer"));
QDBusReply<QString> advice = kcookiejar.call(QLatin1String("getDomainAdvice"),
QDBusInterface kcookiejar(QStringLiteral("org.kde.kded5"),
QStringLiteral("/modules/kcookiejar"),
QStringLiteral("org.kde.KCookieServer"));
QDBusReply<QString> advice = kcookiejar.call(QStringLiteral("getDomainAdvice"),
KDE_BUGZILLA_URL);
if (!advice.isValid()) {
......@@ -420,50 +420,50 @@ void BugzillaInformationPage::aboutToShow()
if (DrKonqi::systemInformation()->bugzillaPlatform() == QLatin1String("unspecified")) {
m_distroComboVisible = true;
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Unspecified"),"unspecified");
"Unspecified"),QStringLiteral("unspecified"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Archlinux"), "Archlinux Packages");
"Archlinux"), QStringLiteral("Archlinux Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Chakra"), "Chakra");
"Chakra"), QStringLiteral("Chakra"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Debian stable"), "Debian stable");
"Debian stable"), QStringLiteral("Debian stable"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Debian testing"), "Debian testing");
"Debian testing"), QStringLiteral("Debian testing"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Debian unstable"), "Debian unstable");
"Debian unstable"), QStringLiteral("Debian unstable"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Exherbo"), "Exherbo Packages");
"Exherbo"), QStringLiteral("Exherbo Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Fedora"), "Fedora RPMs");
"Fedora"), QStringLiteral("Fedora RPMs"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Gentoo"), "Gentoo Packages");
"Gentoo"), QStringLiteral("Gentoo Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Mageia"), "Mageia RPMs");
"Mageia"), QStringLiteral("Mageia RPMs"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Mandriva"), "Mandriva RPMs");
"Mandriva"), QStringLiteral("Mandriva RPMs"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Neon"), "Neon Packages");
"Neon"), QStringLiteral("Neon Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"OpenSUSE"), "openSUSE RPMs");
"OpenSUSE"), QStringLiteral("openSUSE RPMs"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Pardus"), "Pardus Packages");
"Pardus"), QStringLiteral("Pardus Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"RedHat"), "RedHat RPMs");
"RedHat"), QStringLiteral("RedHat RPMs"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Slackware"), "Slackware Packages");
"Slackware"), QStringLiteral("Slackware Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Ubuntu (and derivatives)"),
"Ubuntu Packages");
QStringLiteral("Ubuntu Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"FreeBSD (Ports)"), "FreeBSD Ports");
"FreeBSD (Ports)"), QStringLiteral("FreeBSD Ports"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"NetBSD (pkgsrc)"), "NetBSD pkgsrc");
"NetBSD (pkgsrc)"), QStringLiteral("NetBSD pkgsrc"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"OpenBSD"), "OpenBSD Packages");
"OpenBSD"), QStringLiteral("OpenBSD Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Mac OS X"), "MacPorts Packages");
"Mac OS X"), QStringLiteral("MacPorts Packages"));
ui.m_distroChooserCombo->addItem(i18nc("@label:listbox KDE distribution method",
"Solaris"), "Solaris Packages");
"Solaris"), QStringLiteral("Solaris Packages"));
//Restore previously selected bugzilla platform (distribution)
KConfigGroup config(KSharedConfig::openConfig(), "BugzillaInformationPage");
......@@ -509,10 +509,10 @@ int BugzillaInformationPage::currentDescriptionCharactersCount()
description.remove(QStringLiteral("What I was doing when the application crashed"));
description.remove(QStringLiteral("Unusual behavior I noticed"));
description.remove(QStringLiteral("Custom settings of the application"));
description.remove('\n');
description.remove('-');
description.remove(':');
description.remove(' ');
description.remove(QLatin1Char('\n'));
description.remove(QLatin1Char('-'));
description.remove(QLatin1Char(':'));
description.remove(QLatin1Char(' '));
return description.size();
}
......@@ -558,7 +558,7 @@ bool BugzillaInformationPage::showNextPage()
QString message = i18nc("@info","The description about the crash details does not provide "
"enough information yet.<br /><br />");
message += ' ' + i18nc("@info","The amount of required information is proportional to "
message += QLatin1Char(' ') + i18nc("@info","The amount of required information is proportional to "
"the quality of the other information like the backtrace "
"or the reproducibility rate."
"<br /><br />");
......@@ -566,12 +566,12 @@ bool BugzillaInformationPage::showNextPage()
if (reportInterface()->userCanProvideActionsAppDesktop()
|| reportInterface()->userCanProvideUnusualBehavior()
|| reportInterface()->userCanProvideApplicationConfigDetails()) {
message += ' ' + i18nc("@info","Previously, you told DrKonqi that you could provide some "
message += QLatin1Char(' ') + i18nc("@info","Previously, you told DrKonqi that you could provide some "
"contextual information. Try writing more details about your situation. "
"(even little ones could help us.)<br /><br />");
}
message += ' ' + i18nc("@info","If you cannot provide more information, your report "
message += QLatin1Char(' ') + i18nc("@info","If you cannot provide more information, your report "
"will probably waste developers' time. Can you tell us more?");
KGuiItem yesItem = KStandardGuiItem::yes();
......@@ -636,23 +636,23 @@ void BugzillaInformationPage::showDescriptionHelpExamples()
QString descriptionHelp = i18nc("@info:tooltip help and examples of good bug descriptions",
"Describe in as much detail as possible the crash circumstances:");
if (reportInterface()->userCanProvideActionsAppDesktop()) {
descriptionHelp += "<br />" +
descriptionHelp += QStringLiteral("<br />") +
i18nc("@info:tooltip help and examples of good bug descriptions",
"- Detail which actions were you taking inside and outside the "
"application an instant before the crash.");
}
if (reportInterface()->userCanProvideUnusualBehavior()) {
descriptionHelp += "<br />" +
descriptionHelp += QStringLiteral("<br />") +
i18nc("@info:tooltip help and examples of good bug descriptions",
"- Note if you noticed any unusual behavior in the application "
"or in the whole environment.");
}
if (reportInterface()->userCanProvideApplicationConfigDetails()) {
descriptionHelp += "<br />" +
descriptionHelp += QStringLiteral("<br />") +
i18nc("@info:tooltip help and examples of good bug descriptions",
"- Note any non-default configuration in the application.");
if (reportInterface()->appDetailsExamples()->hasExamples()) {
descriptionHelp += ' ' +
descriptionHelp += QLatin1Char(' ') +
i18nc("@info:tooltip examples of configuration details. "
"the examples are already translated",
"Examples: %1",
......@@ -822,11 +822,10 @@ UnhandledErrorDialog::UnhandledErrorDialog(QWidget * parent, const QString & err
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
QVBoxLayout * layout = new QVBoxLayout();
QVBoxLayout * layout = new QVBoxLayout(this);
layout->addLayout(titleLayout);
layout->addWidget(htmlView);
layout->addWidget(buttonBox);
setLayout(layout);
m_extendedHTMLError = extendedMessage;
mainLabel->setText(i18nc("@label", "There was an unhandled Bugzilla error: %1.<br />"
......
......@@ -336,7 +336,7 @@ void BugzillaDuplicatesPage::searchFinished(const BugMapList & list)
customStatusString = i18nc("@info bug status", "[Incomplete]");
}
title = customStatusString + ' ' + bug[QStringLiteral("short_desc")];
title = customStatusString + QLatin1Char(' ') + bug[QStringLiteral("short_desc")];
QStringList fields = QStringList() << bug[QStringLiteral("bug_id")] << title;
......@@ -408,7 +408,7 @@ void BugzillaDuplicatesPage::analyzedDuplicates(KJob *j)
if (BugReport::isOpen(status) || (BugReport::isClosed(status) && status == BugReport::NeedsInfo)) {
text = (parentDuplicate == duplicate ? i18nc("@label", "Your crash is a <strong>duplicate</strong> and has already been reported as <a href=\"%1\">Bug %1</a>.", QString::number(duplicate)) :
i18nc("@label", "Your crash has already been reported as <a href=\"%1\">Bug %1</a>, which is a <strong>duplicate</strong> of <a href=\"%2\">Bug %2</a>", QString::number(duplicate), QString::number(parentDuplicate))) +
'\n' + i18nc("@label", "Only <strong><a href=\"%1\">attach</a></strong> if you can add needed information to the bug report.", QStringLiteral("attach"));
QLatin1Char('\n') + i18nc("@label", "Only <strong><a href=\"%1\">attach</a></strong> if you can add needed information to the bug report.", QStringLiteral("attach"));
} else if (BugReport::isClosed(status)) {
text = (parentDuplicate == duplicate ? i18nc("@label", "Your crash has already been reported as <a href=\"%1\">Bug %1</a> which has been <strong>closed</strong>.", QString::number(duplicate)) :
i18nc("@label", "Your crash has already been reported as <a href=\"%1\">Bug %1</a>, which is a duplicate of the <strong>closed</strong> <a href=\"%2\">Bug %2</a>.", QString::number(duplicate), QString::number(parentDuplicate)));
......@@ -694,9 +694,9 @@ void BugzillaReportInformationDialog::bugFetchFinished(BugReport report, QObject
QString comment = commentList.at(i);
//Don't add duplicates mark comments
if (!comment.contains(duplicatesMark)) {
comment.replace('\n', QLatin1String("<br />"));
comment.replace(QLatin1Char('\n'), QLatin1String("<br />"));
comments += i18nc("comment $number to use as subtitle", "<h4>Comment %1:</h4>", (i+1))
+ "<p>" + comment + "</p><hr />";
+ QStringLiteral("<p>") + comment + QStringLiteral("</p><hr />");
//Count the inline attached crashes (DrKonqi feature)
QLatin1String attachedCrashMark =
QLatin1String("New crash information added by DrKonqi");
......@@ -797,7 +797,7 @@ void BugzillaReportInformationDialog::bugFetchFinished(BugReport report, QObject
report.product(), report.component()) +
i18nc("@info bug report description",
"<h3>Description of the bug</h3><p>%1</p>",
report.description().replace('\n', QLatin1String("<br />")));
report.description().replace(QLatin1Char('\n'), QLatin1String("<br />")));
if (!comments.isEmpty()) {
text += i18nc("@label:textbox bug report comments (already formatted)",
......
......@@ -207,7 +207,7 @@ QString ReportInterface::generateReportFullText(bool drKonqiStamp) const
Q_FOREACH(const QString & dupe, m_possibleDuplicates) {
duplicatesString += QLatin1String("bug ") + dupe + QLatin1String(", ");
}
duplicatesString = duplicatesString.left(duplicatesString.length()-2) + '.';
duplicatesString = duplicatesString.left(duplicatesString.length()-2) + QLatin1Char('.');
report.append(QStringLiteral("The reporter indicates this bug may be a duplicate of or related to %1\n")
.arg(duplicatesString));
}
......@@ -221,7 +221,7 @@ QString ReportInterface::generateReportFullText(bool drKonqiStamp) const
duplicatesString += QLatin1String("bug ") + m_allPossibleDuplicatesByQuery.at(i) +
QLatin1String(", ");
}
duplicatesString = duplicatesString.left(duplicatesString.length()-2) + '.';
duplicatesString = duplicatesString.left(duplicatesString.length()-2) + QLatin1Char('.');
report.append(QStringLiteral("Possible duplicates by query: %1\n").arg(duplicatesString));
}
......
......@@ -172,12 +172,12 @@ void CrashedApplication::restart()
QString getSuggestedKCrashFilename(const CrashedApplication* app)
{
QString filename = app->fakeExecutableBaseName() + '-' +
QString filename = app->fakeExecutableBaseName() + QLatin1Char('-') +
app->datetime().toString(QStringLiteral("yyyyMMdd-hhmmss")) +
".kcrash.txt";
QStringLiteral(".kcrash.txt");
if (filename.contains('/')) {
filename = filename.mid(filename.lastIndexOf('/') + 1);
if (filename.contains(QLatin1Char('/'))) {
filename = filename.mid(filename.lastIndexOf(QLatin1Char('/')) + 1);
}
return filename;
......
......@@ -67,7 +67,7 @@ QString Debugger::tryExec() const
QStringList Debugger::supportedBackends() const
{
return isValid() ? m_config->group("General").readEntry("Backends")
.split('|', QString::SkipEmptyParts) : QStringList();
.split(QLatin1Char('|'), QString::SkipEmptyParts) : QStringList();
}
void Debugger::setUsedBackend(const QString & backendName)
......@@ -134,7 +134,7 @@ QList<Debugger> Debugger::availableDebuggers(const QString & path, const QString
QList<Debugger> result;
foreach (const QString & debuggerFile, debuggers) {
Debugger debugger;
debugger.m_config = KSharedConfig::openConfig(debuggerDir +'/'+ debuggerFile);
debugger.m_config = KSharedConfig::openConfig(debuggerDir +QLatin1Char('/')+ debuggerFile);
if (debugger.supportedBackends().contains(backend)) {
debugger.setUsedBackend(backend);
result.append(debugger);
......
......@@ -32,7 +32,7 @@
DebugPackageInstaller::DebugPackageInstaller(QObject *parent)
: QObject(parent), m_installerProcess(nullptr), m_progressDialog(nullptr)
{
m_executablePath = QStandardPaths::findExecutable(DEBUG_PACKAGE_INSTALLER_NAME); //defined from CMakeLists.txt
m_executablePath = QStandardPaths::findExecutable(QString::fromLatin1(DEBUG_PACKAGE_INSTALLER_NAME)); //defined from CMakeLists.txt
}
bool DebugPackageInstaller::canInstallDebugPackages() const
......
......@@ -113,8 +113,8 @@ CrashedApplication *KCrashBackend::constructCrashedApplication()
CrashedApplication *a = new CrashedApplication(this);
a->m_datetime = QDateTime::currentDateTime();
a->m_name = DrKonqi::programName();
a->m_version = DrKonqi::appVersion().toUtf8();
a->m_reportAddress = BugReportAddress(DrKonqi::bugAddress().toUtf8());
a->m_version = DrKonqi::appVersion();
a->m_reportAddress = BugReportAddress(DrKonqi::bugAddress());
a->m_pid = DrKonqi::pid();
a->m_signalNumber = DrKonqi::signal();
a->m_restarted = DrKonqi::isRestarted();
......
......@@ -28,7 +28,7 @@ GdbHighlighter::GdbHighlighter(QTextDocument* parent, const QList<BacktraceLine>
int l = 0;
foreach(const BacktraceLine& line, gdbLines) {
lines.insert(l, line);
l += line.toString().count('\n');
l += line.toString().count(QLatin1Char('\n'));
}
// setup formates
......@@ -54,7 +54,7 @@ void GdbHighlighter::highlightBlock(const QString& text)
const QRegExp hexptrPattern(QStringLiteral("0x[0-9a-f]+"), Qt::CaseSensitive, QRegExp::RegExp2);
int lineNr = currentBlock().firstLineNumber();
while ( cur < text.length() ) {
next = text.indexOf('\n', cur);
next = text.indexOf(QLatin1Char('\n'), cur);
if (next == -1) {
next = text.length();
}
......@@ -67,7 +67,7 @@ void GdbHighlighter::highlightBlock(const QString& text)
diff = next - cur;
QString lineStr = text.mid(cur, diff).append('\n');
QString lineStr = text.mid(cur, diff).append(QLatin1Char('\n'));
// -1 since we skip the first line
QMap< int, BacktraceLine >::iterator it = lines.lowerBound(lineNr - 1);
Q_ASSERT(it != lines.end());
......@@ -85,7 +85,7 @@ void GdbHighlighter::highlightBlock(const QString& text)
setFormat(cur, diff, crapFormat);
} else if (line.type() == BacktraceLine::StackFrame) {
if (!line.fileName().isEmpty()) {
int colonPos = line.fileName().lastIndexOf(':');
int colonPos = line.fileName().lastIndexOf(QLatin1Char(':'));
setFormat(lineStr.indexOf(line.fileName()), colonPos == -1 ? line.fileName().length() : colonPos, urlFormat);
}
if (!line.libraryName().isEmpty()) {
......@@ -99,13 +99,13 @@ void GdbHighlighter::highlightBlock(const QString& text)
int i = idx;
int from = idx;
while (i < idx + line.functionName().length()) {
if (lineStr.at(i) == ':') {
if (lineStr.at(i) == QLatin1Char(':')) {
setFormat(from, i - from, otheridFormat);
// skip ::
i += 2;
from = i;
continue;
} else if (lineStr.at(i) == '<' || lineStr.at(i) == '>') {
} else if (lineStr.at(i) == QLatin1Char('<') || lineStr.at(i) == QLatin1Char('>')) {
setFormat(from, i - from, otheridFormat);
++i;
from = i;
......
......@@ -59,7 +59,7 @@ int main(int argc, char* argv[])
qa.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
KLocalizedString::setApplicationDomain("drkonqi5");
QCoreApplication::setApplicationName(QStringLiteral("drkonqi"));
QCoreApplication::setApplicationVersion(version);
QCoreApplication::setApplicationVersion(QString::fromLatin1(version));
QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org"));
// Prevent KApplication from setting the crash handler. We will set it later...
......@@ -68,9 +68,9 @@ int main(int argc, char* argv[])
unsetenv("SESSION_MANAGER");
KAboutData aboutData(QStringLiteral("drkonqi"), i18n("The KDE Crash Handler"),
version, i18n(description),
QString::fromLatin1(version), i18n(description),
KAboutLicense::GPL,
i18n("(C) 2000-2009, The DrKonqi Authors"));
i18n("(C) 2000-2018, The DrKonqi Authors"));
aboutData.addAuthor(i18nc("@info:credit","Hans Petter Bieker"), QString(),
QStringLiteral("bieker@kde.org"));
aboutData.addAuthor(i18nc("@info:credit","Dario Andres Rodriguez"), QString(),
......
......@@ -50,8 +50,7 @@ QString BacktraceParser::parsedBacktrace() const
QString result;
if (d) {
QList<BacktraceLine>::const_iterator i;
for (i = d->m_linesList.constBegin(); i != d->m_linesList.constEnd(); ++i) {
for (QList<BacktraceLine>::const_iterator i = d->m_linesList.constBegin(), total = d->m_linesList.constEnd(); i != total; ++i) {
result += i->toString();
}