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>
This commit is contained in:
Eike Ziller
2013-07-04 13:30:26 +02:00
parent cee1602253
commit dd43d9908f
118 changed files with 326 additions and 326 deletions
+1 -1
View File
@@ -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
@@ -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();
}
@@ -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);
@@ -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)
@@ -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)
{
+1 -1
View File
@@ -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;
}
+11 -11
View File
@@ -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) {
+5 -5
View File
@@ -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);
}
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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());
+1 -1
View File
@@ -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?!
@@ -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();
@@ -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();
}
@@ -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;
}
@@ -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)
@@ -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);
}
@@ -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 {
+14 -14
View File
@@ -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;
}
}
+1 -1
View File
@@ -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);
@@ -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);
@@ -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;
@@ -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 {
@@ -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);
+3 -3
View File
@@ -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())
);
}
+1 -1
View File
@@ -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) {
+12 -12
View File
@@ -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();
}
+5 -5
View File
@@ -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;
+4 -4
View File
@@ -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);
@@ -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;
@@ -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())
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -440,7 +440,7 @@ public:
return new CppTools::Internal::CppCompletionAssistInterface(
document,
position,
editor()->document()->fileName(),
editor()->document()->filePath(),
reason,
modelManager->snapshot(),
includePaths,
@@ -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();
}
+1 -1
View File
@@ -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;
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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?!
+7 -7
View File
@@ -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(),
@@ -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);
}
@@ -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);
}
@@ -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;
+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+3 -3
View File
@@ -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());
}
+7 -7
View File
@@ -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);
}
+1 -1
View File
@@ -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:
@@ -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
+2 -2
View File
@@ -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.
@@ -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)
@@ -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)
@@ -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());
+1 -1
View File
@@ -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();
}
+1 -1
View File
@@ -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())
+1 -1
View File
@@ -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());
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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('/'));
}
}
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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; }
@@ -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);
+1 -1
View File
@@ -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;
@@ -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;
}
@@ -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();
}
@@ -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);
}
@@ -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;
}
}
+1 -1
View File
@@ -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)
@@ -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();
}
@@ -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*)));
+17 -17
View File
@@ -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());
}
}
@@ -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))
+1 -1
View File
@@ -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();
+3 -3
View File
@@ -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;
}
@@ -38,7 +38,7 @@ namespace Internal {
QbsProjectFile::QbsProjectFile(QbsProject *parent, QString fileName) : Core::IDocument(parent),
m_project(parent)
{
setFileName(fileName);
setFilePath(fileName);
}
QbsProjectFile::~QbsProjectFile()
@@ -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));
@@ -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>();
@@ -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
+1 -1
View File
@@ -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);
+3 -3
View File
@@ -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;
+6 -6
View File
@@ -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) {
@@ -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))
+1 -1
View File
@@ -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)) {
+1 -1
View File
@@ -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
@@ -41,7 +41,7 @@ QmlProjectFile::QmlProjectFile(QmlProject *parent, QString fileName)
{
QTC_CHECK(m_project);
QTC_CHECK(!fileName.isEmpty());
setFileName(fileName);
setFilePath(fileName);
}
QmlProjectFile::~QmlProjectFile()
@@ -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()
{
@@ -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;
}
+7 -7
View File
@@ -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
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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();
@@ -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();
}
+2 -2
View File
@@ -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;
@@ -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());
}
+1 -1
View File
@@ -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)
+6 -6
View File
@@ -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));
@@ -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);
@@ -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);
@@ -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);
@@ -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();

Some files were not shown because too many files have changed in this diff Show More