forked from qt-creator/qt-creator
CppEditor: Ensure utf8 encoded working copy from the preprocessor dialog
Change-Id: Ifbc2adeff83cbef9841da872e15a5b9dd8379a3d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user