forked from qt-creator/qt-creator
Make IFile::isReadOnly consistent.
It is supposed to refer to the property of the file on disk (if there is any). Task-number: QTCREATORBUG-4998 Change-Id: Iaed62c17d124b364aecec4d1f910046bade42d40 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include "vcsbaseeditor.h"
|
||||
#include "diffhighlighter.h"
|
||||
#include "baseannotationhighlighter.h"
|
||||
#include "vcsbasetextdocument.h"
|
||||
#include "vcsbaseconstants.h"
|
||||
#include "vcsbaseoutputwindow.h"
|
||||
#include "vcsbaseplugin.h"
|
||||
@@ -50,6 +49,7 @@
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <texteditor/basetextdocument.h>
|
||||
#include <texteditor/basetextdocumentlayout.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
@@ -663,7 +663,6 @@ VcsBaseEditorWidget::VcsBaseEditorWidget(const VcsBaseEditorParameters *type, QW
|
||||
d(new Internal::VcsBaseEditorWidgetPrivate(this, type))
|
||||
{
|
||||
viewport()->setMouseTracking(true);
|
||||
setBaseTextDocument(new Internal::VcsBaseTextDocument);
|
||||
setMimeType(QLatin1String(d->m_parameters->mimeType));
|
||||
}
|
||||
|
||||
@@ -696,21 +695,12 @@ VcsBaseEditorWidget::~VcsBaseEditorWidget()
|
||||
|
||||
void VcsBaseEditorWidget::setForceReadOnly(bool b)
|
||||
{
|
||||
Internal::VcsBaseTextDocument *vbd = qobject_cast<Internal::VcsBaseTextDocument*>(baseTextDocument());
|
||||
VcsBaseEditor *eda = qobject_cast<VcsBaseEditor *>(editor());
|
||||
QTC_ASSERT(vbd != 0 && eda != 0, return);
|
||||
QTC_ASSERT(eda != 0, return);
|
||||
setReadOnly(b);
|
||||
vbd->setForceReadOnly(b);
|
||||
eda->setTemporary(b);
|
||||
}
|
||||
|
||||
bool VcsBaseEditorWidget::isForceReadOnly() const
|
||||
{
|
||||
const Internal::VcsBaseTextDocument *vbd = qobject_cast<const Internal::VcsBaseTextDocument*>(baseTextDocument());
|
||||
QTC_ASSERT(vbd, return false);
|
||||
return vbd->isForceReadOnly();
|
||||
}
|
||||
|
||||
QString VcsBaseEditorWidget::source() const
|
||||
{
|
||||
return d->m_source;
|
||||
|
||||
Reference in New Issue
Block a user