Commit fc9a99fc authored by Eike Ziller's avatar Eike Ziller
Browse files

TextEditors: Move document related function to document



Change-Id: I9d0abacbd1b503390164934a1b833fd305ae3fbe
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent b7ce718d
......@@ -82,7 +82,8 @@ Utils::FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFi
foreach (const QString &filter, nameFilters) {
filterRegs << QRegExp(filter, Qt::CaseInsensitive, QRegExp::Wildcard);
}
QMap<QString, QTextCodec *> openEditorEncodings = TextEditor::ITextEditor::openedTextDocumentEncodings();
QMap<QString, QTextCodec *> openEditorEncodings
= TextEditor::ITextEditorDocument::openedTextDocumentEncodings();
QMap<QString, QTextCodec *> encodings;
foreach (const Project *project, projects) {
QStringList projectFiles = project->files(Project::AllFiles);
......
......@@ -173,12 +173,12 @@ void BaseFileFind::runSearch(Core::SearchResult *search)
watcher->setFuture(Utils::findInFilesRegExp(parameters.text,
files(parameters.nameFilters, parameters.additionalParameters),
textDocumentFlagsForFindFlags(parameters.flags),
ITextEditor::openedTextDocumentContents()));
ITextEditorDocument::openedTextDocumentContents()));
} else {
watcher->setFuture(Utils::findInFiles(parameters.text,
files(parameters.nameFilters, parameters.additionalParameters),
textDocumentFlagsForFindFlags(parameters.flags),
ITextEditor::openedTextDocumentContents()));
ITextEditorDocument::openedTextDocumentContents()));
}
FutureProgress *progress =
ProgressManager::addTask(watcher->future(), tr("Search"), Constants::TASK_SEARCH);
......
......@@ -63,7 +63,8 @@ Utils::FileIterator *FindInCurrentFile::files(const QStringList &nameFilters,
{
Q_UNUSED(nameFilters)
QString fileName = additionalParameters.toString();
QMap<QString, QTextCodec *> openEditorEncodings = ITextEditor::openedTextDocumentEncodings();
QMap<QString, QTextCodec *> openEditorEncodings
= ITextEditorDocument::openedTextDocumentEncodings();
QTextCodec *codec = openEditorEncodings.value(fileName);
if (!codec)
codec = Core::EditorManager::defaultTextCodec();
......
......@@ -63,7 +63,8 @@ Utils::FileIterator *FindInOpenFiles::files(const QStringList &nameFilters,
{
Q_UNUSED(nameFilters)
Q_UNUSED(additionalParameters)
QMap<QString, QTextCodec *> openEditorEncodings = ITextEditor::openedTextDocumentEncodings();
QMap<QString, QTextCodec *> openEditorEncodings
= ITextEditorDocument::openedTextDocumentEncodings();
QStringList fileNames;
QList<QTextCodec *> codecs;
foreach (Core::DocumentModel::Entry *entry,
......
......@@ -38,7 +38,7 @@ ITextEditorDocument::ITextEditorDocument(QObject *parent)
{
}
QMap<QString, QString> ITextEditor::openedTextDocumentContents()
QMap<QString, QString> ITextEditorDocument::openedTextDocumentContents()
{
QMap<QString, QString> workingCopy;
foreach (Core::IDocument *document, Core::EditorManager::documentModel()->openedDocuments()) {
......@@ -51,7 +51,7 @@ QMap<QString, QString> ITextEditor::openedTextDocumentContents()
return workingCopy;
}
QMap<QString, QTextCodec *> TextEditor::ITextEditor::openedTextDocumentEncodings()
QMap<QString, QTextCodec *> ITextEditorDocument::openedTextDocumentEncodings()
{
QMap<QString, QTextCodec *> workingCopy;
foreach (Core::IDocument *document, Core::EditorManager::documentModel()->openedDocuments()) {
......
......@@ -87,6 +87,9 @@ public:
virtual ITextMarkable *markableInterface() const = 0;
static QMap<QString, QString> openedTextDocumentContents();
static QMap<QString, QTextCodec *> openedTextDocumentEncodings();
signals:
void contentsChanged();
};
......@@ -133,9 +136,6 @@ public:
virtual const Utils::CommentDefinition* commentDefinition() const = 0;
static QMap<QString, QString> openedTextDocumentContents();
static QMap<QString, QTextCodec *> openedTextDocumentEncodings();
enum MarkRequestKind {
BreakpointRequest,
BookmarkRequest,
......
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