Move IEditor::isTemporary to IDocument

It's a property of the document implementation, not of the specific
editor instance working on it.

Change-Id: I5c3dd054e21b646e2d94b891916a096d045923f8
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2013-07-12 15:36:29 +02:00
parent 3cde52846e
commit 624d9e2c4c
38 changed files with 58 additions and 89 deletions

View File

@@ -43,7 +43,11 @@
namespace Core {
IDocument::IDocument(QObject *parent) : QObject(parent), m_infoBar(0), m_hasWriteWarning(false), m_restored(false)
IDocument::IDocument(QObject *parent) : QObject(parent),
m_temporary(false),
m_infoBar(0),
m_hasWriteWarning(false),
m_restored(false)
{
}
@@ -78,6 +82,25 @@ bool IDocument::isFileReadOnly() const
return !QFileInfo(filePath()).isWritable();
}
/*!
Returns if the document is a temporary that should for example not be considered
when saving/restoring the session state, recent files, etc. Defaults to false.
\sa setTemporary()
*/
bool IDocument::isTemporary() const
{
return m_temporary;
}
/*!
Sets if the document is \a temporary.
\sa isTemporary()
*/
void IDocument::setTemporary(bool temporary)
{
m_temporary = temporary;
}
bool IDocument::autoSave(QString *errorString, const QString &fileName)
{
if (!save(errorString, fileName, true))