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:
Eike Ziller
2012-02-14 12:10:29 +01:00
parent d7b0ceac8a
commit f916d38dce
35 changed files with 36 additions and 238 deletions

View File

@@ -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;