diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-07-04 13:30:26 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-07-09 13:51:42 +0200 |
commit | dd43d9908f3de19e455d5503b311bb3c1ae7b9c4 (patch) | |
tree | df542f655c2380b2026d49a862c727cb0f1d86a0 /src | |
parent | cee160225378acbc7d29665bd69f6f793ef78fb9 (diff) | |
download | qt-creator-dd43d9908f3de19e455d5503b311bb3c1ae7b9c4.tar.gz |
Rename IDocument::fileName --> filePath
That is what it actually is, wrt how Qt API calls it.
Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src')
118 files changed, 326 insertions, 326 deletions
diff --git a/src/plugins/analyzerbase/analyzerutils.cpp b/src/plugins/analyzerbase/analyzerutils.cpp index 05d71b6d90..2b142ccab7 100644 --- a/src/plugins/analyzerbase/analyzerutils.cpp +++ b/src/plugins/analyzerbase/analyzerutils.cpp @@ -85,7 +85,7 @@ CPlusPlus::Symbol *AnalyzerUtils::findSymbolUnderCursor() editorWidget->convertPosition(pos, &line, &column); const CPlusPlus::Snapshot &snapshot = CppTools::CppModelManagerInterface::instance()->snapshot(); - CPlusPlus::Document::Ptr doc = snapshot.document(editor->document()->fileName()); + CPlusPlus::Document::Ptr doc = snapshot.document(editor->document()->filePath()); QTC_ASSERT(doc, return 0); // fetch the expression's code diff --git a/src/plugins/android/androidmanifestdocument.cpp b/src/plugins/android/androidmanifestdocument.cpp index bf93f1cba5..dc6468742a 100644 --- a/src/plugins/android/androidmanifestdocument.cpp +++ b/src/plugins/android/androidmanifestdocument.cpp @@ -54,13 +54,13 @@ bool AndroidManifestDocument::save(QString *errorString, const QString &fileName QString AndroidManifestDocument::defaultPath() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.absolutePath(); } QString AndroidManifestDocument::suggestedFileName() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.fileName(); } diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index c31982ed80..2a22c2241c 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -500,7 +500,7 @@ void AndroidManifestEditorWidget::preSave() syncToEditor(); if (m_setAppName) { - QString baseDir = QFileInfo(static_cast<AndroidManifestDocument *>(editor()->document())->fileName()).absolutePath(); + QString baseDir = QFileInfo(static_cast<AndroidManifestDocument *>(editor()->document())->filePath()).absolutePath(); QString fileName = baseDir + QLatin1String("/res/values/strings.xml"); QFile f(fileName); if (f.open(QIODevice::ReadOnly)) { @@ -524,7 +524,7 @@ void AndroidManifestEditorWidget::preSave() m_setAppName = false; } - QString baseDir = QFileInfo(static_cast<AndroidManifestDocument *>(editor()->document())->fileName()).absolutePath(); + QString baseDir = QFileInfo(static_cast<AndroidManifestDocument *>(editor()->document())->filePath()).absolutePath(); if (!m_lIconPath.isEmpty()) { copyIcon(LowDPI, baseDir, m_lIconPath); m_lIconPath.clear(); @@ -644,7 +644,7 @@ void AndroidManifestEditorWidget::syncToWidgets(const QDomDocument &doc) m_versionCode->setValue(manifest.attribute(QLatin1String("android:versionCode")).toInt()); m_versionNameLinedit->setText(manifest.attribute(QLatin1String("android:versionName"))); - QString baseDir = QFileInfo(static_cast<AndroidManifestDocument *>(editor()->document())->fileName()).absolutePath(); + QString baseDir = QFileInfo(static_cast<AndroidManifestDocument *>(editor()->document())->filePath()).absolutePath(); QString fileName = baseDir + QLatin1String("/res/values/strings.xml"); QFile f(fileName); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.cpp index 052bab1d02..feca2cc241 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.cpp @@ -40,7 +40,7 @@ AutotoolsProjectFile::AutotoolsProjectFile(AutotoolsProject *project, const QStr Core::IDocument(project), m_project(project) { - setFileName(fileName); + setFilePath(fileName); } bool AutotoolsProjectFile::save(QString *errorString, const QString &fileName, bool autoSave) diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp index ac9ae17b28..8bca0724de 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp @@ -39,7 +39,7 @@ using namespace AutotoolsProjectManager::Internal; using namespace ProjectExplorer; AutotoolsProjectNode::AutotoolsProjectNode(AutotoolsProject *project, Core::IDocument *projectFile) : - ProjectNode(projectFile->fileName()), + ProjectNode(projectFile->filePath()), m_project(project), m_projectFile(projectFile) { diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 3614e74529..e1797c3229 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -690,7 +690,7 @@ bool BazaarPlugin::submitEditorAboutToClose() // Whether local commit or not if (commitWidget->isLocalOptionEnabled()) extraOptions += QLatin1String("--local"); - m_client->commit(m_submitRepository, files, editorDocument->fileName(), extraOptions); + m_client->commit(m_submitRepository, files, editorDocument->filePath(), extraOptions); } return true; } diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 1d1d411320..c447e3e65b 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -199,18 +199,18 @@ public: { QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive const QString fileNameToUse - = fn.isEmpty() ? fileName() : fn; - if (m_widget->save(errorString, fileName(), fileNameToUse)) { - setFileName(fileNameToUse); + = fn.isEmpty() ? filePath() : fn; + if (m_widget->save(errorString, filePath(), fileNameToUse)) { + setFilePath(fileNameToUse); return true; } else { return false; } } - void setFileName(const QString &newName) { + void setFilePath(const QString &newName) { m_widget->editor()->setDisplayName(QFileInfo(newName).fileName()); - IDocument::setFileName(newName); + IDocument::setFilePath(newName); } bool open(QString *errorString, const QString &fileName, quint64 offset = 0) { @@ -228,7 +228,7 @@ public: return false; if (file.open(QIODevice::ReadOnly)) { file.close(); - setFileName(fileName); + setFilePath(fileName); m_widget->setSizes(offset, file.size()); return true; } @@ -244,7 +244,7 @@ public: private slots: void provideData(quint64 block) { - const QString fn = fileName(); + const QString fn = filePath(); if (fn.isEmpty()) return; QFile file(fn); @@ -266,7 +266,7 @@ private slots: void provideNewRange(quint64 offset) { - open(0, fileName(), offset); + open(0, filePath(), offset); } public: @@ -278,7 +278,7 @@ public: bool isModified() const { return m_widget->isMemoryView() ? false : m_widget->isModified(); } bool isFileReadOnly() const { - const QString fn = fileName(); + const QString fn = filePath(); if (m_widget->isMemoryView() || fn.isEmpty()) return false; const QFileInfo fi(fn); @@ -294,7 +294,7 @@ public: emit changed(); } else { emit aboutToReload(); - const bool success = open(errorString, fileName()); + const bool success = open(errorString, filePath()); emit reloadFinished(success); return success; } @@ -349,7 +349,7 @@ public: bool createNew(const QString & /* contents */ = QString()) { m_widget->clear(); - m_file->setFileName(QString()); + m_file->setFilePath(QString()); return true; } bool open(QString *errorString, const QString &fileName, const QString &realFileName) { diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 79ba85d943..e77e53d792 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -426,7 +426,7 @@ void BookmarkManager::toggleBookmark() if (!editor) return; - toggleBookmark(editor->document()->fileName(), editor->currentLine()); + toggleBookmark(editor->document()->filePath(), editor->currentLine()); } void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber) @@ -545,7 +545,7 @@ void BookmarkManager::documentPrevNext(bool next) { TextEditor::ITextEditor *editor = currentTextEditor(); int editorLine = editor->currentLine(); - QFileInfo fi(editor->document()->fileName()); + QFileInfo fi(editor->document()->filePath()); if (!m_bookmarksMap.contains(fi.path())) return; @@ -649,7 +649,7 @@ BookmarkManager::State BookmarkManager::state() const if (!editor) return HasBookMarks; - const QFileInfo fi(editor->document()->fileName()); + const QFileInfo fi(editor->document()->filePath()); const DirectoryFileBookmarksMap::const_iterator dit = m_bookmarksMap.constFind(fi.path()); if (dit == m_bookmarksMap.constEnd()) @@ -845,14 +845,14 @@ void BookmarkManager::handleBookmarkRequest(TextEditor::ITextEditor *textEditor, TextEditor::ITextEditor::MarkRequestKind kind) { if (kind == TextEditor::ITextEditor::BookmarkRequest && textEditor->document()) - toggleBookmark(textEditor->document()->fileName(), line); + toggleBookmark(textEditor->document()->filePath(), line); } void BookmarkManager::handleBookmarkTooltipRequest(TextEditor::ITextEditor *textEditor, const QPoint &pos, int line) { if (textEditor->document()) { - const QFileInfo fi(textEditor->document()->fileName()); + const QFileInfo fi(textEditor->document()->filePath()); Bookmark *mark = findBookmark(fi.path(), fi.fileName(), line); operateTooltip(textEditor, pos, mark); } diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index a98656981e..3d6fff3028 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -185,7 +185,7 @@ void BookmarksPlugin::requestContextMenu(TextEditor::ITextEditor *editor, int lineNumber, QMenu *menu) { m_bookmarkMarginActionLineNumber = lineNumber; - m_bookmarkMarginActionFileName = editor->document()->fileName(); + m_bookmarkMarginActionFileName = editor->document()->filePath(); menu->addAction(m_bookmarkMarginAction); if (m_bookmarkManager->hasBookmarkInPosition(m_bookmarkMarginActionFileName, m_bookmarkMarginActionLineNumber)) diff --git a/src/plugins/classview/classviewmanager.cpp b/src/plugins/classview/classviewmanager.cpp index a09eb9bf02..022f0a3b55 100644 --- a/src/plugins/classview/classviewmanager.cpp +++ b/src/plugins/classview/classviewmanager.cpp @@ -465,7 +465,7 @@ void Manager::gotoLocations(const QList<QVariant> &list) if (Core::IEditor *editor = Core::EditorManager::currentEditor()) { // get current file name if (Core::IDocument *document = editor->document()) - fileName = document->fileName(); + fileName = document->filePath(); // if text file - what is current position? TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor); diff --git a/src/plugins/classview/classviewparser.cpp b/src/plugins/classview/classviewparser.cpp index fdb9baf2f4..338cd4a6b9 100644 --- a/src/plugins/classview/classviewparser.cpp +++ b/src/plugins/classview/classviewparser.cpp @@ -287,7 +287,7 @@ ParserTreeItem::ConstPtr Parser::parse() QString prjName(prj->displayName()); QString prjType(prjName); if (prj->document()) - prjType = prj->document()->fileName(); + prjType = prj->document()->filePath(); SymbolInformation inf(prjName, prjType); QStringList projectList = addProjectNode(item, prj->rootProjectNode()); diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index ee881e3e4b..8019652691 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -554,7 +554,7 @@ bool ClearCasePlugin::submitEditorAboutToClose() // Submit editor closing. Make it write out the check in message // and retrieve files - const QFileInfo editorFile(editorDocument->fileName()); + const QFileInfo editorFile(editorDocument->filePath()); const QFileInfo changeFile(m_checkInMessageFileName); if (editorFile.absoluteFilePath() != changeFile.absoluteFilePath()) return true; // Oops?! diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 77e03a45be..4de9ffb241 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -52,7 +52,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent BuildConfiguration(parent, Core::Id(Constants::CMAKE_BC_ID)), m_useNinja(false) { CMakeProject *project = static_cast<CMakeProject *>(parent->project()); - m_buildDirectory = project->shadowBuildDirectory(project->document()->fileName(), + m_buildDirectory = project->shadowBuildDirectory(project->document()->filePath(), parent->kit(), displayName()); } @@ -181,7 +181,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer: info.sourceDirectory = project->projectDirectory(); info.environment = Utils::Environment::systemEnvironment(); parent->kit()->addToEnvironment(info.environment); - info.buildDirectory = project->shadowBuildDirectory(project->document()->fileName(), + info.buildDirectory = project->shadowBuildDirectory(project->document()->filePath(), parent->kit(), buildConfigurationName); info.kit = parent->kit(); diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index f91450d541..881e662fa8 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -99,7 +99,7 @@ void CMakeEditor::build() foreach (ProjectExplorer::Project *p, projects) { CMakeProject *cmakeProject = qobject_cast<CMakeProject *>(p); if (cmakeProject) { - if (cmakeProject->isProjectFile(document()->fileName())) { + if (cmakeProject->isProjectFile(document()->filePath())) { ProjectExplorer::ProjectExplorerPlugin::instance()->buildProject(cmakeProject); break; } @@ -219,7 +219,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, // TODO: Resolve variables - QDir dir(QFileInfo(editorDocument()->fileName()).absolutePath()); + QDir dir(QFileInfo(editorDocument()->filePath()).absolutePath()); QString fileName = dir.filePath(buffer); QFileInfo fi(fileName); if (fi.exists()) { @@ -250,12 +250,12 @@ CMakeDocument::CMakeDocument() QString CMakeDocument::defaultPath() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.absolutePath(); } QString CMakeDocument::suggestedFileName() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.fileName(); } diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp index 401fc90a38..27be0db94e 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp @@ -76,9 +76,9 @@ QList<Locator::FilterEntry> CMakeLocatorFilter::matchesFor(QFutureInterface<Loca if (cmakeProject) { foreach (const CMakeBuildTarget &ct, cmakeProject->buildTargets()) { if (ct.title.contains(entry)) { - Locator::FilterEntry entry(this, ct.title, cmakeProject->document()->fileName()); + Locator::FilterEntry entry(this, ct.title, cmakeProject->document()->filePath()); entry.extraInfo = FileUtils::shortNativePath( - FileName::fromString(cmakeProject->document()->fileName())); + FileName::fromString(cmakeProject->document()->filePath())); result.append(entry); } } @@ -97,7 +97,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->document()->fileName() == selection.internalData.toString()) + if (cmakeProject && cmakeProject->document()->filePath() == selection.internalData.toString()) break; cmakeProject = 0; } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index daa70d3708..3606363747 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -222,7 +222,7 @@ bool CMakeProject::parseCMakeLists() CMakeBuildConfiguration *activeBC = static_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration()); foreach (Core::IEditor *editor, Core::EditorManager::instance()->openedEditors()) - if (isProjectFile(editor->document()->fileName())) + if (isProjectFile(editor->document()->filePath())) editor->document()->infoBar()->removeInfo(Core::Id("CMakeEditor.RunCMake")); // Find cbp file @@ -845,7 +845,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->document()->fileName(), contents); + updateCodeModelSupportFromEditor(m_lastEditor->document()->filePath(), contents); m_dirtyUic = false; } } @@ -866,7 +866,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->document()->fileName(), contents); + updateCodeModelSupportFromEditor(m_lastEditor->document()->filePath(), contents); m_dirtyUic = false; } } @@ -899,7 +899,7 @@ void CMakeProject::buildStateChanged(ProjectExplorer::Project *project) CMakeFile::CMakeFile(CMakeProject *parent, QString fileName) : Core::IDocument(parent), m_project(parent) { - setFileName(fileName); + setFilePath(fileName); } bool CMakeFile::save(QString *errorString, const QString &fileName, bool autoSave) diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp index 18d1e0f10f..e5c6b737dd 100644 --- a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp +++ b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp @@ -137,7 +137,7 @@ ReadOnlyFilesDialog::ReadOnlyFilesDialog(IDocument *document, QWidget *parent, , d(new ReadOnlyFilesDialogPrivate(document, displaySaveAs)) , ui(new Ui::ReadOnlyFilesDialog) { - initDialog(QStringList() << document->fileName()); + initDialog(QStringList() << document->filePath()); } ReadOnlyFilesDialog::ReadOnlyFilesDialog(const QList<IDocument *> documents, QWidget *parent) @@ -147,7 +147,7 @@ ReadOnlyFilesDialog::ReadOnlyFilesDialog(const QList<IDocument *> documents, QWi { QStringList files; foreach (IDocument *document, documents) - files << document->fileName(); + files << document->filePath(); initDialog(files); } diff --git a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp index 7595ca1946..7a0e5a9953 100644 --- a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp @@ -62,7 +62,7 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent, foreach (IDocument *document, items) { QString visibleName; QString directory; - QString fileName = document->fileName(); + QString fileName = document->filePath(); if (fileName.isEmpty()) { visibleName = document->suggestedFileName(); } else { diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index b53b1a6882..1c1a6a859c 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -264,8 +264,8 @@ static void addFileInfo(const QString &fileName, IDocument *document, bool isLin (The added file names are guaranteed to be absolute and cleaned.) */ static void addFileInfo(IDocument *document) { - const QString fixedName = DocumentManager::fixFileName(document->fileName(), DocumentManager::KeepLinks); - const QString fixedResolvedName = DocumentManager::fixFileName(document->fileName(), DocumentManager::ResolveLinks); + const QString fixedName = DocumentManager::fixFileName(document->filePath(), DocumentManager::KeepLinks); + const QString fixedResolvedName = DocumentManager::fixFileName(document->filePath(), DocumentManager::ResolveLinks); addFileInfo(fixedResolvedName, document, false); if (fixedName != fixedResolvedName) addFileInfo(fixedName, document, true); @@ -284,7 +284,7 @@ void DocumentManager::addDocuments(const QList<IDocument *> &documents, bool add foreach (IDocument *document, documents) { if (document && !d->m_documentsWithoutWatch.contains(document)) { connect(document, SIGNAL(destroyed(QObject*)), m_instance, SLOT(documentDestroyed(QObject*))); - connect(document, SIGNAL(fileNameChanged(QString,QString)), m_instance, SLOT(fileNameChanged(QString,QString))); + connect(document, SIGNAL(filePathChanged(QString,QString)), m_instance, SLOT(filePathChanged(QString,QString))); d->m_documentsWithoutWatch.append(document); } } @@ -295,7 +295,7 @@ void DocumentManager::addDocuments(const QList<IDocument *> &documents, bool add if (document && !d->m_documentsWithWatch.contains(document)) { connect(document, SIGNAL(changed()), m_instance, SLOT(checkForNewFileName())); connect(document, SIGNAL(destroyed(QObject*)), m_instance, SLOT(documentDestroyed(QObject*))); - connect(document, SIGNAL(fileNameChanged(QString,QString)), m_instance, SLOT(fileNameChanged(QString,QString))); + connect(document, SIGNAL(filePathChanged(QString,QString)), m_instance, SLOT(filePathChanged(QString,QString))); addFileInfo(document); } } @@ -385,14 +385,14 @@ void DocumentManager::renamedFile(const QString &from, const QString &to) foreach (IDocument *document, documentsToRename) { d->m_blockedIDocument = document; removeFileInfo(document); - document->setFileName(to); + document->setFilePath(to); addFileInfo(document); d->m_blockedIDocument = 0; } emit m_instance->allDocumentsRenamed(from, to); } -void DocumentManager::fileNameChanged(const QString &oldName, const QString &newName) +void DocumentManager::filePathChanged(const QString &oldName, const QString &newName) { IDocument *doc = qobject_cast<IDocument *>(sender()); QTC_ASSERT(doc, return); @@ -593,7 +593,7 @@ static QList<IDocument *> saveModifiedFilesHelper(const QList<IDocument *> &docu foreach (IDocument *document, documents) { if (document->isModified()) { - QString name = document->fileName(); + QString name = document->filePath(); if (name.isEmpty()) name = document->suggestedFileName(); @@ -659,7 +659,7 @@ static QList<IDocument *> saveModifiedFilesHelper(const QList<IDocument *> &docu bool DocumentManager::saveDocument(IDocument *document, const QString &fileName, bool *isReadOnly) { bool ret = true; - QString effName = fileName.isEmpty() ? document->fileName() : fileName; + QString effName = fileName.isEmpty() ? document->filePath() : fileName; expectFileChange(effName); // This only matters to other IDocuments which refer to this file bool addWatcher = removeDocument(document); // So that our own IDocument gets no notification at all @@ -746,7 +746,7 @@ QString DocumentManager::getSaveAsFileName(const IDocument *document, const QStr { if (!document) return QLatin1String(""); - QString absoluteFilePath = document->fileName(); + QString absoluteFilePath = document->filePath(); const QFileInfo fi(absoluteFilePath); QString fileName = fi.fileName(); QString path = fi.absolutePath(); @@ -957,7 +957,7 @@ void DocumentManager::checkForReload() success = document->reload(&errorString, IDocument::FlagReload, IDocument::TypeContents); } else { // Ask about content change - previousAnswer = Utils::reloadPrompt(document->fileName(), document->isModified(), QApplication::activeWindow()); + previousAnswer = Utils::reloadPrompt(document->filePath(), document->isModified(), QApplication::activeWindow()); switch (previousAnswer) { case Utils::ReloadAll: case Utils::ReloadCurrent: @@ -977,9 +977,9 @@ void DocumentManager::checkForReload() // Ask about removed file bool unhandled = true; while (unhandled) { - switch (Utils::fileDeletedPrompt(document->fileName(), trigger == IDocument::TriggerExternal, QApplication::activeWindow())) { + switch (Utils::fileDeletedPrompt(document->filePath(), trigger == IDocument::TriggerExternal, QApplication::activeWindow())) { case Utils::FileDeletedSave: - documentsToSave.insert(document, document->fileName()); + documentsToSave.insert(document, document->filePath()); unhandled = false; break; case Utils::FileDeletedSaveAs: @@ -1001,7 +1001,7 @@ void DocumentManager::checkForReload() } if (!success) { if (errorString.isEmpty()) - errorStrings << tr("Cannot reload %1").arg(QDir::toNativeSeparators(document->fileName())); + errorStrings << tr("Cannot reload %1").arg(QDir::toNativeSeparators(document->filePath())); else errorStrings << errorString; } @@ -1039,7 +1039,7 @@ void DocumentManager::syncWithEditor(const QList<Core::IContext *> &context) return; foreach (IContext *c, context) { if (editor->widget() == c->widget()) { - setCurrentFile(editor->document()->fileName()); + setCurrentFile(editor->document()->filePath()); break; } } diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index 456e7e5ac9..eabf2562a9 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -146,7 +146,7 @@ protected: private slots: void documentDestroyed(QObject *obj); - void fileNameChanged(const QString &oldName, const QString &newName); + void filePathChanged(const QString &oldName, const QString &newName); void checkForNewFileName(); void checkForReload(); void changedFile(const QString &file); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 5a87a76b8d..bb403e12be 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -631,7 +631,7 @@ QList<IEditor *> EditorManager::editorsForFileName(const QString &filename) cons QList<IEditor *> found; QString fixedname = DocumentManager::fixFileName(filename, DocumentManager::KeepLinks); foreach (IEditor *editor, openedEditors()) { - if (fixedname == DocumentManager::fixFileName(editor->document()->fileName(), DocumentManager::KeepLinks)) + if (fixedname == DocumentManager::fixFileName(editor->document()->filePath(), DocumentManager::KeepLinks)) found << editor; } return found; @@ -1130,11 +1130,11 @@ bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool ask // remove the editors foreach (IEditor *editor, acceptedEditors) { emit editorAboutToClose(editor); - if (!editor->document()->fileName().isEmpty() + if (!editor->document()->filePath().isEmpty() && !editor->isTemporary()) { QByteArray state = editor->saveState(); if (!state.isEmpty()) - d->m_editorStates.insert(editor->document()->fileName(), QVariant(state)); + d->m_editorStates.insert(editor->document()->filePath(), QVariant(state)); } removeEditor(editor); @@ -1486,7 +1486,7 @@ void EditorManager::addEditor(IEditor *editor, bool isDuplicate) const bool addWatcher = !isTemporary; DocumentManager::addDocument(editor->document(), addWatcher); if (!isTemporary) - DocumentManager::addToRecentFiles(editor->document()->fileName(), editor->id()); + DocumentManager::addToRecentFiles(editor->document()->filePath(), editor->id()); } emit editorOpened(editor); } @@ -1716,7 +1716,7 @@ IEditor *EditorManager::openEditorWithContents(const Id &editorId, int i = 1; QSet<QString> docnames; foreach (IEditor *editor, m_instance->openedEditors()) { - QString name = editor->document()->fileName(); + QString name = editor->document()->filePath(); if (name.isEmpty()) name = editor->displayName(); else @@ -1764,7 +1764,7 @@ bool EditorManager::hasEditor(const QString &fileName) const void EditorManager::restoreEditorState(IEditor *editor) { QTC_ASSERT(editor, return); - QString fileName = editor->document()->fileName(); + QString fileName = editor->document()->filePath(); editor->restoreState(d->m_editorStates.value(fileName).toByteArray()); } @@ -1783,7 +1783,7 @@ bool EditorManager::saveDocument(IDocument *documentParam) document->checkPermissions(); - const QString &fileName = document->fileName(); + const QString &fileName = document->filePath(); if (fileName.isEmpty()) return saveDocumentAs(document); @@ -1821,10 +1821,10 @@ void EditorManager::autoSave() IDocument *document = editor->document(); if (!document->isModified() || !document->shouldAutoSave()) continue; - if (document->fileName().isEmpty()) // FIXME: save them to a dedicated directory + if (document->filePath().isEmpty()) // FIXME: save them to a dedicated directory continue; QString errorString; - if (!document->autoSave(&errorString, autoSaveName(document->fileName()))) + if (!document->autoSave(&errorString, autoSaveName(document->filePath()))) errors << errorString; } if (!errors.isEmpty()) @@ -1862,14 +1862,14 @@ bool EditorManager::saveDocumentAs(IDocument *documentParam) const QString &filter = ICore::mimeDatabase()->allFiltersString(); QString selectedFilter = - ICore::mimeDatabase()->findByFile(QFileInfo(document->fileName())).filterString(); + ICore::mimeDatabase()->findByFile(QFileInfo(document->filePath())).filterString(); const QString &absoluteFilePath = DocumentManager::getSaveAsFileName(document, filter, &selectedFilter); if (absoluteFilePath.isEmpty()) return false; - if (absoluteFilePath != document->fileName()) { + if (absoluteFilePath != document->filePath()) { // close existing editors for the new file name const QList<IEditor *> existList = editorsForFileName(absoluteFilePath); if (!existList.isEmpty()) @@ -1906,7 +1906,7 @@ void EditorManager::addDocumentToRecentFiles(IDocument *document) } } if (!isTemporary) - DocumentManager::addToRecentFiles(document->fileName(), editorId); + DocumentManager::addToRecentFiles(document->filePath(), editorId); } void EditorManager::gotoNextDocHistory() @@ -1947,12 +1947,12 @@ void EditorManager::vcsOpenCurrentEditor() if (!curEditor) return; - const QString directory = QFileInfo(curEditor->document()->fileName()).absolutePath(); + const QString directory = QFileInfo(curEditor->document()->filePath()).absolutePath(); IVersionControl *versionControl = ICore::vcsManager()->findVersionControlForDirectory(directory); if (!versionControl || versionControl->openSupportMode() == IVersionControl::NoOpen) return; - if (!versionControl->vcsOpen(curEditor->document()->fileName())) { + if (!versionControl->vcsOpen(curEditor->document()->filePath())) { QMessageBox::warning(ICore::mainWindow(), tr("Cannot Open File"), tr("Cannot open the file for editing with VCS.")); } @@ -1969,7 +1969,7 @@ void EditorManager::updateWindowTitle() QString editorName = curEditor->displayName(); if (!editorName.isEmpty()) windowTitle.prepend(editorName + dashSep); - QString filePath = QFileInfo(curEditor->document()->fileName()).absoluteFilePath(); + QString filePath = QFileInfo(curEditor->document()->filePath()).absoluteFilePath(); if (!filePath.isEmpty()) ICore::mainWindow()->setWindowFilePath(filePath); } else { @@ -2001,7 +2001,7 @@ void EditorManager::updateMakeWritableWarning() // Do this after setWriteWarning so we don't re-evaluate this part even // if we do not really show a warning. bool promptVCS = false; - const QString directory = QFileInfo(curEditor->document()->fileName()).absolutePath(); + const QString directory = QFileInfo(curEditor->document()->filePath()).absolutePath(); IVersionControl *versionControl = ICore::vcsManager()->findVersionControlForDirectory(directory); if (versionControl && versionControl->openSupportMode() != IVersionControl::NoOpen) { if (versionControl->settingsFlags() & IVersionControl::AutoOpen) { @@ -2037,8 +2037,8 @@ QString EditorManager::fileNameForEditor(IEditor *editor) QString fileName; if (editor) { - if (!editor->document()->fileName().isEmpty()) { - QFileInfo fileInfo(editor->document()->fileName()); + if (!editor->document()->filePath().isEmpty()) { + QFileInfo fileInfo(editor->document()->filePath()); fileName = fileInfo.fileName(); } else { fileName = editor->displayName(); @@ -2052,7 +2052,7 @@ void EditorManager::setupSaveActions(IEditor *editor, QAction *saveAction, QActi saveAction->setEnabled(editor != 0 && editor->document()->isModified()); saveAsAction->setEnabled(editor != 0 && editor->document()->isSaveAsAllowed()); revertToSavedAction->setEnabled(editor != 0 - && !editor->document()->fileName().isEmpty() && editor->document()->isModified()); + && !editor->document()->filePath().isEmpty() && editor->document()->isModified()); const QString fileName = fileNameForEditor(editor); QString quotedName; @@ -2233,11 +2233,11 @@ QByteArray EditorManager::saveState() const QList<IEditor *> editors = openedEditors(); foreach (IEditor *editor, editors) { - if (!editor->document()->fileName().isEmpty() + if (!editor->document()->filePath().isEmpty() && !editor->isTemporary()) { QByteArray state = editor->saveState(); if (!state.isEmpty()) - d->m_editorStates.insert(editor->document()->fileName(), QVariant(state)); + d->m_editorStates.insert(editor->document()->filePath(), QVariant(state)); } } @@ -2373,7 +2373,7 @@ void EditorManager::revertToSaved(Core::IEditor *editor) { if (!editor) return; - const QString fileName = editor->document()->fileName(); + const QString fileName = editor->document()->filePath(); if (fileName.isEmpty()) return; if (editor->document()->isModified()) { @@ -2458,7 +2458,7 @@ Core::IEditor *EditorManager::duplicateEditor(Core::IEditor *editor) IEditor *duplicate = editor->duplicate(0); duplicate->restoreState(editor->saveState()); connect(duplicate, SIGNAL(changed()), this, SLOT(handleEditorStateChange())); - emit editorCreated(duplicate, duplicate->document()->fileName()); + emit editorCreated(duplicate, duplicate->document()->filePath()); addEditor(duplicate, true); return duplicate; } @@ -2603,7 +2603,7 @@ void EditorManager::updateVariable(const QByteArray &variable) QString value; IEditor *curEditor = currentEditor(); if (curEditor) { - QString fileName = curEditor->document()->fileName(); + QString fileName = curEditor->document()->filePath(); if (!fileName.isEmpty()) value = VariableManager::fileVariableValue(variable, kCurrentDocumentPrefix, fileName); diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index cd36240692..ed34557d5c 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -209,7 +209,7 @@ void EditorView::updateEditorHistory(IEditor *editor, QList<EditLocation> &histo EditLocation location; location.document = document; - location.fileName = document->fileName(); + location.fileName = document->filePath(); location.id = editor->id(); location.state = QVariant(state); @@ -400,7 +400,7 @@ void EditorView::addCurrentPositionToNavigationHistory(IEditor *editor, const QB EditLocation location; location.document = document; - location.fileName = document->fileName(); + location.fileName = document->filePath(); location.id = editor->id(); location.state = QVariant(state); m_currentNavigationHistoryPosition = qMin(m_currentNavigationHistoryPosition, m_navigationHistory.size()); // paranoia @@ -455,7 +455,7 @@ void EditorView::updateCurrentPositionInNavigationHistory() location = &m_navigationHistory[m_navigationHistory.size()-1]; } location->document = document; - location->fileName = document->fileName(); + location->fileName = document->filePath(); location->id = editor->id(); location->state = QVariant(editor->saveState()); } @@ -737,11 +737,11 @@ QByteArray SplitterOrView::saveState() const IEditor* e = editor(); // don't save state of temporary or ad-hoc editors - if (e && (e->isTemporary() || e->document()->fileName().isEmpty())) { + if (e && (e->isTemporary() || e->document()->filePath().isEmpty())) { // look for another editor that is more suited e = 0; foreach (IEditor *otherEditor, editors()) { - if (!otherEditor->isTemporary() && !otherEditor->document()->fileName().isEmpty()) { + if (!otherEditor->isTemporary() && !otherEditor->document()->filePath().isEmpty()) { e = otherEditor; break; } @@ -752,10 +752,10 @@ QByteArray SplitterOrView::saveState() const stream << QByteArray("empty"); } else if (e == EditorManager::currentEditor()) { stream << QByteArray("currenteditor") - << e->document()->fileName() << e->id().toString() << e->saveState(); + << e->document()->filePath() << e->id().toString() << e->saveState(); } else { stream << QByteArray("editor") - << e->document()->fileName() << e->id().toString() << e->saveState(); + << e->document()->filePath() << e->id().toString() << e->saveState(); } } return bytes; diff --git a/src/plugins/coreplugin/editormanager/openeditorsmodel.cpp b/src/plugins/coreplugin/editormanager/openeditorsmodel.cpp index f48e8ac3d5..d58b497938 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsmodel.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsmodel.cpp @@ -81,7 +81,7 @@ QIcon OpenEditorsModel::unlockedIcon() const } QString OpenEditorsModel::Entry::fileName() const { - return editor ? editor->document()->fileName() : m_fileName; + return editor ? editor->document()->filePath() : m_fileName; } QString OpenEditorsModel::Entry::displayName() const { @@ -338,7 +338,7 @@ QVariant OpenEditorsModel::data(const QModelIndex &index, int role) const { bool showLock = false; if (e->editor) { - showLock = e->editor->document()->fileName().isEmpty() + showLock = e->editor->document()->filePath().isEmpty() ? false : e->editor->document()->isFileReadOnly(); } else { diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index a195dfac2f..19c1a7b3ab 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -260,10 +260,10 @@ void OpenEditorsWindow::addHistoryItems(const QList<EditLocation> &history, Edit QTreeWidgetItem *item = new QTreeWidgetItem(); if (hi.document->isModified()) title += tr("*"); - item->setIcon(0, !hi.document->fileName().isEmpty() && hi.document->isFileReadOnly() + item->setIcon(0, !hi.document->filePath().isEmpty() && hi.document->isFileReadOnly() ? model->lockedIcon() : m_emptyIcon); item->setText(0, title); - item->setToolTip(0, hi.document->fileName()); + item->setToolTip(0, hi.document->filePath()); item->setData(0, Qt::UserRole, QVariant::fromValue(hi.document.data())); item->setData(0, Qt::UserRole+1, QVariant::fromValue(view)); item->setTextAlignment(0, Qt::AlignLeft); diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index dac5846cf8..aa0c3b7829 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -377,7 +377,7 @@ void EditorToolBar::updateEditorStatus(IEditor *editor) d->m_editorList->setCurrentIndex(d->m_editorsListModel->rowOfEditor(editor)); - if (editor->document()->fileName().isEmpty()) { + if (editor->document()->filePath().isEmpty()) { d->m_lockButton->setIcon(QIcon()); d->m_lockButton->setEnabled(false); d->m_lockButton->setToolTip(QString()); @@ -393,9 +393,9 @@ void EditorToolBar::updateEditorStatus(IEditor *editor) IEditor *current = EditorManager::currentEditor(); if (editor == current) d->m_editorList->setToolTip( - current->document()->fileName().isEmpty() + current->document()->filePath().isEmpty() ? current->displayName() - : QDir::toNativeSeparators(editor->document()->fileName()) + : QDir::toNativeSeparators(editor->document()->filePath()) ); } diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index 664cbef66f..3a7643be5c 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -591,7 +591,7 @@ void ExternalToolRunner::run() } if (m_tool->modifiesCurrentDocument()) { if (IEditor *editor = EditorManager::currentEditor()) { - m_expectedFileName = editor->document()->fileName(); + m_expectedFileName = editor->document()->filePath(); bool cancelled = false; DocumentManager::saveModifiedDocuments(QList<IDocument *>() << editor->document(), &cancelled); if (cancelled) { diff --git a/src/plugins/coreplugin/idocument.cpp b/src/plugins/coreplugin/idocument.cpp index f737e22681..df9429cf48 100644 --- a/src/plugins/coreplugin/idocument.cpp +++ b/src/plugins/coreplugin/idocument.cpp @@ -35,10 +35,10 @@ #include <QFileInfo> /*! - \fn QString Core::IDocument::fileName() const + \fn QString Core::IDocument::filePath() const Returns the absolute path of the file that this document refers to. May be empty for non-file documents. - \sa setFileName() + \sa setFilePath() */ namespace Core { @@ -73,9 +73,9 @@ bool IDocument::shouldAutoSave() const bool IDocument::isFileReadOnly() const { - if (fileName().isEmpty()) + if (filePath().isEmpty()) return false; - return !QFileInfo(fileName()).isWritable(); + return !QFileInfo(filePath()).isWritable(); } bool IDocument::autoSave(QString *errorString, const QString &fileName) @@ -118,18 +118,18 @@ InfoBar *IDocument::infoBar() } /*! - Set absolute file path for this file to \a fileName. Can be empty. - The default implementation sets the file name and sends fileNameChanged() and changed() + Set absolute file path for this file to \a filePath. Can be empty. + The default implementation sets the file name and sends filePathChanged() and changed() signals. Can be reimplemented by subclasses to do more. - \sa fileName() + \sa filePath() */ -void IDocument::setFileName(const QString &fileName) +void IDocument::setFilePath(const QString &filePath) { - if (m_fileName == fileName) + if (m_filePath == filePath) return; - QString oldName = m_fileName; - m_fileName = fileName; - emit fileNameChanged(oldName, m_fileName); + QString oldName = m_filePath; + m_filePath = filePath; + emit filePathChanged(oldName, m_filePath); emit changed(); } diff --git a/src/plugins/coreplugin/idocument.h b/src/plugins/coreplugin/idocument.h index 36889a8ec9..5eb8024f9f 100644 --- a/src/plugins/coreplugin/idocument.h +++ b/src/plugins/coreplugin/idocument.h @@ -82,8 +82,8 @@ public: virtual ~IDocument(); virtual bool save(QString *errorString, const QString &fileName = QString(), bool autoSave = false) = 0; - QString fileName() const { return m_fileName; } - virtual void setFileName(const QString &fileName); + QString filePath() const { return m_filePath; } + virtual void setFilePath(const QString &filePath); virtual bool isFileReadOnly() const; virtual QString defaultPath() const = 0; @@ -99,7 +99,7 @@ public: virtual void checkPermissions(); - bool autoSave(QString *errorString, const QString &fileName); + bool autoSave(QString *errorString, const QString &filePath); void setRestoredFrom(const QString &name); void removeAutoSaveFile(); @@ -114,10 +114,10 @@ signals: void aboutToReload(); void reloadFinished(bool success); - void fileNameChanged(const QString &oldName, const QString &newName); + void filePathChanged(const QString &oldName, const QString &newName); private: - QString m_fileName; + QString m_filePath; QString m_autoSaveName; InfoBar *m_infoBar; bool m_hasWriteWarning; diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index a7ba65664d..b8626fc4e1 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1047,7 +1047,7 @@ bool CPPEditorWidget::sortedOutline() const void CPPEditorWidget::updateOutlineNow() { const Snapshot snapshot = m_modelManager->snapshot(); - Document::Ptr document = snapshot.document(editorDocument()->fileName()); + Document::Ptr document = snapshot.document(editorDocument()->filePath()); if (!document) return; @@ -1506,7 +1506,7 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo } // Now we prefer the doc from the snapshot with macros expanded. - Document::Ptr doc = snapshot.document(editorDocument()->fileName()); + Document::Ptr doc = snapshot.document(editorDocument()->filePath()); if (!doc) { doc = m_lastSemanticInfo.doc; if (!doc) @@ -1600,7 +1600,7 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo foreach (const LookupItem &r, resolvedSymbols) { if (Symbol *d = r.declaration()) { if (d->isDeclaration() || d->isFunction()) { - if (editorDocument()->fileName() == QString::fromUtf8(d->fileName(), d->fileNameLength())) { + if (editorDocument()->filePath() == QString::fromUtf8(d->fileName(), d->fileNameLength())) { if (unsigned(lineNumber) == d->line() && unsigned(positionInBlock) >= d->column()) { // ### TODO: check the end result = r; // take the symbol under cursor. break; @@ -2038,7 +2038,7 @@ void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo) // We can use the semanticInfo's snapshot (and avoid locking), but not its // document, since it doesn't contain expanded macros. - LookupContext context(semanticInfo.snapshot.document(editorDocument()->fileName()), + LookupContext context(semanticInfo.snapshot.document(editorDocument()->filePath()), semanticInfo.snapshot); SemanticInfo::LocalUseIterator it(semanticInfo.localUses); diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp index 34c4fd5ccb..08ef725ed7 100644 --- a/src/plugins/cppeditor/cppelementevaluator.cpp +++ b/src/plugins/cppeditor/cppelementevaluator.cpp @@ -85,7 +85,7 @@ void CppElementEvaluator::execute() return; const Snapshot &snapshot = m_modelManager->snapshot(); - Document::Ptr doc = snapshot.document(m_editor->editorDocument()->fileName()); + Document::Ptr doc = snapshot.document(m_editor->editorDocument()->filePath()); if (!doc) return; diff --git a/src/plugins/cppeditor/cppquickfixassistant.cpp b/src/plugins/cppeditor/cppquickfixassistant.cpp index 1157f45d65..2c6d7e3217 100644 --- a/src/plugins/cppeditor/cppquickfixassistant.cpp +++ b/src/plugins/cppeditor/cppquickfixassistant.cpp @@ -82,7 +82,7 @@ const IAssistProvider *CppQuickFixAssistProcessor::provider() const CppQuickFixAssistInterface::CppQuickFixAssistInterface(CPPEditorWidget *editor, TextEditor::AssistReason reason) : DefaultAssistInterface(editor->document(), editor->position(), - editor->editorDocument()->fileName(), reason) + editor->editorDocument()->filePath(), reason) , m_editor(editor) , m_semanticInfo(editor->semanticInfo()) , m_snapshot(CppTools::CppModelManagerInterface::instance()->snapshot()) diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index 428b6e2079..3bdea36e29 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -312,7 +312,7 @@ void TestCase::run() BaseTextEditor *currentTextEditor = dynamic_cast<BaseTextEditor*>(currentEditor); QVERIFY(currentTextEditor); - QCOMPARE(currentTextEditor->document()->fileName(), targetTestFile->filePath()); + QCOMPARE(currentTextEditor->document()->filePath(), targetTestFile->filePath()); int expectedLine, expectedColumn; currentTextEditor->convertPosition(targetTestFile->targetCursorPosition, &expectedLine, &expectedColumn); diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 6213df0c47..d4f1b00838 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -64,7 +64,7 @@ static QStringList getCompletions(TestData &data, bool *replaceAccessOperator = QStringList completions; CppCompletionAssistInterface *ai = new CppCompletionAssistInterface(data.editor->document(), data.pos, - data.editor->editorDocument()->fileName(), ExplicitlyInvoked, + data.editor->editorDocument()->filePath(), ExplicitlyInvoked, data.snapshot, QStringList(), QStringList()); CppCompletionAssistProcessor processor; IAssistProposal *proposal = processor.perform(ai); diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index f68079176f..f636c0a8e2 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -440,7 +440,7 @@ public: return new CppTools::Internal::CppCompletionAssistInterface( document, position, - editor()->document()->fileName(), + editor()->document()->filePath(), reason, modelManager->snapshot(), includePaths, diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp index e7aa07ac90..b18fdbf2a4 100644 --- a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp +++ b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp @@ -127,7 +127,7 @@ void CppCurrentDocumentFilter::onDocumentUpdated(Document::Ptr doc) void CppCurrentDocumentFilter::onCurrentEditorChanged(Core::IEditor * currentEditor) { if (currentEditor) - m_currentFileName = currentEditor->document()->fileName(); + m_currentFileName = currentEditor->document()->filePath(); else m_currentFileName.clear(); m_itemsOfCurrentDoc.clear(); @@ -136,7 +136,7 @@ void CppCurrentDocumentFilter::onCurrentEditorChanged(Core::IEditor * currentEdi void CppCurrentDocumentFilter::onEditorAboutToClose(Core::IEditor * editorAboutToClose) { if (!editorAboutToClose) return; - if (m_currentFileName == editorAboutToClose->document()->fileName()) { + if (m_currentFileName == editorAboutToClose->document()->filePath()) { m_currentFileName.clear(); m_itemsOfCurrentDoc.clear(); } diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 76b8c4e0e5..4380a21297 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -377,7 +377,7 @@ void CppModelManager::dumpModelManagerConfiguration() // Tons of debug output... qDebug()<<"========= CppModelManager::dumpModelManagerConfiguration ======"; foreach (const ProjectInfo &pinfo, m_projects) { - qDebug()<<" for project:"<< pinfo.project().data()->document()->fileName(); + qDebug()<<" for project:"<< pinfo.project().data()->document()->filePath(); foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) { qDebug() << "=== part ==="; const char* cVersion; diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index 86efe3bd26..1b73cf883c 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -163,7 +163,7 @@ CppEditorSupport::~CppEditorSupport() QString CppEditorSupport::fileName() const { - return m_textEditor->document()->fileName(); + return m_textEditor->document()->filePath(); } QString CppEditorSupport::contents() const @@ -246,7 +246,7 @@ void CppEditorSupport::updateDocumentNow() if (m_highlightingSupport && !m_highlightingSupport->requiresSemanticInfo()) startHighlighting(); - const QStringList sourceFiles(m_textEditor->document()->fileName()); + const QStringList sourceFiles(m_textEditor->document()->filePath()); m_documentParser = m_modelManager->updateSourceFiles(sourceFiles); } } diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 7f2bdbd24c..87f170c675 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -154,7 +154,7 @@ ExtensionSystem::IPlugin::ShutdownFlag CppToolsPlugin::aboutToShutdown() void CppToolsPlugin::switchHeaderSource() { QString otherFile = correspondingHeaderOrSource( - Core::EditorManager::currentEditor()->document()->fileName()); + Core::EditorManager::currentEditor()->document()->filePath()); if (!otherFile.isEmpty()) Core::EditorManager::openEditor(otherFile); } @@ -162,7 +162,7 @@ void CppToolsPlugin::switchHeaderSource() void CppToolsPlugin::switchHeaderSourceInNextSplit() { QString otherFile = correspondingHeaderOrSource( - Core::EditorManager::currentEditor()->document()->fileName()); + Core::EditorManager::currentEditor()->document()->filePath()); if (!otherFile.isEmpty()) Core::EditorManager::openEditor(otherFile, Core::Id(), Core::EditorManager::OpenInOtherSplit); } diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 85ffd0a65c..75e49af81f 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -457,7 +457,7 @@ bool CvsPlugin::submitEditorAboutToClose() // Submit editor closing. Make it write out the commit message // and retrieve files - const QFileInfo editorFile(editorDocument->fileName()); + const QFileInfo editorFile(editorDocument->filePath()); const QFileInfo changeFile(m_commitMessageFileName); if (editorFile.absoluteFilePath() != changeFile.absoluteFilePath()) return true; // Oops?! diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 4c54a82050..92a9b02d21 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -686,7 +686,7 @@ static bool currentTextEditorPosition(ContextData *data) return false; const IDocument *document = textEditor->document(); QTC_ASSERT(document, return false); - data->fileName = document->fileName(); + data->fileName = document->filePath(); if (textEditor->property("DisassemblerView").toBool()) { int lineNumber = textEditor->currentLine(); QString line = textEditor->textDocument()->contents() @@ -1862,7 +1862,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, bool contextUsable = true; BreakpointModelId id = BreakpointModelId(); - const QString fileName = editor->document()->fileName(); + const QString fileName = editor->document()->filePath(); if (editor->property("DisassemblerView").toBool()) { args.fileName = fileName; QString line = editor->textDocument()->contents() @@ -1875,7 +1875,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, id = breakHandler()->findSimilarBreakpoint(needle); contextUsable = args.address != 0; } else { - args.fileName = editor->document()->fileName(); + args.fileName = editor->document()->filePath(); id = breakHandler() ->findBreakpointByFileAndLine(args.fileName, lineNumber); if (!id) @@ -1984,7 +1984,7 @@ void DebuggerPluginPrivate::toggleBreakpoint() quint64 address = DisassemblerLine::addressFromDisassemblyLine(line); toggleBreakpointByAddress(address); } else if (lineNumber >= 0) { - toggleBreakpointByFileAndLine(textEditor->document()->fileName(), lineNumber); + toggleBreakpointByFileAndLine(textEditor->document()->filePath(), lineNumber); } } @@ -2041,7 +2041,7 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor, quint64 address = DisassemblerLine::addressFromDisassemblyLine(line); toggleBreakpointByAddress(address); } else if (editor->document()) { - toggleBreakpointByFileAndLine(editor->document()->fileName(), lineNumber); + toggleBreakpointByFileAndLine(editor->document()->filePath(), lineNumber); } } @@ -2130,7 +2130,7 @@ void DebuggerPluginPrivate::cleanupViews() keepIt = false; else if (doc->isModified()) keepIt = true; - else if (doc->fileName().contains(_("qeventdispatcher"))) + else if (doc->filePath().contains(_("qeventdispatcher"))) keepIt = false; else keepIt = (editor == EditorManager::currentEditor()); @@ -3507,7 +3507,7 @@ void DebuggerPluginPrivate::testProjectLoaded(Project *project) void DebuggerPluginPrivate::testProjectEvaluated() { - QString fileName = m_testProject->document()->fileName(); + QString fileName = m_testProject->document()->filePath(); QVERIFY(!fileName.isEmpty()); qWarning("Project %s loaded", qPrintable(fileName)); connect(ProjectExplorerPlugin::instance()->buildManager(), diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 75e0a2b7ca..d56cb66308 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -192,7 +192,7 @@ public: explicit DebuggerToolTipEditor(IEditor *ie = 0); bool isValid() const { return textEditor && baseTextEditor && document; } operator bool() const { return isValid(); } - QString fileName() const { return document ? document->fileName() : QString(); } + QString fileName() const { return document ? document->filePath() : QString(); } static DebuggerToolTipEditor currentToolTipEditor(); @@ -535,7 +535,7 @@ DebuggerToolTipContext DebuggerToolTipContext::fromEditor(IEditor *ie, int pos) DebuggerToolTipContext rc; if (const IDocument *document = ie->document()) { if (const ITextEditor *te = qobject_cast<const ITextEditor *>(ie)) { - rc.fileName = document->fileName(); + rc.fileName = document->filePath(); rc.position = pos; te->convertPosition(pos, &rc.line, &rc.column); } diff --git a/src/plugins/debugger/qml/qmlinspectoradapter.cpp b/src/plugins/debugger/qml/qmlinspectoradapter.cpp index 20d9219b6a..faada0aada 100644 --- a/src/plugins/debugger/qml/qmlinspectoradapter.cpp +++ b/src/plugins/debugger/qml/qmlinspectoradapter.cpp @@ -298,7 +298,7 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor) != QmlJSEditor::Constants::C_QMLJSEDITOR_ID) return; - QString filename = newEditor->document()->fileName(); + QString filename = newEditor->document()->filePath(); QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance(); if (modelManager) { @@ -330,7 +330,7 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor) connect(preview, SIGNAL(reloadRequest()), this, SLOT(onReload())); - m_textPreviews.insert(newEditor->document()->fileName(), preview); + m_textPreviews.insert(newEditor->document()->filePath(), preview); preview->associateEditor(newEditor); preview->updateDebugIds(); } @@ -340,7 +340,7 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor) void QmlInspectorAdapter::removePreviewForEditor(Core::IEditor *editor) { if (QmlLiveTextPreview *preview - = m_textPreviews.value(editor->document()->fileName())) { + = m_textPreviews.value(editor->document()->filePath())) { preview->unassociateEditor(editor); } } @@ -365,7 +365,7 @@ void QmlInspectorAdapter::updatePendingPreviewDocuments(QmlJS::Document::Ptr doc Core::IEditor *editor = editors.takeFirst(); createPreviewForEditor(editor); QmlLiveTextPreview *preview - = m_textPreviews.value(editor->document()->fileName()); + = m_textPreviews.value(editor->document()->filePath()); foreach (Core::IEditor *editor, editors) preview->associateEditor(editor); } diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp index 12ebbc10d3..d1260a98f7 100644 --- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp +++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp @@ -1994,7 +1994,7 @@ void QmlV8DebuggerClient::highlightExceptionCode(int lineNumber, errorFormat.setUnderlineColor(Qt::red); foreach (IEditor *editor, openedEditors) { - if (editor->document()->fileName() == filePath) { + if (editor->document()->filePath() == filePath) { TextEditor::BaseTextEditorWidget *ed = qobject_cast<TextEditor::BaseTextEditorWidget *>(editor->widget()); if (!ed) continue; diff --git a/src/plugins/debugger/sourceutils.cpp b/src/plugins/debugger/sourceutils.cpp index 12072d2197..2e7f25a64d 100644 --- a/src/plugins/debugger/sourceutils.cpp +++ b/src/plugins/debugger/sourceutils.cpp @@ -318,7 +318,7 @@ bool isCppEditor(Core::IEditor *editor) if (!document) return false; - return CppTools::ProjectFile::classify(document->fileName()) != CppTools::ProjectFile::Unclassified; + return CppTools::ProjectFile::classify(document->filePath()) != CppTools::ProjectFile::Unclassified; } // Return the Cpp expression, and, if desired, the function @@ -359,7 +359,7 @@ QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos, if (const Core::IDocument *document= editor->document()) if (modelManager) *function = AbstractEditorSupport::functionAt(modelManager, - document->fileName(), *line, *column); + document->filePath(), *line, *column); return expr; } diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index e435c95cdb..4feb623576 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -866,7 +866,7 @@ static QString currentFile() { if (Core::IEditor *editor = Core::EditorManager::currentEditor()) if (const Core::IDocument *document = editor->document()) { - const QString fileName = document->fileName(); + const QString fileName = document->filePath(); if (!fileName.isEmpty() && QFileInfo(fileName).isFile()) return fileName; } diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp index d6234089ee..1c865fa4c4 100644 --- a/src/plugins/designer/formwindoweditor.cpp +++ b/src/plugins/designer/formwindoweditor.cpp @@ -121,7 +121,7 @@ bool FormWindowEditor::createNew(const QString &contents) return false; syncXmlEditor(contents); - d->m_file.setFileName(QString()); + d->m_file.setFilePath(QString()); d->m_file.setShouldAutoSave(false); return true; } @@ -168,7 +168,7 @@ bool FormWindowEditor::open(QString *errorString, const QString &fileName, const syncXmlEditor(contents); setDisplayName(fi.fileName()); - d->m_file.setFileName(absfileName); + d->m_file.setFilePath(absfileName); d->m_file.setShouldAutoSave(false); if (Internal::ResourceHandler *rh = form->findChild<Designer::Internal::ResourceHandler*>()) @@ -182,7 +182,7 @@ bool FormWindowEditor::open(QString *errorString, const QString &fileName, const void FormWindowEditor::syncXmlEditor() { if (Designer::Constants::Internal::debug) - qDebug() << "FormWindowEditor::syncXmlEditor" << d->m_file.fileName(); + qDebug() << "FormWindowEditor::syncXmlEditor" << d->m_file.filePath(); syncXmlEditor(contents()); } diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp index dd4e7caf02..dfd12e08d3 100644 --- a/src/plugins/designer/formwindowfile.cpp +++ b/src/plugins/designer/formwindowfile.cpp @@ -64,7 +64,7 @@ FormWindowFile::FormWindowFile(QDesignerFormWindowInterface *form, QObject *pare bool FormWindowFile::save(QString *errorString, const QString &name, bool autoSave) { - const QString actualName = name.isEmpty() ? fileName() : name; + const QString actualName = name.isEmpty() ? filePath() : name; if (Designer::Constants::Internal::debug) qDebug() << Q_FUNC_INFO << name << "->" << actualName; @@ -96,19 +96,19 @@ bool FormWindowFile::save(QString *errorString, const QString &name, bool autoSa emit setDisplayName(fi.fileName()); m_formWindow->setDirty(false); - setFileName(fi.absoluteFilePath()); + setFilePath(fi.absoluteFilePath()); emit changed(); emit saved(); return true; } -void FormWindowFile::setFileName(const QString &newName) +void FormWindowFile::setFilePath(const QString &newName) { m_formWindow->setFileName(newName); QFileInfo fi(newName); emit setDisplayName(fi.fileName()); - IDocument::setFileName(fi.absoluteFilePath()); + IDocument::setFilePath(fi.absoluteFilePath()); } bool FormWindowFile::shouldAutoSave() const @@ -134,7 +134,7 @@ bool FormWindowFile::reload(QString *errorString, ReloadFlag flag, ChangeType ty emit changed(); } else { emit aboutToReload(); - emit reload(errorString, fileName()); + emit reload(errorString, filePath()); const bool success = errorString->isEmpty(); emit reloadFinished(success); return success; @@ -150,7 +150,7 @@ QString FormWindowFile::defaultPath() const void FormWindowFile::setSuggestedFileName(const QString &fn) { if (Designer::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << fileName() << fn; + qDebug() << Q_FUNC_INFO << filePath() << fn; m_suggestedName = fn; } @@ -168,7 +168,7 @@ QString FormWindowFile::mimeType() const bool FormWindowFile::writeFile(const QString &fn, QString *errorString) const { if (Designer::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << fileName() << fn; + qDebug() << Q_FUNC_INFO << filePath() << fn; return write(fn, format(), m_formWindow->contents(), errorString); } diff --git a/src/plugins/designer/formwindowfile.h b/src/plugins/designer/formwindowfile.h index 3228a381bc..2daf6cfdf3 100644 --- a/src/plugins/designer/formwindowfile.h +++ b/src/plugins/designer/formwindowfile.h @@ -73,7 +73,7 @@ signals: void setDisplayName(const QString &); public slots: - void setFileName(const QString &); + void setFilePath(const QString &); void setShouldAutoSave(bool sad = true) { m_shouldAutoSave = sad; } private slots: diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 956c1bc51d..0333adf392 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -517,7 +517,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, const EditorData ed = m_few->activeEditor(); QTC_ASSERT(ed, return false); - const QString currentUiFile = ed.formWindowEditor->document()->fileName(); + const QString currentUiFile = ed.formWindowEditor->document()->filePath(); #if 0 return Designer::Internal::navigateToSlot(currentUiFile, objectName, signalSignature, parameterNames, errorMessage); #endif diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index fae5154310..1e68d0e601 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1662,7 +1662,7 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor) connect(ICore::instance(), SIGNAL(saveSettingsRequested()), SLOT(writeSettings())); - handler->setCurrentFileName(editor->document()->fileName()); + handler->setCurrentFileName(editor->document()->filePath()); handler->installEventFilter(); // pop up the bar @@ -1773,7 +1773,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd) // :w[rite] IEditor *editor = m_editorToHandler.key(handler); const QString fileName = handler->currentFileName(); - if (editor && editor->document()->fileName() == fileName) { + if (editor && editor->document()->filePath() == fileName) { // Handle that as a special case for nicer interaction with core DocumentManager::saveDocument(editor->document()); // Check result by reading back. diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 2f36899ba7..e231808957 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -457,7 +457,7 @@ GenericProjectFile::GenericProjectFile(GenericProject *parent, QString fileName, m_project(parent), m_options(options) { - setFileName(fileName); + setFilePath(fileName); } bool GenericProjectFile::save(QString *, const QString &, bool) diff --git a/src/plugins/genericprojectmanager/genericprojectnodes.cpp b/src/plugins/genericprojectmanager/genericprojectnodes.cpp index 687658c326..7bd6773f53 100644 --- a/src/plugins/genericprojectmanager/genericprojectnodes.cpp +++ b/src/plugins/genericprojectmanager/genericprojectnodes.cpp @@ -42,9 +42,9 @@ namespace GenericProjectManager { namespace Internal { GenericProjectNode::GenericProjectNode(GenericProject *project, Core::IDocument *projectFile) - : ProjectNode(projectFile->fileName()), m_project(project), m_projectFile(projectFile) + : ProjectNode(projectFile->filePath()), m_project(project), m_projectFile(projectFile) { - setDisplayName(QFileInfo(projectFile->fileName()).completeBaseName()); + setDisplayName(QFileInfo(projectFile->filePath()).completeBaseName()); } Core::IDocument *GenericProjectNode::projectFile() const @@ -54,7 +54,7 @@ Core::IDocument *GenericProjectNode::projectFile() const QString GenericProjectNode::projectFilePath() const { - return m_projectFile->fileName(); + return m_projectFile->filePath(); } QHash<QString, QStringList> sortFilesIntoPaths(const QString &base, const QSet<QString> files) diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.cpp b/src/plugins/genericprojectmanager/genericprojectplugin.cpp index 837fffece3..2b8bb84e8e 100644 --- a/src/plugins/genericprojectmanager/genericprojectplugin.cpp +++ b/src/plugins/genericprojectmanager/genericprojectplugin.cpp @@ -117,7 +117,7 @@ void GenericProjectPlugin::updateContextMenu(ProjectExplorer::Project *project, void GenericProjectPlugin::editFiles() { GenericProject *genericProject = static_cast<GenericProject *>(m_contextMenuProject); - SelectableFilesDialog sfd(QFileInfo(genericProject->document()->fileName()).path(), genericProject->files(), + SelectableFilesDialog sfd(QFileInfo(genericProject->document()->filePath()).path(), genericProject->files(), Core::ICore::mainWindow()); if (sfd.exec() == QDialog::Accepted) genericProject->setFiles(sfd.selectedFiles()); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 6c2afdc6c5..d0864461cd 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -773,7 +773,7 @@ static inline QString msgParseFilesFailed() static inline QString currentDocumentPath() { if (Core::IEditor *editor = Core::EditorManager::currentEditor()) - return QFileInfo(editor->document()->fileName()).path(); + return QFileInfo(editor->document()->filePath()).path(); return QString(); } diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 63d4f37b8a..af9f31a532 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1055,7 +1055,7 @@ bool GitPlugin::submitEditorAboutToClose() QTC_ASSERT(editorDocument, return true); // Submit editor closing. Make it write out the commit message // and retrieve files - const QFileInfo editorFile(editorDocument->fileName()); + const QFileInfo editorFile(editorDocument->filePath()); const QFileInfo changeFile(m_commitMessageFileName); // Paranoia! if (editorFile.absoluteFilePath() != changeFile.absoluteFilePath()) diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index 844e61b380..e744b603de 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -416,7 +416,7 @@ TextEditor::IAssistInterface *GLSLTextEditorWidget::createAssistInterface( if (kind == TextEditor::Completion) return new GLSLCompletionAssistInterface(document(), position(), - editor()->document()->fileName(), + editor()->document()->filePath(), reason, mimeType(), glslDocument()); diff --git a/src/plugins/imageviewer/imageviewer.cpp b/src/plugins/imageviewer/imageviewer.cpp index 25777c5e5e..d2bdb13ae2 100644 --- a/src/plugins/imageviewer/imageviewer.cpp +++ b/src/plugins/imageviewer/imageviewer.cpp @@ -134,7 +134,7 @@ bool ImageViewer::open(QString *errorString, const QString &fileName, const QStr return false; } setDisplayName(QFileInfo(fileName).fileName()); - d->file->setFileName(fileName); + d->file->setFilePath(fileName); d->ui_toolbar.toolButtonPlayPause->setVisible(d->imageView->isAnimated()); setPaused(!d->imageView->isAnimated()); // d_ptr->file->setMimeType diff --git a/src/plugins/imageviewer/imageviewerfile.cpp b/src/plugins/imageviewer/imageviewerfile.cpp index 36da85b7f7..4352b4a05d 100644 --- a/src/plugins/imageviewer/imageviewerfile.cpp +++ b/src/plugins/imageviewer/imageviewerfile.cpp @@ -61,7 +61,7 @@ bool ImageViewerFile::reload(QString *errorString, emit changed(); return true; } - return m_editor->open(errorString, fileName(), fileName()); + return m_editor->open(errorString, filePath(), filePath()); } bool ImageViewerFile::save(QString *errorString, const QString &fileName, bool autoSave) @@ -72,10 +72,10 @@ bool ImageViewerFile::save(QString *errorString, const QString &fileName, bool a return false; } -void ImageViewerFile::setFileName(const QString &newName) +void ImageViewerFile::setFilePath(const QString &newName) { m_editor->setDisplayName(QFileInfo(newName).fileName()); - IDocument::setFileName(newName); + IDocument::setFilePath(newName); } QString ImageViewerFile::defaultPath() const diff --git a/src/plugins/imageviewer/imageviewerfile.h b/src/plugins/imageviewer/imageviewerfile.h index bc2c254d29..0381052931 100644 --- a/src/plugins/imageviewer/imageviewerfile.h +++ b/src/plugins/imageviewer/imageviewerfile.h @@ -46,7 +46,7 @@ public: explicit ImageViewerFile(ImageViewer *parent = 0); bool save(QString *errorString, const QString &fileName, bool autoSave); - void setFileName(const QString &newName); + void setFilePath(const QString &newName); QString defaultPath() const; QString suggestedFileName() const; diff --git a/src/plugins/locator/filesystemfilter.cpp b/src/plugins/locator/filesystemfilter.cpp index 4e7af5c91b..7e34602abb 100644 --- a/src/plugins/locator/filesystemfilter.cpp +++ b/src/plugins/locator/filesystemfilter.cpp @@ -59,8 +59,8 @@ QList<FilterEntry> FileSystemFilter::matchesFor(QFutureInterface<Locator::Filter directory.replace(0, 1, QDir::homePath()); } else { IEditor *editor = EditorManager::currentEditor(); - if (editor && !editor->document()->fileName().isEmpty()) { - QFileInfo info(editor->document()->fileName()); + if (editor && !editor->document()->filePath().isEmpty()) { + QFileInfo info(editor->document()->filePath()); directory.prepend(info.absolutePath() + QLatin1Char('/')); } } diff --git a/src/plugins/madde/debianmanager.cpp b/src/plugins/madde/debianmanager.cpp index e629f9ae53..c0573c925d 100644 --- a/src/plugins/madde/debianmanager.cpp +++ b/src/plugins/madde/debianmanager.cpp @@ -696,7 +696,7 @@ void DebianManager::controlWasChanged() WatchableFile *file = qobject_cast<WatchableFile *>(sender()); if (!file) return; - emit controlChanged(Utils::FileName::fromString(file->fileName()).parentDir()); + emit controlChanged(Utils::FileName::fromString(file->filePath()).parentDir()); } void DebianManager::changelogWasChanged() @@ -704,7 +704,7 @@ void DebianManager::changelogWasChanged() WatchableFile *file = qobject_cast<WatchableFile *>(sender()); if (!file) return; - emit changelogChanged(Utils::FileName::fromString(file->fileName()).parentDir()); + emit changelogChanged(Utils::FileName::fromString(file->filePath()).parentDir()); } Utils::FileName DebianManager::changelogFilePath(const Utils::FileName &debianDir) diff --git a/src/plugins/madde/maemoglobal.h b/src/plugins/madde/maemoglobal.h index 33cdf9ad6a..feaeb4b6a1 100644 --- a/src/plugins/madde/maemoglobal.h +++ b/src/plugins/madde/maemoglobal.h @@ -58,7 +58,7 @@ public: WatchableFile(const QString &fileName, QObject *parent = 0) : Core::IDocument(parent) { - setFileName(fileName); + setFilePath(fileName); } bool save(QString *, const QString &, bool) { return false; } diff --git a/src/plugins/madde/maemopublisherfremantlefree.cpp b/src/plugins/madde/maemopublisherfremantlefree.cpp index 34d88099ff..c1fbb97db2 100644 --- a/src/plugins/madde/maemopublisherfremantlefree.cpp +++ b/src/plugins/madde/maemopublisherfremantlefree.cpp @@ -210,7 +210,7 @@ bool MaemoPublisherFremantleFree::copyRecursively(const QString &srcFilePath, QByteArray rulesContents = reader.data(); rulesContents.replace("$(MAKE) clean", "# $(MAKE) clean"); rulesContents.replace("# Add here commands to configure the package.", - "qmake " + QFileInfo(m_project->document()->fileName()).fileName().toLocal8Bit()); + "qmake " + QFileInfo(m_project->document()->filePath()).fileName().toLocal8Bit()); MaemoDebianPackageCreationStep::ensureShlibdeps(rulesContents); FileSaver saver(tgtFilePath); saver.write(rulesContents); diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index 74e5338088..f326a76ad4 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -630,7 +630,7 @@ bool MercurialPlugin::submitEditorAboutToClose() QStringList extraOptions; if (!commitEditor->committerInfo().isEmpty()) extraOptions << QLatin1String("-u") << commitEditor->committerInfo(); - m_client->commit(m_submitRepository, files, editorFile->fileName(), + m_client->commit(m_submitRepository, files, editorFile->filePath(), extraOptions); } return true; diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 193e41ec0e..a690a47858 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -76,7 +76,7 @@ QVariant CurrentProjectFind::additionalParameters() const { Project *project = ProjectExplorerPlugin::currentProject(); if (project && project->document()) - return qVariantFromValue(project->document()->fileName()); + return qVariantFromValue(project->document()->filePath()); 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->document() && projectFile == project->document()->fileName()) + if (project->document() && projectFile == project->document()->filePath()) return filesForProjects(nameFilters, QList<Project *>() << project); } return new Utils::FileIterator(); @@ -112,7 +112,7 @@ void CurrentProjectFind::recheckEnabled() QString projectFile = getAdditionalParameters(search).toString(); QList<Project *> allProjects = m_plugin->session()->projects(); foreach (Project *project, allProjects) { - if (project->document() && projectFile == project->document()->fileName()) { + if (project->document() && projectFile == project->document()->filePath()) { search->setSearchAgainEnabled(true); return; } diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp index 4e75ec1792..817171b2c9 100644 --- a/src/plugins/projectexplorer/dependenciespanel.cpp +++ b/src/plugins/projectexplorer/dependenciespanel.cpp @@ -104,7 +104,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->document()->fileName())); + return Core::FileIconProvider::instance()->icon(QFileInfo(p->document()->filePath())); default: return QVariant(); } diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index 6273d97149..e0b2d8d980 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -252,7 +252,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->document()->fileName()); + Project *project = session->projectForFile(editor->document()->filePath()); if (project && project->editorConfiguration() == this) switchSettings(baseTextEditor); } diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index af399f4862..0af61abd67 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -237,7 +237,7 @@ QListWidgetItem *ProjectListWidget::itemForProject(Project *project) QString ProjectListWidget::fullName(ProjectExplorer::Project *project) { - return tr("%1 (%2)").arg(project->displayName(), project->document()->fileName()); + return tr("%1 (%2)").arg(project->displayName(), project->document()->filePath()); } void ProjectListWidget::addProject(Project *project) @@ -1395,7 +1395,7 @@ void MiniProjectTargetSelector::updateActionAndSummary() projectName = project->displayName(); foreach (Project *p, ProjectExplorerPlugin::instance()->session()->projects()) { if (p != project && p->displayName() == projectName) { - fileName = project->document()->fileName(); + fileName = project->document()->filePath(); break; } } diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index a66fdc32c1..f8e42fad82 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -328,7 +328,7 @@ QVariantMap Project::toMap() const QString Project::projectDirectory() const { - return projectDirectory(document()->fileName()); + return projectDirectory(document()->filePath()); } QString Project::projectDirectory(const QString &top) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 374e705077..bd6c58ed82 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1022,7 +1022,7 @@ void ProjectExplorerPlugin::loadAction() // the current file if (Core::IEditor *editor = Core::EditorManager::currentEditor()) { if (const Core::IDocument *document= editor->document()) { - const QString fn = document->fileName(); + const QString fn = document->filePath(); const bool isProject = d->m_profileMimeTypes.contains(document->mimeType()); dir = isProject ? fn : QFileInfo(fn).absolutePath(); } @@ -1062,7 +1062,7 @@ void ProjectExplorerPlugin::unloadProject() Core::IDocument *document = d->m_currentProject->document(); - if (!document || document->fileName().isEmpty()) //nothing to save? + if (!document || document->filePath().isEmpty()) //nothing to save? return; QList<Core::IDocument*> documentsToSave; @@ -1076,7 +1076,7 @@ void ProjectExplorerPlugin::unloadProject() if (!success) return; - addToRecentProjects(document->fileName(), d->m_currentProject->displayName()); + addToRecentProjects(document->filePath(), d->m_currentProject->displayName()); unloadProject(d->m_currentProject); } @@ -1159,7 +1159,7 @@ void ProjectExplorerPlugin::updateVariable(const QByteArray &variable) if (Project *project = currentProject()) { projectName = project->displayName(); if (Core::IDocument *doc = project->document()) - projectFilePath = doc->fileName(); + projectFilePath = doc->filePath(); if (Target *target = project->activeTarget()) { kit = target->kit(); if (BuildConfiguration *buildConfiguration = target->activeBuildConfiguration()) { @@ -1356,7 +1356,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName QString canonicalFilePath = fi.canonicalFilePath(); bool found = false; foreach (ProjectExplorer::Project *pi, session()->projects()) { - if (canonicalFilePath == pi->document()->fileName()) { + if (canonicalFilePath == pi->document()->filePath()) { found = true; break; } @@ -1668,7 +1668,7 @@ void ProjectExplorerPlugin::buildStateChanged(Project * pro) { if (debug) { qDebug() << "buildStateChanged"; - qDebug() << pro->document()->fileName() << "isBuilding()" << d->m_buildManager->isBuilding(pro); + qDebug() << pro->document()->filePath() << "isBuilding()" << d->m_buildManager->isBuilding(pro); } Q_UNUSED(pro) updateActions(); @@ -1768,7 +1768,7 @@ void ProjectExplorerPlugin::updateExternalFileWarning() } if (!d->m_currentProject || !infoBar->canInfoBeAdded(externalFileId)) return; - Utils::FileName fileName = Utils::FileName::fromString(document->fileName()); + Utils::FileName fileName = Utils::FileName::fromString(document->filePath()); if (fileName.isEmpty()) return; Utils::FileName projectDir = Utils::FileName::fromString(d->m_currentProject->projectDirectory()); @@ -1955,7 +1955,7 @@ void ProjectExplorerPlugin::updateActions() QStringList ProjectExplorerPlugin::allFilesWithDependencies(Project *pro) { if (debug) - qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->document()->fileName() << ")"; + qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->document()->filePath() << ")"; QStringList filesToSave; foreach (Project *p, d->m_session->projectOrder(pro)) { @@ -2363,7 +2363,7 @@ void ProjectExplorerPlugin::projectRemoved(ProjectExplorer::Project * pro) void ProjectExplorerPlugin::projectDisplayNameChanged(Project *pro) { - addToRecentProjects(pro->document()->fileName(), pro->displayName()); + addToRecentProjects(pro->document()->filePath(), pro->displayName()); updateActions(); } diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index c4a0891769..fb6f925495 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -347,7 +347,7 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project) } m_tabIndexToProject.insert(index, project); - m_tabWidget->insertTab(index, project->displayName(), project->document()->fileName(), subtabs); + m_tabWidget->insertTab(index, project->displayName(), project->document()->filePath(), subtabs); connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), this, SLOT(removedTarget(ProjectExplorer::Target*))); diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 53cb53dd79..aecaedf25b 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -156,7 +156,7 @@ bool SessionManager::recursiveDependencyCheck(const QString &newDep, const QStri QList<Project *> SessionManager::dependencies(const Project *project) const { - const QString &proName = project->document()->fileName(); + const QString &proName = project->document()->filePath(); const QStringList &proDeps = m_depMap.value(proName); QList<Project *> projects; @@ -170,8 +170,8 @@ QList<Project *> SessionManager::dependencies(const Project *project) const bool SessionManager::hasDependency(const Project *project, const Project *depProject) const { - const QString &proName = project->document()->fileName(); - const QString &depName = depProject->document()->fileName(); + const QString &proName = project->document()->filePath(); + const QString &depName = depProject->document()->filePath(); const QStringList &proDeps = m_depMap.value(proName); return proDeps.contains(depName); @@ -179,16 +179,16 @@ bool SessionManager::hasDependency(const Project *project, const Project *depPro bool SessionManager::canAddDependency(const Project *project, const Project *depProject) const { - const QString &newDep = project->document()->fileName(); - const QString &checkDep = depProject->document()->fileName(); + const QString &newDep = project->document()->filePath(); + const QString &checkDep = depProject->document()->filePath(); return recursiveDependencyCheck(newDep, checkDep); } bool SessionManager::addDependency(Project *project, Project *depProject) { - const QString &proName = project->document()->fileName(); - const QString &depName = depProject->document()->fileName(); + const QString &proName = project->document()->filePath(); + const QString &depName = depProject->document()->filePath(); // check if this dependency is valid if (!recursiveDependencyCheck(proName, depName)) @@ -206,8 +206,8 @@ bool SessionManager::addDependency(Project *project, Project *depProject) void SessionManager::removeDependency(Project *project, Project *depProject) { - const QString &proName = project->document()->fileName(); - const QString &depName = depProject->document()->fileName(); + const QString &proName = project->document()->filePath(); + const QString &depName = depProject->document()->filePath(); QStringList proDeps = m_depMap.value(proName); proDeps.removeAll(depName); @@ -304,7 +304,7 @@ bool SessionManager::save() QVariantMap data; // save the startup project if (m_startupProject) - data.insert(QLatin1String("StartupProject"), m_startupProject->document()->fileName()); + data.insert(QLatin1String("StartupProject"), m_startupProject->document()->filePath()); QColor c = Utils::StyleHelper::requestedBaseColor(); if (c.isValid()) { @@ -317,7 +317,7 @@ bool SessionManager::save() QStringList projectFiles; foreach (Project *pro, m_projects) - projectFiles << pro->document()->fileName(); + projectFiles << pro->document()->filePath(); // Restore infromation on projects that failed to load: // don't readd projects to the list, which the user loaded @@ -394,7 +394,7 @@ QStringList SessionManager::dependenciesOrder() const // copy the map to a temporary list foreach (Project *pro, projects()) { - const QString &proName = pro->document()->fileName(); + const QString &proName = pro->document()->filePath(); unordered << QPair<QString, QStringList> (proName, m_depMap.value(proName)); } @@ -427,13 +427,13 @@ QList<Project *> SessionManager::projectOrder(Project *project) const QStringList pros; if (project) - pros = dependencies(project->document()->fileName()); + pros = dependencies(project->document()->filePath()); else pros = dependenciesOrder(); foreach (const QString &proFile, pros) { foreach (Project *pro, projects()) { - if (pro->document()->fileName() == proFile) { + if (pro->document()->filePath() == proFile) { result << pro; break; } @@ -554,7 +554,7 @@ void SessionManager::removeProjects(QList<Project *> remove) QSet<QString> projectFiles; foreach (Project *pro, projects()) { if (!remove.contains(pro)) - projectFiles.insert(pro->document()->fileName()); + projectFiles.insert(pro->document()->filePath()); } QSet<QString>::const_iterator i = projectFiles.begin(); @@ -757,7 +757,7 @@ void SessionManager::restoreStartupProject(const Utils::PersistentSettingsReader const QString startupProject = reader.restoreValue(QLatin1String("StartupProject")).toString(); if (!startupProject.isEmpty()) { foreach (Project *pro, m_projects) { - if (QDir::cleanPath(pro->document()->fileName()) == startupProject) { + if (QDir::cleanPath(pro->document()->filePath()) == startupProject) { setStartupProject(pro); break; } @@ -794,7 +794,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->document()->fileName()); + m_failedProjects.removeAll(p->document()->filePath()); } } diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 923b1ba370..689e4804d6 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -716,7 +716,7 @@ QByteArray SettingsAccessor::creatorId() QString SettingsAccessor::defaultFileName(const QString &suffix) const { - return project()->document()->fileName() + suffix; + return project()->document()->filePath() + suffix; } int SettingsAccessor::currentVersion() const @@ -819,7 +819,7 @@ SettingsAccessor::SettingsData SettingsAccessor::readUserSettings() const SettingsAccessor::SettingsData SettingsAccessor::readSharedSettings() const { SettingsData sharedSettings; - QString fn = project()->document()->fileName() + m_sharedFileAcessor.suffix(); + QString fn = project()->document()->filePath() + m_sharedFileAcessor.suffix(); sharedSettings.m_fileName = Utils::FileName::fromString(fn); if (!m_sharedFileAcessor.readFile(&sharedSettings)) diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index debe862f56..586ffb9540 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -566,7 +566,7 @@ QbsGroupNode *QbsProductNode::findGroupNode(const QString &name) // -------------------------------------------------------------------- QbsProjectNode::QbsProjectNode(QbsProject *project) : - QbsBaseProjectNode(project->document()->fileName()), + QbsBaseProjectNode(project->document()->filePath()), m_project(project), m_qbsProject(0) { ctor(); diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 766e0f8d19..ffc78ce3ee 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -142,7 +142,7 @@ Core::Id QbsProject::id() const Core::IDocument *QbsProject::document() const { foreach (Core::IDocument *doc, m_qbsDocuments) { - if (doc->fileName() == m_fileName) + if (doc->filePath() == m_fileName) return doc; } QTC_ASSERT(false, return 0); @@ -472,7 +472,7 @@ void QbsProject::updateDocuments(const QSet<QString> &files) QTC_ASSERT(!newFiles.isEmpty(), newFiles << m_fileName); QSet<QString> oldFiles; foreach (Core::IDocument *doc, m_qbsDocuments) - oldFiles.insert(doc->fileName()); + oldFiles.insert(doc->filePath()); QSet<QString> filesToAdd = newFiles; filesToAdd.subtract(oldFiles); @@ -481,7 +481,7 @@ void QbsProject::updateDocuments(const QSet<QString> &files) QSet<Core::IDocument *> currentDocuments = m_qbsDocuments; foreach (Core::IDocument *doc, currentDocuments) { - if (filesToRemove.contains(doc->fileName())) { + if (filesToRemove.contains(doc->filePath())) { m_qbsDocuments.remove(doc); delete doc; } diff --git a/src/plugins/qbsprojectmanager/qbsprojectfile.cpp b/src/plugins/qbsprojectmanager/qbsprojectfile.cpp index aa9aad6c64..3bd663ffc4 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectfile.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectfile.cpp @@ -38,7 +38,7 @@ namespace Internal { QbsProjectFile::QbsProjectFile(QbsProject *parent, QString fileName) : Core::IDocument(parent), m_project(parent) { - setFileName(fileName); + setFilePath(fileName); } QbsProjectFile::~QbsProjectFile() diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index de5b91b028..f6ceb1fde4 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -226,7 +226,7 @@ void QbsProjectManagerPlugin::updateBuildActions() QString file; if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) { - file = currentEditor->document()->fileName(); + file = currentEditor->document()->filePath(); ProjectExplorer::SessionManager *session = m_projectExplorer->session(); ProjectExplorer::Node *node = session->nodeForFile(file); ProjectExplorer::Project *project @@ -297,7 +297,7 @@ void QbsProjectManagerPlugin::buildFile() QString file; QbsProject *project = 0; if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) { - file = currentEditor->document()->fileName(); + file = currentEditor->document()->filePath(); project = qobject_cast<QbsProject *>(m_projectExplorer->session()->projectForFile(file)); } @@ -320,7 +320,7 @@ void QbsProjectManagerPlugin::buildProduct() QbsProject *project = 0; QbsProductNode *product = 0; if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) { - const QString file = currentEditor->document()->fileName(); + const QString file = currentEditor->document()->filePath(); ProjectExplorer::SessionManager *session = m_projectExplorer->session(); project = qobject_cast<QbsProject *>(session->projectForFile(file)); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorcrumblebar.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorcrumblebar.cpp index d9e22c9bb9..94f36d0469 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorcrumblebar.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorcrumblebar.cpp @@ -76,7 +76,7 @@ void FormEditorCrumbleBar::pushInFileComponent(const QString &componentId) { CrumbleBarInfo crumbleBarInfo; crumbleBarInfo.componentId = componentId; - crumbleBarInfo.fileName = currentDesignDocument()->textEditor()->document()->fileName(); + crumbleBarInfo.fileName = currentDesignDocument()->textEditor()->document()->filePath(); CrumbleBarInfo lastElementCrumbleBarInfo = crumblePath()->dataForLastIndex().value<CrumbleBarInfo>(); diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index e0eb754fd6..202c0078a9 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -212,7 +212,7 @@ void DesignDocument::updateFileName(const QString & /*oldFileName*/, const QStri QString DesignDocument::fileName() const { - return editor()->document()->fileName(); + return editor()->document()->filePath(); } int DesignDocument::qtVersionId() const diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index b8df512dc7..822fcf08fc 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -488,7 +488,7 @@ void DesignModeWidget::resizeEvent(QResizeEvent *event) void DesignModeWidget::setupNavigatorHistory(Core::IEditor *editor) { if (!m_keepNavigatorHistory) - addNavigatorHistoryEntry(editor->document()->fileName()); + addNavigatorHistoryEntry(editor->document()->filePath()); const bool canGoBack = m_navigatorHistoryCounter > 0; const bool canGoForward = m_navigatorHistoryCounter < (m_navigatorHistory.size() - 1); diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp index 37d98e95d5..9f200d5cc7 100644 --- a/src/plugins/qmldesigner/shortcutmanager.cpp +++ b/src/plugins/qmldesigner/shortcutmanager.cpp @@ -176,8 +176,8 @@ void ShortCutManager::updateActions(Core::IEditor* currentEditor) QString fileName; if (currentEditor) { - if (!currentEditor->document()->fileName().isEmpty()) { - QFileInfo fileInfo(currentEditor->document()->fileName()); + if (!currentEditor->document()->filePath().isEmpty()) { + QFileInfo fileInfo(currentEditor->document()->filePath()); fileName = fileInfo.fileName(); } else { fileName = currentEditor->displayName(); @@ -187,7 +187,7 @@ void ShortCutManager::updateActions(Core::IEditor* currentEditor) m_saveAction.setEnabled(currentEditor != 0 && currentEditor->document()->isModified()); m_saveAsAction.setEnabled(currentEditor != 0 && currentEditor->document()->isSaveAsAllowed()); m_revertToSavedAction.setEnabled(currentEditor != 0 - && !currentEditor->document()->fileName().isEmpty() + && !currentEditor->document()->filePath().isEmpty() && currentEditor->document()->isModified()); QString quotedName; diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index e1cb96f90e..4292812c07 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -607,7 +607,7 @@ void QmlJSTextEditorWidget::reparseDocumentNow() { m_updateDocumentTimer->stop(); - const QString fileName = editorDocument()->fileName(); + const QString fileName = editorDocument()->filePath(); m_modelManager->updateSourceFiles(QStringList() << fileName, false); } @@ -649,7 +649,7 @@ static void appendExtraSelectionsForMessages( void QmlJSTextEditorWidget::onDocumentUpdated(QmlJS::Document::Ptr doc) { - if (editorDocument()->fileName() != doc->fileName()) + if (editorDocument()->filePath() != doc->fileName()) return; if (doc->editorRevision() != editorRevision()) { @@ -681,7 +681,7 @@ void QmlJSTextEditorWidget::onDocumentUpdated(QmlJS::Document::Ptr doc) void QmlJSTextEditorWidget::modificationChanged(bool changed) { if (!changed && m_modelManager) - m_modelManager->fileChangedOnDisk(editorDocument()->fileName()); + m_modelManager->fileChangedOnDisk(editorDocument()->filePath()); } void QmlJSTextEditorWidget::jumpToOutlineElement(int /*index*/) @@ -1152,12 +1152,12 @@ TextEditor::BaseTextEditorWidget::Link QmlJSTextEditorWidget::findLinkAt(const Q void QmlJSTextEditorWidget::findUsages() { - m_findReferences->findUsages(editorDocument()->fileName(), textCursor().position()); + m_findReferences->findUsages(editorDocument()->filePath(), textCursor().position()); } void QmlJSTextEditorWidget::renameUsages() { - m_findReferences->renameUsages(editorDocument()->fileName(), textCursor().position()); + m_findReferences->renameUsages(editorDocument()->filePath(), textCursor().position()); } void QmlJSTextEditorWidget::showContextPane() @@ -1429,7 +1429,7 @@ TextEditor::IAssistInterface *QmlJSTextEditorWidget::createAssistInterface( if (assistKind == TextEditor::Completion) { return new QmlJSCompletionAssistInterface(document(), position(), - editor()->document()->fileName(), + editor()->document()->filePath(), reason, m_semanticInfo); } else if (assistKind == TextEditor::QuickFix) { diff --git a/src/plugins/qmljseditor/qmljsquickfixassist.cpp b/src/plugins/qmljseditor/qmljsquickfixassist.cpp index 28757dafa5..fef38fadd4 100644 --- a/src/plugins/qmljseditor/qmljsquickfixassist.cpp +++ b/src/plugins/qmljseditor/qmljsquickfixassist.cpp @@ -48,7 +48,7 @@ using namespace Internal; QmlJSQuickFixAssistInterface::QmlJSQuickFixAssistInterface(QmlJSTextEditorWidget *editor, TextEditor::AssistReason reason) : DefaultAssistInterface(editor->document(), editor->position(), - editor->editorDocument()->fileName(), reason) + editor->editorDocument()->filePath(), reason) , m_editor(editor) , m_semanticInfo(editor->semanticInfo()) , m_currentFile(QmlJSRefactoringChanges::file(m_editor, m_semanticInfo.document)) diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index 530ca941d5..a93af2bf89 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -330,7 +330,7 @@ ModelManagerInterface::WorkingCopy ModelManager::workingCopy() const return workingCopy; foreach (Core::IEditor *editor, Core::ICore::editorManager()->openedEditors()) { - const QString key = editor->document()->fileName(); + const QString key = editor->document()->filePath(); if (TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor*>(editor)) { if (textEditor->context().contains(ProjectExplorer::Constants::LANG_QMLJS)) { diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 0973750a3c..7afd63adf3 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -157,7 +157,7 @@ void QmlProject::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc) QDir QmlProject::projectDir() const { - return QFileInfo(document()->fileName()).dir(); + return QFileInfo(document()->filePath()).dir(); } QString QmlProject::filesFileName() const diff --git a/src/plugins/qmlprojectmanager/qmlprojectfile.cpp b/src/plugins/qmlprojectmanager/qmlprojectfile.cpp index c85ddddbb4..80347c0316 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectfile.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectfile.cpp @@ -41,7 +41,7 @@ QmlProjectFile::QmlProjectFile(QmlProject *parent, QString fileName) { QTC_CHECK(m_project); QTC_CHECK(!fileName.isEmpty()); - setFileName(fileName); + setFilePath(fileName); } QmlProjectFile::~QmlProjectFile() diff --git a/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp b/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp index 01c43d173e..bbf8165091 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp @@ -41,11 +41,11 @@ namespace QmlProjectManager { namespace Internal { QmlProjectNode::QmlProjectNode(QmlProject *project, Core::IDocument *projectFile) - : ProjectExplorer::ProjectNode(QFileInfo(projectFile->fileName()).absoluteFilePath()), + : ProjectExplorer::ProjectNode(QFileInfo(projectFile->filePath()).absoluteFilePath()), m_project(project), m_projectFile(projectFile) { - setDisplayName(QFileInfo(projectFile->fileName()).completeBaseName()); + setDisplayName(QFileInfo(projectFile->filePath()).completeBaseName()); // make overlay const QSize desiredSize = QSize(16, 16); const QIcon projectBaseIcon(QLatin1String(":/qmlproject/images/qmlfolder.png")); @@ -62,7 +62,7 @@ Core::IDocument *QmlProjectNode::projectFile() const { return m_projectFile; } QString QmlProjectNode::projectFilePath() const -{ return m_projectFile->fileName(); } +{ return m_projectFile->filePath(); } void QmlProjectNode::refresh() { diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index ce8e908125..10b5a2e1e9 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -153,7 +153,7 @@ QString QmlProjectRunConfiguration::viewerArguments() const QString QmlProjectRunConfiguration::workingDirectory() const { - QFileInfo projectFile(target()->project()->document()->fileName()); + QFileInfo projectFile(target()->project()->document()->filePath()); return canonicalCapsPath(projectFile.absolutePath()); } @@ -273,7 +273,7 @@ bool QmlProjectRunConfiguration::fromMap(const QVariantMap &map) void QmlProjectRunConfiguration::changeCurrentFile(Core::IEditor *editor) { if (editor) - m_currentFileFilename = editor->document()->fileName(); + m_currentFileFilename = editor->document()->filePath(); updateEnabled(); } @@ -284,7 +284,7 @@ void QmlProjectRunConfiguration::updateEnabled() Core::IEditor *editor = Core::EditorManager::currentEditor(); Core::MimeDatabase *db = ICore::mimeDatabase(); if (editor) { - m_currentFileFilename = editor->document()->fileName(); + m_currentFileFilename = editor->document()->filePath(); if (db->findByFile(mainScript()).type() == QLatin1String("application/x-qml")) qmlFileFound = true; } diff --git a/src/plugins/qnx/bardescriptordocument.cpp b/src/plugins/qnx/bardescriptordocument.cpp index 6ba4da0566..96fbee73c1 100644 --- a/src/plugins/qnx/bardescriptordocument.cpp +++ b/src/plugins/qnx/bardescriptordocument.cpp @@ -94,7 +94,7 @@ bool BarDescriptorDocument::open(QString *errorString, const QString &fileName) if (read(fileName, &contents, errorString) != Utils::TextFileFormat::ReadSuccess) return false; - setFileName(fileName); + setFilePath(fileName); bool result = loadContent(contents); @@ -109,7 +109,7 @@ bool BarDescriptorDocument::save(QString *errorString, const QString &fn, bool a QTC_ASSERT(!autoSave, return false); QTC_ASSERT(fn.isEmpty(), return false); - bool result = write(fileName(), xmlSource(), errorString); + bool result = write(filePath(), xmlSource(), errorString); if (!result) return false; @@ -120,13 +120,13 @@ bool BarDescriptorDocument::save(QString *errorString, const QString &fn, bool a QString BarDescriptorDocument::defaultPath() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.absolutePath(); } QString BarDescriptorDocument::suggestedFileName() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.fileName(); } @@ -166,13 +166,13 @@ bool BarDescriptorDocument::reload(QString *errorString, Core::IDocument::Reload if (flag == Core::IDocument::FlagIgnore) return true; - return open(errorString, fileName()); + return open(errorString, filePath()); } -void BarDescriptorDocument::setFileName(const QString &newName) +void BarDescriptorDocument::setFilePath(const QString &newName) { m_editorWidget->editor()->setDisplayName(QFileInfo(newName).fileName()); - IDocument::setFileName(newName); + IDocument::setFilePath(newName); } QString BarDescriptorDocument::xmlSource() const diff --git a/src/plugins/qnx/bardescriptordocument.h b/src/plugins/qnx/bardescriptordocument.h index b8fb3a0d08..f34512fdb2 100644 --- a/src/plugins/qnx/bardescriptordocument.h +++ b/src/plugins/qnx/bardescriptordocument.h @@ -69,7 +69,7 @@ public: ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const; bool reload(QString *errorString, ReloadFlag flag, ChangeType type); - void setFileName(const QString &newName); + void setFilePath(const QString &newName); QString xmlSource() const; bool loadContent(const QString &xmlSource, QString *errorMessage = 0, int *errorLine = 0); diff --git a/src/plugins/qnx/bardescriptoreditor.cpp b/src/plugins/qnx/bardescriptoreditor.cpp index a33dab4a31..ab1779a58a 100644 --- a/src/plugins/qnx/bardescriptoreditor.cpp +++ b/src/plugins/qnx/bardescriptoreditor.cpp @@ -163,7 +163,7 @@ void BarDescriptorEditor::setActivePage(BarDescriptorEditor::EditorPage page) QString errorMsg; int errorLine; if (!m_file->loadContent(editorWidget->xmlSource(), &errorMsg, &errorLine)) { - const ProjectExplorer::Task task(ProjectExplorer::Task::Error, errorMsg, Utils::FileName::fromString(m_file->fileName()), + const ProjectExplorer::Task task(ProjectExplorer::Task::Error, errorMsg, Utils::FileName::fromString(m_file->filePath()), errorLine, Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR); taskHub()->addTask(task); taskHub()->requestPopup(); diff --git a/src/plugins/qt4projectmanager/profileeditor.cpp b/src/plugins/qt4projectmanager/profileeditor.cpp index 0ed797d372..e60d48c60e 100644 --- a/src/plugins/qt4projectmanager/profileeditor.cpp +++ b/src/plugins/qt4projectmanager/profileeditor.cpp @@ -161,7 +161,7 @@ ProFileEditorWidget::Link ProFileEditorWidget::findLinkAt(const QTextCursor &cur } } - QDir dir(QFileInfo(editorDocument()->fileName()).absolutePath()); + QDir dir(QFileInfo(editorDocument()->filePath()).absolutePath()); QString fileName = dir.filePath(buffer); QFileInfo fi(fileName); if (fi.exists()) { @@ -220,13 +220,13 @@ ProFileDocument::ProFileDocument() QString ProFileDocument::defaultPath() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.absolutePath(); } QString ProFileDocument::suggestedFileName() const { - QFileInfo fi(fileName()); + QFileInfo fi(filePath()); return fi.fileName(); } diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index c8b677e002..673b7b4f76 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -122,9 +122,9 @@ QString QMakeStep::allArguments(bool shorted) if (bc->subNodeBuild()) arguments << QDir::toNativeSeparators(bc->subNodeBuild()->path()); else if (shorted) - arguments << QDir::toNativeSeparators(QFileInfo(project()->document()->fileName()).fileName()); + arguments << QDir::toNativeSeparators(QFileInfo(project()->document()->filePath()).fileName()); else - arguments << QDir::toNativeSeparators(project()->document()->fileName()); + arguments << QDir::toNativeSeparators(project()->document()->filePath()); arguments << QLatin1String("-r"); bool userProvidedMkspec = false; diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp index 8c728f8723..0faaa9dc0d 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp @@ -188,7 +188,7 @@ NamedWidget *Qt4BuildConfiguration::createConfigWidget() QString Qt4BuildConfiguration::defaultShadowBuildDirectory() const { // todo displayName isn't ideal - return Qt4Project::shadowBuildDirectory(target()->project()->document()->fileName(), + return Qt4Project::shadowBuildDirectory(target()->project()->document()->filePath(), target()->kit(), displayName()); } diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index e8beaceb8d..94de5f5691 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -173,7 +173,7 @@ using namespace Qt4ProjectManager::Internal; Qt4PriFile::Qt4PriFile(Qt4ProjectManager::Qt4PriFileNode *qt4PriFile) : IDocument(qt4PriFile), m_priFile(qt4PriFile) { - setFileName(m_priFile->path()); + setFilePath(m_priFile->path()); } bool Qt4PriFile::save(QString *errorString, const QString &fileName, bool autoSave) diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index bb5c147d04..67dae42f81 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -269,7 +269,7 @@ Qt4ProjectFile::Qt4ProjectFile(const QString &filePath, QObject *parent) : Core::IDocument(parent), m_mimeType(QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)) { - setFileName(filePath); + setFilePath(filePath); } bool Qt4ProjectFile::save(QString *, const QString &, bool) @@ -383,7 +383,7 @@ void Qt4Project::updateFileList() bool Qt4Project::setupTarget(ProjectExplorer::Target *t) { QList<BuildConfigurationInfo> infoList - = Qt4BuildConfigurationFactory::availableBuildConfigurations(t->kit(), m_fileInfo->fileName()); + = Qt4BuildConfigurationFactory::availableBuildConfigurations(t->kit(), m_fileInfo->filePath()); setupTarget(t, infoList); return true; } @@ -423,7 +423,7 @@ bool Qt4Project::fromMap(const QVariantMap &map) m_manager->registerProject(this); - m_rootProjectNode = new Qt4ProFileNode(this, m_fileInfo->fileName(), this); + m_rootProjectNode = new Qt4ProFileNode(this, m_fileInfo->filePath(), this); m_rootProjectNode->registerWatcher(m_nodesWatcher); update(); @@ -901,7 +901,7 @@ bool Qt4Project::supportsKit(Kit *k, QString *errorMessage) const QString Qt4Project::displayName() const { - return QFileInfo(document()->fileName()).completeBaseName(); + return QFileInfo(document()->filePath()).completeBaseName(); } Core::Id Qt4Project::id() const @@ -1022,7 +1022,7 @@ void Qt4Project::destroyProFileReader(QtSupport::ProFileReader *reader) { delete reader; if (!--m_qmakeGlobalsRefCnt) { - QString dir = QFileInfo(m_fileInfo->fileName()).absolutePath(); + QString dir = QFileInfo(m_fileInfo->filePath()).absolutePath(); if (!dir.endsWith(QLatin1Char('/'))) dir += QLatin1Char('/'); QtSupport::ProFileCacheManager::instance()->discardFiles(dir); @@ -1392,7 +1392,7 @@ void Qt4Project::configureAsExampleProject(const QStringList &platforms) continue; QList<BuildConfigurationInfo> infoList - = Qt4BuildConfigurationFactory::availableBuildConfigurations(k, document()->fileName()); + = Qt4BuildConfigurationFactory::availableBuildConfigurations(k, document()->filePath()); if (infoList.isEmpty()) continue; addTarget(createTarget(k, infoList)); diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp index 2140e8f600..fc5bbab665 100644 --- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp @@ -171,7 +171,7 @@ void Qt4ProjectConfigWidget::updateProblemLabel() { m_ui->shadowBuildDirEdit->triggerChanged(); ProjectExplorer::Kit *k = m_buildConfiguration->target()->kit(); - const QString proFileName = m_buildConfiguration->target()->project()->document()->fileName(); + const QString proFileName = m_buildConfiguration->target()->project()->document()->filePath(); // Check for Qt version: QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k); diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index b3d2c3d0d9..a4d2d89c54 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -132,7 +132,7 @@ void Qt4Manager::editorChanged(Core::IEditor *editor) if (m_dirty) { const QString contents = formWindowEditorContents(m_lastEditor); foreach (Qt4Project *project, m_projects) - project->rootQt4ProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->document()->fileName(), contents); + project->rootQt4ProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->document()->filePath(), contents); m_dirty = false; } } @@ -154,7 +154,7 @@ void Qt4Manager::editorAboutToClose(Core::IEditor *editor) if (m_dirty) { const QString contents = formWindowEditorContents(m_lastEditor); foreach (Qt4Project *project, m_projects) - project->rootQt4ProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->document()->fileName(), contents); + project->rootQt4ProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->document()->filePath(), contents); m_dirty = false; } } @@ -226,7 +226,7 @@ void Qt4Manager::addLibrary() ProFileEditorWidget *editor = qobject_cast<ProFileEditorWidget*>(Core::EditorManager::currentEditor()->widget()); if (editor) - addLibrary(editor->editorDocument()->fileName(), editor); + addLibrary(editor->editorDocument()->filePath(), editor); } void Qt4Manager::addLibraryContextMenu() @@ -327,7 +327,7 @@ void Qt4Manager::buildFileContextMenu() void Qt4Manager::buildFile() { if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) { - QString file = currentEditor->document()->fileName(); + QString file = currentEditor->document()->filePath(); ProjectExplorer::SessionManager *session = projectExplorer()->session(); ProjectExplorer::FileNode *node = qobject_cast<FileNode *>(session->nodeForFile(file)); ProjectExplorer::Project *project = session->projectForFile(file); diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index d0c4930761..de08c39edc 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -417,7 +417,7 @@ void Qt4ProjectManagerPlugin::updateBuildFileAction() QString file; if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) { - file = currentEditor->document()->fileName(); + file = currentEditor->document()->filePath(); ProjectExplorer::SessionManager *session = m_projectExplorer->session(); ProjectExplorer::Node *node = session->nodeForFile(file); ProjectExplorer::Project *project = session->projectForFile(file); diff --git a/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp b/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp index eedebc4bf4..d0ceb5fcd4 100644 --- a/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp +++ b/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp @@ -102,7 +102,7 @@ TargetSetupPageWrapper::TargetSetupPageWrapper(ProjectExplorer::Project *project m_targetSetupPage->setRequiredKitMatcher(new QtSupport::QtVersionKitMatcher); m_targetSetupPage->setUseScrollArea(false); m_targetSetupPage->setImportSearch(true); - m_targetSetupPage->setProFilePath(project->document()->fileName()); + m_targetSetupPage->setProFilePath(project->document()->filePath()); m_targetSetupPage->initializePage(); m_targetSetupPage->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); updateNoteText(); diff --git a/src/plugins/resourceeditor/resourceeditorw.cpp b/src/plugins/resourceeditor/resourceeditorw.cpp index f7442cb7b9..e1180d24ec 100644 --- a/src/plugins/resourceeditor/resourceeditorw.cpp +++ b/src/plugins/resourceeditor/resourceeditorw.cpp @@ -65,7 +65,7 @@ ResourceEditorDocument::ResourceEditorDocument(ResourceEditorW *parent) : m_mimeType(QLatin1String(ResourceEditor::Constants::C_RESOURCE_MIMETYPE)), m_parent(parent) { - setFileName(parent->m_resourceEditor->fileName()); + setFilePath(parent->m_resourceEditor->fileName()); if (debugResourceEditorW) qDebug() << "ResourceEditorFile::ResourceEditorFile()"; } @@ -143,7 +143,7 @@ bool ResourceEditorW::createNew(const QString &contents) return false; const bool rc = m_resourceEditor->load(saver.fileName()); - m_resourceDocument->setFileName(QString()); + m_resourceDocument->setFilePath(QString()); m_shouldAutoSave = false; if (debugResourceEditorW) qDebug() << "ResourceEditorW::createNew: " << contents << " (" << saver.fileName() << ") returns " << rc; @@ -169,7 +169,7 @@ bool ResourceEditorW::open(QString *errorString, const QString &fileName, const return false; } - m_resourceDocument->setFileName(fileName); + m_resourceDocument->setFilePath(fileName); m_resourceEditor->setDirty(fileName != realFileName); m_shouldAutoSave = false; m_diskIo = false; @@ -183,7 +183,7 @@ bool ResourceEditorDocument::save(QString *errorString, const QString &name, boo if (debugResourceEditorW) qDebug(">ResourceEditorW::save: %s", qPrintable(name)); - const QString oldFileName = fileName(); + const QString oldFileName = filePath(); const QString actualName = name.isEmpty() ? oldFileName : name; if (actualName.isEmpty()) return false; @@ -205,14 +205,14 @@ bool ResourceEditorDocument::save(QString *errorString, const QString &name, boo return true; } - setFileName(actualName); + setFilePath(actualName); m_parent->m_diskIo = false; emit changed(); return true; } -void ResourceEditorDocument::setFileName(const QString &newName) +void ResourceEditorDocument::setFilePath(const QString &newName) { if (newName != m_parent->m_resourceEditor->fileName()) m_parent->m_resourceEditor->setFileName(newName); @@ -220,7 +220,7 @@ void ResourceEditorDocument::setFileName(const QString &newName) m_parent->setDisplayName(m_parent->tr("untitled")); else m_parent->setDisplayName(QFileInfo(newName).fileName()); - IDocument::setFileName(newName); + IDocument::setFilePath(newName); } Core::Id ResourceEditorW::id() const @@ -256,7 +256,7 @@ bool ResourceEditorDocument::reload(QString *errorString, ReloadFlag flag, Chang emit changed(); } else { emit aboutToReload(); - QString fn = fileName(); + QString fn = filePath(); const bool success = m_parent->open(errorString, fn, fn); emit reloadFinished(success); return success; diff --git a/src/plugins/resourceeditor/resourceeditorw.h b/src/plugins/resourceeditor/resourceeditorw.h index ef174ed5c7..90aa3b9240 100644 --- a/src/plugins/resourceeditor/resourceeditorw.h +++ b/src/plugins/resourceeditor/resourceeditorw.h @@ -62,7 +62,7 @@ public: QString defaultPath() const; QString suggestedFileName() const; QString mimeType() const; - void setFileName(const QString &newName); + void setFilePath(const QString &newName); private: const QString m_mimeType; diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 5d03160596..96b9f8a875 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -458,7 +458,7 @@ bool SubversionPlugin::submitEditorAboutToClose() // Submit editor closing. Make it write out the commit message // and retrieve files - const QFileInfo editorFile(editorDocument->fileName()); + const QFileInfo editorFile(editorDocument->filePath()); const QFileInfo changeFile(m_commitMessageFileName); if (editorFile.absoluteFilePath() != changeFile.absoluteFilePath()) return true; // Oops?! diff --git a/src/plugins/tasklist/taskfile.cpp b/src/plugins/tasklist/taskfile.cpp index f329d3b980..ab20c1119c 100644 --- a/src/plugins/tasklist/taskfile.cpp +++ b/src/plugins/tasklist/taskfile.cpp @@ -95,12 +95,12 @@ bool TaskFile::reload(QString *errorString, ReloadFlag flag, ChangeType type) deleteLater(); return true; } - return open(errorString, fileName()); + return open(errorString, filePath()); } bool TaskFile::open(QString *errorString, const QString &fileName) { - setFileName(fileName); + setFilePath(fileName); return TaskList::TaskListPlugin::instance()->loadFile(errorString, m_context, fileName); } diff --git a/src/plugins/texteditor/basetextdocument.cpp b/src/plugins/texteditor/basetextdocument.cpp index ee85d15753..d1913986b4 100644 --- a/src/plugins/texteditor/basetextdocument.cpp +++ b/src/plugins/texteditor/basetextdocument.cpp @@ -246,7 +246,7 @@ bool BaseTextDocument::save(QString *errorString, const QString &saveFileName, b cursor.endEditBlock(); } - QString fName = fileName(); + QString fName = filePath(); if (!saveFileName.isEmpty()) fName = saveFileName; @@ -289,7 +289,7 @@ bool BaseTextDocument::save(QString *errorString, const QString &saveFileName, b // inform about the new filename const QFileInfo fi(fName); d->m_document->setModified(false); - setFileName(QDir::cleanPath(fi.absoluteFilePath())); + setFilePath(QDir::cleanPath(fi.absoluteFilePath())); emit changed(); return true; } @@ -299,18 +299,18 @@ bool BaseTextDocument::shouldAutoSave() const return d->m_autoSaveRevision != d->m_document->revision(); } -void BaseTextDocument::setFileName(const QString &newName) +void BaseTextDocument::setFilePath(const QString &newName) { - if (newName == fileName()) + if (newName == filePath()) return; const QFileInfo fi(newName); - IDocument::setFileName(QDir::cleanPath(fi.absoluteFilePath())); + IDocument::setFilePath(QDir::cleanPath(fi.absoluteFilePath())); emit titleChanged(fi.fileName()); } bool BaseTextDocument::isFileReadOnly() const { - if (fileName().isEmpty()) //have no corresponding file, so editing is ok + if (filePath().isEmpty()) //have no corresponding file, so editing is ok return false; return d->m_fileIsReadOnly; } @@ -323,8 +323,8 @@ bool BaseTextDocument::isModified() const void BaseTextDocument::checkPermissions() { bool previousReadOnly = d->m_fileIsReadOnly; - if (!fileName().isEmpty()) { - const QFileInfo fi(fileName()); + if (!filePath().isEmpty()) { + const QFileInfo fi(filePath()); d->m_fileIsReadOnly = !fi.isWritable(); } else { d->m_fileIsReadOnly = false; @@ -375,7 +375,7 @@ bool BaseTextDocument::open(QString *errorString, const QString &fileName, const QTC_ASSERT(documentLayout, return true); documentLayout->lastSaveRevision = d->m_autoSaveRevision = d->m_document->revision(); d->m_document->setModified(fileName != realFileName); - setFileName(QDir::cleanPath(fi.absoluteFilePath())); + setFilePath(QDir::cleanPath(fi.absoluteFilePath())); } return readResult == Utils::TextFileFormat::ReadSuccess || readResult == Utils::TextFileFormat::ReadEncodingError; @@ -397,7 +397,7 @@ bool BaseTextDocument::reload(QString *errorString) if (documentLayout) marks = documentLayout->documentClosing(); // removes text marks non-permanently - bool success = open(errorString, fileName(), fileName()); + bool success = open(errorString, filePath(), filePath()); if (documentLayout) documentLayout->documentReloaded(marks); // readds text marks diff --git a/src/plugins/texteditor/basetextdocument.h b/src/plugins/texteditor/basetextdocument.h index 5f374dc2f0..4e9ac14634 100644 --- a/src/plugins/texteditor/basetextdocument.h +++ b/src/plugins/texteditor/basetextdocument.h @@ -84,7 +84,7 @@ public: bool reload(QString *errorString, ReloadFlag flag, ChangeType type); virtual QString mimeType() const; void setMimeType(const QString &mt); - void setFileName(const QString &newName); + void setFilePath(const QString &newName); virtual QString defaultPath() const; virtual QString suggestedFileName() const; diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 7fdb2c9534..f4bae7752e 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -4899,7 +4899,7 @@ bool BaseTextEditorWidget::openLink(const Link &link, bool inNextSplit) Core::EditorManager *editorManager = Core::EditorManager::instance(); if (inNextSplit) { editorManager->gotoOtherSplit(); - } else if (baseTextDocument()->fileName() == link.targetFileName) { + } else if (baseTextDocument()->filePath() == link.targetFileName) { editorManager->addCurrentPositionToNavigationHistory(); gotoLine(link.targetLine, link.targetColumn); setFocus(); @@ -6724,7 +6724,7 @@ IAssistInterface *BaseTextEditorWidget::createAssistInterface(AssistKind kind, AssistReason reason) const { Q_UNUSED(kind); - return new DefaultAssistInterface(document(), position(), d->m_document->fileName(), reason); + return new DefaultAssistInterface(document(), position(), d->m_document->filePath(), reason); } QString TextEditor::BaseTextEditorWidget::foldReplacementText(const QTextBlock &) const diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index 23622a4893..49dc658b1b 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -78,10 +78,10 @@ void BaseTextMarkRegistry::editorOpened(Core::IEditor *editor) ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor); if (!textEditor) return; - if (!m_marks.contains(Utils::FileName::fromString(editor->document()->fileName()))) + if (!m_marks.contains(Utils::FileName::fromString(editor->document()->filePath()))) return; - foreach (BaseTextMark *mark, m_marks.value(Utils::FileName::fromString(editor->document()->fileName()))) { + foreach (BaseTextMark *mark, m_marks.value(Utils::FileName::fromString(editor->document()->filePath()))) { ITextMarkable *markableInterface = textEditor->markableInterface(); markableInterface->addMark(mark); } diff --git a/src/plugins/texteditor/codecselector.cpp b/src/plugins/texteditor/codecselector.cpp index a8fcff2e14..dd4ab7f02e 100644 --- a/src/plugins/texteditor/codecselector.cpp +++ b/src/plugins/texteditor/codecselector.cpp @@ -74,7 +74,7 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc) QString decodingErrorHint; if (m_hasDecodingError) decodingErrorHint = tr("\nThe following encodings are likely to fit:"); - m_label->setText(tr("Select encoding for \"%1\".%2").arg(QFileInfo(doc->fileName()).fileName()).arg(decodingErrorHint)); + m_label->setText(tr("Select encoding for \"%1\".%2").arg(QFileInfo(doc->filePath()).fileName()).arg(decodingErrorHint)); m_listWidget = new CodecListWidget(this); diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index 705fa3fcae..4ca1267794 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -73,23 +73,23 @@ Utils::FileIterator *FindInCurrentFile::files(const QStringList &nameFilters, QVariant FindInCurrentFile::additionalParameters() const { - return qVariantFromValue(m_currentDocument->fileName()); + return qVariantFromValue(m_currentDocument->filePath()); } QString FindInCurrentFile::label() const { - return tr("File '%1':").arg(QFileInfo(m_currentDocument->fileName()).fileName()); + return tr("File '%1':").arg(QFileInfo(m_currentDocument->filePath()).fileName()); } QString FindInCurrentFile::toolTip() const { // %2 is filled by BaseFileFind::runNewSearch - return tr("File path: %1\n%2").arg(QDir::toNativeSeparators(m_currentDocument->fileName())); + return tr("File path: %1\n%2").arg(QDir::toNativeSeparators(m_currentDocument->filePath())); } bool FindInCurrentFile::isEnabled() const { - return m_currentDocument && !m_currentDocument->fileName().isEmpty(); + return m_currentDocument && !m_currentDocument->filePath().isEmpty(); } void FindInCurrentFile::handleFileChange(Core::IEditor *editor) diff --git a/src/plugins/texteditor/itexteditor.cpp b/src/plugins/texteditor/itexteditor.cpp index 75248dd1b3..cb026ae19c 100644 --- a/src/plugins/texteditor/itexteditor.cpp +++ b/src/plugins/texteditor/itexteditor.cpp @@ -45,7 +45,7 @@ QMap<QString, QString> ITextEditor::openedTextEditorsContents() ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor); if (!textEditor) continue; - QString fileName = textEditor->document()->fileName(); + QString fileName = textEditor->document()->filePath(); workingCopy[fileName] = textEditor->textDocument()->contents(); } return workingCopy; @@ -58,7 +58,7 @@ QMap<QString, QTextCodec *> TextEditor::ITextEditor::openedTextEditorsEncodings( ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor); if (!textEditor) continue; - QString fileName = textEditor->document()->fileName(); + QString fileName = textEditor->document()->filePath(); workingCopy[fileName] = textEditor->textCodec(); } return workingCopy; diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 322113738f..f8bec37bdc 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -134,7 +134,7 @@ void PlainTextEditorWidget::configure() { Core::MimeType mimeType; if (editorDocument()) - mimeType = Core::ICore::mimeDatabase()->findByFile(editorDocument()->fileName()); + mimeType = Core::ICore::mimeDatabase()->findByFile(editorDocument()->filePath()); configure(mimeType); } @@ -175,7 +175,7 @@ void PlainTextEditorWidget::configure(const Core::MimeType &mimeType) setCodeFoldingSupported(true); } } else if (editorDocument()) { - const QString &fileName = editorDocument()->fileName(); + const QString &fileName = editorDocument()->filePath(); if (TextEditorSettings::instance()->highlighterSettings().isIgnoredFilePattern(fileName)) m_isMissingSyntaxDefinition = false; } diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index e8b73f582a..99b0312f72 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -171,7 +171,7 @@ RefactoringFile::RefactoringFile(QTextDocument *document, const QString &fileNam { } RefactoringFile::RefactoringFile(BaseTextEditorWidget *editor) - : m_fileName(editor->editorDocument()->fileName()) + : m_fileName(editor->editorDocument()->filePath()) , m_document(0) , m_editor(editor) , m_openEditor(false) diff --git a/src/plugins/todo/todoitemsprovider.cpp b/src/plugins/todo/todoitemsprovider.cpp index b2e985a633..28e691bc7d 100644 --- a/src/plugins/todo/todoitemsprovider.cpp +++ b/src/plugins/todo/todoitemsprovider.cpp @@ -78,7 +78,7 @@ void TodoItemsProvider::updateList() // Show only items of the current file if any if (m_settings.scanningScope == ScanningScopeCurrentFile) { if (m_currentEditor) - m_itemsList = m_itemsHash.value(m_currentEditor->document()->fileName()); + m_itemsList = m_itemsHash.value(m_currentEditor->document()->filePath()); } // Show only items of the startup project if any diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index efaaba214d..38e530c02e 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -908,7 +908,7 @@ void CallgrindToolPrivate::requestContextMenu(TextEditor::ITextEditor *editor, i // find callgrind text mark that corresponds to this editor's file and line number const Function *func = 0; foreach (CallgrindTextMark *textMark, m_textMarks) { - if (textMark->fileName() == editor->document()->fileName() && textMark->lineNumber() == line) { + if (textMark->fileName() == editor->document()->filePath() && textMark->lineNumber() == line) { func = textMark->function(); break; } diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index d88b522950..60df5d6495 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -1253,7 +1253,7 @@ static QTextCodec *findProjectCodec(const QString &dir) const ProjectList::const_iterator pcend = projects.constEnd(); for (ProjectList::const_iterator it = projects.constBegin(); it != pcend; ++it) if (const Core::IDocument *document = (*it)->document()) - if (document->fileName().startsWith(dir)) { + if (document->filePath().startsWith(dir)) { QTextCodec *codec = (*it)->editorConfiguration()->textCodec(); return codec; } @@ -1299,7 +1299,7 @@ int VcsBaseEditorWidget::lineNumberOfCurrentEditor(const QString ¤tFile) return -1; if (!currentFile.isEmpty()) { const Core::IDocument *idocument = ed->document(); - if (!idocument || idocument->fileName() != currentFile) + if (!idocument || idocument->filePath() != currentFile) return -1; } const TextEditor::BaseTextEditor *eda = qobject_cast<const TextEditor::BaseTextEditor *>(ed); diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 2fdb6ae6b0..4620deabbf 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -237,7 +237,7 @@ void StateListener::slotStateChanged() if (!currentEditor || !currentEditor->document()) state.currentFile.clear(); else - state.currentFile = currentEditor->document()->fileName(); + state.currentFile = currentEditor->document()->filePath(); QScopedPointer<QFileInfo> currentFileInfo; // Instantiate QFileInfo only once if required. if (!state.currentFile.isEmpty()) { const bool isTempFile = state.currentFile.startsWith(QDir::tempPath()); @@ -646,7 +646,7 @@ void VcsBasePlugin::createRepository() // Find current starting directory QString directory; if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectExplorerPlugin::currentProject()) - directory = QFileInfo(currentProject->document()->fileName()).absolutePath(); + directory = QFileInfo(currentProject->document()->filePath()).absolutePath(); // Prompt for a directory that is not under version control yet QWidget *mw = Core::ICore::mainWindow(); do { diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index e8c1cfd1d9..7d32ca2f79 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -369,7 +369,7 @@ bool VcsBaseSubmitEditor::open(QString *errorString, const QString &fileName, co if (!createNew(text)) return false; - d->m_file->setFileName(QFileInfo(fileName).absoluteFilePath()); + d->m_file->setFilePath(QFileInfo(fileName).absoluteFilePath()); d->m_file->setModified(fileName != realFileName); return true; } @@ -529,7 +529,7 @@ void VcsBaseSubmitEditor::slotDiffSelectedVcsFiles(const QList<int> &rawList) bool VcsBaseSubmitEditor::save(QString *errorString, const QString &fileName, bool autoSave) { - const QString fName = fileName.isEmpty() ? d->m_file->fileName() : fileName; + const QString fName = fileName.isEmpty() ? d->m_file->filePath() : fileName; Utils::FileSaver saver(fName, QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); saver.write(fileContents()); if (!saver.finalize(errorString)) @@ -537,7 +537,7 @@ bool VcsBaseSubmitEditor::save(QString *errorString, const QString &fileName, bo if (autoSave) return true; const QFileInfo fi(fName); - d->m_file->setFileName(fi.absoluteFilePath()); + d->m_file->setFilePath(fi.absoluteFilePath()); d->m_file->setModified(false); return true; } |