Debugger: Strip QLatin1* where possible

Change-Id: Idcab23875b5dc2ecf55e3303f417b995e2252720
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2018-10-07 22:38:47 +03:00
committed by Orgad Shaneh
parent d0d6f99491
commit 147a3c27c4
55 changed files with 491 additions and 494 deletions

View File

@@ -46,7 +46,7 @@ static void moveCursorToEndOfName(QTextCursor *tc)
return; return;
QChar ch = doc->characterAt(tc->position()); QChar ch = doc->characterAt(tc->position());
while (ch.isLetterOrNumber() || ch == QLatin1Char('_')) { while (ch.isLetterOrNumber() || ch == '_') {
tc->movePosition(QTextCursor::NextCharacter); tc->movePosition(QTextCursor::NextCharacter);
ch = doc->characterAt(tc->position()); ch = doc->characterAt(tc->position());
} }

View File

@@ -86,12 +86,12 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
verticalLayout->addWidget(d->buttonBox); verticalLayout->addWidget(d->buttonBox);
QSettings *settings = Core::ICore::settings(); QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog")); settings->beginGroup("AnalyzerStartRemoteDialog");
d->kitChooser->populate(); d->kitChooser->populate();
d->kitChooser->setCurrentKitId(Core::Id::fromSetting(settings->value(QLatin1String("profile")))); d->kitChooser->setCurrentKitId(Core::Id::fromSetting(settings->value("profile")));
d->executable->setText(settings->value(QLatin1String("executable")).toString()); d->executable->setText(settings->value("executable").toString());
d->workingDirectory->setText(settings->value(QLatin1String("workingDirectory")).toString()); d->workingDirectory->setText(settings->value("workingDirectory").toString());
d->arguments->setText(settings->value(QLatin1String("arguments")).toString()); d->arguments->setText(settings->value("arguments").toString());
settings->endGroup(); settings->endGroup();
connect(d->kitChooser, &KitChooser::activated, this, &StartRemoteDialog::validate); connect(d->kitChooser, &KitChooser::activated, this, &StartRemoteDialog::validate);
@@ -112,11 +112,11 @@ StartRemoteDialog::~StartRemoteDialog()
void StartRemoteDialog::accept() void StartRemoteDialog::accept()
{ {
QSettings *settings = Core::ICore::settings(); QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog")); settings->beginGroup("AnalyzerStartRemoteDialog");
settings->setValue(QLatin1String("profile"), d->kitChooser->currentKitId().toString()); settings->setValue("profile", d->kitChooser->currentKitId().toString());
settings->setValue(QLatin1String("executable"), d->executable->text()); settings->setValue("executable", d->executable->text());
settings->setValue(QLatin1String("workingDirectory"), d->workingDirectory->text()); settings->setValue("workingDirectory", d->workingDirectory->text());
settings->setValue(QLatin1String("arguments"), d->arguments->text()); settings->setValue("arguments", d->arguments->text());
settings->endGroup(); settings->endGroup();
QDialog::accept(); QDialog::accept();

View File

@@ -403,7 +403,7 @@ BreakpointDialog::BreakpointDialog(unsigned int enabledParts, QWidget *parent)
m_labelType->setBuddy(m_comboBoxType); m_labelType->setBuddy(m_comboBoxType);
m_pathChooserFileName = new PathChooser(groupBoxBasic); m_pathChooserFileName = new PathChooser(groupBoxBasic);
m_pathChooserFileName->setHistoryCompleter(QLatin1String("Debugger.Breakpoint.File.History")); m_pathChooserFileName->setHistoryCompleter("Debugger.Breakpoint.File.History");
m_pathChooserFileName->setExpectedKind(PathChooser::File); m_pathChooserFileName->setExpectedKind(PathChooser::File);
m_labelFileName = new QLabel(tr("&File name:"), groupBoxBasic); m_labelFileName = new QLabel(tr("&File name:"), groupBoxBasic);
m_labelFileName->setBuddy(m_pathChooserFileName); m_labelFileName->setBuddy(m_pathChooserFileName);
@@ -1028,7 +1028,7 @@ int BreakHandler::threadSpecFromDisplay(const QString &str)
return ok ? result : -1; return ok ? result : -1;
} }
const QString empty(QLatin1Char('-')); const QString empty("-");
QVariant BreakpointItem::data(int column, int role) const QVariant BreakpointItem::data(int column, int role) const
{ {

View File

@@ -311,7 +311,7 @@ static QStringList mergeEnvironment(QStringList runConfigEnvironment,
// We do not assume someone sets _NT_DEBUGGER_EXTENSION_PATH in the run // We do not assume someone sets _NT_DEBUGGER_EXTENSION_PATH in the run
// config, just to make sure, delete any existing entries // config, just to make sure, delete any existing entries
const QString cdbExtensionPathVariableAssign = const QString cdbExtensionPathVariableAssign =
QLatin1String(cdbExtensionPathVariableC) + QLatin1Char('='); QLatin1String(cdbExtensionPathVariableC) + '=';
for (QStringList::iterator it = runConfigEnvironment.begin(); it != runConfigEnvironment.end() ; ) { for (QStringList::iterator it = runConfigEnvironment.begin(); it != runConfigEnvironment.end() ; ) {
if (it->startsWith(cdbExtensionPathVariableAssign)) { if (it->startsWith(cdbExtensionPathVariableAssign)) {
it = runConfigEnvironment.erase(it); it = runConfigEnvironment.erase(it);
@@ -485,7 +485,7 @@ void CdbEngine::setupEngine()
// Make sure that QTestLib uses OutputDebugString for logging. // Make sure that QTestLib uses OutputDebugString for logging.
const QString qtLoggingToConsoleKey = QStringLiteral("QT_LOGGING_TO_CONSOLE"); const QString qtLoggingToConsoleKey = QStringLiteral("QT_LOGGING_TO_CONSOLE");
if (!sp.useTerminal && !inferiorEnvironment.hasKey(qtLoggingToConsoleKey)) if (!sp.useTerminal && !inferiorEnvironment.hasKey(qtLoggingToConsoleKey))
inferiorEnvironment.set(qtLoggingToConsoleKey, QString(QLatin1Char('0'))); inferiorEnvironment.set(qtLoggingToConsoleKey, "0");
m_process.setEnvironment(mergeEnvironment(inferiorEnvironment.toStringList(), m_process.setEnvironment(mergeEnvironment(inferiorEnvironment.toStringList(),
extensionFi.absolutePath())); extensionFi.absolutePath()));
@@ -1969,7 +1969,7 @@ void CdbEngine::ensureUsing32BitStackInWow64(const DebuggerResponse &response, c
{ {
// Parsing the header of the stack output to check which bitness // Parsing the header of the stack output to check which bitness
// the cdb is currently using. // the cdb is currently using.
foreach (const QStringRef &line, response.data.data().splitRef(QLatin1Char('\n'))) { foreach (const QStringRef &line, response.data.data().splitRef('\n')) {
if (!line.startsWith("Child")) if (!line.startsWith("Child"))
continue; continue;
if (line.startsWith("ChildEBP")) { if (line.startsWith("ChildEBP")) {
@@ -2344,9 +2344,9 @@ void CdbEngine::parseOutputLine(QString line)
// for some incomprehensible reasons Microsoft cdb version 6.2 is newer than 6.12 // for some incomprehensible reasons Microsoft cdb version 6.2 is newer than 6.12
m_autoBreakPointCorrection = major > 6 || (major == 6 && minor >= 2 && minor < 10); m_autoBreakPointCorrection = major > 6 || (major == 6 && minor >= 2 && minor < 10);
showMessage(line, LogMisc); showMessage(line, LogMisc);
showMessage(QString::fromLatin1("Using ") showMessage("Using "
+ QLatin1String(m_autoBreakPointCorrection ? "CDB " : "codemodel ") + QLatin1String(m_autoBreakPointCorrection ? "CDB " : "codemodel ")
+ QString::fromLatin1("based breakpoint correction."), LogMisc); + "based breakpoint correction.", LogMisc);
} }
} }
} else if (line.startsWith("ModLoad: ")) { } else if (line.startsWith("ModLoad: ")) {
@@ -2736,8 +2736,8 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
} }
const QString &verOutput = data.childAt(0).data(); const QString &verOutput = data.childAt(0).data();
const QString firstToken = verOutput.split(QLatin1Char(' ')).constFirst(); const QString firstToken = verOutput.split(' ').constFirst();
const QVector<QStringRef> pythonVersion = firstToken.splitRef(QLatin1Char('.')); const QVector<QStringRef> pythonVersion = firstToken.splitRef('.');
bool ok = false; bool ok = false;
if (pythonVersion.size() == 3) { if (pythonVersion.size() == 3) {

View File

@@ -145,7 +145,7 @@ QStringList CdbBreakEventWidget::breakEvents() const
const QString filter = filterText(e); const QString filter = filterText(e);
QString s = QLatin1String(eventDescriptions[e].abbreviation); QString s = QLatin1String(eventDescriptions[e].abbreviation);
if (!filter.isEmpty()) { if (!filter.isEmpty()) {
s += QLatin1Char(':'); s += ':';
s += filter; s += filter;
} }
rc.push_back(s); rc.push_back(s);

View File

@@ -66,7 +66,7 @@ QString cdbSourcePathMapping(QString fileName,
// Map parts of the path and ensure a slash follows. // Map parts of the path and ensure a slash follows.
if (fileName.size() > sourceSize && fileName.startsWith(source, Qt::CaseInsensitive)) { if (fileName.size() > sourceSize && fileName.startsWith(source, Qt::CaseInsensitive)) {
const QChar next = fileName.at(sourceSize); const QChar next = fileName.at(sourceSize);
if (next == QLatin1Char('\\') || next == QLatin1Char('/')) { if (next == '\\' || next == '/') {
const QString &target = mode == DebuggerToSource ? m.second: m.first; const QString &target = mode == DebuggerToSource ? m.second: m.first;
fileName.replace(0, sourceSize, target); fileName.replace(0, sourceSize, target);
return fileName; return fileName;
@@ -105,23 +105,23 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
break; break;
case BreakpointAtExec: { // Emulate by breaking on CreateProcessW(). case BreakpointAtExec: { // Emulate by breaking on CreateProcessW().
BreakpointParameters rc(BreakpointByFunction); BreakpointParameters rc(BreakpointByFunction);
rc.module = QLatin1String("kernel32"); rc.module = "kernel32";
rc.functionName = QLatin1String("CreateProcessW"); rc.functionName = "CreateProcessW";
return rc; return rc;
} }
case BreakpointAtThrow: { case BreakpointAtThrow: {
BreakpointParameters rc(BreakpointByFunction); BreakpointParameters rc(BreakpointByFunction);
rc.functionName = QLatin1String("CxxThrowException"); // MSVC runtime. Potentially ambiguous. rc.functionName = "CxxThrowException"; // MSVC runtime. Potentially ambiguous.
return rc; return rc;
} }
case BreakpointAtCatch: { case BreakpointAtCatch: {
BreakpointParameters rc(BreakpointByFunction); BreakpointParameters rc(BreakpointByFunction);
rc.functionName = QLatin1String("__CxxCallCatchBlock"); // MSVC runtime. Potentially ambiguous. rc.functionName = "__CxxCallCatchBlock"; // MSVC runtime. Potentially ambiguous.
return rc; return rc;
} }
case BreakpointAtMain: { case BreakpointAtMain: {
BreakpointParameters rc(BreakpointByFunction); BreakpointParameters rc(BreakpointByFunction);
rc.functionName = QLatin1String("main"); rc.functionName = "main";
return rc; return rc;
} }
} // switch } // switch
@@ -413,12 +413,12 @@ bool parseCdbDisassemblerFunctionLine(const QString &l,
QString *currentFunction, quint64 *functionOffset, QString *currentFunction, quint64 *functionOffset,
QString *sourceFile) QString *sourceFile)
{ {
if (l.isEmpty() || !l.endsWith(QLatin1Char(':')) || l.at(0).isDigit() || l.at(0).isSpace()) if (l.isEmpty() || !l.endsWith(':') || l.at(0).isDigit() || l.at(0).isSpace())
return false; return false;
int functionEnd = l.indexOf(QLatin1Char(' ')); int functionEnd = l.indexOf(' ');
if (functionEnd < 0) if (functionEnd < 0)
functionEnd = l.size() - 1; // Nothing at all, just ':' functionEnd = l.size() - 1; // Nothing at all, just ':'
const int offsetPos = l.indexOf(QLatin1String("+0x")); const int offsetPos = l.indexOf("+0x");
if (offsetPos > 0) { if (offsetPos > 0) {
*currentFunction = l.left(offsetPos); *currentFunction = l.left(offsetPos);
*functionOffset = l.mid(offsetPos + 3, functionEnd - offsetPos - 3).trimmed().toULongLong(nullptr, 16); *functionOffset = l.mid(offsetPos + 3, functionEnd - offsetPos - 3).trimmed().toULongLong(nullptr, 16);
@@ -428,10 +428,10 @@ bool parseCdbDisassemblerFunctionLine(const QString &l,
} }
sourceFile->clear(); sourceFile->clear();
// Parse file and line. // Parse file and line.
const int filePos = l.indexOf(QLatin1Char('['), functionEnd); const int filePos = l.indexOf('[', functionEnd);
if (filePos == -1) if (filePos == -1)
return true; // No file return true; // No file
const int linePos = l.indexOf(QLatin1String(" @ "), filePos + 1); const int linePos = l.indexOf(" @ ", filePos + 1);
if (linePos == -1) if (linePos == -1)
return false; return false;
*sourceFile = l.mid(filePos + 1, linePos - filePos - 1).trimmed(); *sourceFile = l.mid(filePos + 1, linePos - filePos - 1).trimmed();
@@ -454,7 +454,7 @@ bool parseCdbDisassemblerLine(const QString &line, DisassemblerLine *dLine, uint
*sourceLine = 0; *sourceLine = 0;
if (line.size() < 6) if (line.size() < 6)
return false; return false;
const QChar blank = QLatin1Char(' '); const QChar blank = ' ';
int addressPos = 0; int addressPos = 0;
// Check for joined source and address in 6.11 // Check for joined source and address in 6.11
const bool hasV611SourceLine = line.at(5).isDigit(); const bool hasV611SourceLine = line.at(5).isDigit();
@@ -488,7 +488,7 @@ bool parseCdbDisassemblerLine(const QString &line, DisassemblerLine *dLine, uint
const int instructionPos = rawDataEnd + 1; const int instructionPos = rawDataEnd + 1;
bool ok; bool ok;
QString addressS = line.mid(addressPos, addressEnd - addressPos); QString addressS = line.mid(addressPos, addressEnd - addressPos);
if (addressS.size() > 9 && addressS.at(8) == QLatin1Char('`')) if (addressS.size() > 9 && addressS.at(8) == '`')
addressS.remove(8, 1); addressS.remove(8, 1);
dLine->address = addressS.toULongLong(&ok, 16); dLine->address = addressS.toULongLong(&ok, 16);
if (!ok) if (!ok)

View File

@@ -80,7 +80,7 @@ void CommonOptionsPage::apply()
SourcePathMap allPathMap = m_sourceMappingWidget->sourcePathMap(); SourcePathMap allPathMap = m_sourceMappingWidget->sourcePathMap();
for (auto it = allPathMap.begin(), end = allPathMap.end(); it != end; ++it) { for (auto it = allPathMap.begin(), end = allPathMap.end(); it != end; ++it) {
const QString key = it.key(); const QString key = it.key();
if (key.startsWith(QLatin1Char('('))) if (key.startsWith('('))
newOptions.sourcePathRegExpMap.append(qMakePair(QRegExp(key), it.value())); newOptions.sourcePathRegExpMap.append(qMakePair(QRegExp(key), it.value()));
else else
newOptions.sourcePathMap.insert(key, it.value()); newOptions.sourcePathMap.insert(key, it.value());
@@ -118,7 +118,7 @@ QWidget *CommonOptionsPage::widget()
checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging")); checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging"));
QString t = tr("Stopping and stepping in the debugger " QString t = tr("Stopping and stepping in the debugger "
"will automatically open views associated with the current location.") + QLatin1Char('\n'); "will automatically open views associated with the current location.") + '\n';
auto checkBoxCloseSourceBuffersOnExit = new QCheckBox(behaviorBox); auto checkBoxCloseSourceBuffersOnExit = new QCheckBox(behaviorBox);
checkBoxCloseSourceBuffersOnExit->setText(tr("Close temporary source views on debugger exit")); checkBoxCloseSourceBuffersOnExit->setText(tr("Close temporary source views on debugger exit"));
checkBoxCloseSourceBuffersOnExit->setToolTip(t + tr("Closes automatically opened source views when the debugger exits.")); checkBoxCloseSourceBuffersOnExit->setToolTip(t + tr("Closes automatically opened source views when the debugger exits."));
@@ -263,13 +263,13 @@ QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function)
QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function, QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function,
const QString &hint) const QString &hint)
{ {
QString result = QLatin1String("<html><head/><body>"); QString result = "<html><head/><body>";
result += tr("Always adds a breakpoint on the <i>%1()</i> function.").arg(QLatin1String(function)); result += tr("Always adds a breakpoint on the <i>%1()</i> function.").arg(QLatin1String(function));
if (!hint.isEmpty()) { if (!hint.isEmpty()) {
result += QLatin1String("<br>"); result += "<br>";
result += hint; result += hint;
} }
result += QLatin1String("</body></html>"); result += "</body></html>";
return result; return result;
} }
@@ -311,11 +311,11 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
auto label = new QLabel(debuggingHelperGroupBox); auto label = new QLabel(debuggingHelperGroupBox);
label->setTextFormat(Qt::AutoText); label->setTextFormat(Qt::AutoText);
label->setWordWrap(true); label->setWordWrap(true);
label->setText(QLatin1String("<html><head/><body>\n<p>") label->setText("<html><head/><body>\n<p>"
+ tr("The debugging helpers are used to produce a nice " + tr("The debugging helpers are used to produce a nice "
"display of objects of certain types like QString or " "display of objects of certain types like QString or "
"std::map in the &quot;Locals and Expressions&quot; view.") "std::map in the &quot;Locals and Expressions&quot; view.")
+ QLatin1String("</p></body></html>")); + "</p></body></html>");
auto groupBoxCustomDumperCommands = new QGroupBox(debuggingHelperGroupBox); auto groupBoxCustomDumperCommands = new QGroupBox(debuggingHelperGroupBox);
groupBoxCustomDumperCommands->setTitle(tr("Debugging Helper Customization")); groupBoxCustomDumperCommands->setTitle(tr("Debugging Helper Customization"));

View File

@@ -104,7 +104,7 @@ Console::Console()
m_showDebugButtonAction = new Utils::SavedAction(this); m_showDebugButtonAction = new Utils::SavedAction(this);
m_showDebugButtonAction->setDefaultValue(true); m_showDebugButtonAction->setDefaultValue(true);
m_showDebugButtonAction->setSettingsKey(QLatin1String(CONSOLE), QLatin1String(SHOW_LOG)); m_showDebugButtonAction->setSettingsKey(CONSOLE, SHOW_LOG);
m_showDebugButtonAction->setToolTip(tr("Show debug, log, and info messages.")); m_showDebugButtonAction->setToolTip(tr("Show debug, log, and info messages."));
m_showDebugButtonAction->setCheckable(true); m_showDebugButtonAction->setCheckable(true);
m_showDebugButtonAction->setChecked(true); m_showDebugButtonAction->setChecked(true);
@@ -118,7 +118,7 @@ Console::Console()
m_showWarningButtonAction = new Utils::SavedAction(this); m_showWarningButtonAction = new Utils::SavedAction(this);
m_showWarningButtonAction->setDefaultValue(true); m_showWarningButtonAction->setDefaultValue(true);
m_showWarningButtonAction->setSettingsKey(QLatin1String(CONSOLE), QLatin1String(SHOW_WARNING)); m_showWarningButtonAction->setSettingsKey(CONSOLE, SHOW_WARNING);
m_showWarningButtonAction->setToolTip(tr("Show warning messages.")); m_showWarningButtonAction->setToolTip(tr("Show warning messages."));
m_showWarningButtonAction->setCheckable(true); m_showWarningButtonAction->setCheckable(true);
m_showWarningButtonAction->setChecked(true); m_showWarningButtonAction->setChecked(true);
@@ -132,7 +132,7 @@ Console::Console()
m_showErrorButtonAction = new Utils::SavedAction(this); m_showErrorButtonAction = new Utils::SavedAction(this);
m_showErrorButtonAction->setDefaultValue(true); m_showErrorButtonAction->setDefaultValue(true);
m_showErrorButtonAction->setSettingsKey(QLatin1String(CONSOLE), QLatin1String(SHOW_ERROR)); m_showErrorButtonAction->setSettingsKey(CONSOLE, SHOW_ERROR);
m_showErrorButtonAction->setToolTip(tr("Show error messages.")); m_showErrorButtonAction->setToolTip(tr("Show error messages."));
m_showErrorButtonAction->setCheckable(true); m_showErrorButtonAction->setCheckable(true);
m_showErrorButtonAction->setChecked(true); m_showErrorButtonAction->setChecked(true);

View File

@@ -56,7 +56,7 @@ ConsoleItemDelegate::ConsoleItemDelegate(ConsoleItemModel *model, QObject *paren
m_errorIcon(Utils::Icons::CRITICAL.icon()), m_errorIcon(Utils::Icons::CRITICAL.icon()),
m_expandIcon(Utils::Icons::EXPAND.icon()), m_expandIcon(Utils::Icons::EXPAND.icon()),
m_collapseIcon(Utils::Icons::COLLAPSE.icon()), m_collapseIcon(Utils::Icons::COLLAPSE.icon()),
m_prompt(Utils::Icon({{QLatin1String(":/utils/images/next.png"), m_prompt(Utils::Icon({{":/utils/images/next.png",
Utils::Theme::TextColorNormal}}, Utils::Icon::Tint).icon()) Utils::Theme::TextColorNormal}}, Utils::Icon::Tint).icon())
{ {
} }
@@ -183,7 +183,7 @@ void ConsoleItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
if (!file.isEmpty()) { if (!file.isEmpty()) {
QFontMetrics fm(option.font); QFontMetrics fm(option.font);
// Paint FileArea // Paint FileArea
const int pos = file.lastIndexOf(QLatin1Char('/')); const int pos = file.lastIndexOf('/');
if (pos != -1) if (pos != -1)
file = file.mid(pos +1); file = file.mid(pos +1);
const int realFileWidth = fm.width(file); const int realFileWidth = fm.width(file);
@@ -269,11 +269,11 @@ QWidget *ConsoleItemDelegate::createEditor(QWidget *parent,
{ {
auto editor = new ConsoleEdit(index, parent); auto editor = new ConsoleEdit(index, parent);
// Make the background transparent so that the prompt shines through // Make the background transparent so that the prompt shines through
editor->setStyleSheet(QLatin1String("QTextEdit {" editor->setStyleSheet("QTextEdit {"
"margin-left: 24px;" "margin-left: 24px;"
"margin-top: 4px;" "margin-top: 4px;"
"background-color: transparent;" "background-color: transparent;"
"}")); "}");
connect(editor, &ConsoleEdit::editingFinished, this, [this, editor] { connect(editor, &ConsoleEdit::editingFinished, this, [this, editor] {
auto delegate = const_cast<ConsoleItemDelegate*>(this); auto delegate = const_cast<ConsoleItemDelegate*>(this);
emit delegate->commitData(editor); emit delegate->commitData(editor);

View File

@@ -87,7 +87,7 @@ int ConsoleItemModel::sizeOfFile(const QFont &font)
if (lastReadOnlyRow < 0) if (lastReadOnlyRow < 0)
return 0; return 0;
QString filename = static_cast<ConsoleItem *>(rootItem()->childAt(lastReadOnlyRow))->file(); QString filename = static_cast<ConsoleItem *>(rootItem()->childAt(lastReadOnlyRow))->file();
const int pos = filename.lastIndexOf(QLatin1Char('/')); const int pos = filename.lastIndexOf('/');
if (pos != -1) if (pos != -1)
filename = filename.mid(pos + 1); filename = filename.mid(pos + 1);
@@ -100,7 +100,7 @@ int ConsoleItemModel::sizeOfFile(const QFont &font)
int ConsoleItemModel::sizeOfLineNumber(const QFont &font) int ConsoleItemModel::sizeOfLineNumber(const QFont &font)
{ {
QFontMetrics fm(font); QFontMetrics fm(font);
return fm.width(QLatin1String("88888")); return fm.width("88888");
} }
} // Internal } // Internal

View File

@@ -84,30 +84,30 @@ ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) :
setHeaderHidden(true); setHeaderHidden(true);
setRootIsDecorated(false); setRootIsDecorated(false);
setEditTriggers(QAbstractItemView::AllEditTriggers); setEditTriggers(QAbstractItemView::AllEditTriggers);
setStyleSheet(QLatin1String("QTreeView::branch:has-siblings:!adjoins-item {" setStyleSheet("QTreeView::branch:has-siblings:!adjoins-item {"
"border-image: none;" "border-image: none;"
"image: none; }" "image: none; }"
"QTreeView::branch:has-siblings:adjoins-item {" "QTreeView::branch:has-siblings:adjoins-item {"
"border-image: none;" "border-image: none;"
"image: none; }" "image: none; }"
"QTreeView::branch:!has-children:!has-siblings:adjoins-item {" "QTreeView::branch:!has-children:!has-siblings:adjoins-item {"
"border-image: none;" "border-image: none;"
"image: none; }" "image: none; }"
"QTreeView::branch:has-children:!has-siblings:closed," "QTreeView::branch:has-children:!has-siblings:closed,"
"QTreeView::branch:closed:has-children:has-siblings {" "QTreeView::branch:closed:has-children:has-siblings {"
"border-image: none;" "border-image: none;"
"image: none; }" "image: none; }"
"QTreeView::branch:open:has-children:!has-siblings," "QTreeView::branch:open:has-children:!has-siblings,"
"QTreeView::branch:open:has-children:has-siblings {" "QTreeView::branch:open:has-children:has-siblings {"
"border-image: none;" "border-image: none;"
"image: none; }")); "image: none; }");
QString baseName = QApplication::style()->objectName(); QString baseName = QApplication::style()->objectName();
if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost() if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost()
&& baseName == QLatin1String("windows")) { && baseName == "windows") {
// Sometimes we get the standard windows 95 style as a fallback // Sometimes we get the standard windows 95 style as a fallback
if (QStyleFactory::keys().contains(QLatin1String("Fusion"))) { if (QStyleFactory::keys().contains("Fusion")) {
baseName = QLatin1String("fusion"); // Qt5 baseName = "fusion"; // Qt5
} }
} }
auto style = new ConsoleViewStyle(baseName); auto style = new ConsoleViewStyle(baseName);

View File

@@ -52,10 +52,10 @@ namespace Internal {
void GlobalDebuggerOptions::toSettings() const void GlobalDebuggerOptions::toSettings() const
{ {
QSettings *s = Core::ICore::settings(); QSettings *s = Core::ICore::settings();
s->beginWriteArray(QLatin1String(sourcePathMappingArrayNameC)); s->beginWriteArray(sourcePathMappingArrayNameC);
if (!sourcePathMap.isEmpty() || !sourcePathRegExpMap.isEmpty()) { if (!sourcePathMap.isEmpty() || !sourcePathRegExpMap.isEmpty()) {
const QString sourcePathMappingSourceKey = QLatin1String(sourcePathMappingSourceKeyC); const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC);
const QString sourcePathMappingTargetKey = QLatin1String(sourcePathMappingTargetKeyC); const QString sourcePathMappingTargetKey(sourcePathMappingTargetKeyC);
int i = 0; int i = 0;
for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd();
it != cend; it != cend;
@@ -79,14 +79,14 @@ void GlobalDebuggerOptions::fromSettings()
{ {
QSettings *s = Core::ICore::settings(); QSettings *s = Core::ICore::settings();
sourcePathMap.clear(); sourcePathMap.clear();
if (const int count = s->beginReadArray(QLatin1String(sourcePathMappingArrayNameC))) { if (const int count = s->beginReadArray(sourcePathMappingArrayNameC)) {
const QString sourcePathMappingSourceKey = QLatin1String(sourcePathMappingSourceKeyC); const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC);
const QString sourcePathMappingTargetKey = QLatin1String(sourcePathMappingTargetKeyC); const QString sourcePathMappingTargetKey(sourcePathMappingTargetKeyC);
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
s->setArrayIndex(i); s->setArrayIndex(i);
const QString key = s->value(sourcePathMappingSourceKey).toString(); const QString key = s->value(sourcePathMappingSourceKey).toString();
const QString value = s->value(sourcePathMappingTargetKey).toString(); const QString value = s->value(sourcePathMappingTargetKey).toString();
if (key.startsWith(QLatin1Char('('))) if (key.startsWith('('))
sourcePathRegExpMap.append(qMakePair(QRegExp(key), value)); sourcePathRegExpMap.append(qMakePair(QRegExp(key), value));
else else
sourcePathMap.insert(key, value); sourcePathMap.insert(key, value);
@@ -107,8 +107,8 @@ DebuggerSettings::DebuggerSettings()
{ {
theDebuggerSettings = this; theDebuggerSettings = this;
const QString debugModeGroup = QLatin1String(debugModeSettingsGroupC); const QString debugModeGroup(debugModeSettingsGroupC);
const QString cdbSettingsGroup = QLatin1String(cdbSettingsGroupC); const QString cdbSettingsGroup(cdbSettingsGroupC);
SavedAction *item = nullptr; SavedAction *item = nullptr;
@@ -124,35 +124,34 @@ DebuggerSettings::DebuggerSettings()
item->setCheckable(true); item->setCheckable(true);
item->setValue(true); item->setValue(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setSettingsKey(debugModeGroup, item->setSettingsKey(debugModeGroup, "AlwaysAdjustColumnWidths");
QLatin1String("AlwaysAdjustColumnWidths"));
insertItem(AlwaysAdjustColumnWidths, item); insertItem(AlwaysAdjustColumnWidths, item);
// Needed by QML Inspector // Needed by QML Inspector
item = new SavedAction(this); item = new SavedAction(this);
item->setText(tr("Use Alternating Row Colors")); item->setText(tr("Use Alternating Row Colors"));
item->setSettingsKey(debugModeGroup, QLatin1String("UseAlternatingRowColours")); item->setSettingsKey(debugModeGroup, "UseAlternatingRowColours");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(UseAlternatingRowColors, item); insertItem(UseAlternatingRowColors, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setText(tr("Keep Editor Stationary When Stepping")); item->setText(tr("Keep Editor Stationary When Stepping"));
item->setSettingsKey(debugModeGroup, QLatin1String("StationaryEditorWhileStepping")); item->setSettingsKey(debugModeGroup, "StationaryEditorWhileStepping");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(StationaryEditorWhileStepping, item); insertItem(StationaryEditorWhileStepping, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setText(tr("Debugger Font Size Follows Main Editor")); item->setText(tr("Debugger Font Size Follows Main Editor"));
item->setSettingsKey(debugModeGroup, QLatin1String("FontSizeFollowsEditor")); item->setSettingsKey(debugModeGroup, "FontSizeFollowsEditor");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(FontSizeFollowsEditor, item); insertItem(FontSizeFollowsEditor, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setText(tr("Show a Message Box When Receiving a Signal")); item->setText(tr("Show a Message Box When Receiving a Signal"));
item->setSettingsKey(debugModeGroup, QLatin1String("UseMessageBoxForSignals")); item->setSettingsKey(debugModeGroup, "UseMessageBoxForSignals");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setValue(true); item->setValue(true);
@@ -160,7 +159,7 @@ DebuggerSettings::DebuggerSettings()
item = new SavedAction(this); item = new SavedAction(this);
item->setText(tr("Log Time Stamps")); item->setText(tr("Log Time Stamps"));
item->setSettingsKey(debugModeGroup, QLatin1String("LogTimeStamps")); item->setSettingsKey(debugModeGroup, "LogTimeStamps");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(LogTimeStamps, item); insertItem(LogTimeStamps, item);
@@ -169,7 +168,7 @@ DebuggerSettings::DebuggerSettings()
item->setText(tr("Dereference Pointers Automatically")); item->setText(tr("Dereference Pointers Automatically"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setSettingsKey(debugModeGroup, QLatin1String("AutoDerefPointers")); item->setSettingsKey(debugModeGroup, "AutoDerefPointers");
item->setToolTip(tr("<p>This switches the Locals and Expressions view to " item->setToolTip(tr("<p>This switches the Locals and Expressions view to "
"automatically dereference pointers. This saves a level in the " "automatically dereference pointers. This saves a level in the "
"tree view, but also loses data for the now-missing intermediate " "tree view, but also loses data for the now-missing intermediate "
@@ -182,71 +181,71 @@ DebuggerSettings::DebuggerSettings()
item = new SavedAction(this); item = new SavedAction(this);
item->setDefaultValue(QString()); item->setDefaultValue(QString());
item->setSettingsKey(cdbSettingsGroup, QLatin1String("AdditionalArguments")); item->setSettingsKey(cdbSettingsGroup, "AdditionalArguments");
insertItem(CdbAdditionalArguments, item); insertItem(CdbAdditionalArguments, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setDefaultValue(QStringList()); item->setDefaultValue(QStringList());
item->setSettingsKey(cdbSettingsGroup, QLatin1String("SymbolPaths")); item->setSettingsKey(cdbSettingsGroup, "SymbolPaths");
insertItem(CdbSymbolPaths, item); insertItem(CdbSymbolPaths, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setDefaultValue(QStringList()); item->setDefaultValue(QStringList());
item->setSettingsKey(cdbSettingsGroup, QLatin1String("SourcePaths")); item->setSettingsKey(cdbSettingsGroup, "SourcePaths");
insertItem(CdbSourcePaths, item); insertItem(CdbSourcePaths, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setDefaultValue(QStringList()); item->setDefaultValue(QStringList());
item->setSettingsKey(cdbSettingsGroup, QLatin1String("BreakEvent")); item->setSettingsKey(cdbSettingsGroup, "BreakEvent");
insertItem(CdbBreakEvents, item); insertItem(CdbBreakEvents, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setSettingsKey(cdbSettingsGroup, QLatin1String("BreakOnCrtDbgReport")); item->setSettingsKey(cdbSettingsGroup, "BreakOnCrtDbgReport");
insertItem(CdbBreakOnCrtDbgReport, item); insertItem(CdbBreakOnCrtDbgReport, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setSettingsKey(cdbSettingsGroup, QLatin1String("CDB_Console")); item->setSettingsKey(cdbSettingsGroup, "CDB_Console");
insertItem(UseCdbConsole, item); insertItem(UseCdbConsole, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setSettingsKey(cdbSettingsGroup, QLatin1String("BreakpointCorrection")); item->setSettingsKey(cdbSettingsGroup, "BreakpointCorrection");
insertItem(CdbBreakPointCorrection, item); insertItem(CdbBreakPointCorrection, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setSettingsKey(cdbSettingsGroup, QLatin1String("UsePythonDumper")); item->setSettingsKey(cdbSettingsGroup, "UsePythonDumper");
insertItem(CdbUsePythonDumper, item); insertItem(CdbUsePythonDumper, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setSettingsKey(cdbSettingsGroup, QLatin1String("FirstChanceExceptionTaskEntry")); item->setSettingsKey(cdbSettingsGroup, "FirstChanceExceptionTaskEntry");
insertItem(FirstChanceExceptionTaskEntry, item); insertItem(FirstChanceExceptionTaskEntry, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setSettingsKey(cdbSettingsGroup, QLatin1String("SecondChanceExceptionTaskEntry")); item->setSettingsKey(cdbSettingsGroup, "SecondChanceExceptionTaskEntry");
insertItem(SecondChanceExceptionTaskEntry, item); insertItem(SecondChanceExceptionTaskEntry, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setSettingsKey(cdbSettingsGroup, QLatin1String("IgnoreFirstChanceAccessViolation")); item->setSettingsKey(cdbSettingsGroup, "IgnoreFirstChanceAccessViolation");
insertItem(IgnoreFirstChanceAccessViolation, item); insertItem(IgnoreFirstChanceAccessViolation, item);
// //
// Locals & Watchers // Locals & Watchers
// //
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ShowStandardNamespace")); item->setSettingsKey(debugModeGroup, "ShowStandardNamespace");
item->setText(tr("Show \"std::\" Namespace in Types")); item->setText(tr("Show \"std::\" Namespace in Types"));
item->setDialogText(tr("Show \"std::\" namespace in types")); item->setDialogText(tr("Show \"std::\" namespace in types"));
item->setToolTip(tr("<p>Shows \"std::\" prefix for types from the standard library.")); item->setToolTip(tr("<p>Shows \"std::\" prefix for types from the standard library."));
@@ -256,7 +255,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(ShowStdNamespace, item); insertItem(ShowStdNamespace, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ShowQtNamespace")); item->setSettingsKey(debugModeGroup, "ShowQtNamespace");
item->setText(tr("Show Qt's Namespace in Types")); item->setText(tr("Show Qt's Namespace in Types"));
item->setDialogText(tr("Show Qt's namespace in types")); item->setDialogText(tr("Show Qt's namespace in types"));
item->setToolTip(tr("<p>Shows Qt namespace prefix for Qt types. This is only " item->setToolTip(tr("<p>Shows Qt namespace prefix for Qt types. This is only "
@@ -267,7 +266,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(ShowQtNamespace, item); insertItem(ShowQtNamespace, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ShowQObjectNames2")); item->setSettingsKey(debugModeGroup, "ShowQObjectNames2");
item->setText(tr("Show QObject names if available")); item->setText(tr("Show QObject names if available"));
item->setDialogText(tr("Show QObject names if available")); item->setDialogText(tr("Show QObject names if available"));
item->setToolTip(tr("<p>Displays the objectName property of QObject based items. " item->setToolTip(tr("<p>Displays the objectName property of QObject based items. "
@@ -279,7 +278,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(ShowQObjectNames, item); insertItem(ShowQObjectNames, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("SortStructMembers")); item->setSettingsKey(debugModeGroup, "SortStructMembers");
item->setText(tr("Sort Members of Classes and Structs Alphabetically")); item->setText(tr("Sort Members of Classes and Structs Alphabetically"));
item->setDialogText(tr("Sort members of classes and structs alphabetically")); item->setDialogText(tr("Sort members of classes and structs alphabetically"));
item->setCheckable(true); item->setCheckable(true);
@@ -291,7 +290,7 @@ DebuggerSettings::DebuggerSettings()
// DebuggingHelper // DebuggingHelper
// //
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseDebuggingHelper")); item->setSettingsKey(debugModeGroup, "UseDebuggingHelper");
item->setText(tr("Use Debugging Helpers")); item->setText(tr("Use Debugging Helpers"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
@@ -299,7 +298,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseDebuggingHelpers, item); insertItem(UseDebuggingHelpers, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseCodeModel")); item->setSettingsKey(debugModeGroup, "UseCodeModel");
item->setDialogText(tr("Use code model")); item->setDialogText(tr("Use code model"));
item->setToolTip(tr("<p>Selecting this causes the C++ Code Model being asked " item->setToolTip(tr("<p>Selecting this causes the C++ Code Model being asked "
"for variable scope information. This might result in slightly faster " "for variable scope information. This might result in slightly faster "
@@ -310,7 +309,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseCodeModel, item); insertItem(UseCodeModel, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ShowThreadNames")); item->setSettingsKey(debugModeGroup, "ShowThreadNames");
item->setToolTip(tr("<p>Displays names of QThread based threads.")); item->setToolTip(tr("<p>Displays names of QThread based threads."));
item->setDialogText(tr("Display thread names")); item->setDialogText(tr("Display thread names"));
item->setCheckable(true); item->setCheckable(true);
@@ -337,7 +336,7 @@ DebuggerSettings::DebuggerSettings()
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
item->setValue(true); item->setValue(true);
item->setSettingsKey(debugModeGroup, QLatin1String("AdjustBreakpointLocations")); item->setSettingsKey(debugModeGroup, "AdjustBreakpointLocations");
insertItem(AdjustBreakpointLocations, item); insertItem(AdjustBreakpointLocations, item);
item = new SavedAction(this); item = new SavedAction(this);
@@ -345,7 +344,7 @@ DebuggerSettings::DebuggerSettings()
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setValue(false); item->setValue(false);
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnThrow")); item->setSettingsKey(debugModeGroup, "BreakOnThrow");
insertItem(BreakOnThrow, item); insertItem(BreakOnThrow, item);
item = new SavedAction(this); item = new SavedAction(this);
@@ -353,7 +352,7 @@ DebuggerSettings::DebuggerSettings()
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setValue(false); item->setValue(false);
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnCatch")); item->setSettingsKey(debugModeGroup, "BreakOnCatch");
insertItem(BreakOnCatch, item); insertItem(BreakOnCatch, item);
item = new SavedAction(this); item = new SavedAction(this);
@@ -361,7 +360,7 @@ DebuggerSettings::DebuggerSettings()
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setValue(false); item->setValue(false);
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnWarning")); item->setSettingsKey(debugModeGroup, "BreakOnWarning");
insertItem(BreakOnWarning, item); insertItem(BreakOnWarning, item);
item = new SavedAction(this); item = new SavedAction(this);
@@ -369,7 +368,7 @@ DebuggerSettings::DebuggerSettings()
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setValue(false); item->setValue(false);
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnFatal")); item->setSettingsKey(debugModeGroup, "BreakOnFatal");
insertItem(BreakOnFatal, item); insertItem(BreakOnFatal, item);
item = new SavedAction(this); item = new SavedAction(this);
@@ -377,7 +376,7 @@ DebuggerSettings::DebuggerSettings()
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setValue(false); item->setValue(false);
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnAbort")); item->setSettingsKey(debugModeGroup, "BreakOnAbort");
insertItem(BreakOnAbort, item); insertItem(BreakOnAbort, item);
// //
@@ -385,7 +384,7 @@ DebuggerSettings::DebuggerSettings()
// //
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("LoadGdbInit")); item->setSettingsKey(debugModeGroup, "LoadGdbInit");
item->setDefaultValue(QString()); item->setDefaultValue(QString());
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
@@ -393,7 +392,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(LoadGdbInit, item); insertItem(LoadGdbInit, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("LoadGdbDumpers2")); item->setSettingsKey(debugModeGroup, "LoadGdbDumpers2");
item->setDefaultValue(QString()); item->setDefaultValue(QString());
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
@@ -401,7 +400,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(LoadGdbDumpers, item); insertItem(LoadGdbDumpers, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("AutoEnrichParameters")); item->setSettingsKey(debugModeGroup, "AutoEnrichParameters");
item->setDefaultValue(QString()); item->setDefaultValue(QString());
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
@@ -409,7 +408,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(AutoEnrichParameters, item); insertItem(AutoEnrichParameters, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseDynamicType")); item->setSettingsKey(debugModeGroup, "UseDynamicType");
item->setText(tr("Use Dynamic Object Type for Display")); item->setText(tr("Use Dynamic Object Type for Display"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
@@ -417,95 +416,95 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseDynamicType, item); insertItem(UseDynamicType, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("TargetAsync")); item->setSettingsKey(debugModeGroup, "TargetAsync");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setValue(false); item->setValue(false);
insertItem(TargetAsync, item); insertItem(TargetAsync, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("WarnOnReleaseBuilds")); item->setSettingsKey(debugModeGroup, "WarnOnReleaseBuilds");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
insertItem(WarnOnReleaseBuilds, item); insertItem(WarnOnReleaseBuilds, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("GdbStartupCommands")); item->setSettingsKey(debugModeGroup, "GdbStartupCommands");
item->setDefaultValue(QString()); item->setDefaultValue(QString());
insertItem(GdbStartupCommands, item); insertItem(GdbStartupCommands, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("GdbCustomDumperCommands")); item->setSettingsKey(debugModeGroup, "GdbCustomDumperCommands");
item->setDefaultValue(QString()); item->setDefaultValue(QString());
insertItem(ExtraDumperCommands, item); insertItem(ExtraDumperCommands, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ExtraDumperFile")); item->setSettingsKey(debugModeGroup, "ExtraDumperFile");
item->setDefaultValue(QString()); item->setDefaultValue(QString());
insertItem(ExtraDumperFile, item); insertItem(ExtraDumperFile, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("GdbPostAttachCommands")); item->setSettingsKey(debugModeGroup, "GdbPostAttachCommands");
item->setDefaultValue(QString()); item->setDefaultValue(QString());
insertItem(GdbPostAttachCommands, item); insertItem(GdbPostAttachCommands, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("CloseBuffersOnExit")); item->setSettingsKey(debugModeGroup, "CloseBuffersOnExit");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(CloseSourceBuffersOnExit, item); insertItem(CloseSourceBuffersOnExit, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("CloseMemoryBuffersOnExit")); item->setSettingsKey(debugModeGroup, "CloseMemoryBuffersOnExit");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
insertItem(CloseMemoryBuffersOnExit, item); insertItem(CloseMemoryBuffersOnExit, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("SwitchModeOnExit")); item->setSettingsKey(debugModeGroup, "SwitchModeOnExit");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(SwitchModeOnExit, item); insertItem(SwitchModeOnExit, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("BreakpointsFullPath")); item->setSettingsKey(debugModeGroup, "BreakpointsFullPath");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(BreakpointsFullPathByDefault, item); insertItem(BreakpointsFullPathByDefault, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("RaiseOnInterrupt")); item->setSettingsKey(debugModeGroup, "RaiseOnInterrupt");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(true); item->setDefaultValue(true);
insertItem(RaiseOnInterrupt, item); insertItem(RaiseOnInterrupt, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("AutoQuit")); item->setSettingsKey(debugModeGroup, "AutoQuit");
item->setText(tr("Automatically Quit Debugger")); item->setText(tr("Automatically Quit Debugger"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(AutoQuit, item); insertItem(AutoQuit, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("MultiInferior")); item->setSettingsKey(debugModeGroup, "MultiInferior");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(MultiInferior, item); insertItem(MultiInferior, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("IntelFlavor")); item->setSettingsKey(debugModeGroup, "IntelFlavor");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(IntelFlavor, item); insertItem(IntelFlavor, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("IdentifyDebugInfoPackages")); item->setSettingsKey(debugModeGroup, "IdentifyDebugInfoPackages");
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(IdentifyDebugInfoPackages, item); insertItem(IdentifyDebugInfoPackages, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseToolTips")); item->setSettingsKey(debugModeGroup, "UseToolTips");
item->setText(tr("Use tooltips in main editor when debugging")); item->setText(tr("Use tooltips in main editor when debugging"));
item->setToolTip(tr("<p>Checking this will enable tooltips for variable " item->setToolTip(tr("<p>Checking this will enable tooltips for variable "
"values during debugging. Since this can slow down debugging and " "values during debugging. Since this can slow down debugging and "
@@ -516,7 +515,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseToolTipsInMainEditor, item); insertItem(UseToolTipsInMainEditor, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseToolTipsInLocalsView")); item->setSettingsKey(debugModeGroup, "UseToolTipsInLocalsView");
item->setText(tr("Use Tooltips in Locals View when Debugging")); item->setText(tr("Use Tooltips in Locals View when Debugging"));
item->setToolTip(tr("<p>Checking this will enable tooltips in the locals " item->setToolTip(tr("<p>Checking this will enable tooltips in the locals "
"view during debugging.")); "view during debugging."));
@@ -525,7 +524,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseToolTipsInLocalsView, item); insertItem(UseToolTipsInLocalsView, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseToolTipsInBreakpointsView")); item->setSettingsKey(debugModeGroup, "UseToolTipsInBreakpointsView");
item->setText(tr("Use Tooltips in Breakpoints View when Debugging")); item->setText(tr("Use Tooltips in Breakpoints View when Debugging"));
item->setToolTip(tr("<p>Checking this will enable tooltips in the breakpoints " item->setToolTip(tr("<p>Checking this will enable tooltips in the breakpoints "
"view during debugging.")); "view during debugging."));
@@ -534,7 +533,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseToolTipsInBreakpointsView, item); insertItem(UseToolTipsInBreakpointsView, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseToolTipsInStackView")); item->setSettingsKey(debugModeGroup, "UseToolTipsInStackView");
item->setText(tr("Use Tooltips in Stack View when Debugging")); item->setText(tr("Use Tooltips in Stack View when Debugging"));
item->setToolTip(tr("<p>Checking this will enable tooltips in the stack " item->setToolTip(tr("<p>Checking this will enable tooltips in the stack "
"view during debugging.")); "view during debugging."));
@@ -543,7 +542,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseToolTipsInStackView, item); insertItem(UseToolTipsInStackView, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseAddressInBreakpointsView")); item->setSettingsKey(debugModeGroup, "UseAddressInBreakpointsView");
item->setText(tr("Show Address Data in Breakpoints View when Debugging")); item->setText(tr("Show Address Data in Breakpoints View when Debugging"));
item->setToolTip(tr("<p>Checking this will show a column with address " item->setToolTip(tr("<p>Checking this will show a column with address "
"information in the breakpoint view during debugging.")); "information in the breakpoint view during debugging."));
@@ -552,7 +551,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseAddressInBreakpointsView, item); insertItem(UseAddressInBreakpointsView, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("UseAddressInStackView")); item->setSettingsKey(debugModeGroup, "UseAddressInStackView");
item->setText(tr("Show Address Data in Stack View when Debugging")); item->setText(tr("Show Address Data in Stack View when Debugging"));
item->setToolTip(tr("<p>Checking this will show a column with address " item->setToolTip(tr("<p>Checking this will show a column with address "
"information in the stack view during debugging.")); "information in the stack view during debugging."));
@@ -561,14 +560,14 @@ DebuggerSettings::DebuggerSettings()
insertItem(UseAddressInStackView, item); insertItem(UseAddressInStackView, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("SkipKnownFrames")); item->setSettingsKey(debugModeGroup, "SkipKnownFrames");
item->setText(tr("Skip Known Frames")); item->setText(tr("Skip Known Frames"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(SkipKnownFrames, item); insertItem(SkipKnownFrames, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("EnableReverseDebugging")); item->setSettingsKey(debugModeGroup, "EnableReverseDebugging");
item->setText(tr("Enable Reverse Debugging")); item->setText(tr("Enable Reverse Debugging"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
@@ -577,7 +576,7 @@ DebuggerSettings::DebuggerSettings()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
item = new RegisterPostMortemAction(this); item = new RegisterPostMortemAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("RegisterForPostMortem")); item->setSettingsKey(debugModeGroup, "RegisterForPostMortem");
item->setText(tr("Register For Post-Mortem Debugging")); item->setText(tr("Register For Post-Mortem Debugging"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
@@ -585,32 +584,32 @@ DebuggerSettings::DebuggerSettings()
#endif #endif
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("AllPluginBreakpoints")); item->setSettingsKey(debugModeGroup, "AllPluginBreakpoints");
item->setDefaultValue(true); item->setDefaultValue(true);
insertItem(AllPluginBreakpoints, item); insertItem(AllPluginBreakpoints, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("SelectedPluginBreakpoints")); item->setSettingsKey(debugModeGroup, "SelectedPluginBreakpoints");
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(SelectedPluginBreakpoints, item); insertItem(SelectedPluginBreakpoints, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("NoPluginBreakpoints")); item->setSettingsKey(debugModeGroup, "NoPluginBreakpoints");
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(NoPluginBreakpoints, item); insertItem(NoPluginBreakpoints, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("SelectedPluginBreakpointsPattern")); item->setSettingsKey(debugModeGroup, "SelectedPluginBreakpointsPattern");
item->setDefaultValue(QLatin1String(".*")); item->setDefaultValue(".*");
insertItem(SelectedPluginBreakpointsPattern, item); insertItem(SelectedPluginBreakpointsPattern, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("MaximalStackDepth")); item->setSettingsKey(debugModeGroup, "MaximalStackDepth");
item->setDefaultValue(20); item->setDefaultValue(20);
insertItem(MaximalStackDepth, item); insertItem(MaximalStackDepth, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("DisplayStringLimit")); item->setSettingsKey(debugModeGroup, "DisplayStringLimit");
item->setToolTip(tr("<p>The maximum length of string entries in the " item->setToolTip(tr("<p>The maximum length of string entries in the "
"Locals and Expressions pane. Longer than that are cut off " "Locals and Expressions pane. Longer than that are cut off "
"and displayed with an ellipsis attached.")); "and displayed with an ellipsis attached."));
@@ -618,7 +617,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(DisplayStringLimit, item); insertItem(DisplayStringLimit, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("MaximalStringLength")); item->setSettingsKey(debugModeGroup, "MaximalStringLength");
item->setToolTip(tr("<p>The maximum length for strings in separated windows. " item->setToolTip(tr("<p>The maximum length for strings in separated windows. "
"Longer strings are cut off and displayed with an ellipsis attached.")); "Longer strings are cut off and displayed with an ellipsis attached."));
item->setDefaultValue(10000); item->setDefaultValue(10000);
@@ -633,7 +632,7 @@ DebuggerSettings::DebuggerSettings()
insertItem(CreateFullBacktrace, item); insertItem(CreateFullBacktrace, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("WatchdogTimeout")); item->setSettingsKey(debugModeGroup, "WatchdogTimeout");
item->setDefaultValue(20); item->setDefaultValue(20);
insertItem(GdbWatchdogTimeout, item); insertItem(GdbWatchdogTimeout, item);
@@ -641,13 +640,13 @@ DebuggerSettings::DebuggerSettings()
// QML Tools // QML Tools
// //
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ShowQmlObjectTree")); item->setSettingsKey(debugModeGroup, "ShowQmlObjectTree");
item->setDefaultValue(true); item->setDefaultValue(true);
insertItem(ShowQmlObjectTree, item); insertItem(ShowQmlObjectTree, item);
const QString qmlInspectorGroup = QLatin1String("QML.Inspector"); const QString qmlInspectorGroup = "QML.Inspector";
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(qmlInspectorGroup, QLatin1String("QmlInspector.ShowAppOnTop")); item->setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop");
item->setDefaultValue(false); item->setDefaultValue(false);
insertItem(ShowAppOnTop, item); insertItem(ShowAppOnTop, item);
} }

View File

@@ -172,13 +172,13 @@ QString StartApplicationParameters::displayName() const
const int maxLength = 60; const int maxLength = 60;
QString name = FileName::fromString(runnable.executable).fileName() QString name = FileName::fromString(runnable.executable).fileName()
+ QLatin1Char(' ') + runnable.commandLineArguments; + ' ' + runnable.commandLineArguments;
if (name.size() > 60) { if (name.size() > 60) {
int index = name.lastIndexOf(QLatin1Char(' '), maxLength); int index = name.lastIndexOf(' ', maxLength);
if (index == -1) if (index == -1)
index = maxLength; index = maxLength;
name.truncate(index); name.truncate(index);
name += QLatin1String("..."); name += "...";
} }
if (Kit *kit = KitManager::kit(kitId)) if (Kit *kit = KitManager::kit(kitId))
@@ -246,15 +246,15 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->localExecutablePathChooser = new PathChooser(this); d->localExecutablePathChooser = new PathChooser(this);
d->localExecutablePathChooser->setExpectedKind(PathChooser::File); d->localExecutablePathChooser->setExpectedKind(PathChooser::File);
d->localExecutablePathChooser->setPromptDialogTitle(tr("Select Executable")); d->localExecutablePathChooser->setPromptDialogTitle(tr("Select Executable"));
d->localExecutablePathChooser->setHistoryCompleter(QLatin1String("LocalExecutable")); d->localExecutablePathChooser->setHistoryCompleter("LocalExecutable");
d->arguments = new FancyLineEdit(this); d->arguments = new FancyLineEdit(this);
d->arguments->setHistoryCompleter(QLatin1String("CommandlineArguments")); d->arguments->setHistoryCompleter("CommandlineArguments");
d->workingDirectory = new PathChooser(this); d->workingDirectory = new PathChooser(this);
d->workingDirectory->setExpectedKind(PathChooser::ExistingDirectory); d->workingDirectory->setExpectedKind(PathChooser::ExistingDirectory);
d->workingDirectory->setPromptDialogTitle(tr("Select Working Directory")); d->workingDirectory->setPromptDialogTitle(tr("Select Working Directory"));
d->workingDirectory->setHistoryCompleter(QLatin1String("WorkingDirectory")); d->workingDirectory->setHistoryCompleter("WorkingDirectory");
d->runInTerminalCheckBox = new QCheckBox(this); d->runInTerminalCheckBox = new QCheckBox(this);
@@ -277,7 +277,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->debuginfoPathChooser->setToolTip(tr( d->debuginfoPathChooser->setToolTip(tr(
"Base path for external debug information and debug sources. " "Base path for external debug information and debug sources. "
"If empty, $SYSROOT/usr/lib/debug will be chosen.")); "If empty, $SYSROOT/usr/lib/debug will be chosen."));
d->debuginfoPathChooser->setHistoryCompleter(QLatin1String("Debugger.DebugLocation.History")); d->debuginfoPathChooser->setHistoryCompleter("Debugger.DebugLocation.History");
auto line = new QFrame(this); auto line = new QFrame(this);
line->setFrameShape(QFrame::HLine); line->setFrameShape(QFrame::HLine);
@@ -369,8 +369,8 @@ void StartApplicationDialog::updateState()
void StartApplicationDialog::run(bool attachRemote) void StartApplicationDialog::run(bool attachRemote)
{ {
const QString settingsGroup = QLatin1String("DebugMode"); const QString settingsGroup = "DebugMode";
const QString arrayName = QLatin1String("StartApplication"); const QString arrayName = "StartApplication";
QList<StartApplicationParameters> history; QList<StartApplicationParameters> history;
QSettings *settings = ICore::settings(); QSettings *settings = ICore::settings();
@@ -585,8 +585,8 @@ static QString cdbRemoteHelp()
"to use TCP/IP as communication protocol.</p><p>Enter the connection parameters as:</p>" "to use TCP/IP as communication protocol.</p><p>Enter the connection parameters as:</p>"
"<pre>%6</pre></body></html>") "<pre>%6</pre></body></html>")
.arg(Core::Constants::IDE_DISPLAY_NAME, .arg(Core::Constants::IDE_DISPLAY_NAME,
ext32, ext64, QLatin1String("_NT_DEBUGGER_EXTENSION_PATH"), ext32, ext64, "_NT_DEBUGGER_EXTENSION_PATH",
QLatin1String("cdb.exe -server tcp:port=1234"), "cdb.exe -server tcp:port=1234",
QLatin1String(cdbConnectionSyntax)); QLatin1String(cdbConnectionSyntax));
} }
@@ -647,7 +647,7 @@ QString StartRemoteCdbDialog::connection() const
{ {
const QString rc = m_lineEdit->text(); const QString rc = m_lineEdit->text();
// Transform an IP:POrt ('localhost:1234') specification into full spec // Transform an IP:POrt ('localhost:1234') specification into full spec
QRegExp ipRegexp(QLatin1String("([\\w\\.\\-_]+):([0-9]{1,4})")); QRegExp ipRegexp("([\\w\\.\\-_]+):([0-9]{1,4})");
QTC_ASSERT(ipRegexp.isValid(), return QString()); QTC_ASSERT(ipRegexp.isValid(), return QString());
if (ipRegexp.exactMatch(rc)) if (ipRegexp.exactMatch(rc))
return QString::fromLatin1("tcp:server=%1,port=%2").arg(ipRegexp.cap(1), ipRegexp.cap(2)); return QString::fromLatin1("tcp:server=%1,port=%2").arg(ipRegexp.cap(1), ipRegexp.cap(2));
@@ -669,7 +669,7 @@ AddressDialog::AddressDialog(QWidget *parent) :
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto hLayout = new QHBoxLayout; auto hLayout = new QHBoxLayout;
hLayout->addWidget(new QLabel(tr("Enter an address:") + QLatin1Char(' '))); hLayout->addWidget(new QLabel(tr("Enter an address:") + ' '));
hLayout->addWidget(m_lineEdit); hLayout->addWidget(m_lineEdit);
auto vLayout = new QVBoxLayout; auto vLayout = new QVBoxLayout;
@@ -697,7 +697,7 @@ bool AddressDialog::isOkButtonEnabled() const
void AddressDialog::setAddress(quint64 a) void AddressDialog::setAddress(quint64 a)
{ {
m_lineEdit->setText(QLatin1String("0x") + QString::number(a, 16)); m_lineEdit->setText("0x" + QString::number(a, 16));
} }
quint64 AddressDialog::address() const quint64 AddressDialog::address() const
@@ -748,19 +748,19 @@ StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent)
setWindowTitle(tr("Start Remote Engine")); setWindowTitle(tr("Start Remote Engine"));
d->host = new FancyLineEdit(this); d->host = new FancyLineEdit(this);
d->host->setHistoryCompleter(QLatin1String("HostName")); d->host->setHistoryCompleter("HostName");
d->username = new FancyLineEdit(this); d->username = new FancyLineEdit(this);
d->username->setHistoryCompleter(QLatin1String("UserName")); d->username->setHistoryCompleter("UserName");
d->password = new QLineEdit(this); d->password = new QLineEdit(this);
d->password->setEchoMode(QLineEdit::Password); d->password->setEchoMode(QLineEdit::Password);
d->enginePath = new FancyLineEdit(this); d->enginePath = new FancyLineEdit(this);
d->enginePath->setHistoryCompleter(QLatin1String("EnginePath")); d->enginePath->setHistoryCompleter("EnginePath");
d->inferiorPath = new FancyLineEdit(this); d->inferiorPath = new FancyLineEdit(this);
d->inferiorPath->setHistoryCompleter(QLatin1String("InferiorPath")); d->inferiorPath->setHistoryCompleter("InferiorPath");
d->buttonBox = new QDialogButtonBox(this); d->buttonBox = new QDialogButtonBox(this);
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
@@ -916,11 +916,11 @@ void TypeFormatsDialog::addTypeFormats(const QString &type0,
const DisplayFormats &typeFormats, int current) const DisplayFormats &typeFormats, int current)
{ {
QString type = type0; QString type = type0;
type.replace(QLatin1String("__"), QLatin1String("::")); type.replace("__", "::");
int pos = 2; int pos = 2;
if (type.startsWith(QLatin1Char('Q'))) if (type.startsWith('Q'))
pos = 0; pos = 0;
else if (type.startsWith(QLatin1String("std::"))) else if (type.startsWith("std::"))
pos = 1; pos = 1;
m_ui->pages[pos]->addTypeFormats(type, typeFormats, current); m_ui->pages[pos]->addTypeFormats(type, typeFormats, current);
} }

View File

@@ -281,7 +281,7 @@ public:
m_toolTipManager(engine) m_toolTipManager(engine)
{ {
m_logWindow = new LogWindow(m_engine); // Needed before start() m_logWindow = new LogWindow(m_engine); // Needed before start()
m_logWindow->setObjectName(QLatin1String(DOCKWIDGET_OUTPUT)); m_logWindow->setObjectName(DOCKWIDGET_OUTPUT);
m_debuggerName = DebuggerEngine::tr("Debugger"); m_debuggerName = DebuggerEngine::tr("Debugger");
connect(action(EnableReverseDebugging), &SavedAction::valueChanged, connect(action(EnableReverseDebugging), &SavedAction::valueChanged,
@@ -1641,8 +1641,8 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c
d->m_logWindow->showOutput(LogInput, msg); d->m_logWindow->showOutput(LogInput, msg);
break; break;
case LogError: case LogError:
d->m_logWindow->showInput(LogError, QLatin1String("ERROR: ") + msg); d->m_logWindow->showInput(LogError, "ERROR: " + msg);
d->m_logWindow->showOutput(LogError, QLatin1String("ERROR: ") + msg); d->m_logWindow->showOutput(LogError, "ERROR: " + msg);
break; break;
case AppOutput: case AppOutput:
case AppStuff: case AppStuff:
@@ -2362,7 +2362,7 @@ void DebuggerEngine::handleExecRunToSelectedFunction()
if (functionName.isEmpty()) { if (functionName.isEmpty()) {
const QTextBlock block = cursor.block(); const QTextBlock block = cursor.block();
const QString line = block.text(); const QString line = block.text();
foreach (const QString &str, line.trimmed().split(QLatin1Char('('))) { foreach (const QString &str, line.trimmed().split('(')) {
QString a; QString a;
for (int i = str.size(); --i >= 0; ) { for (int i = str.size(); --i >= 0; ) {
if (!str.at(i).isLetterOrNumber()) if (!str.at(i).isLetterOrNumber())
@@ -2522,7 +2522,7 @@ QString DebuggerEngine::formatStartParameters() const
if (!sp.qmlServer.host().isEmpty()) if (!sp.qmlServer.host().isEmpty())
str << "QML server: " << sp.qmlServer.host() << ':' << sp.qmlServer.port() << '\n'; str << "QML server: " << sp.qmlServer.host() << ':' << sp.qmlServer.port() << '\n';
str << "Sysroot: " << sp.sysRoot << '\n'; str << "Sysroot: " << sp.sysRoot << '\n';
str << "Debug Source Location: " << sp.debugSourceLocation.join(QLatin1Char(':')) << '\n'; str << "Debug Source Location: " << sp.debugSourceLocation.join(':') << '\n';
return rc; return rc;
} }

View File

@@ -77,18 +77,18 @@ DebuggerItem::DebuggerItem(const QVariant &id)
DebuggerItem::DebuggerItem(const QVariantMap &data) DebuggerItem::DebuggerItem(const QVariantMap &data)
{ {
m_id = data.value(QLatin1String(DEBUGGER_INFORMATION_ID)).toString(); m_id = data.value(DEBUGGER_INFORMATION_ID).toString();
m_command = FileName::fromUserInput(data.value(QLatin1String(DEBUGGER_INFORMATION_COMMAND)).toString()); m_command = FileName::fromUserInput(data.value(DEBUGGER_INFORMATION_COMMAND).toString());
m_workingDirectory = FileName::fromUserInput(data.value(DEBUGGER_INFORMATION_WORKINGDIRECTORY).toString()); m_workingDirectory = FileName::fromUserInput(data.value(DEBUGGER_INFORMATION_WORKINGDIRECTORY).toString());
m_unexpandedDisplayName = data.value(QLatin1String(DEBUGGER_INFORMATION_DISPLAYNAME)).toString(); m_unexpandedDisplayName = data.value(DEBUGGER_INFORMATION_DISPLAYNAME).toString();
m_isAutoDetected = data.value(QLatin1String(DEBUGGER_INFORMATION_AUTODETECTED), false).toBool(); m_isAutoDetected = data.value(DEBUGGER_INFORMATION_AUTODETECTED, false).toBool();
m_autoDetectionSource = data.value(QLatin1String(DEBUGGER_INFORMATION_AUTODETECTION_SOURCE)).toString(); m_autoDetectionSource = data.value(DEBUGGER_INFORMATION_AUTODETECTION_SOURCE).toString();
m_version = data.value(QLatin1String(DEBUGGER_INFORMATION_VERSION)).toString(); m_version = data.value(DEBUGGER_INFORMATION_VERSION).toString();
m_engineType = DebuggerEngineType(data.value(QLatin1String(DEBUGGER_INFORMATION_ENGINETYPE), m_engineType = DebuggerEngineType(data.value(DEBUGGER_INFORMATION_ENGINETYPE,
static_cast<int>(NoEngineType)).toInt()); static_cast<int>(NoEngineType)).toInt());
m_lastModified = data.value(QLatin1String(DEBUGGER_INFORMATION_LASTMODIFIED)).toDateTime(); m_lastModified = data.value(DEBUGGER_INFORMATION_LASTMODIFIED).toDateTime();
foreach (const QString &a, data.value(QLatin1String(DEBUGGER_INFORMATION_ABIS)).toStringList()) { foreach (const QString &a, data.value(DEBUGGER_INFORMATION_ABIS).toStringList()) {
Abi abi = Abi::fromString(a); Abi abi = Abi::fromString(a);
if (!abi.isNull()) if (!abi.isNull())
m_abis.append(abi); m_abis.append(abi);
@@ -118,12 +118,12 @@ void DebuggerItem::reinitializeFromFile()
const char *version = "-version"; const char *version = "-version";
const QFileInfo fileInfo = m_command.toFileInfo(); const QFileInfo fileInfo = m_command.toFileInfo();
m_lastModified = fileInfo.lastModified(); m_lastModified = fileInfo.lastModified();
if (fileInfo.baseName().toLower().contains(QLatin1String("lldb-mi"))) if (fileInfo.baseName().toLower().contains("lldb-mi"))
version = "--version"; version = "--version";
SynchronousProcess proc; SynchronousProcess proc;
SynchronousProcessResponse response SynchronousProcessResponse response
= proc.runBlocking(m_command.toString(), QStringList({QLatin1String(version)})); = proc.runBlocking(m_command.toString(), {QLatin1String(version)});
if (response.result != SynchronousProcessResponse::Finished) { if (response.result != SynchronousProcessResponse::Finished) {
m_engineType = NoEngineType; m_engineType = NoEngineType;
return; return;
@@ -177,7 +177,7 @@ void DebuggerItem::reinitializeFromFile()
// "cdb version 6.2.9200.16384" // "cdb version 6.2.9200.16384"
m_engineType = CdbEngineType; m_engineType = CdbEngineType;
m_abis = Abi::abisOfBinary(m_command); m_abis = Abi::abisOfBinary(m_command);
m_version = output.section(QLatin1Char(' '), 2); m_version = output.section(' ', 2);
return; return;
} }
if (output.startsWith("Python")) { if (output.startsWith("Python")) {
@@ -246,22 +246,22 @@ bool DebuggerItem::operator==(const DebuggerItem &other) const
QVariantMap DebuggerItem::toMap() const QVariantMap DebuggerItem::toMap() const
{ {
QVariantMap data; QVariantMap data;
data.insert(QLatin1String(DEBUGGER_INFORMATION_DISPLAYNAME), m_unexpandedDisplayName); data.insert(DEBUGGER_INFORMATION_DISPLAYNAME, m_unexpandedDisplayName);
data.insert(QLatin1String(DEBUGGER_INFORMATION_ID), m_id); data.insert(DEBUGGER_INFORMATION_ID, m_id);
data.insert(QLatin1String(DEBUGGER_INFORMATION_COMMAND), m_command.toString()); data.insert(DEBUGGER_INFORMATION_COMMAND, m_command.toString());
data.insert(QLatin1String(DEBUGGER_INFORMATION_WORKINGDIRECTORY), m_workingDirectory.toString()); data.insert(DEBUGGER_INFORMATION_WORKINGDIRECTORY, m_workingDirectory.toString());
data.insert(QLatin1String(DEBUGGER_INFORMATION_ENGINETYPE), int(m_engineType)); data.insert(DEBUGGER_INFORMATION_ENGINETYPE, int(m_engineType));
data.insert(QLatin1String(DEBUGGER_INFORMATION_AUTODETECTED), m_isAutoDetected); data.insert(DEBUGGER_INFORMATION_AUTODETECTED, m_isAutoDetected);
data.insert(QLatin1String(DEBUGGER_INFORMATION_AUTODETECTION_SOURCE), m_autoDetectionSource); data.insert(DEBUGGER_INFORMATION_AUTODETECTION_SOURCE, m_autoDetectionSource);
data.insert(QLatin1String(DEBUGGER_INFORMATION_VERSION), m_version); data.insert(DEBUGGER_INFORMATION_VERSION, m_version);
data.insert(QLatin1String(DEBUGGER_INFORMATION_ABIS), abiNames()); data.insert(DEBUGGER_INFORMATION_ABIS, abiNames());
data.insert(QLatin1String(DEBUGGER_INFORMATION_LASTMODIFIED), m_lastModified); data.insert(DEBUGGER_INFORMATION_LASTMODIFIED, m_lastModified);
return data; return data;
} }
QString DebuggerItem::displayName() const QString DebuggerItem::displayName() const
{ {
if (!m_unexpandedDisplayName.contains(QLatin1Char('%'))) if (!m_unexpandedDisplayName.contains('%'))
return m_unexpandedDisplayName; return m_unexpandedDisplayName;
MacroExpander expander; MacroExpander expander;
@@ -271,7 +271,7 @@ QString DebuggerItem::displayName() const
[this] { return !m_version.isEmpty() ? m_version : [this] { return !m_version.isEmpty() ? m_version :
DebuggerKitInformation::tr("Unknown debugger version"); }); DebuggerKitInformation::tr("Unknown debugger version"); });
expander.registerVariable("Debugger:Abi", DebuggerKitInformation::tr("Debugger"), expander.registerVariable("Debugger:Abi", DebuggerKitInformation::tr("Debugger"),
[this] { return !m_abis.isEmpty() ? abiNames().join(QLatin1Char(' ')) : [this] { return !m_abis.isEmpty() ? abiNames().join(' ') :
DebuggerKitInformation::tr("Unknown debugger ABI"); }); DebuggerKitInformation::tr("Unknown debugger ABI"); });
return expander.expand(m_unexpandedDisplayName); return expander.expand(m_unexpandedDisplayName);
} }

View File

@@ -353,7 +353,7 @@ DebuggerItem DebuggerItemConfigWidget::item() const
item.setWorkingDirectory(m_workingDirectoryChooser->fileName()); item.setWorkingDirectory(m_workingDirectoryChooser->fileName());
item.setAutoDetected(m_autodetected); item.setAutoDetected(m_autodetected);
QList<ProjectExplorer::Abi> abiList; QList<ProjectExplorer::Abi> abiList;
foreach (const QString &a, m_abis->text().split(QRegExp(QLatin1String("[^A-Za-z0-9-_]+")))) { foreach (const QString &a, m_abis->text().split(QRegExp("[^A-Za-z0-9-_]+"))) {
if (a.isNull()) if (a.isNull())
continue; continue;
abiList << Abi::fromString(a); abiList << Abi::fromString(a);
@@ -372,7 +372,7 @@ void DebuggerItemConfigWidget::store() const
void DebuggerItemConfigWidget::setAbis(const QStringList &abiNames) void DebuggerItemConfigWidget::setAbis(const QStringList &abiNames)
{ {
m_abis->setText(abiNames.join(QLatin1String(", "))); m_abis->setText(abiNames.join(", "));
} }
void DebuggerItemConfigWidget::load(const DebuggerItem *item) void DebuggerItemConfigWidget::load(const DebuggerItem *item)
@@ -406,9 +406,9 @@ void DebuggerItemConfigWidget::load(const DebuggerItem *item)
"<a href=\"%1\">Windows Console Debugger executable</a>" "<a href=\"%1\">Windows Console Debugger executable</a>"
" (%2) here.").arg(QLatin1String(debuggingToolsWikiLinkC), versionString) " (%2) here.").arg(QLatin1String(debuggingToolsWikiLinkC), versionString)
+ "</p></body></html>"; + "</p></body></html>";
versionCommand = QLatin1String("-version"); versionCommand = "-version";
} else { } else {
versionCommand = QLatin1String("--version"); versionCommand = "--version";
} }
m_cdbLabel->setText(text); m_cdbLabel->setText(text);
@@ -730,7 +730,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
SynchronousProcess lldbInfo; SynchronousProcess lldbInfo;
lldbInfo.setTimeoutS(2); lldbInfo.setTimeoutS(2);
SynchronousProcessResponse response SynchronousProcessResponse response
= lldbInfo.runBlocking(QLatin1String("xcrun"), {"--find", "lldb"}); = lldbInfo.runBlocking("xcrun", {"--find", "lldb"});
if (response.result == Utils::SynchronousProcessResponse::Finished) { if (response.result == Utils::SynchronousProcessResponse::Finished) {
QString lPath = response.allOutput().trimmed(); QString lPath = response.allOutput().trimmed();
if (!lPath.isEmpty()) { if (!lPath.isEmpty()) {
@@ -749,8 +749,8 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
foreach (const Utils::FileName &base, path) { foreach (const Utils::FileName &base, path) {
dir.setPath(base.toFileInfo().absoluteFilePath()); dir.setPath(base.toFileInfo().absoluteFilePath());
foreach (const QString &entry, dir.entryList()) { foreach (const QString &entry, dir.entryList()) {
if (entry.startsWith(QLatin1String("lldb-platform-")) if (entry.startsWith("lldb-platform-")
|| entry.startsWith(QLatin1String("lldb-gdbserver-"))) { || entry.startsWith("lldb-gdbserver-")) {
continue; continue;
} }
suspects.append(FileName::fromString(dir.absoluteFilePath(entry))); suspects.append(FileName::fromString(dir.absoluteFilePath(entry)));
@@ -788,19 +788,19 @@ void DebuggerItemManagerPrivate::readLegacyDebuggers(const FileName &file)
foreach (const QVariant &v, reader.restoreValues()) { foreach (const QVariant &v, reader.restoreValues()) {
QVariantMap data1 = v.toMap(); QVariantMap data1 = v.toMap();
QString kitName = data1.value(QLatin1String("PE.Profile.Name")).toString(); QString kitName = data1.value("PE.Profile.Name").toString();
QVariantMap data2 = data1.value(QLatin1String("PE.Profile.Data")).toMap(); QVariantMap data2 = data1.value("PE.Profile.Data").toMap();
QVariant v3 = data2.value(DebuggerKitInformation::id().toString()); QVariant v3 = data2.value(DebuggerKitInformation::id().toString());
QString fn; QString fn;
if (v3.type() == QVariant::String) if (v3.type() == QVariant::String)
fn = v3.toString(); fn = v3.toString();
else else
fn = v3.toMap().value(QLatin1String("Binary")).toString(); fn = v3.toMap().value("Binary").toString();
if (fn.isEmpty()) if (fn.isEmpty())
continue; continue;
if (fn.startsWith(QLatin1Char('{'))) if (fn.startsWith('{'))
continue; continue;
if (fn == QLatin1String("auto")) if (fn == "auto")
continue; continue;
FileName command = FileName::fromUserInput(fn); FileName command = FileName::fromUserInput(fn);
if (!command.exists()) if (!command.exists())

View File

@@ -51,7 +51,7 @@ namespace Debugger {
DebuggerKitInformation::DebuggerKitInformation() DebuggerKitInformation::DebuggerKitInformation()
{ {
setObjectName(QLatin1String("DebuggerKitInformation")); setObjectName("DebuggerKitInformation");
setId(DebuggerKitInformation::id()); setId(DebuggerKitInformation::id());
setPriority(28000); setPriority(28000);
} }
@@ -130,11 +130,11 @@ void DebuggerKitInformation::setup(Kit *k)
} else { } else {
// Old structure. // Old structure.
const QMap<QString, QVariant> map = rawId.toMap(); const QMap<QString, QVariant> map = rawId.toMap();
QString binary = map.value(QLatin1String("Binary")).toString(); QString binary = map.value("Binary").toString();
if (binary == QLatin1String("auto")) { if (binary == "auto") {
// This is close to the "new kit" case, except that we know // This is close to the "new kit" case, except that we know
// an engine type. // an engine type.
DebuggerEngineType autoEngine = DebuggerEngineType(map.value(QLatin1String("EngineType")).toInt()); DebuggerEngineType autoEngine = DebuggerEngineType(map.value("EngineType").toInt());
if (item.engineType() == autoEngine) { if (item.engineType() == autoEngine) {
// Use item if host toolchain fits, but only as fallback. // Use item if host toolchain fits, but only as fallback.
level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat);
@@ -185,8 +185,8 @@ void DebuggerKitInformation::fix(Kit *k)
} }
QMap<QString, QVariant> map = rawId.toMap(); QMap<QString, QVariant> map = rawId.toMap();
QString binary = map.value(QLatin1String("Binary")).toString(); QString binary = map.value("Binary").toString();
if (binary == QLatin1String("auto")) { if (binary == "auto") {
// This should not happen as "auto" is handled by setup() already. // This should not happen as "auto" is handled by setup() already.
QTC_CHECK(false); QTC_CHECK(false);
k->setValue(DebuggerKitInformation::id(), QVariant()); k->setValue(DebuggerKitInformation::id(), QVariant());
@@ -334,7 +334,7 @@ void DebuggerKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expande
[kit]() -> QString { [kit]() -> QString {
const DebuggerItem *item = debugger(kit); const DebuggerItem *item = debugger(kit);
return item && !item->abis().isEmpty() return item && !item->abis().isEmpty()
? item->abiNames().join(QLatin1Char(' ')) ? item->abiNames().join(' ')
: tr("Unknown debugger ABI"); : tr("Unknown debugger ABI");
}); });
} }

View File

@@ -188,11 +188,11 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
hbox->addWidget(closeButton); hbox->addWidget(closeButton);
auto dock = new QDockWidget(tr("Toolbar"), q); auto dock = new QDockWidget(tr("Toolbar"), q);
dock->setObjectName(QLatin1String("Toolbar")); dock->setObjectName("Toolbar");
dock->setFeatures(QDockWidget::NoDockWidgetFeatures); dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
dock->setAllowedAreas(Qt::BottomDockWidgetArea); dock->setAllowedAreas(Qt::BottomDockWidgetArea);
dock->setTitleBarWidget(new QWidget(dock)); // hide title bar dock->setTitleBarWidget(new QWidget(dock)); // hide title bar
dock->setProperty("managed_dockwidget", QLatin1String("true")); dock->setProperty("managed_dockwidget", "true");
toolbar->setParent(dock); toolbar->setParent(dock);
dock->setWidget(toolbar); dock->setWidget(toolbar);
m_toolBarDock = dock; m_toolBarDock = dock;
@@ -300,7 +300,7 @@ void DebuggerMainWindow::onModeChanged(Core::Id mode)
Perspective *perspective = theMainWindow->d->m_currentPerspective; Perspective *perspective = theMainWindow->d->m_currentPerspective;
if (!perspective) { if (!perspective) {
const QSettings *settings = ICore::settings(); const QSettings *settings = ICore::settings();
const QString lastPerspectiveId = settings->value(QLatin1String(LAST_PERSPECTIVE_KEY)).toString(); const QString lastPerspectiveId = settings->value(LAST_PERSPECTIVE_KEY).toString();
perspective = Perspective::findPerspective(lastPerspectiveId); perspective = Perspective::findPerspective(lastPerspectiveId);
// If we don't find a perspective with the stored name, pick any. // If we don't find a perspective with the stored name, pick any.
// This can happen e.g. when a plugin was disabled that provided // This can happen e.g. when a plugin was disabled that provided
@@ -671,7 +671,7 @@ void Perspective::select()
d->m_lastActiveSubPerspectiveId.clear(); d->m_lastActiveSubPerspectiveId.clear();
const QString &lastKey = d->m_parentPerspectiveId.isEmpty() ? d->m_id : d->m_parentPerspectiveId; const QString &lastKey = d->m_parentPerspectiveId.isEmpty() ? d->m_id : d->m_parentPerspectiveId;
ICore::settings()->setValue(QLatin1String(LAST_PERSPECTIVE_KEY), lastKey); ICore::settings()->setValue(LAST_PERSPECTIVE_KEY, lastKey);
} }
void PerspectivePrivate::restoreLayout() void PerspectivePrivate::restoreLayout()

View File

@@ -465,7 +465,7 @@ class DebugMode : public IMode
public: public:
DebugMode() DebugMode()
{ {
setObjectName(QLatin1String("DebugMode")); setObjectName("DebugMode");
setContext(Context(C_DEBUGMODE, CC::C_NAVIGATION_PANE)); setContext(Context(C_DEBUGMODE, CC::C_NAVIGATION_PANE));
setDisplayName(DebuggerPlugin::tr("Debug")); setDisplayName(DebuggerPlugin::tr("Debug"));
setIcon(Utils::Icon::modeIcon(Icons::MODE_DEBUGGER_CLASSIC, setIcon(Utils::Icon::modeIcon(Icons::MODE_DEBUGGER_CLASSIC,
@@ -504,7 +504,7 @@ public:
mainWindowSplitter->addWidget(mainWindow); mainWindowSplitter->addWidget(mainWindow);
mainWindowSplitter->addWidget(new OutputPanePlaceHolder(MODE_DEBUG, mainWindowSplitter)); mainWindowSplitter->addWidget(new OutputPanePlaceHolder(MODE_DEBUG, mainWindowSplitter));
auto outputPane = new OutputPanePlaceHolder(MODE_DEBUG, mainWindowSplitter); auto outputPane = new OutputPanePlaceHolder(MODE_DEBUG, mainWindowSplitter);
outputPane->setObjectName(QLatin1String("DebuggerOutputPanePlaceHolder")); outputPane->setObjectName("DebuggerOutputPanePlaceHolder");
mainWindowSplitter->addWidget(outputPane); mainWindowSplitter->addWidget(outputPane);
mainWindowSplitter->setStretchFactor(0, 10); mainWindowSplitter->setStretchFactor(0, 10);
mainWindowSplitter->setStretchFactor(1, 0); mainWindowSplitter->setStretchFactor(1, 0);
@@ -517,7 +517,7 @@ public:
splitter->addWidget(mainWindowSplitter); splitter->addWidget(mainWindowSplitter);
splitter->setStretchFactor(0, 0); splitter->setStretchFactor(0, 0);
splitter->setStretchFactor(1, 1); splitter->setStretchFactor(1, 1);
splitter->setObjectName(QLatin1String("DebugModeWidget")); splitter->setObjectName("DebugModeWidget");
mainWindow->setCentralWidget(centralEditorWidget); mainWindow->setCentralWidget(centralEditorWidget);
mainWindow->addSubPerspectiveSwitcher(EngineManager::engineChooser()); mainWindow->addSubPerspectiveSwitcher(EngineManager::engineChooser());
@@ -956,7 +956,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
// -wincrashevent <event-handle>:<pid>. A handle used for // -wincrashevent <event-handle>:<pid>. A handle used for
// a handshake when attaching to a crashed Windows process. // a handshake when attaching to a crashed Windows process.
// This is created by $QTC/src/tools/qtcdebugger/main.cpp: // This is created by $QTC/src/tools/qtcdebugger/main.cpp:
// args << QLatin1String("-wincrashevent") // args << "-wincrashevent"
// << QString::fromLatin1("%1:%2").arg(argWinCrashEvent).arg(argProcessId); // << QString::fromLatin1("%1:%2").arg(argWinCrashEvent).arg(argProcessId);
if (*it == "-wincrashevent") { if (*it == "-wincrashevent") {
++it; ++it;
@@ -2235,7 +2235,7 @@ void showModuleSymbols(const QString &moduleName, const Symbols &symbols)
w->setRootIsDecorated(false); w->setRootIsDecorated(false);
w->setAlternatingRowColors(true); w->setAlternatingRowColors(true);
w->setSortingEnabled(true); w->setSortingEnabled(true);
w->setObjectName(QLatin1String("Symbols.") + moduleName); w->setObjectName("Symbols." + moduleName);
QStringList header; QStringList header;
header.append(DebuggerPlugin::tr("Symbol")); header.append(DebuggerPlugin::tr("Symbol"));
header.append(DebuggerPlugin::tr("Address")); header.append(DebuggerPlugin::tr("Address"));
@@ -2264,7 +2264,7 @@ void showModuleSections(const QString &moduleName, const Sections &sections)
w->setRootIsDecorated(false); w->setRootIsDecorated(false);
w->setAlternatingRowColors(true); w->setAlternatingRowColors(true);
w->setSortingEnabled(true); w->setSortingEnabled(true);
w->setObjectName(QLatin1String("Sections.") + moduleName); w->setObjectName("Sections." + moduleName);
QStringList header; QStringList header;
header.append(DebuggerPlugin::tr("Name")); header.append(DebuggerPlugin::tr("Name"));
header.append(DebuggerPlugin::tr("From")); header.append(DebuggerPlugin::tr("From"));
@@ -2306,8 +2306,8 @@ void openTextEditor(const QString &titlePattern0, const QString &contents)
EditorManager::IgnoreNavigationHistory); EditorManager::IgnoreNavigationHistory);
if (auto textEditor = qobject_cast<BaseTextEditor *>(editor)) { if (auto textEditor = qobject_cast<BaseTextEditor *>(editor)) {
QString suggestion = titlePattern; QString suggestion = titlePattern;
if (!suggestion.contains(QLatin1Char('.'))) if (!suggestion.contains('.'))
suggestion.append(QLatin1String(".txt")); suggestion.append(".txt");
textEditor->textDocument()->setFallbackSaveAsFileName(suggestion); textEditor->textDocument()->setFallbackSaveAsFileName(suggestion);
} }
QTC_ASSERT(editor, return); QTC_ASSERT(editor, return);
@@ -2337,7 +2337,7 @@ static DebuggerPlugin *m_instance = nullptr;
DebuggerPlugin::DebuggerPlugin() DebuggerPlugin::DebuggerPlugin()
{ {
setObjectName(QLatin1String("DebuggerPlugin")); setObjectName("DebuggerPlugin");
m_instance = this; m_instance = this;
} }
@@ -2507,7 +2507,7 @@ bool wantRunTool(ToolMode toolMode, const QString &toolName)
"Do you want to continue and run the tool in %2 mode?</p></body></html>") "Do you want to continue and run the tool in %2 mode?</p></body></html>")
.arg(toolName).arg(currentMode).arg(toolModeString); .arg(toolName).arg(currentMode).arg(toolModeString);
if (Utils::CheckableMessageBox::doNotAskAgainQuestion(ICore::mainWindow(), if (Utils::CheckableMessageBox::doNotAskAgainQuestion(ICore::mainWindow(),
title, message, ICore::settings(), QLatin1String("AnalyzerCorrectModeWarning")) title, message, ICore::settings(), "AnalyzerCorrectModeWarning")
!= QDialogButtonBox::Yes) != QDialogButtonBox::Yes)
return false; return false;
} }
@@ -2588,7 +2588,7 @@ void DebuggerUnitTests::initTestCase()
// QSKIP("No clang suitable for analyzing found"); // QSKIP("No clang suitable for analyzing found");
s_testRun = true; s_testRun = true;
m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(QLatin1String(":/unit-tests")); m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(":/unit-tests");
QVERIFY(m_tmpDir->isValid()); QVERIFY(m_tmpDir->isValid());
} }

View File

@@ -439,14 +439,14 @@ QString DebuggerResponse::toString() const
void extractGdbVersion(const QString &msg, void extractGdbVersion(const QString &msg,
int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb, bool *isQnxGdb) int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb, bool *isQnxGdb)
{ {
const QChar dot(QLatin1Char('.')); const QChar dot('.');
const bool ignoreParenthesisContent = msg.contains(QLatin1String("rubenvb")) const bool ignoreParenthesisContent = msg.contains("rubenvb")
|| msg.contains(QLatin1String("openSUSE")) || msg.contains("openSUSE")
|| msg.contains(QLatin1String("SUSE Linux Enterprise")); || msg.contains("SUSE Linux Enterprise");
const QChar parOpen(QLatin1Char('(')); const QChar parOpen('(');
const QChar parClose(QLatin1Char(')')); const QChar parClose(')');
QString cleaned; QString cleaned;
QString build; QString build;
@@ -476,8 +476,8 @@ void extractGdbVersion(const QString &msg,
} }
} }
*isMacGdb = msg.contains(QLatin1String("Apple version")); *isMacGdb = msg.contains("Apple version");
*isQnxGdb = msg.contains(QLatin1String("qnx")); *isQnxGdb = msg.contains("qnx");
*gdbVersion = 10000 * cleaned.section(dot, 0, 0).toInt() *gdbVersion = 10000 * cleaned.section(dot, 0, 0).toInt()
+ 100 * cleaned.section(dot, 1, 1).toInt() + 100 * cleaned.section(dot, 1, 1).toInt()
@@ -504,7 +504,7 @@ static QString quoteUnprintableLatin1(const QString &ba)
for (int i = 0, n = ba.size(); i != n; ++i) { for (int i = 0, n = ba.size(); i != n; ++i) {
const unsigned char c = ba.at(i).unicode(); const unsigned char c = ba.at(i).unicode();
if (isprint(c)) { if (isprint(c)) {
res += QLatin1Char(c); res += c;
} else { } else {
qsnprintf(buf, sizeof(buf) - 1, "\\%x", int(c)); qsnprintf(buf, sizeof(buf) - 1, "\\%x", int(c));
res += QLatin1String(buf); res += QLatin1String(buf);
@@ -638,18 +638,18 @@ QString decodeData(const QString &ba, const QString &encoding)
} }
case DebuggerEncoding::JulianDate: { case DebuggerEncoding::JulianDate: {
const QDate date = dateFromData(ba.toInt()); const QDate date = dateFromData(ba.toInt());
return date.isValid() ? date.toString(Qt::TextDate) : QLatin1String("(invalid)"); return date.isValid() ? date.toString(Qt::TextDate) : "(invalid)";
} }
case DebuggerEncoding::MillisecondsSinceMidnight: { case DebuggerEncoding::MillisecondsSinceMidnight: {
const QTime time = timeFromData(ba.toInt()); const QTime time = timeFromData(ba.toInt());
return time.isValid() ? time.toString(Qt::TextDate) : QLatin1String("(invalid)"); return time.isValid() ? time.toString(Qt::TextDate) : "(invalid)";
} }
case DebuggerEncoding::JulianDateAndMillisecondsSinceMidnight: { case DebuggerEncoding::JulianDateAndMillisecondsSinceMidnight: {
const int p = ba.indexOf('/'); const int p = ba.indexOf('/');
const QDate date = dateFromData(ba.left(p).toInt()); const QDate date = dateFromData(ba.left(p).toInt());
const QTime time = timeFromData(ba.mid(p + 1 ).toInt()); const QTime time = timeFromData(ba.mid(p + 1 ).toInt());
const QDateTime dateTime = QDateTime(date, time); const QDateTime dateTime = QDateTime(date, time);
return dateTime.isValid() ? dateTime.toString(Qt::TextDate) : QLatin1String("(invalid)"); return dateTime.isValid() ? dateTime.toString(Qt::TextDate) : "(invalid)";
} }
case DebuggerEncoding::HexEncodedUnsignedInteger: case DebuggerEncoding::HexEncodedUnsignedInteger:
case DebuggerEncoding::HexEncodedSignedInteger: case DebuggerEncoding::HexEncodedSignedInteger:
@@ -719,7 +719,7 @@ QString decodeData(const QString &ba, const QString &encoding)
} }
if (enc.quotes) { if (enc.quotes) {
const QChar doubleQuote(QLatin1Char('"')); const QChar doubleQuote('"');
result = doubleQuote + result + doubleQuote; result = doubleQuote + result + doubleQuote;
} }
return result; return result;
@@ -763,7 +763,7 @@ void DebuggerCommand::arg(const char *name, const QString &value)
void DebuggerCommand::arg(const char *name, const char *value) void DebuggerCommand::arg(const char *name, const char *value)
{ {
args = addToJsonObject(args, name, QLatin1String(value)); args = addToJsonObject(args, name, value);
} }
void DebuggerCommand::arg(const char *name, const QList<int> &list) void DebuggerCommand::arg(const char *name, const QList<int> &list)
@@ -786,7 +786,7 @@ void DebuggerCommand::arg(const char *value)
{ {
QTC_ASSERT(args.isArray() || args.isNull(), return); QTC_ASSERT(args.isArray() || args.isNull(), return);
QJsonArray arr = args.toArray(); QJsonArray arr = args.toArray();
arr.append(QLatin1String(value)); arr.append(value);
args = arr; args = arr;
} }
@@ -846,7 +846,7 @@ QString DebuggerCommand::argsToString() const
DebuggerEncoding::DebuggerEncoding(const QString &data) DebuggerEncoding::DebuggerEncoding(const QString &data)
{ {
const QVector<QStringRef> l = data.splitRef(QLatin1Char(':')); const QVector<QStringRef> l = data.splitRef(':');
const QStringRef &t = l.at(0); const QStringRef &t = l.at(0);
if (t == "latin1") { if (t == "latin1") {

View File

@@ -296,29 +296,29 @@ int DebuggerRunConfigurationAspect::portsUsedByDebugger() const
void DebuggerRunConfigurationAspect::toMap(QVariantMap &map) const void DebuggerRunConfigurationAspect::toMap(QVariantMap &map) const
{ {
map.insert(QLatin1String(USE_CPP_DEBUGGER_KEY), d.useCppDebugger == EnabledLanguage); map.insert(USE_CPP_DEBUGGER_KEY, d.useCppDebugger == EnabledLanguage);
map.insert(QLatin1String(USE_CPP_DEBUGGER_AUTO_KEY), d.useCppDebugger == AutoEnabledLanguage); map.insert(USE_CPP_DEBUGGER_AUTO_KEY, d.useCppDebugger == AutoEnabledLanguage);
map.insert(QLatin1String(USE_QML_DEBUGGER_KEY), d.useQmlDebugger == EnabledLanguage); map.insert(USE_QML_DEBUGGER_KEY, d.useQmlDebugger == EnabledLanguage);
map.insert(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), d.useQmlDebugger == AutoEnabledLanguage); map.insert(USE_QML_DEBUGGER_AUTO_KEY, d.useQmlDebugger == AutoEnabledLanguage);
map.insert(QLatin1String(QML_DEBUG_SERVER_PORT_KEY), d.qmlDebugServerPort); map.insert(QML_DEBUG_SERVER_PORT_KEY, d.qmlDebugServerPort);
map.insert(QLatin1String(USE_MULTIPROCESS_KEY), d.useMultiProcess); map.insert(USE_MULTIPROCESS_KEY, d.useMultiProcess);
} }
void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map) void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map)
{ {
if (map.value(QLatin1String(USE_CPP_DEBUGGER_AUTO_KEY), false).toBool()) { if (map.value(USE_CPP_DEBUGGER_AUTO_KEY, false).toBool()) {
d.useCppDebugger = AutoEnabledLanguage; d.useCppDebugger = AutoEnabledLanguage;
} else { } else {
bool useCpp = map.value(QLatin1String(USE_CPP_DEBUGGER_KEY), false).toBool(); bool useCpp = map.value(USE_CPP_DEBUGGER_KEY, false).toBool();
d.useCppDebugger = useCpp ? EnabledLanguage : DisabledLanguage; d.useCppDebugger = useCpp ? EnabledLanguage : DisabledLanguage;
} }
if (map.value(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), false).toBool()) { if (map.value(USE_QML_DEBUGGER_AUTO_KEY, false).toBool()) {
d.useQmlDebugger = AutoEnabledLanguage; d.useQmlDebugger = AutoEnabledLanguage;
} else { } else {
bool useQml = map.value(QLatin1String(USE_QML_DEBUGGER_KEY), false).toBool(); bool useQml = map.value(USE_QML_DEBUGGER_KEY, false).toBool();
d.useQmlDebugger = useQml ? EnabledLanguage : DisabledLanguage; d.useQmlDebugger = useQml ? EnabledLanguage : DisabledLanguage;
} }
d.useMultiProcess = map.value(QLatin1String(USE_MULTIPROCESS_KEY), false).toBool(); d.useMultiProcess = map.value(USE_MULTIPROCESS_KEY, false).toBool();
} }
} // namespace Debugger } // namespace Debugger

View File

@@ -676,7 +676,7 @@ void DebuggerRunTool::start()
DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger " DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger "
"languages currently active, and will be ignored.\n" "languages currently active, and will be ignored.\n"
"Affected are breakpoints %1") "Affected are breakpoints %1")
.arg(unhandledIds.join(QLatin1String(", "))); .arg(unhandledIds.join(", "));
showMessage(warningMessage, LogWarning); showMessage(warningMessage, LogWarning);

View File

@@ -133,8 +133,8 @@ SourcePathMap SourcePathMappingModel::sourcePathMap() const
// Check a mapping whether it still contains a placeholder. // Check a mapping whether it still contains a placeholder.
bool SourcePathMappingModel::isNewPlaceHolder(const Mapping &m) const bool SourcePathMappingModel::isNewPlaceHolder(const Mapping &m) const
{ {
const QLatin1Char lessThan('<'); const QChar lessThan('<');
const QLatin1Char greaterThan('>'); const QChar greaterThan('>');
return m.first.isEmpty() || m.first.startsWith(lessThan) return m.first.isEmpty() || m.first.startsWith(lessThan)
|| m.first.endsWith(greaterThan) || m.first.endsWith(greaterThan)
|| m.first == m_newSourcePlaceHolder || m.first == m_newSourcePlaceHolder
@@ -253,7 +253,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent
// Edit part // Edit part
m_targetChooser->setExpectedKind(PathChooser::ExistingDirectory); m_targetChooser->setExpectedKind(PathChooser::ExistingDirectory);
m_targetChooser->setHistoryCompleter(QLatin1String("Debugger.MappingTarget.History")); m_targetChooser->setHistoryCompleter("Debugger.MappingTarget.History");
connect(m_sourceLineEdit, &QLineEdit::textChanged, connect(m_sourceLineEdit, &QLineEdit::textChanged,
this, &DebuggerSourcePathMappingWidget::slotEditSourceFieldChanged); this, &DebuggerSourcePathMappingWidget::slotEditSourceFieldChanged);
connect(m_targetChooser, &PathChooser::pathChanged, connect(m_targetChooser, &PathChooser::pathChanged,
@@ -407,8 +407,8 @@ static QString findQtInstallPath(const FileName &qmakePath)
return QString(); return QString();
QProcess proc; QProcess proc;
QStringList args; QStringList args;
args.append(QLatin1String("-query")); args.append("-query");
args.append(QLatin1String("QT_INSTALL_HEADERS")); args.append("QT_INSTALL_HEADERS");
proc.start(qmakePath.toString(), args); proc.start(qmakePath.toString(), args);
if (!proc.waitForStarted()) { if (!proc.waitForStarted()) {
qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(qmakePath.toString()), qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(qmakePath.toString()),

View File

@@ -546,7 +546,7 @@ DebuggerToolTipWidget::DebuggerToolTipWidget()
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
isPinned = false; isPinned = false;
const QIcon pinIcon(QLatin1String(":/debugger/images/pin.xpm")); const QIcon pinIcon(":/debugger/images/pin.xpm");
pinButton = new QToolButton; pinButton = new QToolButton;
pinButton->setIcon(pinIcon); pinButton->setIcon(pinIcon);
@@ -582,7 +582,7 @@ DebuggerToolTipWidget::DebuggerToolTipWidget()
QString text; QString text;
QTextStream str(&text); QTextStream str(&text);
model.forAllItems([&str](ToolTipWatchItem *item) { model.forAllItems([&str](ToolTipWatchItem *item) {
str << QString(item->level(), QLatin1Char('\t')) str << QString(item->level(), '\t')
<< item->name << '\t' << item->value << '\t' << item->type << '\n'; << item->name << '\t' << item->value << '\t' << item->type << '\n';
}); });
QClipboard *clipboard = QApplication::clipboard(); QClipboard *clipboard = QApplication::clipboard();
@@ -832,7 +832,7 @@ void DebuggerToolTipHolder::updateTooltip(DebuggerEngine *engine)
// FIXME: The engine should decide on whether it likes // FIXME: The engine should decide on whether it likes
// the context. // the context.
const bool sameFrame = context.matchesFrame(frame) const bool sameFrame = context.matchesFrame(frame)
|| context.fileName.endsWith(QLatin1String(".py")); || context.fileName.endsWith(".py");
DEBUG("UPDATE TOOLTIP: STATE " << state << context.iname DEBUG("UPDATE TOOLTIP: STATE " << state << context.iname
<< "PINNED: " << widget->isPinned << "PINNED: " << widget->isPinned
<< "SHOW NEEDED: " << widget->isPinned << "SHOW NEEDED: " << widget->isPinned
@@ -940,29 +940,29 @@ static QDate dateFromString(const QString &date)
void DebuggerToolTipHolder::saveSessionData(QXmlStreamWriter &w) const void DebuggerToolTipHolder::saveSessionData(QXmlStreamWriter &w) const
{ {
w.writeStartElement(QLatin1String(toolTipElementC)); w.writeStartElement(toolTipElementC);
QXmlStreamAttributes attributes; QXmlStreamAttributes attributes;
// attributes.append(QLatin1String(toolTipClassAttributeC), QString::fromLatin1(metaObject()->className())); // attributes.append(toolTipClassAttributeC, QString::fromLatin1(metaObject()->className()));
attributes.append(QLatin1String(fileNameAttributeC), context.fileName); attributes.append(fileNameAttributeC, context.fileName);
if (!context.function.isEmpty()) if (!context.function.isEmpty())
attributes.append(QLatin1String(functionAttributeC), context.function); attributes.append(functionAttributeC, context.function);
attributes.append(QLatin1String(textPositionAttributeC), QString::number(context.position)); attributes.append(textPositionAttributeC, QString::number(context.position));
attributes.append(QLatin1String(textLineAttributeC), QString::number(context.line)); attributes.append(textLineAttributeC, QString::number(context.line));
attributes.append(QLatin1String(textColumnAttributeC), QString::number(context.column)); attributes.append(textColumnAttributeC, QString::number(context.column));
attributes.append(QLatin1String(dateAttributeC), creationDate.toString(QLatin1String("yyyyMMdd"))); attributes.append(dateAttributeC, creationDate.toString("yyyyMMdd"));
QPoint offset = widget->titleLabel->m_offset; QPoint offset = widget->titleLabel->m_offset;
if (offset.x()) if (offset.x())
attributes.append(QLatin1String(offsetXAttributeC), QString::number(offset.x())); attributes.append(offsetXAttributeC, QString::number(offset.x()));
if (offset.y()) if (offset.y())
attributes.append(QLatin1String(offsetYAttributeC), QString::number(offset.y())); attributes.append(offsetYAttributeC, QString::number(offset.y()));
attributes.append(QLatin1String(engineTypeAttributeC), context.engineType); attributes.append(engineTypeAttributeC, context.engineType);
attributes.append(QLatin1String(treeExpressionAttributeC), context.expression); attributes.append(treeExpressionAttributeC, context.expression);
attributes.append(QLatin1String(treeInameAttributeC), context.iname); attributes.append(treeInameAttributeC, context.iname);
w.writeAttributes(attributes); w.writeAttributes(attributes);
w.writeStartElement(QLatin1String(treeElementC)); w.writeStartElement(treeElementC);
widget->model.forAllItems([&w](ToolTipWatchItem *item) { widget->model.forAllItems([&w](ToolTipWatchItem *item) {
const QString modelItemElement = QLatin1String(modelItemElementC); const QString modelItemElement(modelItemElementC);
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
const QString value = item->data(i, Qt::DisplayRole).toString(); const QString value = item->data(i, Qt::DisplayRole).toString();
if (value.isEmpty()) if (value.isEmpty())
@@ -1078,36 +1078,36 @@ void DebuggerToolTipManagerPrivate::loadSessionData()
closeAllToolTips(); closeAllToolTips();
const QString data = SessionManager::value(sessionSettingsKeyC).toString(); const QString data = SessionManager::value(sessionSettingsKeyC).toString();
QXmlStreamReader r(data); QXmlStreamReader r(data);
if (r.readNextStartElement() && r.name() == QLatin1String(sessionDocumentC)) { if (r.readNextStartElement() && r.name() == sessionDocumentC) {
while (!r.atEnd()) { while (!r.atEnd()) {
if (readStartElement(r, toolTipElementC)) { if (readStartElement(r, toolTipElementC)) {
const QXmlStreamAttributes attributes = r.attributes(); const QXmlStreamAttributes attributes = r.attributes();
DebuggerToolTipContext context; DebuggerToolTipContext context;
context.fileName = attributes.value(QLatin1String(fileNameAttributeC)).toString(); context.fileName = attributes.value(fileNameAttributeC).toString();
context.position = attributes.value(QLatin1String(textPositionAttributeC)).toString().toInt(); context.position = attributes.value(textPositionAttributeC).toString().toInt();
context.line = attributes.value(QLatin1String(textLineAttributeC)).toString().toInt(); context.line = attributes.value(textLineAttributeC).toString().toInt();
context.column = attributes.value(QLatin1String(textColumnAttributeC)).toString().toInt(); context.column = attributes.value(textColumnAttributeC).toString().toInt();
context.function = attributes.value(QLatin1String(functionAttributeC)).toString(); context.function = attributes.value(functionAttributeC).toString();
QPoint offset; QPoint offset;
const QString offsetXAttribute = QLatin1String(offsetXAttributeC); const QString offsetXAttribute(offsetXAttributeC);
const QString offsetYAttribute = QLatin1String(offsetYAttributeC); const QString offsetYAttribute(offsetYAttributeC);
if (attributes.hasAttribute(offsetXAttribute)) if (attributes.hasAttribute(offsetXAttribute))
offset.setX(attributes.value(offsetXAttribute).toString().toInt()); offset.setX(attributes.value(offsetXAttribute).toString().toInt());
if (attributes.hasAttribute(offsetYAttribute)) if (attributes.hasAttribute(offsetYAttribute))
offset.setY(attributes.value(offsetYAttribute).toString().toInt()); offset.setY(attributes.value(offsetYAttribute).toString().toInt());
context.mousePosition = offset; context.mousePosition = offset;
context.iname = attributes.value(QLatin1String(treeInameAttributeC)).toString(); context.iname = attributes.value(treeInameAttributeC).toString();
context.expression = attributes.value(QLatin1String(treeExpressionAttributeC)).toString(); context.expression = attributes.value(treeExpressionAttributeC).toString();
// const QStringRef className = attributes.value(QLatin1String(toolTipClassAttributeC)); // const QStringRef className = attributes.value(toolTipClassAttributeC);
context.engineType = attributes.value(QLatin1String(engineTypeAttributeC)).toString(); context.engineType = attributes.value(engineTypeAttributeC).toString();
context.creationDate = dateFromString(attributes.value(QLatin1String(dateAttributeC)).toString()); context.creationDate = dateFromString(attributes.value(dateAttributeC).toString());
bool readTree = context.isValid(); bool readTree = context.isValid();
if (!context.creationDate.isValid() || context.creationDate.daysTo(QDate::currentDate()) > toolTipsExpiryDays) { if (!context.creationDate.isValid() || context.creationDate.daysTo(QDate::currentDate()) > toolTipsExpiryDays) {
// DEBUG("Expiring tooltip " << context.fileName << '@' << context.position << " from " << creationDate) // DEBUG("Expiring tooltip " << context.fileName << '@' << context.position << " from " << creationDate)
//readTree = false; //readTree = false;
} else { //if (className != QLatin1String("Debugger::Internal::DebuggerToolTipWidget")) { } else { //if (className != "Debugger::Internal::DebuggerToolTipWidget") {
//qWarning("Unable to create debugger tool tip widget of class %s", qPrintable(className.toString())); //qWarning("Unable to create debugger tool tip widget of class %s", qPrintable(className.toString()));
//readTree = false; //readTree = false;
} }
@@ -1136,8 +1136,8 @@ void DebuggerToolTipManagerPrivate::saveSessionData()
QXmlStreamWriter w(&data); QXmlStreamWriter w(&data);
w.writeStartDocument(); w.writeStartDocument();
w.writeStartElement(QLatin1String(sessionDocumentC)); w.writeStartElement(sessionDocumentC);
w.writeAttribute(QLatin1String(sessionVersionAttributeC), QLatin1String("1.0")); w.writeAttribute(sessionVersionAttributeC, "1.0");
for (DebuggerToolTipHolder *tooltip : qAsConst(m_tooltips)) for (DebuggerToolTipHolder *tooltip : qAsConst(m_tooltips))
if (tooltip->widget->isPinned) if (tooltip->widget->isPinned)
tooltip->saveSessionData(w); tooltip->saveSessionData(w);

View File

@@ -309,7 +309,7 @@ void DisassemblerAgent::setContentsToDocument(const DisassemblerLines &contents)
{ {
QTC_ASSERT(d, return); QTC_ASSERT(d, return);
if (!d->document) { if (!d->document) {
QString titlePattern = QLatin1String("Disassembler"); QString titlePattern = "Disassembler";
IEditor *editor = EditorManager::openEditorWithContents( IEditor *editor = EditorManager::openEditorWithContents(
Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, Core::Constants::K_DEFAULT_TEXT_EDITOR_ID,
&titlePattern); &titlePattern);

View File

@@ -52,12 +52,12 @@ void DisassemblerLine::fromString(const QString &unparsed)
QString addr = unparsed.left(pos); QString addr = unparsed.left(pos);
// MSVC 64bit: Remove 64bit separator 00000000`00a45000'. // MSVC 64bit: Remove 64bit separator 00000000`00a45000'.
if (addr.size() >= 9 && addr.at(8) == QLatin1Char('`')) if (addr.size() >= 9 && addr.at(8) == '`')
addr.remove(8, 1); addr.remove(8, 1);
if (addr.endsWith(QLatin1Char(':'))) // clang if (addr.endsWith(':')) // clang
addr.chop(1); addr.chop(1);
if (addr.startsWith(QLatin1String("0x"))) if (addr.startsWith("0x"))
addr.remove(0, 2); addr.remove(0, 2);
bool ok = false; bool ok = false;
address = addr.toULongLong(&ok, 16); address = addr.toULongLong(&ok, 16);
@@ -121,7 +121,7 @@ void DisassemblerLines::appendSourceLine(const QString &fileName, uint lineNumbe
QFile file(fileName); QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) { if (file.open(QIODevice::ReadOnly)) {
QTextStream ts(&file); QTextStream ts(&file);
cache->lines = ts.readAll().split(QLatin1Char('\n')); cache->lines = ts.readAll().split('\n');
} }
} }
if (lineNumber >= uint(cache->lines.size())) if (lineNumber >= uint(cache->lines.size()))
@@ -144,42 +144,42 @@ void DisassemblerLines::appendUnparsed(const QString &unparsed)
QString line = unparsed.trimmed(); QString line = unparsed.trimmed();
if (line.isEmpty()) if (line.isEmpty())
return; return;
if (line.startsWith(QLatin1String("Current language:"))) if (line.startsWith("Current language:"))
return; return;
if (line.startsWith(QLatin1String("Dump of assembler"))) { if (line.startsWith("Dump of assembler")) {
m_lastFunction.clear(); m_lastFunction.clear();
return; return;
} }
if (line.startsWith(QLatin1String("The current source"))) if (line.startsWith("The current source"))
return; return;
if (line.startsWith(QLatin1String("End of assembler"))) { if (line.startsWith("End of assembler")) {
m_lastFunction.clear(); m_lastFunction.clear();
return; return;
} }
if (line.startsWith(QLatin1String("=> "))) if (line.startsWith("=> "))
line = line.mid(3); line = line.mid(3);
if (line.startsWith(QLatin1String("0x"))) { if (line.startsWith("0x")) {
// Address line. Split at the tab. // Address line. Split at the tab.
int tab1 = line.indexOf(QLatin1Char('\t')); int tab1 = line.indexOf('\t');
if (tab1 == -1) { if (tab1 == -1) {
appendComment(line); appendComment(line);
return; return;
} }
int tab2 = line.indexOf(QLatin1Char('\t'), tab1 + 1); int tab2 = line.indexOf('\t', tab1 + 1);
if (tab2 == -1) if (tab2 == -1)
tab2 = tab1; tab2 = tab1;
QString address = line.left(tab1); QString address = line.left(tab1);
if (address.endsWith(QLatin1Char(':'))) if (address.endsWith(':'))
address.chop(1); address.chop(1);
int pos1 = address.indexOf(QLatin1Char('<')) + 1; int pos1 = address.indexOf('<') + 1;
DisassemblerLine dl; DisassemblerLine dl;
dl.bytes = line.mid(tab1, tab2 - tab1).trimmed(); dl.bytes = line.mid(tab1, tab2 - tab1).trimmed();
m_bytesLength = qMax(m_bytesLength, tab2 - tab1); m_bytesLength = qMax(m_bytesLength, tab2 - tab1);
dl.data = line.mid(tab2).trimmed(); dl.data = line.mid(tab2).trimmed();
if (pos1 && address.indexOf(QLatin1String("<UNDEFINED> instruction:")) == -1) { if (pos1 && address.indexOf("<UNDEFINED> instruction:") == -1) {
if (address.endsWith(QLatin1Char('>'))) if (address.endsWith('>'))
address.chop(1); address.chop(1);
int pos2 = address.indexOf(QLatin1Char('+'), pos1); int pos2 = address.indexOf('+', pos1);
if (pos1 < pos2) { if (pos1 < pos2) {
QString function = address.mid(pos1, pos2 - pos1); QString function = address.mid(pos1, pos2 - pos1);
if (function != m_lastFunction) { if (function != m_lastFunction) {
@@ -222,7 +222,7 @@ QString DisassemblerLine::toString(int maxOp) const
else else
str += " "; str += " ";
str += QString(" %1 ").arg(bytes); str += QString(" %1 ").arg(bytes);
str += QString(maxOp - bytes.size(), QLatin1Char(' ')); str += QString(maxOp - bytes.size(), ' ');
str += data; str += data;
} else if (isCode()) { } else if (isCode()) {
str += someSpace; str += someSpace;
@@ -244,7 +244,7 @@ QString DisassemblerLines::toString() const
QString str; QString str;
for (int i = 0, n = size(); i != n; ++i) { for (int i = 0, n = size(); i != n; ++i) {
str += m_data.at(i).toString(m_bytesLength); str += m_data.at(i).toString(m_bytesLength);
str += QLatin1Char('\n'); str += '\n';
} }
return str; return str;
} }

View File

@@ -69,7 +69,7 @@ QString SnapshotData::function() const
if (m_frames.isEmpty()) if (m_frames.isEmpty())
return QString(); return QString();
const StackFrame &frame = m_frames.at(0); const StackFrame &frame = m_frames.at(0);
return frame.function + QLatin1Char(':') + QString::number(frame.line); return frame.function + ':' + QString::number(frame.line);
} }
QString SnapshotData::toString() const QString SnapshotData::toString() const

View File

@@ -2731,7 +2731,7 @@ void GdbEngine::handleShowModuleSections(const DebuggerResponse &response,
// ~" 0xb44a6114->0xb44a6138 at 0x00000114: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS\n" // ~" 0xb44a6114->0xb44a6138 at 0x00000114: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS\n"
if (response.resultClass == ResultDone) { if (response.resultClass == ResultDone) {
const QStringList lines = response.consoleStreamOutput.split('\n'); const QStringList lines = response.consoleStreamOutput.split('\n');
const QString prefix = QLatin1String(" Object file: "); const QString prefix = " Object file: ";
const QString needle = prefix + moduleName; const QString needle = prefix + moduleName;
Sections sections; Sections sections;
bool active = false; bool active = false;
@@ -3575,7 +3575,7 @@ void GdbEngine::setupEngine()
} }
const QString tests = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_TESTS")); const QString tests = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_TESTS"));
foreach (const QStringRef &test, tests.splitRef(QLatin1Char(','))) foreach (const QStringRef &test, tests.splitRef(','))
m_testCases.insert(test.toInt()); m_testCases.insert(test.toInt());
foreach (int test, m_testCases) foreach (int test, m_testCases)
showMessage("ENABLING TEST CASE: " + QString::number(test)); showMessage("ENABLING TEST CASE: " + QString::number(test));
@@ -4688,7 +4688,7 @@ static QString findExecutableFromName(const QString &fileNameFromCore, const QSt
return absPath; return absPath;
// remove possible trailing arguments // remove possible trailing arguments
QLatin1Char sep(' '); QChar sep(' ');
QStringList pathFragments = absPath.split(sep); QStringList pathFragments = absPath.split(sep);
while (pathFragments.size() > 0) { while (pathFragments.size() > 0) {
QString joined_path = pathFragments.join(sep); QString joined_path = pathFragments.join(sep);

View File

@@ -124,7 +124,7 @@ void ImageViewer::setInfo(const QString &info)
void ImageViewer::clicked(const QString &message) void ImageViewer::clicked(const QString &message)
{ {
const QString text = m_info + QLatin1Char('\n') const QString text = m_info + '\n'
+ (message.isEmpty() ? tr("<Click to display color>") : message); + (message.isEmpty() ? tr("<Click to display color>") : message);
m_infoLabel->setText(text); m_infoLabel->setText(text);
} }

View File

@@ -797,7 +797,7 @@ QString LldbEngine::errorMessage(QProcess::ProcessError error) const
void LldbEngine::handleLldbFinished(int exitCode, QProcess::ExitStatus exitStatus) void LldbEngine::handleLldbFinished(int exitCode, QProcess::ExitStatus exitStatus)
{ {
notifyDebuggerProcessFinished(exitCode, exitStatus, QLatin1String("LLDB")); notifyDebuggerProcessFinished(exitCode, exitStatus, "LLDB");
} }
void LldbEngine::readLldbStandardError() void LldbEngine::readLldbStandardError()
@@ -960,7 +960,7 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent)
//dl.rawData = line["rawdata"].data(); //dl.rawData = line["rawdata"].data();
dl.data = line["rawdata"].data(); dl.data = line["rawdata"].data();
if (!dl.data.isEmpty()) if (!dl.data.isEmpty())
dl.data += QString(30 - dl.data.size(), QLatin1Char(' ')); dl.data += QString(30 - dl.data.size(), ' ');
dl.data += fromHex(line["hexdata"].data()); dl.data += fromHex(line["hexdata"].data());
dl.data += line["data"].data(); dl.data += line["data"].data();
dl.offset = line["offset"].toInt(); dl.offset = line["offset"].toInt();

View File

@@ -270,17 +270,17 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
d->selectRemoteCoreButton = new QPushButton(PathChooser::browseButtonLabel(), this); d->selectRemoteCoreButton = new QPushButton(PathChooser::browseButtonLabel(), this);
d->localCoreFileName = new PathChooser(this); d->localCoreFileName = new PathChooser(this);
d->localCoreFileName->setHistoryCompleter(QLatin1String("Debugger.CoreFile.History")); d->localCoreFileName->setHistoryCompleter("Debugger.CoreFile.History");
d->localCoreFileName->setExpectedKind(PathChooser::File); d->localCoreFileName->setExpectedKind(PathChooser::File);
d->localCoreFileName->setPromptDialogTitle(tr("Select Core File")); d->localCoreFileName->setPromptDialogTitle(tr("Select Core File"));
d->localExecFileName = new PathChooser(this); d->localExecFileName = new PathChooser(this);
d->localExecFileName->setHistoryCompleter(QLatin1String("LocalExecutable")); d->localExecFileName->setHistoryCompleter("LocalExecutable");
d->localExecFileName->setExpectedKind(PathChooser::File); d->localExecFileName->setExpectedKind(PathChooser::File);
d->localExecFileName->setPromptDialogTitle(tr("Select Executable")); d->localExecFileName->setPromptDialogTitle(tr("Select Executable"));
d->overrideStartScriptFileName = new PathChooser(this); d->overrideStartScriptFileName = new PathChooser(this);
d->overrideStartScriptFileName->setHistoryCompleter(QLatin1String("Debugger.StartupScript.History")); d->overrideStartScriptFileName->setHistoryCompleter("Debugger.StartupScript.History");
d->overrideStartScriptFileName->setExpectedKind(PathChooser::File); d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script")); d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));

View File

@@ -175,7 +175,7 @@ private:
{ {
using Utils::Theme; using Utils::Theme;
Theme *theme = Utils::creatorTheme(); Theme *theme = Utils::creatorTheme();
if (text.size() > 3 && text.at(2) == QLatin1Char(':')) { if (text.size() > 3 && text.at(2) == ':') {
QTextCharFormat format; QTextCharFormat format;
format.setForeground(theme->color(Theme::Debugger_LogWindow_LogTime)); format.setForeground(theme->color(Theme::Debugger_LogWindow_LogTime));
setFormat(1, text.size(), format); setFormat(1, text.size(), format);
@@ -310,7 +310,7 @@ private:
int n = 0; int n = 0;
// cut time string // cut time string
if (line.size() > 18 && line.at(0) == QLatin1Char('[')) if (line.size() > 18 && line.at(0) == '[')
line = line.mid(18); line = line.mid(18);
//qDebug() << line; //qDebug() << line;
@@ -358,8 +358,8 @@ public:
void gotoResult(int i) void gotoResult(int i)
{ {
QString needle = QString::number(i) + QLatin1Char('^'); QString needle = QString::number(i) + '^';
QString needle2 = QLatin1Char('>') + needle; QString needle2 = '>' + needle;
QString needle3 = QString::fromLatin1("dtoken(\"%1\")@").arg(i); QString needle3 = QString::fromLatin1("dtoken(\"%1\")@").arg(i);
QTextCursor cursor(document()); QTextCursor cursor(document());
do { do {
@@ -394,7 +394,7 @@ LogWindow::LogWindow(DebuggerEngine *engine)
: m_engine(engine) : m_engine(engine)
{ {
setWindowTitle(tr("Debugger &Log")); setWindowTitle(tr("Debugger &Log"));
setObjectName(QLatin1String("Log")); setObjectName("Log");
m_ignoreNextInputEcho = false; m_ignoreNextInputEcho = false;
@@ -412,7 +412,7 @@ LogWindow::LogWindow(DebuggerEngine *engine)
m_commandEdit = new Utils::FancyLineEdit(this); m_commandEdit = new Utils::FancyLineEdit(this);
m_commandEdit->setFrame(false); m_commandEdit->setFrame(false);
m_commandEdit->setHistoryCompleter(QLatin1String("DebuggerInput")); m_commandEdit->setHistoryCompleter("DebuggerInput");
auto repeatButton = new QToolButton(this); auto repeatButton = new QToolButton(this);
repeatButton->setIcon(Icons::STEP_OVER.icon()); repeatButton->setIcon(Icons::STEP_OVER.icon());
@@ -521,12 +521,12 @@ void LogWindow::showOutput(int channel, const QString &output)
return; return;
const QChar cchar = charForChannel(channel); const QChar cchar = charForChannel(channel);
const QChar nchar = QLatin1Char('\n'); const QChar nchar = '\n';
QString out; QString out;
out.reserve(output.size() + 1000); out.reserve(output.size() + 1000);
if (output.at(0) != QLatin1Char('~') && boolSetting(LogTimeStamps)) { if (output.at(0) != '~' && boolSetting(LogTimeStamps)) {
out.append(charForChannel(LogTime)); out.append(charForChannel(LogTime));
out.append(logTimeStamp()); out.append(logTimeStamp());
out.append(nchar); out.append(nchar);
@@ -536,12 +536,12 @@ void LogWindow::showOutput(int channel, const QString &output)
const int npos = output.indexOf(nchar, pos); const int npos = output.indexOf(nchar, pos);
const int nnpos = npos == -1 ? n : npos; const int nnpos = npos == -1 ? n : npos;
const int l = nnpos - pos; const int l = nnpos - pos;
if (l != 6 || output.midRef(pos, 6) != QLatin1String("(gdb) ")) { if (l != 6 || output.midRef(pos, 6) != "(gdb) ") {
out.append(cchar); out.append(cchar);
if (l > 30000) { if (l > 30000) {
// FIXME: QTextEdit asserts on really long lines... // FIXME: QTextEdit asserts on really long lines...
out.append(output.midRef(pos, 30000)); out.append(output.midRef(pos, 30000));
out.append(QLatin1String(" [...] <cut off>\n")); out.append(" [...] <cut off>\n");
} else { } else {
out.append(output.midRef(pos, l + 1)); out.append(output.midRef(pos, l + 1));
} }
@@ -631,7 +631,7 @@ QString LogWindow::logTimeStamp()
{ {
// Cache the last log time entry by ms. If time progresses, // Cache the last log time entry by ms. If time progresses,
// report the difference to the last time stamp in ms. // report the difference to the last time stamp in ms.
static const QString logTimeFormat(QLatin1String("hh:mm:ss.zzz")); static const QString logTimeFormat("hh:mm:ss.zzz");
static QTime lastTime = QTime::currentTime(); static QTime lastTime = QTime::currentTime();
static QString lastTimeStamp = lastTime.toString(logTimeFormat); static QString lastTimeStamp = lastTime.toString(logTimeFormat);
@@ -642,9 +642,9 @@ QString LogWindow::logTimeStamp()
lastTimeStamp = lastTime.toString(logTimeFormat); lastTimeStamp = lastTime.toString(logTimeFormat);
// Append time elapsed // Append time elapsed
QString rc = lastTimeStamp; QString rc = lastTimeStamp;
rc += QLatin1String(" ["); rc += " [";
rc += QString::number(elapsedMS); rc += QString::number(elapsedMS);
rc += QLatin1String("ms]"); rc += "ms]";
return rc; return rc;
} }
return lastTimeStamp; return lastTimeStamp;

View File

@@ -56,7 +56,7 @@ public:
#define DEMANGLER_ASSERT(cond) \ #define DEMANGLER_ASSERT(cond) \
do { \ do { \
if (!(cond)) { \ if (!(cond)) { \
throw InternalDemanglerException(QLatin1String(Q_FUNC_INFO), QLatin1String(__FILE__), __LINE__); \ throw InternalDemanglerException(Q_FUNC_INFO, __FILE__, __LINE__); \
} \ } \
} while (0) } while (0)
@@ -69,8 +69,7 @@ template <typename T> QSharedPointer<T> demanglerCast(const QSharedPointer<Parse
return out; return out;
} }
#define DEMANGLER_CAST(type, input) demanglerCast<type>(input, QLatin1String(Q_FUNC_INFO), \ #define DEMANGLER_CAST(type, input) demanglerCast<type>(input, Q_FUNC_INFO, __FILE__, __LINE__)
QLatin1String(__FILE__), __LINE__)
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger

View File

@@ -43,7 +43,7 @@ char GlobalParseState::advance(int steps)
{ {
Q_ASSERT(steps > 0); Q_ASSERT(steps > 0);
if (m_pos + steps > m_mangledName.size()) if (m_pos + steps > m_mangledName.size())
throw ParseException(QLatin1String("Unexpected end of input")); throw ParseException("Unexpected end of input");
const char c = m_mangledName[m_pos]; const char c = m_mangledName[m_pos];
m_pos += steps; m_pos += steps;

View File

@@ -62,7 +62,7 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName)
MangledNameRule::parse(&m_parseState, ParseTreeNode::Ptr()); MangledNameRule::parse(&m_parseState, ParseTreeNode::Ptr());
if (m_parseState.m_pos != m_parseState.m_mangledName.size()) if (m_parseState.m_pos != m_parseState.m_mangledName.size())
throw ParseException(QLatin1String("Unconsumed input")); throw ParseException("Unconsumed input");
if (m_parseState.m_parseStack.count() != 1) { if (m_parseState.m_parseStack.count() != 1) {
throw ParseException(QString::fromLatin1("There are %1 elements on the parse stack; " throw ParseException(QString::fromLatin1("There are %1 elements on the parse stack; "
"expected one.").arg(m_parseState.m_parseStack.count())); "expected one.").arg(m_parseState.m_parseStack.count()));

View File

@@ -54,7 +54,7 @@
#define PARSE_RULE_AND_ADD_RESULT_AS_CHILD(nodeType) \ #define PARSE_RULE_AND_ADD_RESULT_AS_CHILD(nodeType) \
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_THIS(nodeType, parseState()) PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_THIS(nodeType, parseState())
#define CHILD_AT(obj, index) obj->childAt(index, QLatin1String(Q_FUNC_INFO), QLatin1String(__FILE__), __LINE__) #define CHILD_AT(obj, index) obj->childAt(index, Q_FUNC_INFO, __FILE__, __LINE__)
#define MY_CHILD_AT(index) CHILD_AT(this, index) #define MY_CHILD_AT(index) CHILD_AT(this, index)
#define CHILD_TO_BYTEARRAY(index) MY_CHILD_AT(index)->toByteArray() #define CHILD_TO_BYTEARRAY(index) MY_CHILD_AT(index)->toByteArray()
@@ -514,12 +514,12 @@ void CvQualifiersNode::parse()
while (true) { while (true) {
if (PEEK() == 'V') { if (PEEK() == 'V') {
if (hasQualifiers()) if (hasQualifiers())
throw ParseException(QLatin1String("Invalid qualifiers: unexpected 'volatile'")); throw ParseException("Invalid qualifiers: unexpected 'volatile'");
m_hasVolatile = true; m_hasVolatile = true;
ADVANCE(); ADVANCE();
} else if (PEEK() == 'K') { } else if (PEEK() == 'K') {
if (m_hasConst) if (m_hasConst)
throw ParseException(QLatin1String("Invalid qualifiers: 'const' appears twice")); throw ParseException("Invalid qualifiers: 'const' appears twice");
m_hasConst = true; m_hasConst = true;
ADVANCE(); ADVANCE();
} else { } else {
@@ -684,7 +684,7 @@ void ExpressionNode::parse()
while (ExpressionNode::mangledRepresentationStartsWith(PEEK())) while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
if (ADVANCE() != '_') if (ADVANCE() != '_')
throw ParseException(QLatin1String("Invalid expression")); throw ParseException("Invalid expression");
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TypeNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TypeNode);
if (PEEK() == 'E') if (PEEK() == 'E')
ADVANCE(); ADVANCE();
@@ -1269,7 +1269,7 @@ void ExprPrimaryNode::parse()
? BuiltinTypeNode::Ptr() ? BuiltinTypeNode::Ptr()
: CHILD_AT(topLevelTypeNode, 0).dynamicCast<BuiltinTypeNode>(); : CHILD_AT(topLevelTypeNode, 0).dynamicCast<BuiltinTypeNode>();
if (!typeNode) if (!typeNode)
throw ParseException(QLatin1String("Invalid type in expr-primary")); throw ParseException("Invalid type in expr-primary");
switch (typeNode->type()) { switch (typeNode->type()) {
case BuiltinTypeNode::UnsignedShortType: case BuiltinTypeNode::UnsignedShortType:
@@ -2046,7 +2046,7 @@ void NumberNode::parse()
{ {
const char next = PEEK(); const char next = PEEK();
if (!mangledRepresentationStartsWith(next)) if (!mangledRepresentationStartsWith(next))
throw ParseException(QLatin1String("Invalid number")); throw ParseException("Invalid number");
if (next == 'n') { if (next == 'n') {
m_isNegative = true; m_isNegative = true;
@@ -2756,15 +2756,15 @@ QByteArray LambdaSigNode::toByteArray() const
void ClosureTypeNameNode::parse() void ClosureTypeNameNode::parse()
{ {
if (parseState()->readAhead(2) != "Ul") if (parseState()->readAhead(2) != "Ul")
throw ParseException(QLatin1String("Invalid closure-type-name")); throw ParseException("Invalid closure-type-name");
parseState()->advance(2); parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(LambdaSigNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(LambdaSigNode);
if (ADVANCE() != 'E') if (ADVANCE() != 'E')
throw ParseException(QLatin1String("invalid closure-type-name")); throw ParseException("invalid closure-type-name");
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK())) if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_') if (ADVANCE() != '_')
throw ParseException(QLatin1String("Invalid closure-type-name")); throw ParseException("Invalid closure-type-name");
} }
QByteArray ClosureTypeNameNode::toByteArray() const QByteArray ClosureTypeNameNode::toByteArray() const
@@ -2798,7 +2798,7 @@ void UnnamedTypeNameNode::parse()
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK())) if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_') if (ADVANCE() != '_')
throw ParseException(QLatin1String("Invalid unnamed-type-node")); throw ParseException("Invalid unnamed-type-node");
} else { } else {
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ClosureTypeNameNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ClosureTypeNameNode);
} }
@@ -2834,7 +2834,7 @@ void DeclTypeNode::parse()
{ {
const QByteArray start = parseState()->readAhead(2); const QByteArray start = parseState()->readAhead(2);
if (start != "DT" && start != "Dt") if (start != "DT" && start != "Dt")
throw ParseException(QLatin1String("Invalid decltype")); throw ParseException("Invalid decltype");
parseState()->advance(2); parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
if (ADVANCE() != 'E') if (ADVANCE() != 'E')
@@ -2870,7 +2870,7 @@ void UnresolvedTypeRule::parse(GlobalParseState *parseState)
else if (SubstitutionNode::mangledRepresentationStartsWith(next)) else if (SubstitutionNode::mangledRepresentationStartsWith(next))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(SubstitutionNode, parseState, parentNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(SubstitutionNode, parseState, parentNode);
else else
throw ParseException(QLatin1String("Invalid unresolved-type")); throw ParseException("Invalid unresolved-type");
} }
@@ -2911,7 +2911,7 @@ void DestructorNameNode::parse()
else if (SimpleIdNode::mangledRepresentationStartsWith(next)) else if (SimpleIdNode::mangledRepresentationStartsWith(next))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SimpleIdNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SimpleIdNode);
else else
throw ParseException(QLatin1String("Invalid destructor-name")); throw ParseException("Invalid destructor-name");
} }
QByteArray DestructorNameNode::toByteArray() const QByteArray DestructorNameNode::toByteArray() const
@@ -2965,7 +2965,7 @@ void BaseUnresolvedNameNode::parse()
parseState()->advance(2); parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(DestructorNameNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(DestructorNameNode);
} else { } else {
throw ParseException(QLatin1String("Invalid <base-unresolved-name>")); throw ParseException("Invalid <base-unresolved-name>");
} }
} }
@@ -2992,12 +2992,12 @@ bool InitializerNode::mangledRepresentationStartsWith(char c)
void InitializerNode::parse() void InitializerNode::parse()
{ {
if (parseState()->readAhead(2) != "pi") if (parseState()->readAhead(2) != "pi")
throw ParseException(QLatin1String("Invalid initializer")); throw ParseException("Invalid initializer");
parseState()->advance(2); parseState()->advance(2);
while (ExpressionNode::mangledRepresentationStartsWith(PEEK())) while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
if (ADVANCE() != 'E') if (ADVANCE() != 'E')
throw ParseException(QLatin1String("Invalid initializer")); throw ParseException("Invalid initializer");
} }
QByteArray InitializerNode::toByteArray() const QByteArray InitializerNode::toByteArray() const
@@ -3044,20 +3044,20 @@ void UnresolvedNameNode::parse()
UnresolvedQualifierLevelRule::parse(parseState()); UnresolvedQualifierLevelRule::parse(parseState());
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK())); while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()));
if (ADVANCE() != 'E') if (ADVANCE() != 'E')
throw ParseException(QLatin1String("Invalid unresolved-name")); throw ParseException("Invalid unresolved-name");
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
} else if (UnresolvedTypeRule::mangledRepresentationStartsWith(PEEK())) { } else if (UnresolvedTypeRule::mangledRepresentationStartsWith(PEEK())) {
if (m_globalNamespace) if (m_globalNamespace)
throw ParseException(QLatin1String("Invalid unresolved-name")); throw ParseException("Invalid unresolved-name");
UnresolvedTypeRule::parse(parseState()); UnresolvedTypeRule::parse(parseState());
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
} else { } else {
if (!UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK())) if (!UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
throw ParseException(QLatin1String("Invalid unresolved-name")); throw ParseException("Invalid unresolved-name");
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK())) while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
UnresolvedQualifierLevelRule::parse(parseState()); UnresolvedQualifierLevelRule::parse(parseState());
if (ADVANCE() != 'E') if (ADVANCE() != 'E')
throw ParseException(QLatin1String("Invalid unresolved-name")); throw ParseException("Invalid unresolved-name");
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
} }
} else { } else {
@@ -3103,19 +3103,19 @@ void FunctionParamNode::parse()
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK())) if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_') if (ADVANCE() != '_')
throw ParseException(QLatin1String("Invalid function-param")); throw ParseException("Invalid function-param");
} else if (parseState()->readAhead(2) == "fL") { } else if (parseState()->readAhead(2) == "fL") {
parseState()->advance(2); parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != 'p') if (ADVANCE() != 'p')
throw ParseException(QLatin1String("Invalid function-param")); throw ParseException("Invalid function-param");
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(CvQualifiersNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(CvQualifiersNode);
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK())) if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_') if (ADVANCE() != '_')
throw ParseException(QLatin1String("Invalid function-param")); throw ParseException("Invalid function-param");
} else { } else {
throw ParseException(QLatin1String("Invalid function-param")); throw ParseException("Invalid function-param");
} }
} }

View File

@@ -115,7 +115,7 @@ void PdbEngine::setupEngine()
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
m_interpreter = runParameters().interpreter; m_interpreter = runParameters().interpreter;
QString bridge = ICore::resourcePath() + QLatin1String("/debugger/pdbbridge.py"); QString bridge = ICore::resourcePath() + "/debugger/pdbbridge.py";
connect(&m_proc, &QProcess::errorOccurred, this, &PdbEngine::handlePdbError); connect(&m_proc, &QProcess::errorOccurred, this, &PdbEngine::handlePdbError);
connect(&m_proc, static_cast<void(QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished), connect(&m_proc, static_cast<void(QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished),
@@ -135,7 +135,7 @@ void PdbEngine::setupEngine()
QStringList args = {bridge, scriptFile.fileName()}; QStringList args = {bridge, scriptFile.fileName()};
args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory)); args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory));
showMessage("STARTING " + m_interpreter + QLatin1Char(' ') + args.join(QLatin1Char(' '))); showMessage("STARTING " + m_interpreter + ' ' + args.join(' '));
m_proc.setEnvironment(runParameters().debugger.environment.toStringList()); m_proc.setEnvironment(runParameters().debugger.environment.toStringList());
m_proc.start(m_interpreter, args); m_proc.start(m_interpreter, args);
@@ -428,7 +428,7 @@ QString PdbEngine::errorMessage(QProcess::ProcessError error) const
return tr("An error occurred when attempting to read from " return tr("An error occurred when attempting to read from "
"the Pdb process. For example, the process may not be running."); "the Pdb process. For example, the process may not be running.");
default: default:
return tr("An unknown error in the Pdb process occurred.") + QLatin1Char(' '); return tr("An unknown error in the Pdb process occurred.") + ' ';
} }
} }

View File

@@ -143,11 +143,11 @@ GDB 32bit | Api | Api | NA | Win32
if (breakApi == UseDebugBreakApi) { if (breakApi == UseDebugBreakApi) {
ok = DebugBreakProcess(inferior); ok = DebugBreakProcess(inferior);
if (!ok) if (!ok)
*errorMessage = QLatin1String("DebugBreakProcess failed: ") + Utils::winErrorMessage(GetLastError()); *errorMessage = "DebugBreakProcess failed: " + Utils::winErrorMessage(GetLastError());
} else { } else {
const QString executable = breakApi == UseWin32Interrupt const QString executable = breakApi == UseWin32Interrupt
? QCoreApplication::applicationDirPath() + QLatin1String("/win32interrupt.exe") ? QCoreApplication::applicationDirPath() + "/win32interrupt.exe"
: QCoreApplication::applicationDirPath() + QLatin1String("/win64interrupt.exe"); : QCoreApplication::applicationDirPath() + "/win64interrupt.exe";
if (!QFile::exists(executable)) { if (!QFile::exists(executable)) {
*errorMessage = QString::fromLatin1("%1 does not exist. If you have built %2 " *errorMessage = QString::fromLatin1("%1 does not exist. If you have built %2 "
"on your own, checkout " "on your own, checkout "
@@ -165,7 +165,7 @@ GDB 32bit | Api | Api | NA | Win32
break; break;
default: default:
*errorMessage = QDir::toNativeSeparators(executable) *errorMessage = QDir::toNativeSeparators(executable)
+ QLatin1String(" could not break the process."); + " could not break the process.";
break; break;
} }
break; break;

View File

@@ -1031,7 +1031,7 @@ void QmlEngine::updateCurrentContext()
return; return;
} }
debuggerConsole()->setContext(tr("Context:") + QLatin1Char(' ') debuggerConsole()->setContext(tr("Context:") + ' '
+ (context.isEmpty() ? tr("Global QML Context") : context)); + (context.isEmpty() ? tr("Global QML Context") : context));
} }
@@ -1576,7 +1576,7 @@ QmlV8ObjectData QmlEnginePrivate::extractData(const QVariant &data) const
objectData.value = dataMap.value(VALUE); objectData.value = dataMap.value(VALUE);
} else if (type == "string") { } else if (type == "string") {
QLatin1Char quote('"'); QChar quote('"');
objectData.type = "string"; objectData.type = "string";
objectData.value = QString(quote + dataMap.value(VALUE).toString() + quote); objectData.value = QString(quote + dataMap.value(VALUE).toString() + quote);

View File

@@ -128,8 +128,8 @@ QmlInspectorAgent::QmlInspectorAgent(QmlEngine *engine, QmlDebugConnection *conn
this, &QmlInspectorAgent::toolsClientStateChanged); this, &QmlInspectorAgent::toolsClientStateChanged);
// toolbar // toolbar
m_selectAction->setObjectName(QLatin1String("QML Select Action")); m_selectAction->setObjectName("QML Select Action");
m_zoomAction->setObjectName(QLatin1String("QML Zoom Action")); m_zoomAction->setObjectName("QML Zoom Action");
m_selectAction->setCheckable(true); m_selectAction->setCheckable(true);
m_zoomAction->setCheckable(true); m_zoomAction->setCheckable(true);
m_showAppOnTopAction->setCheckable(true); m_showAppOnTopAction->setCheckable(true);
@@ -223,7 +223,7 @@ bool QmlInspectorAgent::selectObjectInTree(int debugId)
// we may have to fetch it // we may have to fetch it
m_objectToSelect = debugId; m_objectToSelect = debugId;
using namespace QmlDebug::Constants; using namespace QmlDebug::Constants;
if (m_engineClient->objectName() == QLatin1String(QDECLARATIVE_ENGINE)) { if (m_engineClient->objectName() == QDECLARATIVE_ENGINE) {
// reset current Selection // reset current Selection
QString root = m_qmlEngine->watchHandler()->watchItem(QModelIndex())->iname; QString root = m_qmlEngine->watchHandler()->watchItem(QModelIndex())->iname;
m_qmlEngine->watchHandler()->setCurrentItem(root); m_qmlEngine->watchHandler()->setCurrentItem(root);
@@ -322,9 +322,9 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
|| type == "RESET_BINDING_R" || type == "RESET_BINDING_R"
|| type == "SET_METHOD_BODY_R") { || type == "SET_METHOD_BODY_R") {
// FIXME: This is not supported anymore. // FIXME: This is not supported anymore.
QString msg = QLatin1String(type) + tr("Success:"); QString msg = type + tr("Success:");
msg += QLatin1Char(' '); msg += ' ';
msg += value.toBool() ? QLatin1Char('1') : QLatin1Char('0'); msg += value.toBool() ? '1' : '0';
// if (!value.toBool()) // if (!value.toBool())
// emit automaticUpdateFailed(); // emit automaticUpdateFailed();
log(LogReceive, msg); log(LogReceive, msg);
@@ -366,7 +366,7 @@ void QmlInspectorAgent::newObject(int engineId, int /*objectId*/, int /*parentId
{ {
qCDebug(qmlInspectorLog) << __FUNCTION__ << "()"; qCDebug(qmlInspectorLog) << __FUNCTION__ << "()";
log(LogReceive, QLatin1String("OBJECT_CREATED")); log(LogReceive, "OBJECT_CREATED");
if (m_engine.debugId() != engineId) if (m_engine.debugId() != engineId)
return; return;
@@ -456,7 +456,7 @@ void QmlInspectorAgent::queryEngineContext()
if (!isConnected() || !boolSetting(ShowQmlObjectTree)) if (!isConnected() || !boolSetting(ShowQmlObjectTree))
return; return;
log(LogSend, QLatin1String("LIST_OBJECTS")); log(LogSend, "LIST_OBJECTS");
m_rootContextQueryId m_rootContextQueryId
= m_engineClient->queryRootContexts(m_engine); = m_engineClient->queryRootContexts(m_engine);
@@ -469,7 +469,7 @@ void QmlInspectorAgent::fetchObject(int debugId)
if (!isConnected() || !boolSetting(ShowQmlObjectTree)) if (!isConnected() || !boolSetting(ShowQmlObjectTree))
return; return;
log(LogSend, QLatin1String("FETCH_OBJECT ") + QString::number(debugId)); log(LogSend, "FETCH_OBJECT " + QString::number(debugId));
quint32 queryId = m_engineClient->queryObject(debugId); quint32 queryId = m_engineClient->queryObject(debugId);
qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << debugId << ')' qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << debugId << ')'
<< " - query id" << queryId; << " - query id" << queryId;
@@ -590,7 +590,7 @@ void QmlInspectorAgent::buildDebugIdHashRecursive(const ObjectReference &ref)
// handle the case where the url contains the revision number encoded. // handle the case where the url contains the revision number encoded.
//(for object created by the debugger) //(for object created by the debugger)
static QRegExp rx(QLatin1String("(.*)_(\\d+):(\\d+)$")); static QRegExp rx("(.*)_(\\d+):(\\d+)$");
if (rx.exactMatch(fileUrl.path())) { if (rx.exactMatch(fileUrl.path())) {
fileUrl.setPath(rx.cap(1)); fileUrl.setPath(rx.cap(1));
rev = rx.cap(2).toInt(); rev = rx.cap(2).toInt();

View File

@@ -119,7 +119,7 @@ public:
painter->setPen(lightColor); painter->setPen(lightColor);
// FIXME: performance? this changes only on real font changes. // FIXME: performance? this changes only on real font changes.
QFontMetrics fm(option.font); QFontMetrics fm(option.font);
int charWidth = qMax(fm.width(QLatin1Char('x')), fm.width(QLatin1Char('0'))); int charWidth = qMax(fm.width('x'), fm.width('0'));
QString str = index.data(Qt::DisplayRole).toString(); QString str = index.data(Qt::DisplayRole).toString();
int x = option.rect.x(); int x = option.rect.x();
bool light = !paintRed; bool light = !paintRed;
@@ -174,26 +174,26 @@ void Register::guessMissingData()
static QString subTypeName(RegisterKind kind, int size, RegisterFormat format) static QString subTypeName(RegisterKind kind, int size, RegisterFormat format)
{ {
QString name(QLatin1Char('[')); QString name('[');
switch (kind) { switch (kind) {
case IntegerRegister: name += QLatin1Char('i'); break; case IntegerRegister: name += 'i'; break;
case FloatRegister: name += QLatin1Char('f'); break; case FloatRegister: name += 'f'; break;
default: break; default: break;
} }
name += QString::number(size); name += QString::number(size);
switch (format) { switch (format) {
case BinaryFormat: name += QLatin1Char('b'); break; case BinaryFormat: name += 'b'; break;
case OctalFormat: name += QLatin1Char('o'); break; case OctalFormat: name += 'o'; break;
case DecimalFormat: name += QLatin1Char('u'); break; case DecimalFormat: name += 'u'; break;
case SignedDecimalFormat: name += QLatin1Char('s'); break; case SignedDecimalFormat: name += 's'; break;
case HexadecimalFormat: name += QLatin1Char('x'); break; case HexadecimalFormat: name += 'x'; break;
case CharacterFormat: name += QLatin1Char('c'); break; case CharacterFormat: name += 'c'; break;
} }
name += QLatin1Char(']'); name += ']';
return name; return name;
} }
@@ -492,7 +492,7 @@ Qt::ItemFlags RegisterItem::flags(int column) const
{ {
const Qt::ItemFlags notEditable = Qt::ItemIsSelectable|Qt::ItemIsEnabled; const Qt::ItemFlags notEditable = Qt::ItemIsSelectable|Qt::ItemIsEnabled;
// Can edit registers if they are hex numbers and not arrays. // Can edit registers if they are hex numbers and not arrays.
if (column == 1) // && IntegerWatchLineEdit::isUnsignedHexNumber(QLatin1String(m_reg.display))) if (column == 1) // && IntegerWatchLineEdit::isUnsignedHexNumber(m_reg.display))
return notEditable | Qt::ItemIsEditable; return notEditable | Qt::ItemIsEditable;
return notEditable; return notEditable;
} }

View File

@@ -47,8 +47,8 @@ namespace Internal {
void RegisterPostMortemAction::registerNow(const QVariant &value) void RegisterPostMortemAction::registerNow(const QVariant &value)
{ {
const bool boolValue = value.toBool(); const bool boolValue = value.toBool();
const QString debuggerExe = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + QLatin1Char('/') const QString debuggerExe = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + '/'
+ QLatin1String(debuggerApplicationFileC) + QLatin1String(".exe")); + QLatin1String(debuggerApplicationFileC) + ".exe");
const ushort *debuggerWString = debuggerExe.utf16(); const ushort *debuggerWString = debuggerExe.utf16();
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);

View File

@@ -48,9 +48,9 @@ void dumpBacktrace(int maxdepth)
qDebug() << "0x" + QByteArray::number(quintptr(bt[i]), 16); qDebug() << "0x" + QByteArray::number(quintptr(bt[i]), 16);
QProcess proc; QProcess proc;
QStringList args; QStringList args;
args.append(QLatin1String("-e")); args.append("-e");
args.append(QCoreApplication::arguments().at(0)); args.append(QCoreApplication::arguments().at(0));
proc.start(QLatin1String("addr2line"), args); proc.start("addr2line", args);
proc.waitForStarted(); proc.waitForStarted();
for (int i = 0; i < qMin(size, maxdepth); i++) for (int i = 0; i < qMin(size, maxdepth); i++)
proc.write("0x" + QByteArray::number(quintptr(bt[i]), 16) + '\n'); proc.write("0x" + QByteArray::number(quintptr(bt[i]), 16) + '\n');

View File

@@ -55,7 +55,7 @@ CacheDirectoryDialog::CacheDirectoryDialog(QWidget *parent) :
auto formLayout = new QFormLayout; auto formLayout = new QFormLayout;
m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory); m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
m_chooser->setHistoryCompleter(QLatin1String("Debugger.CdbCacheDir.History")); m_chooser->setHistoryCompleter("Debugger.CdbCacheDir.History");
m_chooser->setMinimumWidth(400); m_chooser->setMinimumWidth(400);
formLayout->addRow(tr("Path:"), m_chooser); formLayout->addRow(tr("Path:"), m_chooser);
@@ -189,10 +189,10 @@ QString CdbSymbolPathListEditor::symbolPath(const QString &cacheDir,
CdbSymbolPathListEditor::SymbolPathMode mode) CdbSymbolPathListEditor::SymbolPathMode mode)
{ {
if (mode == SymbolCachePath) if (mode == SymbolCachePath)
return QLatin1String(symbolCachePrefixC) + QDir::toNativeSeparators(cacheDir); return symbolCachePrefixC + QDir::toNativeSeparators(cacheDir);
QString s = QLatin1String(symbolServerPrefixC); QString s = QLatin1String(symbolServerPrefixC);
if (!cacheDir.isEmpty()) if (!cacheDir.isEmpty())
s += QDir::toNativeSeparators(cacheDir) + QLatin1Char('*'); s += QDir::toNativeSeparators(cacheDir) + '*';
s += QLatin1String(symbolServerPostfixC); s += QLatin1String(symbolServerPostfixC);
return s; return s;
} }

View File

@@ -288,7 +288,7 @@ bool getPDBFiles(const QString &peExecutableFileName, QStringList *rc, QString *
{ {
Q_UNUSED(peExecutableFileName) Q_UNUSED(peExecutableFileName)
rc->clear(); rc->clear();
*errorMessage = QLatin1String("Not implemented."); *errorMessage = "Not implemented.";
return false; return false;
} }

View File

@@ -45,13 +45,13 @@ namespace Internal {
static QString chopConst(QString type) static QString chopConst(QString type)
{ {
while (true) { while (true) {
if (type.startsWith(QLatin1String("const"))) if (type.startsWith("const"))
type = type.mid(5); type = type.mid(5);
else if (type.startsWith(QLatin1Char(' '))) else if (type.startsWith(' '))
type = type.mid(1); type = type.mid(1);
else if (type.endsWith(QLatin1String("const"))) else if (type.endsWith("const"))
type.chop(5); type.chop(5);
else if (type.endsWith(QLatin1Char(' '))) else if (type.endsWith(' '))
type.chop(1); type.chop(1);
else else
break; break;
@@ -61,13 +61,13 @@ static QString chopConst(QString type)
static inline QRegExp stdStringRegExp(const QString &charType) static inline QRegExp stdStringRegExp(const QString &charType)
{ {
QString rc = QLatin1String("basic_string<"); QString rc = "basic_string<";
rc += charType; rc += charType;
rc += QLatin1String(",[ ]?std::char_traits<"); rc += ",[ ]?std::char_traits<";
rc += charType; rc += charType;
rc += QLatin1String(">,[ ]?std::allocator<"); rc += ">,[ ]?std::allocator<";
rc += charType; rc += charType;
rc += QLatin1String("> >"); rc += "> >";
const QRegExp re(rc); const QRegExp re(rc);
QTC_ASSERT(re.isValid(), /**/); QTC_ASSERT(re.isValid(), /**/);
return re; return re;
@@ -90,8 +90,8 @@ static inline void simplifyStdString(const QString &charType, const QString &rep
pos = matchPos + replacementSize; pos = matchPos + replacementSize;
// If we were inside an 'allocator<std::basic_string..char > >' // If we were inside an 'allocator<std::basic_string..char > >'
// kill the following blank -> 'allocator<std::string>' // kill the following blank -> 'allocator<std::string>'
if (pos + 1 < type->size() && type->at(pos) == QLatin1Char(' ') if (pos + 1 < type->size() && type->at(pos) == ' '
&& type->at(pos + 1) == QLatin1Char('>')) && type->at(pos + 1) == '>')
type->remove(pos, 1); type->remove(pos, 1);
} }
} }
@@ -102,9 +102,9 @@ static inline QString fixNestedTemplates(QString s)
{ {
const int size = s.size(); const int size = s.size();
if (size > 3 if (size > 3
&& s.at(size - 1) == QLatin1Char('>') && s.at(size - 1) == '>'
&& s.at(size - 2) == QLatin1Char(' ') && s.at(size - 2) == ' '
&& s.at(size - 3) != QLatin1Char('>')) && s.at(size - 3) != '>')
s.remove(size - 2, 1); s.remove(size - 2, 1);
return s; return s;
} }
@@ -112,57 +112,57 @@ static inline QString fixNestedTemplates(QString s)
QString simplifyType(const QString &typeIn) QString simplifyType(const QString &typeIn)
{ {
QString type = typeIn; QString type = typeIn;
if (type.startsWith(QLatin1String("class "))) // MSVC prepends class,struct if (type.startsWith("class ")) // MSVC prepends class,struct
type.remove(0, 6); type.remove(0, 6);
if (type.startsWith(QLatin1String("struct "))) if (type.startsWith("struct "))
type.remove(0, 7); type.remove(0, 7);
type.replace(QLatin1String("short int"), QLatin1String("short")); type.replace("short int", "short");
const bool isLibCpp = type.contains(QLatin1String("std::__1")); const bool isLibCpp = type.contains("std::__1");
type.replace(QLatin1String("std::__cxx11::"), QLatin1String("std::")); type.replace("std::__cxx11::", "std::");
type.replace(QLatin1String("std::__1::"), QLatin1String("std::")); type.replace("std::__1::", "std::");
type.replace(QLatin1String("std::__debug::"), QLatin1String("std::")); type.replace("std::__debug::", "std::");
QRegExp simpleStringRE(QString::fromLatin1("std::basic_string<char> ?")); QRegExp simpleStringRE("std::basic_string<char> ?");
type.replace(simpleStringRE, QLatin1String("std::string")); type.replace(simpleStringRE, "std::string");
// Normalize space + ptr. // Normalize space + ptr.
type.replace(QLatin1String(" *"), QLatin1String("@")); type.replace(" *", "@");
type.replace(QLatin1Char('*'), QLatin1Char('@')); type.replace('*', '@');
// Normalize char const * and const char *. // Normalize char const * and const char *.
type.replace(QLatin1String("char const@"), QLatin1String("const char@")); type.replace("char const@", "const char@");
for (int i = 0; i < 10; ++i) { for (int i = 0; i < 10; ++i) {
// boost::shared_ptr<...>::element_type // boost::shared_ptr<...>::element_type
if (type.startsWith(QLatin1String("boost::shared_ptr<")) if (type.startsWith("boost::shared_ptr<")
&& type.endsWith(QLatin1String(">::element_type"))) && type.endsWith(">::element_type"))
type = type.mid(18, type.size() - 33); type = type.mid(18, type.size() - 33);
// std::shared_ptr<...>::element_type // std::shared_ptr<...>::element_type
if (type.startsWith(QLatin1String("std::shared_ptr<")) if (type.startsWith("std::shared_ptr<")
&& type.endsWith(QLatin1String(">::element_type"))) && type.endsWith(">::element_type"))
type = type.mid(16, type.size() - 31); type = type.mid(16, type.size() - 31);
// std::ifstream // std::ifstream
QRegExp ifstreamRE(QLatin1String("std::basic_ifstream<char,\\s*std::char_traits<char>\\s*>")); QRegExp ifstreamRE("std::basic_ifstream<char,\\s*std::char_traits<char>\\s*>");
ifstreamRE.setMinimal(true); ifstreamRE.setMinimal(true);
QTC_ASSERT(ifstreamRE.isValid(), return typeIn); QTC_ASSERT(ifstreamRE.isValid(), return typeIn);
if (ifstreamRE.indexIn(type) != -1) if (ifstreamRE.indexIn(type) != -1)
type.replace(ifstreamRE.cap(0), QLatin1String("std::ifstream")); type.replace(ifstreamRE.cap(0), "std::ifstream");
// std::__1::hash_node<int, void *>::value_type -> int // std::__1::hash_node<int, void *>::value_type -> int
if (isLibCpp) { if (isLibCpp) {
//QRegExp hashNodeRE(QLatin1String("std::__hash_node<([^<>]*),\\s*void\\s*@>::value_type")); //QRegExp hashNodeRE("std::__hash_node<([^<>]*),\\s*void\\s*@>::value_type");
QRegExp hashNodeRE(QLatin1String("std::__hash_node<([^<>]*),\\s*void\\s*@>::value_type")); QRegExp hashNodeRE("std::__hash_node<([^<>]*),\\s*void\\s*@>::value_type");
QTC_ASSERT(hashNodeRE.isValid(), return typeIn); QTC_ASSERT(hashNodeRE.isValid(), return typeIn);
if (hashNodeRE.indexIn(type) != -1) if (hashNodeRE.indexIn(type) != -1)
type.replace(hashNodeRE.cap(0), hashNodeRE.cap(1)); type.replace(hashNodeRE.cap(0), hashNodeRE.cap(1));
} }
// Anything with a std::allocator // Anything with a std::allocator
int start = type.indexOf(QLatin1String("std::allocator<")); int start = type.indexOf("std::allocator<");
if (start != -1) { if (start != -1) {
// search for matching '>' // search for matching '>'
int pos; int pos;
@@ -182,12 +182,12 @@ QString simplifyType(const QString &typeIn)
const QString allocEsc = QRegExp::escape(alloc); const QString allocEsc = QRegExp::escape(alloc);
const QString innerEsc = QRegExp::escape(inner); const QString innerEsc = QRegExp::escape(inner);
if (inner == QLatin1String("char")) { // std::string if (inner == "char") { // std::string
simplifyStdString(QLatin1String("char"), QLatin1String("string"), &type); simplifyStdString("char", "string", &type);
} else if (inner == QLatin1String("wchar_t")) { // std::wstring } else if (inner == "wchar_t") { // std::wstring
simplifyStdString(QLatin1String("wchar_t"), QLatin1String("wstring"), &type); simplifyStdString("wchar_t", "wstring", &type);
} else if (inner == QLatin1String("unsigned short")) { // std::wstring/MSVC } else if (inner == "unsigned short") { // std::wstring/MSVC
simplifyStdString(QLatin1String("unsigned short"), QLatin1String("wstring"), &type); simplifyStdString("unsigned short", "wstring", &type);
} }
// std::vector, std::deque, std::list // std::vector, std::deque, std::list
QRegExp re1(QString::fromLatin1("(vector|list|deque)<%1, ?%2\\s*>").arg(innerEsc, allocEsc)); QRegExp re1(QString::fromLatin1("(vector|list|deque)<%1, ?%2\\s*>").arg(innerEsc, allocEsc));
@@ -233,7 +233,7 @@ QString simplifyType(const QString &typeIn)
type.replace(boostUnorderedSetRE.cap(0), QString::fromLatin1("unordered_set<%1>").arg(inner)); type.replace(boostUnorderedSetRE.cap(0), QString::fromLatin1("unordered_set<%1>").arg(inner));
// std::map // std::map
if (inner.startsWith(QLatin1String("std::pair<"))) { if (inner.startsWith("std::pair<")) {
// search for outermost ',', split key and value // search for outermost ',', split key and value
int pos; int pos;
int level = 0; int level = 0;
@@ -249,7 +249,7 @@ QString simplifyType(const QString &typeIn)
const QString key = chopConst(inner.mid(10, pos - 10)); const QString key = chopConst(inner.mid(10, pos - 10));
const QString keyEsc = QRegExp::escape(key); const QString keyEsc = QRegExp::escape(key);
// Get value: MSVC: 'pair<a const ,b>', gcc: 'pair<const a, b>' // Get value: MSVC: 'pair<a const ,b>', gcc: 'pair<const a, b>'
if (inner.at(++pos) == QLatin1Char(' ')) if (inner.at(++pos) == ' ')
pos++; pos++;
const QString value = inner.mid(pos, inner.size() - pos - 1).trimmed(); const QString value = inner.mid(pos, inner.size() - pos - 1).trimmed();
const QString valueEsc = QRegExp::escape(value); const QString valueEsc = QRegExp::escape(value);
@@ -269,7 +269,7 @@ QString simplifyType(const QString &typeIn)
} }
// std::unordered_map // std::unordered_map
if (inner.startsWith(QLatin1String("std::pair<"))) { if (inner.startsWith("std::pair<")) {
// search for outermost ',', split key and value // search for outermost ',', split key and value
int pos; int pos;
int level = 0; int level = 0;
@@ -285,7 +285,7 @@ QString simplifyType(const QString &typeIn)
const QString key = chopConst(inner.mid(10, pos - 10)); const QString key = chopConst(inner.mid(10, pos - 10));
const QString keyEsc = QRegExp::escape(key); const QString keyEsc = QRegExp::escape(key);
// Get value: MSVC: 'pair<a const ,b>', gcc: 'pair<const a, b>' // Get value: MSVC: 'pair<a const ,b>', gcc: 'pair<const a, b>'
if (inner.at(++pos) == QLatin1Char(' ')) if (inner.at(++pos) == ' ')
pos++; pos++;
const QString value = inner.mid(pos, inner.size() - pos - 1).trimmed(); const QString value = inner.mid(pos, inner.size() - pos - 1).trimmed();
const QString valueEsc = QRegExp::escape(value); const QString valueEsc = QRegExp::escape(value);
@@ -308,8 +308,8 @@ QString simplifyType(const QString &typeIn)
} }
} // with std::allocator } // with std::allocator
} }
type.replace(QLatin1Char('@'), QLatin1String(" *")); type.replace('@', " *");
type.replace(QLatin1String(" >"), QLatin1String(">")); type.replace(" >", ">");
return type; return type;
} }

View File

@@ -68,7 +68,7 @@ public:
}; };
SourceAgentPrivate::SourceAgentPrivate() SourceAgentPrivate::SourceAgentPrivate()
: producer(QLatin1String("remote")) : producer("remote")
{ {
} }
@@ -103,7 +103,7 @@ void SourceAgent::setContent(const QString &filePath, const QString &content)
d->path = filePath; d->path = filePath;
if (!d->editor) { if (!d->editor) {
QString titlePattern = d->producer + QLatin1String(": ") QString titlePattern = d->producer + ": "
+ Utils::FileName::fromString(filePath).fileName(); + Utils::FileName::fromString(filePath).fileName();
d->editor = qobject_cast<BaseTextEditor *>( d->editor = qobject_cast<BaseTextEditor *>(
EditorManager::openEditorWithContents( EditorManager::openEditorWithContents(

View File

@@ -67,8 +67,8 @@ QVariant SourceFilesHandler::headerData(int section,
{ {
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
static QString headers[] = { static QString headers[] = {
tr("Internal Name") + QLatin1String(" "), tr("Internal Name") + " ",
tr("Full Name") + QLatin1String(" "), tr("Full Name") + " ",
}; };
return headers[section]; return headers[section];
} }

View File

@@ -263,7 +263,7 @@ QString cppExpressionAt(TextEditorWidget *editorWidget, int pos,
if (expr.isEmpty()) { if (expr.isEmpty()) {
tc.setPosition(pos); tc.setPosition(pos);
const QChar ch = editorWidget->characterAt(pos); const QChar ch = editorWidget->characterAt(pos);
if (ch.isLetterOrNumber() || ch == QLatin1Char('_')) if (ch.isLetterOrNumber() || ch == '_')
tc.movePosition(QTextCursor::EndOfWord); tc.movePosition(QTextCursor::EndOfWord);
// Fetch the expression's code. // Fetch the expression's code.
@@ -324,7 +324,7 @@ ContextData getLocationContext(TextDocument *document, int lineNumber)
QString fileName = document->property(Constants::DISASSEMBLER_SOURCE_FILE).toString(); QString fileName = document->property(Constants::DISASSEMBLER_SOURCE_FILE).toString();
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
// Possibly one of the "27 [1] foo = x" lines // Possibly one of the "27 [1] foo = x" lines
int pos = line.indexOf(QLatin1Char('[')); int pos = line.indexOf('[');
int ln = line.leftRef(pos - 1).toInt(); int ln = line.leftRef(pos - 1).toInt();
if (ln > 0) { if (ln > 0) {
data.type = LocationByFile; data.type = LocationByFile;

View File

@@ -98,8 +98,8 @@ StackFrame StackFrame::parseFrame(const GdbMi &frameMi, const DebuggerRunParamet
frame.address = frameMi["address"].toAddress(); frame.address = frameMi["address"].toAddress();
frame.context = frameMi["context"].data(); frame.context = frameMi["context"].data();
if (frameMi["language"].data() == "js" if (frameMi["language"].data() == "js"
|| frame.file.endsWith(QLatin1String(".js")) || frame.file.endsWith(".js")
|| frame.file.endsWith(QLatin1String(".qml"))) { || frame.file.endsWith(".qml")) {
frame.language = QmlLanguage; frame.language = QmlLanguage;
frame.fixQrcFrame(rp); frame.fixQrcFrame(rp);
} }
@@ -151,9 +151,8 @@ QString StackFrame::toToolTip() const
showDistributionNote = true; showDistributionNote = true;
} }
if (!Utils::HostOsInfo::isWindowsHost() && showDistributionNote) { if (!Utils::HostOsInfo::isWindowsHost() && showDistributionNote) {
str << QLatin1Char(' ') << str << ' ' << tr("Note that most distributions ship debug information "
tr("Note that most distributions ship debug information " "in separate packages.");
"in separate packages.");
} }
str << "</body></html>"; str << "</body></html>";
@@ -185,11 +184,11 @@ void StackFrame::fixQrcFrame(const DebuggerRunParameters &rp)
usable = aFi.isFile(); usable = aFi.isFile();
return; return;
} }
if (!file.startsWith(QLatin1String("qrc:/"))) if (!file.startsWith("qrc:/"))
return; return;
QString relativeFile = file.right(file.size() - 5); QString relativeFile = file.right(file.size() - 5);
while (relativeFile.startsWith(QLatin1Char('/'))) while (relativeFile.startsWith('/'))
relativeFile = relativeFile.mid(1); relativeFile = relativeFile.mid(1);
QString absFile = findFile(rp.projectSourceDirectory.toString(), relativeFile); QString absFile = findFile(rp.projectSourceDirectory.toString(), relativeFile);

View File

@@ -130,14 +130,14 @@ QVariant ThreadItem::threadPart(int column) const
? QString::number(threadData.lineNumber) : QString(); ? QString::number(threadData.lineNumber) : QString();
case ThreadData::AddressColumn: case ThreadData::AddressColumn:
return threadData.address > 0 return threadData.address > 0
? QLatin1String("0x") + QString::number(threadData.address, 16) ? "0x" + QString::number(threadData.address, 16)
: QString(); : QString();
case ThreadData::CoreColumn: case ThreadData::CoreColumn:
return threadData.core; return threadData.core;
case ThreadData::StateColumn: case ThreadData::StateColumn:
return threadData.state; return threadData.state;
case ThreadData::TargetIdColumn: case ThreadData::TargetIdColumn:
if (threadData.targetId.startsWith(QLatin1String("Thread "))) if (threadData.targetId.startsWith("Thread "))
return threadData.targetId.mid(7); return threadData.targetId.mid(7);
return threadData.targetId; return threadData.targetId;
case ThreadData::NameColumn: case ThreadData::NameColumn:
@@ -215,9 +215,9 @@ void ThreadItem::mergeThreadData(const ThreadData &other)
ThreadsHandler::ThreadsHandler(DebuggerEngine *engine) ThreadsHandler::ThreadsHandler(DebuggerEngine *engine)
: m_engine(engine) : m_engine(engine)
{ {
setObjectName(QLatin1String("ThreadsModel")); setObjectName("ThreadsModel");
setHeader({ setHeader({
QLatin1String(" ") + tr("ID") + QLatin1String(" "), " " + tr("ID") + " ",
tr("Address"), tr("Function"), tr("File"), tr("Line"), tr("State"), tr("Address"), tr("Function"), tr("File"), tr("Line"), tr("State"),
tr("Name"), tr("Target ID"), tr("Details"), tr("Core"), tr("Name"), tr("Target ID"), tr("Details"), tr("Core"),
}); });

View File

@@ -105,7 +105,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
auto pathLayout = new QHBoxLayout; auto pathLayout = new QHBoxLayout;
m_pathChooser = new Utils::PathChooser(this); m_pathChooser = new Utils::PathChooser(this);
m_pathChooser->setExpectedKind(Utils::PathChooser::ExistingCommand); m_pathChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_pathChooser->setHistoryCompleter(QLatin1String("LocalExecutable"), true); m_pathChooser->setHistoryCompleter("LocalExecutable", true);
m_pathChooser->setMinimumWidth(400); m_pathChooser->setMinimumWidth(400);
auto resetExecutable = new QPushButton(tr("Reset")); auto resetExecutable = new QPushButton(tr("Reset"));

View File

@@ -137,7 +137,7 @@ void WatchItem::setError(const QString &msg)
void WatchItem::setValue(const QString &value0) void WatchItem::setValue(const QString &value0)
{ {
value = value0; value = value0;
if (value == QLatin1String("{...}")) { if (value == "{...}") {
value.clear(); value.clear();
wantsChildren = true; // at least one... wantsChildren = true; // at least one...
} }
@@ -148,7 +148,7 @@ QString WatchItem::toString() const
const char *doubleQuoteComma = "\","; const char *doubleQuoteComma = "\",";
QString res; QString res;
QTextStream str(&res); QTextStream str(&res);
str << QLatin1Char('{'); str << '{';
if (!iname.isEmpty()) if (!iname.isEmpty())
str << "iname=\"" << iname << doubleQuoteComma; str << "iname=\"" << iname << doubleQuoteComma;
if (!name.isEmpty() && name != iname) if (!name.isEmpty() && name != iname)
@@ -180,9 +180,9 @@ QString WatchItem::toString() const
str << "wantsChildren=\"" << (wantsChildren ? "true" : "false") << doubleQuoteComma; str << "wantsChildren=\"" << (wantsChildren ? "true" : "false") << doubleQuoteComma;
str.flush(); str.flush();
if (res.endsWith(QLatin1Char(','))) if (res.endsWith(','))
res.truncate(res.size() - 1); res.truncate(res.size() - 1);
return res + QLatin1Char('}'); return res + '}';
} }
QString WatchItem::msgNotInScope() QString WatchItem::msgNotInScope()
@@ -468,7 +468,7 @@ void WatchItem::parse(const GdbMi &data, bool maySort)
static void formatToolTipRow(QTextStream &str, const QString &category, const QString &value) static void formatToolTipRow(QTextStream &str, const QString &category, const QString &value)
{ {
QString val = value.toHtmlEscaped(); QString val = value.toHtmlEscaped();
val.replace(QLatin1Char('\n'), QLatin1String("<br>")); val.replace('\n', "<br>");
str << "<tr><td>" << category << "</td><td>"; str << "<tr><td>" << category << "</td><td>";
if (!category.isEmpty()) if (!category.isEmpty())
str << ':'; str << ':';
@@ -494,7 +494,7 @@ QString WatchItem::toToolTip() const
QString val = value; QString val = value;
if (val.size() > 1000) { if (val.size() > 1000) {
val.truncate(1000); val.truncate(1000);
val += QLatin1Char(' '); val += ' ';
val += tr("... <cut off>"); val += tr("... <cut off>");
} }
formatToolTipRow(str, tr("Value"), val); formatToolTipRow(str, tr("Value"), val);

View File

@@ -109,14 +109,14 @@ QValidator::State IntegerValidator::validateEntry(const QString &s, int base, bo
return QValidator::Intermediate; return QValidator::Intermediate;
int pos = 0; int pos = 0;
// Skip sign. // Skip sign.
if (signedV && s.at(pos) == QLatin1Char('-')) { if (signedV && s.at(pos) == '-') {
pos++; pos++;
if (pos == size) if (pos == size)
return QValidator::Intermediate; return QValidator::Intermediate;
} }
// Hexadecimal: '0x'? // Hexadecimal: '0x'?
if (base == 16 && pos + 2 <= size if (base == 16 && pos + 2 <= size
&& s.at(pos) == QLatin1Char('0') && s.at(pos + 1) == QLatin1Char('x')) { && s.at(pos) == '0' && s.at(pos + 1) == 'x') {
pos+= 2; pos+= 2;
if (pos == size) if (pos == size)
return QValidator::Intermediate; return QValidator::Intermediate;
@@ -236,7 +236,7 @@ void IntegerWatchLineEdit::setModelData(const QVariant &v)
default: default:
qWarning("Invalid value (%s) passed to IntegerLineEdit::setModelData", qWarning("Invalid value (%s) passed to IntegerLineEdit::setModelData",
v.typeName()); v.typeName());
setText(QString(QLatin1Char('0'))); setText(QString('0'));
break; break;
} }
if (debug) if (debug)
@@ -303,7 +303,7 @@ WatchLineEdit *WatchLineEdit::create(QVariant::Type t, QWidget *parent)
BooleanComboBox::BooleanComboBox(QWidget *parent) : QComboBox(parent) BooleanComboBox::BooleanComboBox(QWidget *parent) : QComboBox(parent)
{ {
QStringList items; QStringList items;
items << QLatin1String("false") << QLatin1String("true"); items << "false" << "true";
addItems(items); addItems(items);
} }

View File

@@ -652,7 +652,7 @@ static QString reformatCharacter(int code, int size, bool isSigned)
if (code < 0) if (code < 0)
out += QString("/%1 ").arg((1ULL << (8*size)) + code).left(2 + 2 * size); out += QString("/%1 ").arg((1ULL << (8*size)) + code).left(2 + 2 * size);
else else
out += QString(2 + 2 * size, QLatin1Char(' ')); out += QString(2 + 2 * size, ' ');
} else { } else {
out += QString::number(unsigned(code)); out += QString::number(unsigned(code));
} }
@@ -2193,7 +2193,7 @@ void WatchHandler::watchExpression(const QString &exp, const QString &name, bool
saveWatchers(); saveWatchers();
if (m_model->m_engine->state() == DebuggerNotReady) { if (m_model->m_engine->state() == DebuggerNotReady) {
item->setValue(QString(QLatin1Char(' '))); item->setValue(" ");
item->update(); item->update();
} else { } else {
m_model->m_engine->updateWatchData(item->iname); m_model->m_engine->updateWatchData(item->iname);
@@ -2216,7 +2216,7 @@ void WatchHandler::updateWatchExpression(WatchItem *item, const QString &newExp)
saveWatchers(); saveWatchers();
if (m_model->m_engine->state() == DebuggerNotReady) { if (m_model->m_engine->state() == DebuggerNotReady) {
item->setValue(QString(QLatin1Char(' '))); item->setValue(" ");
item->update(); item->update();
} else { } else {
m_model->m_engine->updateWatchData(item->iname); m_model->m_engine->updateWatchData(item->iname);
@@ -2622,7 +2622,7 @@ QString WatchModel::editorContents(const QModelIndexList &list)
QTextStream ts(&contents); QTextStream ts(&contents);
forAllItems([&ts, this, list](WatchItem *item) { forAllItems([&ts, this, list](WatchItem *item) {
if (list.isEmpty() || list.contains(indexForItem(item))) { if (list.isEmpty() || list.contains(indexForItem(item))) {
const QChar tab = QLatin1Char('\t'); const QChar tab = '\t';
const QChar nl = '\n'; const QChar nl = '\n';
ts << QString(item->level(), tab) << item->name << tab << displayValue(item) << tab ts << QString(item->level(), tab) << item->name << tab << displayValue(item) << tab
<< item->type << nl; << item->type << nl;