Use the encoding settings when doing multi-file searches.

Task-number: QTCREATORBUG-65
This commit is contained in:
con
2010-10-11 11:34:17 +02:00
parent 38d3090a4a
commit d2a91ed1a0
9 changed files with 161 additions and 75 deletions

View File

@@ -31,6 +31,8 @@
#include <coreplugin/editormanager/editormanager.h>
#include <QtCore/QTextCodec>
using namespace TextEditor;
QMap<QString, QString> ITextEditor::openedTextEditorsContents()
@@ -45,3 +47,16 @@ QMap<QString, QString> ITextEditor::openedTextEditorsContents()
}
return workingCopy;
}
QMap<QString, QTextCodec *> TextEditor::ITextEditor::openedTextEditorsEncodings()
{
QMap<QString, QTextCodec *> workingCopy;
foreach (Core::IEditor *editor, Core::EditorManager::instance()->openedEditors()) {
ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor);
if (!textEditor)
continue;
QString fileName = textEditor->file()->fileName();
workingCopy[fileName] = textEditor->textCodec();
}
return workingCopy;
}