summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2012-11-21 22:36:47 +0200
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2012-11-22 09:40:14 +0100
commitbe443b8edb9822d09cee9a0d5997d1f952836a87 (patch)
tree358eb747975dc8b2837f4096a3ca6a7840b86a9e /src/plugins
parentf0ef96ef0c37b5903bda18e2af80c82f14f30181 (diff)
downloadqt-creator-be443b8edb9822d09cee9a0d5997d1f952836a87.tar.gz
CppTools: Compile with QT_NO_CAST_FROM_ASCII
Change-Id: I31a6117c2b4be3f8603c16a9f98b6937a0b9aeb2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cpptools/cppchecksymbols.cpp10
-rw-r--r--src/plugins/cpptools/cppclassesfilter.cpp2
-rw-r--r--src/plugins/cpptools/cppcodestylepreferences.cpp2
-rw-r--r--src/plugins/cpptools/cppcodestylepreferencesfactory.cpp2
-rw-r--r--src/plugins/cpptools/cppcodestylesettingspage.cpp11
-rw-r--r--src/plugins/cpptools/cppcompletionassist.cpp14
-rw-r--r--src/plugins/cpptools/cppcurrentdocumentfilter.cpp2
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp14
-rw-r--r--src/plugins/cpptools/cpplocatorfilter.cpp2
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp10
-rw-r--r--src/plugins/cpptools/cpptools.pro3
-rw-r--r--src/plugins/cpptools/cpptools.qbs2
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.cpp2
-rw-r--r--src/plugins/cpptools/cpptoolssettings.cpp6
-rw-r--r--src/plugins/cpptools/insertionpointlocator.cpp6
-rw-r--r--src/plugins/cpptools/symbolsfindfilter.cpp14
16 files changed, 50 insertions, 52 deletions
diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp
index e9679394ce..13f06b87bb 100644
--- a/src/plugins/cpptools/cppchecksymbols.cpp
+++ b/src/plugins/cpptools/cppchecksymbols.cpp
@@ -509,9 +509,9 @@ bool CheckSymbols::visit(SimpleDeclarationAST *ast)
// Add a diagnostic message if non-virtual function has override/final marker
if ((_usages.back().kind != SemanticInfo::VirtualMethodUse)) {
if (funTy->isOverride())
- warning(declrIdNameAST, "Only virtual methods can be marked `override'");
+ warning(declrIdNameAST, QCoreApplication::translate("CPlusplus::CheckSymbols", "Only virtual methods can be marked `override'"));
else if (funTy->isFinal())
- warning(declrIdNameAST, "Only virtual methods can be marked `final'");
+ warning(declrIdNameAST, QCoreApplication::translate("CPlusPlus::CheckSymbols", "Only virtual methods can be marked `final'"));
}
}
}
@@ -713,7 +713,7 @@ void CheckSymbols::checkNamespace(NameAST *name)
}
const unsigned length = tokenAt(name->lastToken() - 1).end() - tokenAt(name->firstToken()).begin();
- warning(line, column, QCoreApplication::translate("CheckUndefinedSymbols", "Expected a namespace-name"), length);
+ warning(line, column, QCoreApplication::translate("CPlusPlus::CheckSymbols", "Expected a namespace-name"), length);
}
bool CheckSymbols::hasVirtualDestructor(Class *klass) const
@@ -1288,9 +1288,9 @@ bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST
// Add a diagnostic message if argument count does not match
if (matchType == Match_TooFewArgs)
- warning(line, column, "Too few arguments", length);
+ warning(line, column, QCoreApplication::translate("CplusPlus::CheckSymbols", "Too few arguments"), length);
else if (matchType == Match_TooManyArgs)
- warning(line, column, "Too many arguments", length);
+ warning(line, column, QCoreApplication::translate("CPlusPlus::CheckSymbols", "Too many arguments"), length);
const Use use(line, column, length, kind);
addUse(use);
diff --git a/src/plugins/cpptools/cppclassesfilter.cpp b/src/plugins/cpptools/cppclassesfilter.cpp
index fa23705a42..a66024377f 100644
--- a/src/plugins/cpptools/cppclassesfilter.cpp
+++ b/src/plugins/cpptools/cppclassesfilter.cpp
@@ -35,7 +35,7 @@ using namespace CppTools::Internal;
CppClassesFilter::CppClassesFilter(CppModelManager *manager)
: CppLocatorFilter(manager)
{
- setShortcutString("c");
+ setShortcutString(QLatin1String("c"));
setIncludedByDefault(false);
search.setSymbolsToSearchFor(SearchSymbols::Classes);
diff --git a/src/plugins/cpptools/cppcodestylepreferences.cpp b/src/plugins/cpptools/cppcodestylepreferences.cpp
index b80bae5744..2cb5da15c9 100644
--- a/src/plugins/cpptools/cppcodestylepreferences.cpp
+++ b/src/plugins/cpptools/cppcodestylepreferences.cpp
@@ -96,7 +96,7 @@ void CppCodeStylePreferences::slotCurrentValueChanged(const QVariant &value)
QString CppCodeStylePreferences::settingsSuffix() const
{
- return settingsSuffixKey;
+ return QLatin1String(settingsSuffixKey);
}
void CppCodeStylePreferences::toMap(const QString &prefix, QVariantMap *map) const
diff --git a/src/plugins/cpptools/cppcodestylepreferencesfactory.cpp b/src/plugins/cpptools/cppcodestylepreferencesfactory.cpp
index d2a6b4c72d..f1cf45634c 100644
--- a/src/plugins/cpptools/cppcodestylepreferencesfactory.cpp
+++ b/src/plugins/cpptools/cppcodestylepreferencesfactory.cpp
@@ -98,7 +98,7 @@ Core::Id CppCodeStylePreferencesFactory::languageId()
QString CppCodeStylePreferencesFactory::displayName()
{
- return Constants::CPP_SETTINGS_NAME;
+ return QString::fromUtf8(Constants::CPP_SETTINGS_NAME);
}
TextEditor::ICodeStylePreferences *CppCodeStylePreferencesFactory::createCodeStyle() const
diff --git a/src/plugins/cpptools/cppcodestylesettingspage.cpp b/src/plugins/cpptools/cppcodestylesettingspage.cpp
index 8029f64839..a3262d8015 100644
--- a/src/plugins/cpptools/cppcodestylesettingspage.cpp
+++ b/src/plugins/cpptools/cppcodestylesettingspage.cpp
@@ -216,9 +216,8 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
m_previews << m_ui->previewTextEditGeneral << m_ui->previewTextEditContent
<< m_ui->previewTextEditBraces << m_ui->previewTextEditSwitch
<< m_ui->previewTextEditPadding;
- for (int i = 0; i < m_previews.size(); ++i) {
- m_previews[i]->setPlainText(defaultCodeStyleSnippets[i]);
- }
+ for (int i = 0; i < m_previews.size(); ++i)
+ m_previews[i]->setPlainText(QLatin1String(defaultCodeStyleSnippets[i]));
TextEditor::TextEditorSettings *textEditorSettings = TextEditorSettings::instance();
decorateEditors(textEditorSettings->fontSettings());
@@ -513,17 +512,17 @@ void CppCodeStyleSettingsPage::apply()
if (originalCppCodeStylePreferences->codeStyleSettings() != m_pageCppCodeStylePreferences->codeStyleSettings()) {
originalCppCodeStylePreferences->setCodeStyleSettings(m_pageCppCodeStylePreferences->codeStyleSettings());
if (s)
- originalCppCodeStylePreferences->toSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
+ originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
}
if (originalCppCodeStylePreferences->tabSettings() != m_pageCppCodeStylePreferences->tabSettings()) {
originalCppCodeStylePreferences->setTabSettings(m_pageCppCodeStylePreferences->tabSettings());
if (s)
- originalCppCodeStylePreferences->toSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
+ originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
}
if (originalCppCodeStylePreferences->currentDelegate() != m_pageCppCodeStylePreferences->currentDelegate()) {
originalCppCodeStylePreferences->setCurrentDelegate(m_pageCppCodeStylePreferences->currentDelegate());
if (s)
- originalCppCodeStylePreferences->toSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
+ originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
}
}
}
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index 66c5e1c972..e9cfda9dda 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -412,9 +412,9 @@ QString CppFunctionHintModel::text(int index) const
QString hintText;
hintText += Qt::escape(prettyMethod.left(begin));
- hintText += "<b>";
+ hintText += QLatin1String("<b>");
hintText += Qt::escape(prettyMethod.mid(begin, end - begin));
- hintText += "</b>";
+ hintText += QLatin1String("</b>");
hintText += Qt::escape(prettyMethod.mid(end));
return hintText;
}
@@ -648,7 +648,7 @@ Function *asFunctionOrTemplateFunctionType(FullySpecifiedType ty)
CppCompletionAssistProcessor::CppCompletionAssistProcessor()
: m_startPosition(-1)
, m_objcEnabled(true)
- , m_snippetCollector(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID,
+ , m_snippetCollector(QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID),
QIcon(QLatin1String(":/texteditor/images/snippet.png")))
, preprocessorCompletions(QStringList()
<< QLatin1String("define")
@@ -1130,7 +1130,7 @@ void CppCompletionAssistProcessor::completeObjCMsgSend(CPlusPlus::ClassOrNamespa
if (i > 0)
text += QLatin1Char(' ');
Symbol *arg = method->argumentAt(i);
- text += selectorName->nameAt(i)->identifier()->chars();
+ text += QString::fromUtf8(selectorName->nameAt(i)->identifier()->chars());
text += QLatin1Char(':');
text += TextEditor::Snippet::kVariableDelimiter;
text += QLatin1Char('(');
@@ -1140,7 +1140,7 @@ void CppCompletionAssistProcessor::completeObjCMsgSend(CPlusPlus::ClassOrNamespa
text += TextEditor::Snippet::kVariableDelimiter;
}
} else {
- text = selectorName->identifier()->chars();
+ text = QString::fromUtf8(selectorName->identifier()->chars());
}
data = text;
@@ -1237,7 +1237,7 @@ bool CppCompletionAssistProcessor::objcKeywordsWanted() const
QString fileName = document->fileName();
const Core::MimeDatabase *mdb = Core::ICore::mimeDatabase();
- return mdb->findByFile(fileName).type() == CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE;
+ return mdb->findByFile(fileName).type() == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE);
}
int CppCompletionAssistProcessor::startCompletionInternal(const QString fileName,
@@ -1863,7 +1863,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
int lineStartToken = bs.startOfLine(startToken);
// make sure the required tokens are actually available
bs.LA(startToken - lineStartToken);
- QString possibleDecl = bs.mid(lineStartToken).trimmed().append("();");
+ QString possibleDecl = bs.mid(lineStartToken).trimmed().append(QLatin1String("();"));
Document::Ptr doc = Document::create(QLatin1String("<completion>"));
doc->setUtf8Source(possibleDecl.toLatin1());
diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
index 31ffc140c2..d06fe6a839 100644
--- a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
+++ b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
@@ -68,7 +68,7 @@ QList<Locator::FilterEntry> CppCurrentDocumentFilter::matchesFor(QFutureInterfac
QRegExp regexp(asterisk + entry + asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid())
return goodEntries;
- bool hasWildcard = (entry.contains(asterisk) || entry.contains('?'));
+ bool hasWildcard = (entry.contains(asterisk) || entry.contains(QLatin1Char('?')));
if (m_currentFileName.isEmpty())
return goodEntries;
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index faafde01da..173ed20222 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -297,7 +297,7 @@ void CppFindReferences::findAll_helper(Find::SearchResult *search)
Core::ProgressManager *progressManager = Core::ICore::progressManager();
Core::FutureProgress *progress = progressManager->addTask(result, tr("Searching"),
- CppTools::Constants::TASK_SEARCH);
+ QLatin1String(CppTools::Constants::TASK_SEARCH));
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
}
@@ -410,7 +410,7 @@ namespace {
class SymbolFinder : public SymbolVisitor
{
public:
- SymbolFinder(const QStringList &uid) : m_uid(uid), m_index(0), m_result(0) { }
+ SymbolFinder(const QList<QByteArray> &uid) : m_uid(uid), m_index(0), m_result(0) { }
Symbol *result() const { return m_result; }
bool preVisit(Symbol *symbol)
@@ -439,7 +439,7 @@ public:
}
private:
- QStringList m_uid;
+ QList<QByteArray> m_uid;
int m_index;
Symbol *m_result;
};
@@ -461,7 +461,7 @@ bool CppFindReferences::findSymbol(CppFindReferencesParameters *parameters,
doc->check();
// construct id of old symbol
- QStringList uid;
+ QList<QByteArray> uid;
Symbol *current = parameters->symbol;
do {
uid.prepend(idForSymbol(current));
@@ -649,7 +649,7 @@ void CppFindReferences::findMacroUses(const Macro &macro, const QString &replace
Find::SearchResult *search = Find::SearchResultWindow::instance()->startNewSearch(
tr("C++ Macro Usages:"),
QString(),
- macro.name(),
+ QString::fromUtf8(macro.name()),
replace ? Find::SearchResultWindow::SearchAndReplace
: Find::SearchResultWindow::SearchOnly,
QLatin1String("CppEditor"));
@@ -683,13 +683,13 @@ void CppFindReferences::findMacroUses(const Macro &macro, const QString &replace
Core::ProgressManager *progressManager = Core::ICore::progressManager();
Core::FutureProgress *progress = progressManager->addTask(result, tr("Searching"),
- CppTools::Constants::TASK_SEARCH);
+ QLatin1String(CppTools::Constants::TASK_SEARCH));
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
}
void CppFindReferences::renameMacroUses(const Macro &macro, const QString &replacement)
{
- const QString textToReplace = replacement.isEmpty() ? macro.name() : replacement;
+ const QString textToReplace = replacement.isEmpty() ? QString::fromUtf8(macro.name()) : replacement;
findMacroUses(macro, textToReplace, true);
}
diff --git a/src/plugins/cpptools/cpplocatorfilter.cpp b/src/plugins/cpptools/cpplocatorfilter.cpp
index f86ceaa684..99a0e36591 100644
--- a/src/plugins/cpptools/cpplocatorfilter.cpp
+++ b/src/plugins/cpptools/cpplocatorfilter.cpp
@@ -88,7 +88,7 @@ QList<Locator::FilterEntry> CppLocatorFilter::matchesFor(QFutureInterface<Locato
QRegExp regexp(asterisk + entry+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid())
return goodEntries;
- bool hasWildcard = (entry.contains(asterisk) || entry.contains('?'));
+ bool hasWildcard = (entry.contains(asterisk) || entry.contains(QLatin1Char('?')));
QHashIterator<QString, QList<ModelItemInfo> > it(m_searchList);
while (it.hasNext()) {
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index a70f8f1e0b..b01c8ae420 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -709,7 +709,7 @@ public:
if (sourceFiles.count() > 1) {
Core::ICore::progressManager()->addTask(result,
QCoreApplication::translate("IndexingSupport", "Parsing"),
- CppTools::Constants::TASK_INDEX);
+ QLatin1String(CppTools::Constants::TASK_INDEX));
}
return result;
@@ -1052,13 +1052,13 @@ CppModelManager::WorkingCopy CppModelManager::buildWorkingCopyList()
QSetIterator<AbstractEditorSupport *> jt(m_addtionalEditorSupport);
while (jt.hasNext()) {
AbstractEditorSupport *es = jt.next();
- workingCopy.insert(es->fileName(), es->contents());
+ workingCopy.insert(es->fileName(), QString::fromUtf8(es->contents()));
}
// add the project configuration file
QByteArray conf(pp_configuration);
conf += definedMacros();
- workingCopy.insert(pp_configuration_file, conf);
+ workingCopy.insert(QLatin1String(pp_configuration_file), QString::fromUtf8(conf));
return workingCopy;
}
@@ -1124,7 +1124,7 @@ QList<CppModelManager::ProjectPart::Ptr> CppModelManager::projectPart(const QStr
return parts;
//### FIXME: This is a DIRTY hack!
- if (fileName.endsWith(".h")) {
+ if (fileName.endsWith(QLatin1String(".h"))) {
QString cppFile = fileName.mid(0, fileName.length() - 2) + QLatin1String(".cpp");
parts = m_srcToProjectPart.value(cppFile);
if (!parts.isEmpty())
@@ -1358,7 +1358,7 @@ void CppModelManager::onAboutToRemoveProject(ProjectExplorer::Project *project)
void CppModelManager::onAboutToUnloadSession()
{
if (Core::ProgressManager *pm = Core::ICore::progressManager()) {
- pm->cancelTasks(CppTools::Constants::TASK_INDEX);
+ pm->cancelTasks(QLatin1String(CppTools::Constants::TASK_INDEX));
}
do {
QMutexLocker locker(&mutex);
diff --git a/src/plugins/cpptools/cpptools.pro b/src/plugins/cpptools/cpptools.pro
index d3c5eab097..7c49e5e521 100644
--- a/src/plugins/cpptools/cpptools.pro
+++ b/src/plugins/cpptools/cpptools.pro
@@ -4,8 +4,7 @@ include(../../qtcreatorplugin.pri)
include($$IDE_SOURCE_TREE/src/plugins/locator/locator.pri)
include(cpptools_dependencies.pri)
-# DEFINES += QT_NO_CAST_FROM_ASCII
-DEFINES += QT_NO_CAST_TO_ASCII
+DEFINES += QT_NO_CAST_FROM_ASCII
INCLUDEPATH += .
DEFINES += CPPTOOLS_LIBRARY
HEADERS += completionsettingspage.h \
diff --git a/src/plugins/cpptools/cpptools.qbs b/src/plugins/cpptools/cpptools.qbs
index 8c073e25c4..1b2518cf11 100644
--- a/src/plugins/cpptools/cpptools.qbs
+++ b/src/plugins/cpptools/cpptools.qbs
@@ -16,7 +16,7 @@ QtcPlugin {
Depends { name: "LanguageUtils" }
Depends { name: "cpp" }
- cpp.defines: base.concat(["QT_NO_CAST_TO_ASCII"])
+ cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
files: [
"ModelManagerInterface.cpp",
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp
index 6fbb4c315e..e88518ad2d 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.cpp
+++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp
@@ -123,7 +123,7 @@ void CppEditorSupport::updateDocumentNow()
_updateDocumentTimer->stop();
QStringList sourceFiles(_textEditor->document()->fileName());
- _cachedContents = _textEditor->contents().toUtf8();
+ _cachedContents = _textEditor->contents();
_documentParser = _modelManager->updateSourceFiles(sourceFiles);
}
}
diff --git a/src/plugins/cpptools/cpptoolssettings.cpp b/src/plugins/cpptools/cpptoolssettings.cpp
index 3494c16b8b..503cc99bb9 100644
--- a/src/plugins/cpptools/cpptoolssettings.cpp
+++ b/src/plugins/cpptools/cpptoolssettings.cpp
@@ -102,7 +102,7 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
d->m_globalCodeStyle = new CppCodeStylePreferences(this);
d->m_globalCodeStyle->setDelegatingPool(pool);
d->m_globalCodeStyle->setDisplayName(tr("Global", "Settings"));
- d->m_globalCodeStyle->setId(idKey);
+ d->m_globalCodeStyle->setId(QLatin1String(idKey));
pool->addCodeStyle(d->m_globalCodeStyle);
textEditorSettings->registerCodeStyle(CppTools::Constants::CPP_SETTINGS_ID, d->m_globalCodeStyle);
@@ -171,7 +171,7 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
// load global settings (after built-in settings are added to the pool)
QSettings *s = Core::ICore::settings();
- d->m_globalCodeStyle->fromSettings(CppTools::Constants::CPP_SETTINGS_ID, Core::ICore::settings());
+ d->m_globalCodeStyle->fromSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), Core::ICore::settings());
// legacy handling start (Qt Creator Version < 2.4)
const bool legacyTransformed =
@@ -214,7 +214,7 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
// change the current delegate and save
d->m_globalCodeStyle->setCurrentDelegate(oldCreator);
- d->m_globalCodeStyle->toSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
+ d->m_globalCodeStyle->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
}
// mark old settings as transformed
s->setValue(QLatin1String("CppCodeStyleSettings/LegacyTransformed"), true);
diff --git a/src/plugins/cpptools/insertionpointlocator.cpp b/src/plugins/cpptools/insertionpointlocator.cpp
index 4bb5b2a4e0..d30101c085 100644
--- a/src/plugins/cpptools/insertionpointlocator.cpp
+++ b/src/plugins/cpptools/insertionpointlocator.cpp
@@ -528,14 +528,14 @@ static InsertionLocation nextToSurroundingDefinitions(Declaration *declaration,
if (!definitionFunction)
return noResult;
- Document::Ptr targetDoc = changes.snapshot().document(definition->fileName());
+ Document::Ptr targetDoc = changes.snapshot().document(QString::fromUtf8(definition->fileName()));
if (!targetDoc)
return noResult;
targetDoc->translationUnit()->getPosition(definitionFunction->endOffset(), &line, &column);
} else {
// we don't have an offset to the start of the function definition, so we need to manually find it...
- CppRefactoringFilePtr targetFile = changes.file(definition->fileName());
+ CppRefactoringFilePtr targetFile = changes.file(QString::fromUtf8(definition->fileName()));
if (!targetFile->isValid())
return noResult;
@@ -547,7 +547,7 @@ static InsertionLocation nextToSurroundingDefinitions(Declaration *declaration,
targetFile->cppDocument()->translationUnit()->getTokenStartPosition(functionDefinition->firstToken(), &line, &column);
}
- return InsertionLocation(definition->fileName(), prefix, suffix, line, column);
+ return InsertionLocation(QString::fromUtf8(definition->fileName()), prefix, suffix, line, column);
}
QList<InsertionLocation> InsertionPointLocator::methodDefinition(
diff --git a/src/plugins/cpptools/symbolsfindfilter.cpp b/src/plugins/cpptools/symbolsfindfilter.cpp
index ddb4f2fa4b..2ea320ef46 100644
--- a/src/plugins/cpptools/symbolsfindfilter.cpp
+++ b/src/plugins/cpptools/symbolsfindfilter.cpp
@@ -207,7 +207,7 @@ void SymbolsFindFilter::startSearch(Find::SearchResult *search)
m_manager->snapshot(), projectFileNames));
Core::FutureProgress *progress = Core::ICore::progressManager()->addTask(watcher->future(),
tr("Searching"),
- Find::Constants::TASK_SEARCH);
+ QLatin1String(Find::Constants::TASK_SEARCH));
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
}
@@ -256,17 +256,17 @@ QWidget *SymbolsFindFilter::createConfigWidget()
void SymbolsFindFilter::writeSettings(QSettings *settings)
{
settings->beginGroup(QLatin1String(SETTINGS_GROUP));
- settings->setValue(SETTINGS_SYMBOLTYPES, (int)m_symbolsToSearch);
- settings->setValue(SETTINGS_SEARCHSCOPE, (int)m_scope);
+ settings->setValue(QLatin1String(SETTINGS_SYMBOLTYPES), (int)m_symbolsToSearch);
+ settings->setValue(QLatin1String(SETTINGS_SEARCHSCOPE), (int)m_scope);
settings->endGroup();
}
void SymbolsFindFilter::readSettings(QSettings *settings)
{
settings->beginGroup(QLatin1String(SETTINGS_GROUP));
- m_symbolsToSearch = (SearchSymbols::SymbolTypes)settings->value(SETTINGS_SYMBOLTYPES,
+ m_symbolsToSearch = (SearchSymbols::SymbolTypes)settings->value(QLatin1String(SETTINGS_SYMBOLTYPES),
(int)SearchSymbols::AllTypes).toInt();
- m_scope = (SearchScope)settings->value(SETTINGS_SEARCHSCOPE,
+ m_scope = (SearchScope)settings->value(QLatin1String(SETTINGS_SEARCHSCOPE),
(int)SearchProjectsOnly).toInt();
settings->endGroup();
emit symbolsToSearchChanged();
@@ -274,7 +274,7 @@ void SymbolsFindFilter::readSettings(QSettings *settings)
void SymbolsFindFilter::onTaskStarted(const QString &type)
{
- if (type == CppTools::Constants::TASK_INDEX) {
+ if (type == QLatin1String(CppTools::Constants::TASK_INDEX)) {
m_enabled = false;
emit enabledChanged(m_enabled);
}
@@ -282,7 +282,7 @@ void SymbolsFindFilter::onTaskStarted(const QString &type)
void SymbolsFindFilter::onAllTasksFinished(const QString &type)
{
- if (type == CppTools::Constants::TASK_INDEX) {
+ if (type == QLatin1String(CppTools::Constants::TASK_INDEX)) {
m_enabled = true;
emit enabledChanged(m_enabled);
}