forked from qt-creator/qt-creator
Make IDocument::fileName a member with setter.
Instead of requiring subclasses to implement a method. Also renames IDocument::rename to IDocument::setFileName, since it doesn't really rename any files or such. Change-Id: I1344025c24d2f74a6a983e04fb0a5245f1f37aad Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -53,11 +53,6 @@ bool TaskFile::save(QString *errorString, const QString &fileName, bool autoSave
|
||||
return false;
|
||||
}
|
||||
|
||||
QString TaskFile::fileName() const
|
||||
{
|
||||
return m_fileName;
|
||||
}
|
||||
|
||||
QString TaskFile::defaultPath() const
|
||||
{
|
||||
return QString();
|
||||
@@ -100,18 +95,13 @@ bool TaskFile::reload(QString *errorString, ReloadFlag flag, ChangeType type)
|
||||
deleteLater();
|
||||
return true;
|
||||
}
|
||||
return open(errorString, m_fileName);
|
||||
}
|
||||
|
||||
void TaskFile::rename(const QString &newName)
|
||||
{
|
||||
Q_UNUSED(newName);
|
||||
return open(errorString, fileName());
|
||||
}
|
||||
|
||||
bool TaskFile::open(QString *errorString, const QString &fileName)
|
||||
{
|
||||
m_fileName = fileName;
|
||||
return TaskList::TaskListPlugin::instance()->loadFile(errorString, m_context, m_fileName);
|
||||
setFileName(fileName);
|
||||
return TaskList::TaskListPlugin::instance()->loadFile(errorString, m_context, fileName);
|
||||
}
|
||||
|
||||
ProjectExplorer::Project *TaskFile::context() const
|
||||
|
||||
@@ -46,7 +46,6 @@ public:
|
||||
~TaskFile();
|
||||
|
||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
||||
QString fileName() const;
|
||||
|
||||
QString defaultPath() const;
|
||||
QString suggestedFileName() const;
|
||||
@@ -57,7 +56,6 @@ public:
|
||||
|
||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
||||
void rename(const QString &newName);
|
||||
|
||||
bool open(QString *errorString, const QString &fileName);
|
||||
|
||||
@@ -65,7 +63,6 @@ public:
|
||||
void setContext(ProjectExplorer::Project *context);
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
ProjectExplorer::Project *m_context;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user