summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/texteditor')
-rw-r--r--src/plugins/texteditor/basetextdocument.cpp20
-rw-r--r--src/plugins/texteditor/basetextdocument.h2
-rw-r--r--src/plugins/texteditor/basetexteditor.cpp4
-rw-r--r--src/plugins/texteditor/basetextmark.cpp4
-rw-r--r--src/plugins/texteditor/codecselector.cpp2
-rw-r--r--src/plugins/texteditor/findincurrentfile.cpp8
-rw-r--r--src/plugins/texteditor/itexteditor.cpp4
-rw-r--r--src/plugins/texteditor/plaintexteditor.cpp4
-rw-r--r--src/plugins/texteditor/refactoringchanges.cpp2
9 files changed, 25 insertions, 25 deletions
diff --git a/src/plugins/texteditor/basetextdocument.cpp b/src/plugins/texteditor/basetextdocument.cpp
index ee85d15753..d1913986b4 100644
--- a/src/plugins/texteditor/basetextdocument.cpp
+++ b/src/plugins/texteditor/basetextdocument.cpp
@@ -246,7 +246,7 @@ bool BaseTextDocument::save(QString *errorString, const QString &saveFileName, b
cursor.endEditBlock();
}
- QString fName = fileName();
+ QString fName = filePath();
if (!saveFileName.isEmpty())
fName = saveFileName;
@@ -289,7 +289,7 @@ bool BaseTextDocument::save(QString *errorString, const QString &saveFileName, b
// inform about the new filename
const QFileInfo fi(fName);
d->m_document->setModified(false);
- setFileName(QDir::cleanPath(fi.absoluteFilePath()));
+ setFilePath(QDir::cleanPath(fi.absoluteFilePath()));
emit changed();
return true;
}
@@ -299,18 +299,18 @@ bool BaseTextDocument::shouldAutoSave() const
return d->m_autoSaveRevision != d->m_document->revision();
}
-void BaseTextDocument::setFileName(const QString &newName)
+void BaseTextDocument::setFilePath(const QString &newName)
{
- if (newName == fileName())
+ if (newName == filePath())
return;
const QFileInfo fi(newName);
- IDocument::setFileName(QDir::cleanPath(fi.absoluteFilePath()));
+ IDocument::setFilePath(QDir::cleanPath(fi.absoluteFilePath()));
emit titleChanged(fi.fileName());
}
bool BaseTextDocument::isFileReadOnly() const
{
- if (fileName().isEmpty()) //have no corresponding file, so editing is ok
+ if (filePath().isEmpty()) //have no corresponding file, so editing is ok
return false;
return d->m_fileIsReadOnly;
}
@@ -323,8 +323,8 @@ bool BaseTextDocument::isModified() const
void BaseTextDocument::checkPermissions()
{
bool previousReadOnly = d->m_fileIsReadOnly;
- if (!fileName().isEmpty()) {
- const QFileInfo fi(fileName());
+ if (!filePath().isEmpty()) {
+ const QFileInfo fi(filePath());
d->m_fileIsReadOnly = !fi.isWritable();
} else {
d->m_fileIsReadOnly = false;
@@ -375,7 +375,7 @@ bool BaseTextDocument::open(QString *errorString, const QString &fileName, const
QTC_ASSERT(documentLayout, return true);
documentLayout->lastSaveRevision = d->m_autoSaveRevision = d->m_document->revision();
d->m_document->setModified(fileName != realFileName);
- setFileName(QDir::cleanPath(fi.absoluteFilePath()));
+ setFilePath(QDir::cleanPath(fi.absoluteFilePath()));
}
return readResult == Utils::TextFileFormat::ReadSuccess
|| readResult == Utils::TextFileFormat::ReadEncodingError;
@@ -397,7 +397,7 @@ bool BaseTextDocument::reload(QString *errorString)
if (documentLayout)
marks = documentLayout->documentClosing(); // removes text marks non-permanently
- bool success = open(errorString, fileName(), fileName());
+ bool success = open(errorString, filePath(), filePath());
if (documentLayout)
documentLayout->documentReloaded(marks); // readds text marks
diff --git a/src/plugins/texteditor/basetextdocument.h b/src/plugins/texteditor/basetextdocument.h
index 5f374dc2f0..4e9ac14634 100644
--- a/src/plugins/texteditor/basetextdocument.h
+++ b/src/plugins/texteditor/basetextdocument.h
@@ -84,7 +84,7 @@ public:
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
virtual QString mimeType() const;
void setMimeType(const QString &mt);
- void setFileName(const QString &newName);
+ void setFilePath(const QString &newName);
virtual QString defaultPath() const;
virtual QString suggestedFileName() const;
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 7fdb2c9534..f4bae7752e 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -4899,7 +4899,7 @@ bool BaseTextEditorWidget::openLink(const Link &link, bool inNextSplit)
Core::EditorManager *editorManager = Core::EditorManager::instance();
if (inNextSplit) {
editorManager->gotoOtherSplit();
- } else if (baseTextDocument()->fileName() == link.targetFileName) {
+ } else if (baseTextDocument()->filePath() == link.targetFileName) {
editorManager->addCurrentPositionToNavigationHistory();
gotoLine(link.targetLine, link.targetColumn);
setFocus();
@@ -6724,7 +6724,7 @@ IAssistInterface *BaseTextEditorWidget::createAssistInterface(AssistKind kind,
AssistReason reason) const
{
Q_UNUSED(kind);
- return new DefaultAssistInterface(document(), position(), d->m_document->fileName(), reason);
+ return new DefaultAssistInterface(document(), position(), d->m_document->filePath(), reason);
}
QString TextEditor::BaseTextEditorWidget::foldReplacementText(const QTextBlock &) const
diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp
index 23622a4893..49dc658b1b 100644
--- a/src/plugins/texteditor/basetextmark.cpp
+++ b/src/plugins/texteditor/basetextmark.cpp
@@ -78,10 +78,10 @@ void BaseTextMarkRegistry::editorOpened(Core::IEditor *editor)
ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor);
if (!textEditor)
return;
- if (!m_marks.contains(Utils::FileName::fromString(editor->document()->fileName())))
+ if (!m_marks.contains(Utils::FileName::fromString(editor->document()->filePath())))
return;
- foreach (BaseTextMark *mark, m_marks.value(Utils::FileName::fromString(editor->document()->fileName()))) {
+ foreach (BaseTextMark *mark, m_marks.value(Utils::FileName::fromString(editor->document()->filePath()))) {
ITextMarkable *markableInterface = textEditor->markableInterface();
markableInterface->addMark(mark);
}
diff --git a/src/plugins/texteditor/codecselector.cpp b/src/plugins/texteditor/codecselector.cpp
index a8fcff2e14..dd4ab7f02e 100644
--- a/src/plugins/texteditor/codecselector.cpp
+++ b/src/plugins/texteditor/codecselector.cpp
@@ -74,7 +74,7 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc)
QString decodingErrorHint;
if (m_hasDecodingError)
decodingErrorHint = tr("\nThe following encodings are likely to fit:");
- m_label->setText(tr("Select encoding for \"%1\".%2").arg(QFileInfo(doc->fileName()).fileName()).arg(decodingErrorHint));
+ m_label->setText(tr("Select encoding for \"%1\".%2").arg(QFileInfo(doc->filePath()).fileName()).arg(decodingErrorHint));
m_listWidget = new CodecListWidget(this);
diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp
index 705fa3fcae..4ca1267794 100644
--- a/src/plugins/texteditor/findincurrentfile.cpp
+++ b/src/plugins/texteditor/findincurrentfile.cpp
@@ -73,23 +73,23 @@ Utils::FileIterator *FindInCurrentFile::files(const QStringList &nameFilters,
QVariant FindInCurrentFile::additionalParameters() const
{
- return qVariantFromValue(m_currentDocument->fileName());
+ return qVariantFromValue(m_currentDocument->filePath());
}
QString FindInCurrentFile::label() const
{
- return tr("File '%1':").arg(QFileInfo(m_currentDocument->fileName()).fileName());
+ return tr("File '%1':").arg(QFileInfo(m_currentDocument->filePath()).fileName());
}
QString FindInCurrentFile::toolTip() const
{
// %2 is filled by BaseFileFind::runNewSearch
- return tr("File path: %1\n%2").arg(QDir::toNativeSeparators(m_currentDocument->fileName()));
+ return tr("File path: %1\n%2").arg(QDir::toNativeSeparators(m_currentDocument->filePath()));
}
bool FindInCurrentFile::isEnabled() const
{
- return m_currentDocument && !m_currentDocument->fileName().isEmpty();
+ return m_currentDocument && !m_currentDocument->filePath().isEmpty();
}
void FindInCurrentFile::handleFileChange(Core::IEditor *editor)
diff --git a/src/plugins/texteditor/itexteditor.cpp b/src/plugins/texteditor/itexteditor.cpp
index 75248dd1b3..cb026ae19c 100644
--- a/src/plugins/texteditor/itexteditor.cpp
+++ b/src/plugins/texteditor/itexteditor.cpp
@@ -45,7 +45,7 @@ QMap<QString, QString> ITextEditor::openedTextEditorsContents()
ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor);
if (!textEditor)
continue;
- QString fileName = textEditor->document()->fileName();
+ QString fileName = textEditor->document()->filePath();
workingCopy[fileName] = textEditor->textDocument()->contents();
}
return workingCopy;
@@ -58,7 +58,7 @@ QMap<QString, QTextCodec *> TextEditor::ITextEditor::openedTextEditorsEncodings(
ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor);
if (!textEditor)
continue;
- QString fileName = textEditor->document()->fileName();
+ QString fileName = textEditor->document()->filePath();
workingCopy[fileName] = textEditor->textCodec();
}
return workingCopy;
diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp
index 322113738f..f8bec37bdc 100644
--- a/src/plugins/texteditor/plaintexteditor.cpp
+++ b/src/plugins/texteditor/plaintexteditor.cpp
@@ -134,7 +134,7 @@ void PlainTextEditorWidget::configure()
{
Core::MimeType mimeType;
if (editorDocument())
- mimeType = Core::ICore::mimeDatabase()->findByFile(editorDocument()->fileName());
+ mimeType = Core::ICore::mimeDatabase()->findByFile(editorDocument()->filePath());
configure(mimeType);
}
@@ -175,7 +175,7 @@ void PlainTextEditorWidget::configure(const Core::MimeType &mimeType)
setCodeFoldingSupported(true);
}
} else if (editorDocument()) {
- const QString &fileName = editorDocument()->fileName();
+ const QString &fileName = editorDocument()->filePath();
if (TextEditorSettings::instance()->highlighterSettings().isIgnoredFilePattern(fileName))
m_isMissingSyntaxDefinition = false;
}
diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp
index e8b73f582a..99b0312f72 100644
--- a/src/plugins/texteditor/refactoringchanges.cpp
+++ b/src/plugins/texteditor/refactoringchanges.cpp
@@ -171,7 +171,7 @@ RefactoringFile::RefactoringFile(QTextDocument *document, const QString &fileNam
{ }
RefactoringFile::RefactoringFile(BaseTextEditorWidget *editor)
- : m_fileName(editor->editorDocument()->fileName())
+ : m_fileName(editor->editorDocument()->filePath())
, m_document(0)
, m_editor(editor)
, m_openEditor(false)