Commit 2fd8b2d7 authored by Friedemann Kleint's avatar Friedemann Kleint

Fix some code scanning issues.

QString: Use QChar where appropriate.
parent d2235489
......@@ -227,7 +227,7 @@ static QByteArray stripPointerType(const QByteArray &_type)
// This is used to abort evaluation of custom data dumpers in a "coordinated"
// way. Abortion will happen at the latest when we try to access a non-initialized
// non-trivial object, so there is no way to prevent this from occuring at all
// non-trivial object, so there is no way to prevent this from occurring at all
// conceptionally. Ideally, if there is API to check memory access, it should
// be used to terminate nicely, especially with CDB.
// 1) Gdb will catch SIGSEGV and return to the calling frame.
......@@ -3436,7 +3436,7 @@ static void handleProtocolVersion2and3(QDumper &d)
#endif
const char *type = stripNamespace(d.outerType);
// type[0] is usally 'Q', so don't use it
// type[0] is usually 'Q', so don't use it
switch (type[1]) {
case 'a':
if (isEqual(type, "map"))
......
......@@ -56,7 +56,7 @@ unsigned optVerbose = 0;
const char *appPath = 0;
// Provide address of type of be tested.
// When testing unitialized memory, allocate at random.
// When testing uninitialized memory, allocate at random.
template <class T>
inline T* testAddress(T* in)
{
......
......@@ -260,7 +260,7 @@ bool CMakeProject::parseCMakeLists()
foreach(const CMakeTarget &ct, m_targets) {
if (ct.executable.isEmpty())
continue;
if (ct.title.endsWith("/fast"))
if (ct.title.endsWith(QLatin1String("/fast")))
continue;
QList<CMakeRunConfiguration *> list = existingRunConfigurations.values(ct.title);
if (!list.isEmpty()) {
......@@ -312,7 +312,7 @@ QStringList CMakeProject::targets() const
foreach (const CMakeTarget &ct, m_targets) {
if (ct.executable.isEmpty())
continue;
if (ct.title.endsWith("/fast"))
if (ct.title.endsWith(QLatin1String("/fast")))
continue;
results << ct.title;
}
......@@ -324,7 +324,7 @@ bool CMakeProject::hasTarget(const QString &title) const
foreach (const CMakeTarget &ct, m_targets) {
if (ct.executable.isEmpty())
continue;
if (ct.title.endsWith("/fast"))
if (ct.title.endsWith(QLatin1String("/fast")))
continue;
if (ct.title == title)
return true;
......@@ -410,11 +410,12 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::
ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *rootNode, QString directory)
{
QString relativePath = QDir(QFileInfo(rootNode->path()).path()).relativeFilePath(directory);
QStringList parts = relativePath.split("/", QString::SkipEmptyParts);
QStringList parts = relativePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
ProjectExplorer::FolderNode *parent = rootNode;
QString path = QFileInfo(rootNode->path()).path();
foreach (const QString &part, parts) {
path += "/" + part;
path += QLatin1Char('/');
path += part;
// Find folder in subFolders
bool found = false;
foreach (ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) {
......@@ -899,12 +900,12 @@ void CMakeCbpParser::parseUnit()
while (!atEnd()) {
readNext();
if (isEndElement()) {
if (!fileName.endsWith(".rule") && !m_processedUnits.contains(fileName)) {
if (!fileName.endsWith(QLatin1String(".rule")) && !m_processedUnits.contains(fileName)) {
// Now check whether we found a virtual element beneath
if (m_parsingCmakeUnit) {
m_cmakeFileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false));
} else {
if (fileName.endsWith(".qrc"))
if (fileName.endsWith(QLatin1String(".qrc")))
m_fileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ResourceType, false));
else
m_fileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::SourceType, false));
......
......@@ -292,7 +292,7 @@ void MakeStepConfigWidget::updateDetails()
CMakeBuildConfiguration *bc = m_makeStep->cmakeBuildConfiguration();
ProjectExplorer::ToolChain *tc = bc->toolChain();
if (tc)
m_summaryText = tr("<b>Make:</b> %1 %2").arg(tc->makeCommand(), arguments.join(" "));
m_summaryText = tr("<b>Make:</b> %1 %2").arg(tc->makeCommand(), arguments.join(QString(QLatin1Char(' '))));
else
m_summaryText = tr("<b>Unknown Toolchain</b>");
emit updateSummary();
......
......@@ -67,7 +67,7 @@ class SettingsDatabasePrivate
public:
QString effectiveGroup() const
{
return m_groups.join(QLatin1String("/"));
return m_groups.join(QString(QLatin1Char('/')));
}
QString effectiveKey(const QString &key) const
......
......@@ -129,7 +129,7 @@ void CodePasterProtocol::paste(const QString &text,
data += CGI::encodeURL(username).toLatin1();
http.setHost(hostName);
http.post("/", data);
http.post(QString(QLatin1Char('/')), data);
}
bool CodePasterProtocol::hasSettings() const
......
......@@ -40,7 +40,7 @@ using namespace CPlusPlus;
CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Core::EditorManager *editorManager)
: m_modelManager(manager)
{
setShortcutString(".");
setShortcutString(QString(QLatin1Char('.')));
setIncludedByDefault(false);
search.setSymbolsToSearchFor(SearchSymbols::Declarations |
......@@ -64,10 +64,11 @@ QList<Locator::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString &
QList<Locator::FilterEntry> goodEntries;
QList<Locator::FilterEntry> betterEntries;
QStringMatcher matcher(entry, Qt::CaseInsensitive);
const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
const QChar asterisk = QLatin1Char('*');
const QRegExp regexp(asterisk + entry + asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid())
return goodEntries;
bool hasWildcard = (entry.contains('*') || entry.contains('?'));
bool hasWildcard = (entry.contains(asterisk) || entry.contains('?'));
if (m_currentFileName.isEmpty())
return goodEntries;
......
......@@ -34,7 +34,7 @@ using namespace CppTools::Internal;
CppFunctionsFilter::CppFunctionsFilter(CppModelManager *manager, Core::EditorManager *editorManager)
: CppLocatorFilter(manager, editorManager)
{
setShortcutString("m");
setShortcutString(QString(QLatin1Char('m')));
setIncludedByDefault(false);
search.setSymbolsToSearchFor(SearchSymbols::Functions);
......
......@@ -44,7 +44,7 @@ CppLocatorFilter::CppLocatorFilter(CppModelManager *manager, Core::EditorManager
m_editorManager(editorManager),
m_forceNewSearchList(true)
{
setShortcutString(":");
setShortcutString(QString(QLatin1Char(':')));
setIncludedByDefault(false);
connect(manager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
......@@ -84,11 +84,12 @@ QList<Locator::FilterEntry> CppLocatorFilter::matchesFor(const QString &origEntr
QString entry = trimWildcards(origEntry);
QList<Locator::FilterEntry> goodEntries;
QList<Locator::FilterEntry> betterEntries;
const QChar asterisk = QLatin1Char('*');
QStringMatcher matcher(entry, Qt::CaseInsensitive);
const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
const QRegExp regexp(asterisk + entry+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid())
return goodEntries;
bool hasWildcard = (entry.contains('*') || entry.contains('?'));
bool hasWildcard = (entry.contains(asterisk) || entry.contains('?'));
QMutableMapIterator<QString, Info> it(m_searchList);
while (it.hasNext()) {
......
......@@ -197,7 +197,7 @@ QString SearchSymbols::symbolName(const Symbol *symbol) const
}
symbolName = QLatin1String("<anonymous ");
symbolName += type;
symbolName += QLatin1String(">");
symbolName += QLatin1Char('>');
}
return symbolName;
}
......
......@@ -268,7 +268,7 @@ public slots:
void gotoResult(int i)
{
QString needle = QString::number(i) + '^';
QString needle2 = QLatin1String(">") + needle;
QString needle2 = QLatin1Char('>') + needle;
QTextCursor cursor(document());
do {
const QString line = cursor.block().text();
......
......@@ -2207,7 +2207,7 @@ void GdbEngine::attemptBreakpointSynchronization()
// (reloadSourceFiles and reloadBreakList) to be executed
// within the same stop-executecommand-continue cycle.
// Just calling reloadSourceFiles and reloadBreakList doesn't work
// in this case, because a) stopping the executable is asyncronous,
// in this case, because a) stopping the executable is asynchronous,
// b) we wouldn't want to stop-exec-continue twice
m_sourcesListUpdating = true;
GdbCommand cmd;
......
......@@ -255,7 +255,7 @@ QList<StackFrame> StackHandler::frames() const
bool StackHandler::isDebuggingDebuggingHelpers() const
{
for (int i = m_stackFrames.size(); --i >= 0; )
if (m_stackFrames.at(i).function.startsWith("qDumpObjectData"))
if (m_stackFrames.at(i).function.startsWith(QLatin1String("qDumpObjectData")))
return true;
return false;
}
......
......@@ -152,7 +152,7 @@ void WatchData::setValue(const QString &value0)
}
// avoid duplicated information
if (value.startsWith("(") && value.contains(") 0x"))
if (value.startsWith(QLatin1Char('(')) && value.contains(") 0x"))
value = value.mid(value.lastIndexOf(") 0x") + 2);
// doubles are sometimes displayed as "@0x6141378: 1.2".
......@@ -171,8 +171,8 @@ void WatchData::setValue(const QString &value0)
// pointer type information is available in the 'type'
// column. No need to duplicate it here.
if (value.startsWith("(" + type + ") 0x"))
value = value.section(" ", -1, -1);
if (value.startsWith(QLatin1Char('(') + type + ") 0x"))
value = value.section(QLatin1Char(' '), -1, -1);
setValueUnneeded();
}
......@@ -796,7 +796,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
switch (idx.column()) {
case 0:
if (data.name == QLatin1String("*") && item->parent)
return QLatin1String("*") + item->parent->name;
return QLatin1Char('*') + item->parent->name;
return data.name;
case 1: {
int format = m_handler->m_individualFormats.value(data.iname, -1);
......
......@@ -164,11 +164,11 @@ bool isSkippableFunction(const QString &funcName, const QString &fileName)
if (fileName.endsWith(QLatin1String(".moc")))
return true;
if (funcName.endsWith("::qt_metacall"))
if (funcName.endsWith(QLatin1String("::qt_metacall")))
return true;
if (funcName.endsWith("::d_func"))
if (funcName.endsWith(QLatin1String("::d_func")))
return true;
if (funcName.endsWith("::q_func"))
if (funcName.endsWith(QLatin1String("::q_func")))
return true;
return false;
......
......@@ -2207,7 +2207,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd)
static bool isSubstitution(const QString &cmd0, QStringList *result)
{
QString cmd;
if (cmd0.startsWith("substitute"))
if (cmd0.startsWith(QLatin1String("substitute")))
cmd = cmd0.mid(10);
else if (cmd0.startsWith('s') && cmd0.size() > 1
&& !isalpha(cmd0.at(1).unicode()))
......@@ -2450,7 +2450,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
} else if (act) {
// non-boolean to show
showBlackMessage(arg + '=' + act->value().toString());
} else if (arg.startsWith("no")
} else if (arg.startsWith(QLatin1String("no"))
&& (act = theFakeVimSettings()->item(arg.mid(2)))) {
// boolean config to be switched off
bool oldValue = act->value().toBool();
......@@ -2505,10 +2505,10 @@ void FakeVimHandler::Private::passUnknownSetCommand(const QString &arg)
static void vimPatternToQtPattern(QString *needle, QTextDocument::FindFlags *flags)
{
// FIXME: Rough mapping of a common case
if (needle->startsWith("\\<") && needle->endsWith("\\>"))
if (needle->startsWith(QLatin1String("\\<")) && needle->endsWith(QLatin1String("\\>")))
(*flags) |= QTextDocument::FindWholeWords;
needle->replace("\\<", ""); // start of word
needle->replace("\\>", ""); // end of word
needle->remove(QLatin1String("\\<")); // start of word
needle->remove(QLatin1String("\\>")); // end of word
//qDebug() << "NEEDLE " << needle0 << needle;
}
......
......@@ -231,41 +231,36 @@ QVariant SearchResultTreeModel::data(const SearchResultTextRow *row, int role) c
QVariant SearchResultTreeModel::data(const SearchResultFile *file, int role) const
{
QVariant result;
switch (role)
{
#if 0
case Qt::CheckStateRole:
if (file->isUserCheckable())
result = file->checkState();
break;
return QVariant(file->checkState());
#endif
case Qt::BackgroundRole: {
const QColor baseColor = QApplication::palette().base().color();
result = baseColor.darker(105);
return QVariant(baseColor.darker(105));
break;
}
case Qt::DisplayRole:
result = QString(QDir::toNativeSeparators(file->fileName())
+ " (" + QString::number(file->childrenCount()) + ")");
break;
case Qt::DisplayRole: {
QString result = QDir::toNativeSeparators(file->fileName());
result += QLatin1String(" (");
result += QString::number(file->childrenCount());
result += QLatin1Char(')');
return QVariant(result);
}
case ItemDataRoles::FileNameRole:
case Qt::ToolTipRole:
result = QDir::toNativeSeparators(file->fileName());
break;
return QVariant(QDir::toNativeSeparators(file->fileName()));
case ItemDataRoles::ResultLinesCountRole:
result = file->childrenCount();
break;
return QVariant(file->childrenCount());
case ItemDataRoles::TypeRole:
result = "file";
break;
return QVariant(QLatin1String("file"));
default:
result = QVariant();
break;
}
return result;
return QVariant();
}
QVariant SearchResultTreeModel::headerData(int section, Qt::Orientation orientation,
......
......@@ -144,7 +144,7 @@ ProjectExplorer::FolderNode *GenericProjectNode::findOrCreateFolderByName(const
else if (FolderNode *folder = m_folderByName.value(folderName))
return folder;
FolderNode *folder = new FolderNode(baseDir + "/" + folderName);
FolderNode *folder = new FolderNode(baseDir + QLatin1Char('/') + folderName);
folder->setFolderName(component);
m_folderByName.insert(folderName, folder);
......
......@@ -49,7 +49,7 @@ HelpIndexFilter::HelpIndexFilter(HelpPlugin *plugin, QHelpEngine *helpEngine):
m_icon(QIcon()) // TODO: Put an icon next to the results
{
setIncludedByDefault(false);
setShortcutString("?");
setShortcutString(QString(QLatin1Char('?')));
connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()),
this, SLOT(updateIndices()));
......
......@@ -590,16 +590,16 @@ void HelpPlugin::extensionsInitialized()
QStringList documentationToRemove;
QStringList filtersToRemove;
const QString &docInternal = QString("com.nokia.qtcreator.%1%2%3")
const QString &docInternal = QString::fromLatin1("com.nokia.qtcreator.%1%2%3")
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR).arg(IDE_VERSION_RELEASE);
const QString filterInternal = QString("Qt Creator %1.%2.%3")
const QString filterInternal = QString::fromLatin1("Qt Creator %1.%2.%3")
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR).arg(IDE_VERSION_RELEASE);
const QRegExp filterRegExp("Qt Creator \\d*\\.\\d*\\.\\d*");
const QStringList &docs = m_helpEngine->registeredDocumentations();
foreach (const QString &ns, docs) {
if (ns == docInternal) {
assistantInternalDocRegistered = true;
} else if (ns.startsWith("com.nokia.qtcreator.")) {
} else if (ns.startsWith(QLatin1String("com.nokia.qtcreator."))) {
documentationToRemove << ns;
}
}
......@@ -663,8 +663,8 @@ void HelpPlugin::extensionsInitialized()
QString addedDocs = m_helpEngine->customValue(QLatin1String("AddedDocs")).toString();
if (!addedDocs.isEmpty()) {
QStringList documentationToAdd = addedDocs.split(";");
foreach (QString item, documentationToAdd)
const QStringList documentationToAdd = addedDocs.split(QLatin1Char(';'));
foreach (const QString &item, documentationToAdd)
m_helpEngine->registerDocumentation(item);
m_helpEngine->removeCustomValue(QLatin1String("AddedDocs"));
}
......@@ -984,7 +984,7 @@ void HelpPlugin::openHelpPage(const QString& url)
} else {
// local help not installed, resort to external web help
QString urlPrefix;
if (url.startsWith("qthelp://com.nokia.qtcreator")) {
if (url.startsWith(QLatin1String("qthelp://com.nokia.qtcreator"))) {
urlPrefix = QString::fromLatin1("http://doc.trolltech.com/qtcreator-%1.%2/")
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR);
} else {
......
......@@ -225,7 +225,7 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
QDir::Files|QDir::Hidden,
QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
foreach (const QString &file, fileEntries)
files.append(dir.path()+"/"+file);
files.append(dir.path()+ QLatin1Char('/') +file);
progress += dirProgressMax;
} else {
int subProgress = dirProgressMax/(subDirs.size()+1);
......@@ -234,7 +234,7 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
progressValues.push(selfProgress);
processedValues.push(true);
foreach (const QString &directory, subDirs) {
dirs.push(QDir(dir.path()+"/"+directory));
dirs.push(QDir(dir.path()+ QLatin1Char('/') + directory));
progressValues.push(subProgress);
processedValues.push(false);
}
......
......@@ -40,7 +40,7 @@ using namespace Locator::Internal;
FileSystemFilter::FileSystemFilter(EditorManager *editorManager, LocatorWidget *locatorWidget)
: m_editorManager(editorManager), m_locatorWidget(locatorWidget), m_includeHidden(true)
{
setShortcutString("f");
setShortcutString(QString(QLatin1Char('f')));
setIncludedByDefault(false);
}
......@@ -52,13 +52,13 @@ QList<FilterEntry> FileSystemFilter::matchesFor(const QString &entry)
QString directory = entryInfo.path();
QString filePath = entryInfo.filePath();
if (entryInfo.isRelative()) {
if (filePath.startsWith("~/")) {
if (filePath.startsWith(QLatin1String("~/"))) {
directory.replace(0, 1, QDir::homePath());
} else {
IEditor *editor = m_editorManager->currentEditor();
if (editor && !editor->file()->fileName().isEmpty()) {
QFileInfo info(editor->file()->fileName());
directory.prepend(info.absolutePath()+"/");
directory.prepend(info.absolutePath() + QLatin1Char('/'));
}
}
}
......@@ -74,7 +74,7 @@ QList<FilterEntry> FileSystemFilter::matchesFor(const QString &entry)
QStringList files = dirInfo.entryList(fileFilter,
QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
foreach (const QString &dir, dirs) {
if (dir != "." && (name.isEmpty() || dir.startsWith(name, Qt::CaseInsensitive))) {
if (dir != QLatin1String(".") && (name.isEmpty() || dir.startsWith(name, Qt::CaseInsensitive))) {
FilterEntry entry(this, dir, dirInfo.filePath(dir));
entry.resolveFileIcon = true;
value.append(entry);
......@@ -95,7 +95,9 @@ void FileSystemFilter::accept(FilterEntry selection) const
{
QFileInfo info(selection.internalData.toString());
if (info.isDir()) {
QString value = shortcutString() + " " + QDir::toNativeSeparators(info.absoluteFilePath()+"/");
QString value = shortcutString();
value += QLatin1Char(' ');
value += QDir::toNativeSeparators(info.absoluteFilePath() + QLatin1Char('/'));
m_locatorWidget->show(value, value.length());
return;
}
......
......@@ -375,7 +375,7 @@ void LocatorWidget::showPopup()
QList<ILocatorFilter*> LocatorWidget::filtersFor(const QString &text, QString &searchText)
{
QList<ILocatorFilter*> filters = m_locatorPlugin->filters();
int whiteSpace = text.indexOf(" ");
const int whiteSpace = text.indexOf(QLatin1Char(' '));
QString prefix;
if (whiteSpace >= 0)
prefix = text.left(whiteSpace);
......@@ -464,13 +464,13 @@ void LocatorWidget::filterSelected()
if (!currentText.isEmpty()) {
searchText = currentText;
foreach (ILocatorFilter *otherfilter, m_locatorPlugin->filters()) {
if (currentText.startsWith(otherfilter->shortcutString() + " ")) {
if (currentText.startsWith(otherfilter->shortcutString() + QLatin1Char(' '))) {
searchText = currentText.mid(otherfilter->shortcutString().length()+1);
break;
}
}
}
show(filter->shortcutString() + " " + searchText,
show(filter->shortcutString() + QLatin1Char(' ') + searchText,
filter->shortcutString().length() + 1,
searchText.length());
updateCompletionList(m_fileLineEdit->text());
......
......@@ -42,7 +42,7 @@ OpenDocumentsFilter::OpenDocumentsFilter(EditorManager *editorManager) :
this, SLOT(refreshInternally()));
connect(m_editorManager, SIGNAL(editorsClosed(QList<Core::IEditor*>)),
this, SLOT(refreshInternally()));
setShortcutString("o");
setShortcutString(QString(QLatin1Char('o')));
setIncludedByDefault(true);
}
......
......@@ -636,7 +636,7 @@ void PerforcePlugin::startSubmitProject()
QStringList fstatLines = fstatResult.stdOut.split(QLatin1Char('\n'));
QStringList depotFileNames;
foreach (const QString &line, fstatLines) {
if (line.startsWith("... depotFile"))
if (line.startsWith(QLatin1String("... depotFile")))
depotFileNames.append(line.mid(14));
}
if (depotFileNames.isEmpty()) {
......
......@@ -281,8 +281,8 @@ void AbstractProcessStep::taskAdded(const ProjectExplorer::TaskWindow::Task &tas
} else {
// More then one filename, so do a better compare
// Chop of any "../"
while (filePath.startsWith("../"))
filePath = filePath.mid(3);
while (filePath.startsWith(QLatin1String("../")))
filePath.remove(0, 3);
int count = 0;
QString possibleFilePath;
foreach(const QFileInfo &fi, possibleFiles) {
......
......@@ -44,7 +44,7 @@ AllProjectsFilter::AllProjectsFilter(ProjectExplorerPlugin *pe)
{
connect(m_projectExplorer, SIGNAL(fileListChanged()),
this, SLOT(markFilesAsOutOfDate()));
setShortcutString("a");
setShortcutString(QString(QLatin1Char('a')));
setIncludedByDefault(true);
}
......
......@@ -56,7 +56,7 @@ AllProjectsFind::AllProjectsFind(ProjectExplorerPlugin *plugin, SearchResultWind
QString AllProjectsFind::id() const
{
return "All Projects";
return QLatin1String("All Projects");
}
QString AllProjectsFind::name() const
......@@ -128,14 +128,14 @@ QWidget *AllProjectsFind::createConfigWidget()
void AllProjectsFind::writeSettings(QSettings *settings)
{
settings->beginGroup("AllProjectsFind");
settings->beginGroup(QLatin1String("AllProjectsFind"));
writeCommonSettings(settings);
settings->endGroup();
}
void AllProjectsFind::readSettings(QSettings *settings)
{
settings->beginGroup("AllProjectsFind");
readCommonSettings(settings, "*");
settings->beginGroup(QLatin1String("AllProjectsFind"));
readCommonSettings(settings, QString(QLatin1Char('*')));
settings->endGroup();
}
......@@ -49,7 +49,7 @@ CurrentProjectFilter::CurrentProjectFilter(ProjectExplorerPlugin *pe)
connect(m_projectExplorer, SIGNAL(currentProjectChanged(ProjectExplorer::Project*)),
this, SLOT(currentProjectChanged(ProjectExplorer::Project*)));
setShortcutString("p");
setShortcutString(QString(QLatin1Char('p')));
setIncludedByDefault(false);
}
......
......@@ -56,7 +56,7 @@ CurrentProjectFind::CurrentProjectFind(ProjectExplorerPlugin *plugin, SearchResu
QString CurrentProjectFind::id() const
{
return "Current Project";
return QLatin1String("Current Project");
}
QString CurrentProjectFind::name() const
......@@ -123,14 +123,14 @@ QWidget *CurrentProjectFind::createConfigWidget()
void CurrentProjectFind::writeSettings(QSettings *settings)
{
settings->beginGroup("CurrentProjectFind");
settings->beginGroup(QLatin1String("CurrentProjectFind"));
writeCommonSettings(settings);
settings->endGroup();
}
void CurrentProjectFind::readSettings(QSettings *settings)
{
settings->beginGroup("CurrentProjectFind");
readCommonSettings(settings, "*");
settings->beginGroup(QLatin1String("CurrentProjectFind"));
readCommonSettings(settings, QString(QLatin1Char('*')));
settings->endGroup();
}
......@@ -332,7 +332,7 @@ QString CustomExecutableRunConfiguration::executable() const
Environment env = activeBuildConfiguration()->environment();
exec = env.searchInPath(m_executable);
if (exec.isEmpty())
exec = QDir::cleanPath(workingDirectory() + "/" + m_executable);
exec = QDir::cleanPath(workingDirectory() + QLatin1Char('/') + m_executable);
} else {
exec = m_executable;
}
......
......@@ -42,7 +42,7 @@ QList<EnvironmentItem> EnvironmentItem::fromStringList(QStringList list)
foreach (const QString &string, list) {
int pos = string.indexOf(QLatin1Char('='));
if (pos == -1) {
EnvironmentItem item(string, "");
EnvironmentItem item(string, QString());
item.unset = true;
result.append(item);
} else {
......@@ -152,21 +152,21 @@ void Environment::prependOrSet(const QString&key, const QString &value, const QS
void Environment::appendOrSetPath(const QString &value)
{
#ifdef Q_OS_WIN
QString sep = ";";
const QChar sep = QLatin1Char(';');
#else
QString sep = ":";
const QChar sep = QLatin1Char(':');
#endif
appendOrSet("PATH", QDir::toNativeSeparators(value), sep);
appendOrSet(QLatin1String("PATH"), QDir::toNativeSeparators(value), QString(sep));
}