Commit 18f38709 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

CppEditor: Ensure utf8 encoded working copy from the preprocessor dialog



Change-Id: Ifbc2adeff83cbef9841da872e15a5b9dd8379a3d
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 25c21b35
......@@ -709,7 +709,7 @@ void CPPEditorWidget::setMimeType(const QString &mt)
const QString &projectFile = ProjectExplorer::SessionManager::value(
QLatin1String(Constants::CPP_PREPROCESSOR_PROJECT_PREFIX) + filePath).toString();
const QByteArray &additionalDirectives = ProjectExplorer::SessionManager::value(
projectFile + QLatin1Char(',') + filePath).toByteArray();
projectFile + QLatin1Char(',') + filePath).toString().toUtf8();
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
......@@ -1988,7 +1988,7 @@ void CPPEditorWidget::showPreProcessorWidget()
if (preProcessorDialog.exec() == QDialog::Accepted) {
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
updater->setEditorDefines(preProcessorDialog.additionalPreProcessorDirectives().toLatin1());
updater->setEditorDefines(preProcessorDialog.additionalPreProcessorDirectives().toUtf8());
updater->update(m_modelManager->workingCopy());
}
}
......
......@@ -1000,7 +1000,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor()
while (sup->lastSemanticInfoDocument().isNull())
QCoreApplication::processEvents();
sup->snapshotUpdater()->setEditorDefines(editorDefines.toLatin1());
sup->snapshotUpdater()->setEditorDefines(editorDefines.toUtf8());
sup->snapshotUpdater()->update(mm->workingCopy());
Document::Ptr doc = mm->snapshot().document(main1File);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment