Commit c32db575 authored by Eike Ziller's avatar Eike Ziller

EditorManager: Remove unneeded methods

Change-Id: If3ab9414270df33fb6b0e269b628813e4c71e5c8
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent aa981f40
......@@ -826,7 +826,7 @@ void DocumentManager::checkForReload()
IDocument::ReloadSetting defaultBehavior = EditorManager::instance()->reloadSetting();
Utils::ReloadPromptAnswer previousAnswer = Utils::ReloadCurrent;
QList<IEditor*> editorsToClose;
QList<IDocument *> documentsToClose;
QMap<IDocument*, QString> documentsToSave;
// collect file information
......@@ -931,7 +931,7 @@ void DocumentManager::checkForReload()
&& type == IDocument::TypeRemoved && !document->isModified()) {
// file removed, but unmodified files should be reloaded
// so we close the file
editorsToClose << EditorManager::instance()->editorsForDocument(document);
documentsToClose << document;
} else if (defaultBehavior == IDocument::IgnoreAll) {
// content change or removed, but settings say ignore
success = document->reload(&errorString, IDocument::FlagIgnore, type);
......@@ -943,7 +943,7 @@ void DocumentManager::checkForReload()
if (document->reloadBehavior(trigger, type) == IDocument::BehaviorSilent) {
// content change or removed, IDocument wants silent handling
if (type == IDocument::TypeRemoved)
editorsToClose << EditorManager::instance()->editorsForDocument(document);
documentsToClose << document;
else
success = document->reload(&errorString, IDocument::FlagReload, type);
// IDocument wants us to ask
......@@ -968,7 +968,7 @@ void DocumentManager::checkForReload()
success = document->reload(&errorString, IDocument::FlagIgnore, IDocument::TypeContents);
break;
case Utils::CloseCurrent:
editorsToClose << EditorManager::instance()->editorsForDocument(document);
documentsToClose << document;
break;
}
}
......@@ -992,7 +992,7 @@ void DocumentManager::checkForReload()
break;
}
case Utils::FileDeletedClose:
editorsToClose << EditorManager::instance()->editorsForDocument(document);
documentsToClose << document;
unhandled = false;
break;
}
......@@ -1016,7 +1016,7 @@ void DocumentManager::checkForReload()
errorStrings.join(QLatin1String("\n")));
// handle deleted files
EditorManager::instance()->closeEditors(editorsToClose, false);
EditorManager::closeDocuments(documentsToClose, false);
QMapIterator<IDocument *, QString> it(documentsToSave);
while (it.hasNext()) {
it.next();
......
......@@ -638,16 +638,6 @@ QList<IEditor *> EditorManager::editorsForFileName(const QString &filename) cons
return found;
}
QList<IEditor *> EditorManager::editorsForDocument(IDocument *document) const
{
QList<IEditor *> found;
foreach (IEditor *editor, openedEditors()) {
if (editor->document() == document)
found << editor;
}
return found;
}
IDocument *EditorManager::currentDocument()
{
return d->m_currentEditor ? d->m_currentEditor->document() : 0;
......@@ -1299,7 +1289,7 @@ IEditor *EditorManager::activateEditorForDocument(IDocument *document, OpenEdito
Core::IEditor *EditorManager::activateEditorForDocument(Core::Internal::EditorView *view, Core::IDocument *document, OpenEditorFlags flags)
{
Q_ASSERT(view);
const QList<IEditor*> editors = editorsForDocument(document);
const QList<IEditor*> editors = d->m_documentModel->editorsForDocument(document);
if (editors.isEmpty())
return 0;
......@@ -1695,11 +1685,6 @@ IEditor *EditorManager::openEditorWithContents(const Id &editorId,
return edt;
}
bool EditorManager::hasEditor(const QString &fileName) const
{
return !editorsForFileName(fileName).isEmpty();
}
void EditorManager::restoreEditorState(IEditor *editor)
{
QTC_ASSERT(editor, return);
......
......@@ -122,9 +122,7 @@ public:
QStringList getOpenFileNames() const;
Id getOpenWithEditorId(const QString &fileName, bool *isExternalEditor = 0) const;
bool hasEditor(const QString &fileName) const;
QList<IEditor *> editorsForFileName(const QString &filename) const;
QList<IEditor *> editorsForDocument(IDocument *document) const;
static IDocument *currentDocument();
static IEditor *currentEditor();
......
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