Rename IFile->IDocument and FileManager->DocumentManager

And adapt the other API respectively.

Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Eike Ziller
2012-02-14 16:43:51 +01:00
parent 266da3568d
commit d66acb51d0
216 changed files with 1201 additions and 1207 deletions

View File

@@ -79,7 +79,7 @@ Core::Id CMakeEditor::id() const
void CMakeEditor::markAsChanged()
{
if (!file()->isModified())
if (!document()->isModified())
return;
if (m_infoBarShown)
return;
@@ -87,7 +87,7 @@ void CMakeEditor::markAsChanged()
Core::InfoBarEntry info(QLatin1String("CMakeEditor.RunCMake"),
tr("Changes to cmake files are shown in the project tree after building."));
info.setCustomButtonInfo(tr("Build now"), this, SLOT(build()));
file()->infoBar()->addInfo(info);
document()->infoBar()->addInfo(info);
}
void CMakeEditor::build()
@@ -97,7 +97,7 @@ void CMakeEditor::build()
foreach (ProjectExplorer::Project *p, projects) {
CMakeProject *cmakeProject = qobject_cast<CMakeProject *>(p);
if (cmakeProject) {
if (cmakeProject->isProjectFile(file()->fileName())) {
if (cmakeProject->isProjectFile(document()->fileName())) {
ProjectExplorer::ProjectExplorerPlugin::instance()->buildProject(cmakeProject);
break;
}

View File

@@ -58,10 +58,10 @@ QString CMakeEditorFactory::displayName() const
return tr(CMakeProjectManager::Constants::CMAKE_EDITOR_DISPLAY_NAME);
}
Core::IFile *CMakeEditorFactory::open(const QString &fileName)
Core::IDocument *CMakeEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, id());
return iface ? iface->file() : 0;
return iface ? iface->document() : 0;
}
Core::IEditor *CMakeEditorFactory::createEditor(QWidget *parent)

View File

@@ -57,7 +57,7 @@ public:
QStringList mimeTypes() const;
Core::Id id() const;
QString displayName() const;
Core::IFile *open(const QString &fileName);
Core::IDocument *open(const QString &fileName);
Core::IEditor *createEditor(QWidget *parent);
private:

View File

@@ -75,8 +75,8 @@ QList<Locator::FilterEntry> CMakeLocatorFilter::matchesFor(QFutureInterface<Loca
if (cmakeProject) {
foreach (CMakeBuildTarget ct, cmakeProject->buildTargets()) {
if (ct.title.contains(entry)) {
Locator::FilterEntry entry(this, ct.title, cmakeProject->file()->fileName());
entry.extraInfo = cmakeProject->file()->fileName();
Locator::FilterEntry entry(this, ct.title, cmakeProject->document()->fileName());
entry.extraInfo = cmakeProject->document()->fileName();
result.append(entry);
}
}
@@ -95,7 +95,7 @@ void CMakeLocatorFilter::accept(Locator::FilterEntry selection) const
ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projects();
foreach (ProjectExplorer::Project *p, projects) {
cmakeProject = qobject_cast<CMakeProject *>(p);
if (cmakeProject && cmakeProject->file()->fileName() == selection.internalData.toString())
if (cmakeProject && cmakeProject->document()->fileName() == selection.internalData.toString())
break;
cmakeProject = 0;
}

View File

@@ -197,8 +197,8 @@ bool CMakeProject::parseCMakeLists()
return false;
foreach (Core::IEditor *editor, Core::EditorManager::instance()->openedEditors())
if (isProjectFile(editor->file()->fileName()))
editor->file()->infoBar()->removeInfo(QLatin1String("CMakeEditor.RunCMake"));
if (isProjectFile(editor->document()->fileName()))
editor->document()->infoBar()->removeInfo(QLatin1String("CMakeEditor.RunCMake"));
// Find cbp file
CMakeBuildConfiguration *activeBC = activeTarget()->activeBuildConfiguration();
@@ -481,7 +481,7 @@ QString CMakeProject::id() const
return QLatin1String(Constants::CMAKEPROJECT_ID);
}
Core::IFile *CMakeProject::file() const
Core::IDocument *CMakeProject::document() const
{
return m_file;
}
@@ -692,7 +692,7 @@ void CMakeProject::editorChanged(Core::IEditor *editor)
disconnect(m_lastEditor, SIGNAL(changed()), this, SLOT(uiEditorContentsChanged()));
if (m_dirtyUic) {
const QString contents = formWindowEditorContents(m_lastEditor);
updateCodeModelSupportFromEditor(m_lastEditor->file()->fileName(), contents);
updateCodeModelSupportFromEditor(m_lastEditor->document()->fileName(), contents);
m_dirtyUic = false;
}
}
@@ -713,7 +713,7 @@ void CMakeProject::editorAboutToClose(Core::IEditor *editor)
disconnect(m_lastEditor, SIGNAL(changed()), this, SLOT(uiEditorContentsChanged()));
if (m_dirtyUic) {
const QString contents = formWindowEditorContents(m_lastEditor);
updateCodeModelSupportFromEditor(m_lastEditor->file()->fileName(), contents);
updateCodeModelSupportFromEditor(m_lastEditor->document()->fileName(), contents);
m_dirtyUic = false;
}
}
@@ -744,7 +744,7 @@ void CMakeProject::buildStateChanged(ProjectExplorer::Project *project)
// CMakeFile
CMakeFile::CMakeFile(CMakeProject *parent, QString fileName)
: Core::IFile(parent), m_project(parent), m_fileName(fileName)
: Core::IDocument(parent), m_project(parent), m_fileName(fileName)
{
}
@@ -797,7 +797,7 @@ void CMakeFile::rename(const QString &newName)
// Can't happen....
}
Core::IFile::ReloadBehavior CMakeFile::reloadBehavior(ChangeTrigger state, ChangeType type) const
Core::IDocument::ReloadBehavior CMakeFile::reloadBehavior(ChangeTrigger state, ChangeType type) const
{
Q_UNUSED(state)
Q_UNUSED(type)

View File

@@ -43,7 +43,7 @@
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildconfiguration.h>
#include <coreplugin/ifile.h>
#include <coreplugin/idocument.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
@@ -81,7 +81,7 @@ public:
QString displayName() const;
QString id() const;
Core::IFile *file() const;
Core::IDocument *document() const;
CMakeManager *projectManager() const;
CMakeTarget *activeTarget() const;
@@ -193,7 +193,7 @@ private:
QString m_compiler;
};
class CMakeFile : public Core::IFile
class CMakeFile : public Core::IDocument
{
Q_OBJECT
public: