diff options
author | Eike Ziller <eike.ziller@nokia.com> | 2012-02-14 16:43:51 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@nokia.com> | 2012-02-20 13:32:49 +0100 |
commit | d66acb51d0c8b511df9f679806cbd3d84cce41ef (patch) | |
tree | 58289c9e7f7bc6107b4d620fad791a206d097555 /src/plugins/projectexplorer | |
parent | 266da3568d2db185f67227d38e29cd20d28fb2bd (diff) | |
download | qt-creator-d66acb51d0c8b511df9f679806cbd3d84cce41ef.tar.gz |
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>
Diffstat (limited to 'src/plugins/projectexplorer')
18 files changed, 87 insertions, 87 deletions
diff --git a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp index ebe331af1b..f733af247d 100644 --- a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp +++ b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp @@ -34,7 +34,7 @@ #include <coreplugin/basefilewizard.h> #include <coreplugin/icore.h> -#include <coreplugin/filemanager.h> +#include <coreplugin/documentmanager.h> #include <utils/projectintropage.h> #include <QDir> @@ -139,8 +139,8 @@ void BaseProjectWizardDialog::slotAccepted() { if (d->introPage->useAsDefaultPath()) { // Store the path as default path for new projects if desired. - Core::FileManager::setProjectsDirectory(path()); - Core::FileManager::setUseProjectsDirectory(true); + Core::DocumentManager::setProjectsDirectory(path()); + Core::DocumentManager::setUseProjectsDirectory(true); } } diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 6edab82dc2..205aa2466d 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -36,7 +36,7 @@ #include "project.h" #include "session.h" -#include <coreplugin/ifile.h> +#include <coreplugin/idocument.h> #include <utils/qtcassert.h> #include <QDebug> @@ -75,8 +75,8 @@ bool CurrentProjectFind::isEnabled() const QVariant CurrentProjectFind::additionalParameters() const { Project *project = ProjectExplorerPlugin::currentProject(); - if (project && project->file()) - return qVariantFromValue(project->file()->fileName()); + if (project && project->document()) + return qVariantFromValue(project->document()->fileName()); return QVariant(); } @@ -87,7 +87,7 @@ Utils::FileIterator *CurrentProjectFind::files(const QStringList &nameFilters, QList<Project *> allProjects = m_plugin->session()->projects(); QString projectFile = additionalParameters.toString(); foreach (Project *project, allProjects) { - if (project->file() && projectFile == project->file()->fileName()) + if (project->document() && projectFile == project->document()->fileName()) return filesForProjects(nameFilters, QList<Project *>() << project); } return new Utils::FileIterator(); diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp index bdf8815a0e..64ce1ada92 100644 --- a/src/plugins/projectexplorer/dependenciespanel.cpp +++ b/src/plugins/projectexplorer/dependenciespanel.cpp @@ -35,7 +35,7 @@ #include "session.h" #include <coreplugin/fileiconprovider.h> -#include <coreplugin/ifile.h> +#include <coreplugin/idocument.h> #include <utils/detailswidget.h> #include <QVector> @@ -114,7 +114,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const case Qt::CheckStateRole: return m_session->hasDependency(m_project, p) ? Qt::Checked : Qt::Unchecked; case Qt::DecorationRole: - return Core::FileIconProvider::instance()->icon(QFileInfo(p->file()->fileName())); + return Core::FileIconProvider::instance()->icon(QFileInfo(p->document()->fileName())); default: return QVariant(); } diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index 787a73f718..ee2459a23f 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -257,7 +257,7 @@ void EditorConfiguration::setUseGlobalSettings(bool use) QList<Core::IEditor *> opened = Core::EditorManager::instance()->openedEditors(); foreach (Core::IEditor *editor, opened) { if (BaseTextEditorWidget *baseTextEditor = qobject_cast<BaseTextEditorWidget *>(editor->widget())) { - Project *project = session->projectForFile(editor->file()->fileName()); + Project *project = session->projectForFile(editor->document()->fileName()); if (project && project->editorConfiguration() == this) switchSettings(baseTextEditor); } diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 43fb44222d..b89e3a4274 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -38,7 +38,7 @@ #include <coreplugin/icore.h> #include <coreplugin/fileiconprovider.h> -#include <coreplugin/filemanager.h> +#include <coreplugin/documentmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/coreconstants.h> #include <coreplugin/fileutils.h> @@ -188,11 +188,11 @@ void FolderNavigationWidget::setAutoSynchronization(bool sync) m_autoSync = sync; if (m_autoSync) { - connect(Core::FileManager::instance(), SIGNAL(currentFileChanged(QString)), + connect(Core::DocumentManager::instance(), SIGNAL(currentFileChanged(QString)), this, SLOT(setCurrentFile(QString))); - setCurrentFile(Core::FileManager::currentFile()); + setCurrentFile(Core::DocumentManager::currentFile()); } else { - disconnect(Core::FileManager::instance(), SIGNAL(currentFileChanged(QString)), + disconnect(Core::DocumentManager::instance(), SIGNAL(currentFileChanged(QString)), this, SLOT(setCurrentFile(QString))); } } @@ -322,7 +322,7 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev) // open with... if (!m_fileSystemModel->isDir(current)) { QMenu *openWith = menu.addMenu(tr("Open with")); - Core::FileManager::populateOpenWithMenu(openWith, + Core::DocumentManager::populateOpenWithMenu(openWith, m_fileSystemModel->filePath(current)); } @@ -360,7 +360,7 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev) findOnFileSystem(info.absolutePath()); return; } - Core::FileManager::executeOpenWithMenuAction(action); + Core::DocumentManager::executeOpenWithMenuAction(action); } QString FolderNavigationWidget::msgFindOnFileSystem() diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 4115bdefda..70ea3ab7ea 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -37,7 +37,7 @@ #include <utils/styledbar.h> #include <utils/stylehelper.h> -#include <coreplugin/ifile.h> +#include <coreplugin/idocument.h> #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> #include <coreplugin/modemanager.h> @@ -229,7 +229,7 @@ QListWidgetItem *ProjectListWidget::itemForProject(Project *project) QString ProjectListWidget::fullName(ProjectExplorer::Project *project) { - return tr("%1 (%2)").arg(project->displayName(), project->file()->fileName()); + return tr("%1 (%2)").arg(project->displayName(), project->document()->fileName()); } void ProjectListWidget::addProject(Project *project) diff --git a/src/plugins/projectexplorer/pluginfilefactory.cpp b/src/plugins/projectexplorer/pluginfilefactory.cpp index 4f18e32109..74ab068811 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.cpp +++ b/src/plugins/projectexplorer/pluginfilefactory.cpp @@ -75,7 +75,7 @@ QString ProjectFileFactory::displayName() const return tr("Project File Factory", "ProjectExplorer::ProjectFileFactory display name."); } -Core::IFile *ProjectFileFactory::open(const QString &fileName) +Core::IDocument *ProjectFileFactory::open(const QString &fileName) { ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance(); pe->openProject(fileName, 0); diff --git a/src/plugins/projectexplorer/pluginfilefactory.h b/src/plugins/projectexplorer/pluginfilefactory.h index 85b27e4615..b7b3d9bd1f 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.h +++ b/src/plugins/projectexplorer/pluginfilefactory.h @@ -33,7 +33,7 @@ #ifndef PLUGINFILEFACTORY_H #define PLUGINFILEFACTORY_H -#include <coreplugin/ifilefactory.h> +#include <coreplugin/idocumentfactory.h> #include <QStringList> @@ -44,7 +44,7 @@ class ProjectExplorerPlugin; namespace Internal { -class ProjectFileFactory : public Core::IFileFactory +class ProjectFileFactory : public Core::IDocumentFactory { Q_OBJECT @@ -56,7 +56,7 @@ public: Core::Id id() const; QString displayName() const; - Core::IFile *open(const QString &fileName); + Core::IDocument *open(const QString &fileName); static QList<ProjectFileFactory*> createFactories(QString *filterString); diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 8b9e6eaf24..ff6623b31e 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -37,7 +37,7 @@ #include "projectexplorerconstants.h" #include "target.h" -#include <coreplugin/ifile.h> +#include <coreplugin/idocument.h> #include <utils/qtcprocess.h> #include <utils/qtcassert.h> diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index ce9dfbef9f..cb60322621 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -40,7 +40,7 @@ #include "target.h" #include "settingsaccessor.h" -#include <coreplugin/ifile.h> +#include <coreplugin/idocument.h> #include <coreplugin/icontext.h> #include <extensionsystem/pluginmanager.h> #include <projectexplorer/buildmanager.h> @@ -274,7 +274,7 @@ QVariantMap Project::toMap() const QString Project::projectDirectory() const { - return projectDirectory(file()->fileName()); + return projectDirectory(document()->fileName()); } QString Project::projectDirectory(const QString &proFile) diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index d050b90939..b4f217c900 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -40,7 +40,7 @@ #include <QFileSystemModel> namespace Core { -class IFile; +class IDocument; class Context; } @@ -71,7 +71,7 @@ public: virtual QString displayName() const = 0; virtual QString id() const = 0; - virtual Core::IFile *file() const = 0; + virtual Core::IDocument *document() const = 0; virtual IProjectManager *projectManager() const = 0; virtual QList<Project *> dependsOn() = 0; //NBS TODO implement dependsOn diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index a7664a63b6..267f469e5b 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -90,7 +90,7 @@ #include <extensionsystem/pluginspec.h> #include <coreplugin/coreconstants.h> -#include <coreplugin/filemanager.h> +#include <coreplugin/documentmanager.h> #include <coreplugin/icore.h> #include <coreplugin/imode.h> #include <coreplugin/mimedatabase.h> @@ -339,7 +339,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager())); addObject(d->m_welcomePage); - connect(Core::FileManager::instance(), SIGNAL(currentFileChanged(QString)), + connect(Core::DocumentManager::instance(), SIGNAL(currentFileChanged(QString)), this, SLOT(setCurrentFile(QString))); d->m_session = new SessionManager(this); @@ -519,7 +519,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er d->m_openWithMenu->setTitle(tr("Open With")); connect(d->m_openWithMenu, SIGNAL(triggered(QAction *)), - Core::FileManager::instance(), SLOT(slotExecuteOpenWithMenuAction(QAction*))); + Core::DocumentManager::instance(), SLOT(slotExecuteOpenWithMenuAction(QAction*))); // // Separators @@ -1032,9 +1032,9 @@ void ProjectExplorerPlugin::loadAction() // for your special convenience, we preselect a pro file if it is // the current file if (Core::IEditor *editor = Core::EditorManager::instance()->currentEditor()) { - if (const Core::IFile *file = editor->file()) { - const QString fn = file->fileName(); - const bool isProject = d->m_profileMimeTypes.contains(file->mimeType()); + if (const Core::IDocument *document= editor->document()) { + const QString fn = document->fileName(); + const bool isProject = d->m_profileMimeTypes.contains(document->mimeType()); dir = isProject ? fn : QFileInfo(fn).absolutePath(); } } @@ -1071,23 +1071,23 @@ void ProjectExplorerPlugin::unloadProject() buildManager()->cancel(); } - Core::IFile *fi = d->m_currentProject->file(); + Core::IDocument *document = d->m_currentProject->document(); - if (!fi || fi->fileName().isEmpty()) //nothing to save? + if (!document || document->fileName().isEmpty()) //nothing to save? return; - QList<Core::IFile*> filesToSave; - filesToSave << fi; + QList<Core::IDocument*> documentsToSave; + documentsToSave << document; bool success = false; - if (fi->isReadOnly()) - success = Core::FileManager::saveModifiedFiles(filesToSave).isEmpty(); + if (document->isFileReadOnly()) + success = Core::DocumentManager::saveModifiedDocuments(documentsToSave).isEmpty(); else - success = Core::FileManager::saveModifiedFilesSilently(filesToSave).isEmpty(); + success = Core::DocumentManager::saveModifiedDocumentsSilently(documentsToSave).isEmpty(); if (!success) return; - addToRecentProjects(fi->fileName(), d->m_currentProject->displayName()); + addToRecentProjects(document->fileName(), d->m_currentProject->displayName()); d->m_session->removeProject(d->m_currentProject); updateActions(); } @@ -1130,16 +1130,16 @@ void ProjectExplorerPlugin::loadCustomWizards() void ProjectExplorerPlugin::updateVariable(const QByteArray &variable) { if (variable == kCurrentProjectFilePath) { - if (currentProject() && currentProject()->file()) { + if (currentProject() && currentProject()->document()) { Core::VariableManager::instance()->insert(variable, - currentProject()->file()->fileName()); + currentProject()->document()->fileName()); } else { Core::VariableManager::instance()->remove(variable); } } else if (variable == kCurrentProjectPath) { - if (currentProject() && currentProject()->file()) { + if (currentProject() && currentProject()->document()) { Core::VariableManager::instance()->insert(variable, - QFileInfo(currentProject()->file()->fileName()).path()); + QFileInfo(currentProject()->document()->fileName()).path()); } else { Core::VariableManager::instance()->remove(variable); } @@ -1556,7 +1556,7 @@ void ProjectExplorerPlugin::buildStateChanged(Project * pro) { if (debug) { qDebug() << "buildStateChanged"; - qDebug() << pro->file()->fileName() << "isBuilding()" << d->m_buildManager->isBuilding(pro); + qDebug() << pro->document()->fileName() << "isBuilding()" << d->m_buildManager->isBuilding(pro); } Q_UNUSED(pro) updateActions(); @@ -1666,7 +1666,7 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node updateActions(); } - Core::FileManager::setCurrentFile(filePath); + Core::DocumentManager::setCurrentFile(filePath); } void ProjectExplorerPlugin::updateActions() @@ -1747,7 +1747,7 @@ void ProjectExplorerPlugin::updateActions() QStringList ProjectExplorerPlugin::allFilesWithDependencies(Project *pro) { if (debug) - qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->file()->fileName() << ")"; + qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->document()->fileName() << ")"; QStringList filesToSave; foreach (Project *p, d->m_session->projectOrder(pro)) { @@ -1764,17 +1764,17 @@ bool ProjectExplorerPlugin::saveModifiedFiles() if (debug) qDebug() << "ProjectExplorerPlugin::saveModifiedFiles"; - QList<Core::IFile *> filesToSave = Core::FileManager::modifiedFiles(); - if (!filesToSave.isEmpty()) { + QList<Core::IDocument *> documentsToSave = Core::DocumentManager::modifiedDocuments(); + if (!documentsToSave.isEmpty()) { if (d->m_projectExplorerSettings.saveBeforeBuild) { bool cancelled = false; - Core::FileManager::saveModifiedFilesSilently(filesToSave, &cancelled); + Core::DocumentManager::saveModifiedDocumentsSilently(documentsToSave, &cancelled); if (cancelled) return false; } else { bool cancelled = false; bool alwaysSave = false; - Core::FileManager::saveModifiedFiles(filesToSave, &cancelled, QString(), + Core::DocumentManager::saveModifiedDocuments(documentsToSave, &cancelled, QString(), tr("Always save files before build"), &alwaysSave); if (cancelled) @@ -2750,7 +2750,7 @@ void ProjectExplorerPlugin::deleteFile() projectNode->deleteFiles(fileNode->fileType(), QStringList(filePath)); - Core::FileManager::expectFileChange(filePath); + Core::DocumentManager::expectFileChange(filePath); if (Core::IVersionControl *vc = Core::ICore::vcsManager()->findVersionControlForDirectory(QFileInfo(filePath).absolutePath())) { vc->vcsDelete(filePath); @@ -2761,7 +2761,7 @@ void ProjectExplorerPlugin::deleteFile() QMessageBox::warning(Core::ICore::mainWindow(), tr("Deleting File Failed"), tr("Could not delete file %1.").arg(filePath)); } - Core::FileManager::unexpectFileChange(filePath); + Core::DocumentManager::unexpectFileChange(filePath); } void ProjectExplorerPlugin::renameFile() @@ -2810,7 +2810,7 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &to) result = fileSystemRenameFile(orgFilePath, newFilePath); if (result) { // yeah we moved, tell the filemanager about it - Core::FileManager::renamedFile(orgFilePath, newFilePath); + Core::DocumentManager::renamedFile(orgFilePath, newFilePath); // Tell the project plugin about it ProjectNode *projectNode = fileNode->projectNode(); projectNode->renameFile(fileNode->fileType(), orgFilePath, newFilePath); @@ -2825,7 +2825,7 @@ void ProjectExplorerPlugin::setStartupProject() void ProjectExplorerPlugin::populateOpenWithMenu() { - Core::FileManager::populateOpenWithMenu(d->m_openWithMenu, currentNode()->path()); + Core::DocumentManager::populateOpenWithMenu(d->m_openWithMenu, currentNode()->path()); } void ProjectExplorerPlugin::updateSessionMenu() @@ -2877,8 +2877,8 @@ QStringList ProjectExplorerPlugin::projectFilePatterns() void ProjectExplorerPlugin::openOpenProjectDialog() { - const QString path = Core::FileManager::useProjectsDirectory() ? Core::FileManager::projectsDirectory() : QString(); - const QStringList files = Core::FileManager::getOpenFileNames(d->m_projectFilterString, path); + const QString path = Core::DocumentManager::useProjectsDirectory() ? Core::DocumentManager::projectsDirectory() : QString(); + const QStringList files = Core::DocumentManager::getOpenFileNames(d->m_projectFilterString, path); if (!files.isEmpty()) Core::ICore::openFiles(files, Core::ICore::SwitchMode); } diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index 44398ff877..48489c428b 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -36,7 +36,7 @@ #include "projectexplorer.h" #include <coreplugin/icore.h> -#include <coreplugin/filemanager.h> +#include <coreplugin/documentmanager.h> #include <QLabel> #include <QCoreApplication> @@ -185,8 +185,8 @@ QWidget *ProjectExplorerSettingsPage::createPage(QWidget *parent) { m_widget = new ProjectExplorerSettingsWidget(parent); m_widget->setSettings(ProjectExplorerPlugin::instance()->projectExplorerSettings()); - m_widget->setProjectsDirectory(Core::FileManager::projectsDirectory()); - m_widget->setUseProjectsDirectory(Core::FileManager::useProjectsDirectory()); + m_widget->setProjectsDirectory(Core::DocumentManager::projectsDirectory()); + m_widget->setUseProjectsDirectory(Core::DocumentManager::useProjectsDirectory()); if (m_searchKeywords.isEmpty()) m_searchKeywords = m_widget->searchKeywords(); return m_widget; @@ -196,8 +196,8 @@ void ProjectExplorerSettingsPage::apply() { if (m_widget) { ProjectExplorerPlugin::instance()->setProjectExplorerSettings(m_widget->settings()); - Core::FileManager::setProjectsDirectory(m_widget->projectsDirectory()); - Core::FileManager::setUseProjectsDirectory(m_widget->useProjectsDirectory()); + Core::DocumentManager::setProjectsDirectory(m_widget->projectsDirectory()); + Core::DocumentManager::setUseProjectsDirectory(m_widget->useProjectsDirectory()); } } diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp index 2ace305d96..828948d44b 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.cpp +++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp @@ -41,7 +41,7 @@ #include <utils/stringutils.h> #include <coreplugin/basefilewizard.h> -#include <coreplugin/filemanager.h> +#include <coreplugin/documentmanager.h> #include <coreplugin/icore.h> #include <coreplugin/iversioncontrol.h> #include <coreplugin/vcsmanager.h> diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 2861451284..4c2a93cfe4 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -44,7 +44,7 @@ #include "target.h" #include <coreplugin/icore.h> -#include <coreplugin/ifile.h> +#include <coreplugin/idocument.h> #include <extensionsystem/pluginmanager.h> #include <utils/qtcassert.h> #include <utils/stylehelper.h> @@ -367,7 +367,7 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project) } m_tabIndexToProject.insert(index, project); - m_tabWidget->insertTab(index, project->displayName(), project->file()->fileName(), subtabs); + m_tabWidget->insertTab(index, project->displayName(), project->document()->fileName(), subtabs); } void ProjectWindow::deregisterProject(ProjectExplorer::Project *project) diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index baa1613fd7..d36933fa7e 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -41,7 +41,7 @@ #include <coreplugin/icore.h> #include <coreplugin/imode.h> -#include <coreplugin/filemanager.h> +#include <coreplugin/documentmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/coreconstants.h> @@ -172,7 +172,7 @@ bool SessionManager::recursiveDependencyCheck(const QString &newDep, const QStri QList<Project *> SessionManager::dependencies(const Project *project) const { - const QString &proName = project->file()->fileName(); + const QString &proName = project->document()->fileName(); const QStringList &proDeps = m_depMap.value(proName); QList<Project *> projects; @@ -186,8 +186,8 @@ QList<Project *> SessionManager::dependencies(const Project *project) const bool SessionManager::hasDependency(const Project *project, const Project *depProject) const { - const QString &proName = project->file()->fileName(); - const QString &depName = depProject->file()->fileName(); + const QString &proName = project->document()->fileName(); + const QString &depName = depProject->document()->fileName(); const QStringList &proDeps = m_depMap.value(proName); return proDeps.contains(depName); @@ -195,16 +195,16 @@ bool SessionManager::hasDependency(const Project *project, const Project *depPro bool SessionManager::canAddDependency(const Project *project, const Project *depProject) const { - const QString &newDep = project->file()->fileName(); - const QString &checkDep = depProject->file()->fileName(); + const QString &newDep = project->document()->fileName(); + const QString &checkDep = depProject->document()->fileName(); return recursiveDependencyCheck(newDep, checkDep); } bool SessionManager::addDependency(Project *project, Project *depProject) { - const QString &proName = project->file()->fileName(); - const QString &depName = depProject->file()->fileName(); + const QString &proName = project->document()->fileName(); + const QString &depName = depProject->document()->fileName(); // check if this dependency is valid if (!recursiveDependencyCheck(proName, depName)) @@ -222,8 +222,8 @@ bool SessionManager::addDependency(Project *project, Project *depProject) void SessionManager::removeDependency(Project *project, Project *depProject) { - const QString &proName = project->file()->fileName(); - const QString &depName = depProject->file()->fileName(); + const QString &proName = project->document()->fileName(); + const QString &depName = depProject->document()->fileName(); QStringList proDeps = m_depMap.value(proName); proDeps.removeAll(depName); @@ -313,12 +313,12 @@ bool SessionManager::save() // save the startup project if (m_startupProject) { - writer.saveValue(QLatin1String("StartupProject"), m_startupProject->file()->fileName()); + writer.saveValue(QLatin1String("StartupProject"), m_startupProject->document()->fileName()); } QStringList projectFiles; foreach (Project *pro, m_projects) - projectFiles << pro->file()->fileName(); + projectFiles << pro->document()->fileName(); // Restore infromation on projects that failed to load: projectFiles.append(m_failedProjects); @@ -405,7 +405,7 @@ QStringList SessionManager::dependenciesOrder() const // copy the map to a temporary list foreach (Project *pro, projects()) { - const QString &proName = pro->file()->fileName(); + const QString &proName = pro->document()->fileName(); unordered << QPair<QString, QStringList> (proName, m_depMap.value(proName)); } @@ -438,14 +438,14 @@ QList<Project *> SessionManager::projectOrder(Project *project) const QStringList pros; if (project) { - pros = dependencies(project->file()->fileName()); + pros = dependencies(project->document()->fileName()); } else { pros = dependenciesOrder(); } foreach (const QString &proFile, pros) { foreach (Project *pro, projects()) { - if (pro->file()->fileName() == proFile) { + if (pro->document()->fileName() == proFile) { result << pro; break; } @@ -566,7 +566,7 @@ void SessionManager::removeProjects(QList<Project *> remove) QSet<QString> projectFiles; foreach (Project *pro, projects()) { if (!remove.contains(pro)) - projectFiles.insert(pro->file()->fileName()); + projectFiles.insert(pro->document()->fileName()); } QSet<QString>::const_iterator i = projectFiles.begin(); @@ -758,7 +758,7 @@ void SessionManager::restoreStartupProject(const Utils::PersistentSettingsReader if (!startupProject.isEmpty()) { const QString startupProjectPath = startupProject; foreach (Project *pro, m_projects) { - if (QDir::cleanPath(pro->file()->fileName()) == startupProjectPath) { + if (QDir::cleanPath(pro->document()->fileName()) == startupProjectPath) { setStartupProject(m_startupProject); break; } @@ -795,7 +795,7 @@ void SessionManager::restoreProjects(const QStringList &fileList) if (!errors.isEmpty()) QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errors); foreach (Project *p, projects) - m_failedProjects.removeAll(p->file()->fileName()); + m_failedProjects.removeAll(p->document()->fileName()); } } diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index 6f555f5ed6..0d9f370685 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -51,7 +51,7 @@ QT_END_NAMESPACE namespace Core { class IMode; class IEditor; -class IFile; +class IDocument; } namespace ProjectExplorer { diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 2b099643b1..dd17b9fdef 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -40,7 +40,7 @@ #include "target.h" #include <coreplugin/icore.h> -#include <coreplugin/ifile.h> +#include <coreplugin/idocument.h> #include <utils/qtcassert.h> #include <utils/qtcprocess.h> #include <utils/persistentsettings.h> @@ -774,7 +774,7 @@ void SettingsAccessor::FileAccessor::assignSuffix(const QString &defaultSuffix, QString SettingsAccessor::FileAccessor::assembleFileName(const Project *project) const { - return project->file()->fileName() + m_suffix; + return project->document()->fileName() + m_suffix; } bool SettingsAccessor::FileAccessor::findNewestCompatibleSetting(SettingsData *settings) const |