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:
Eike Ziller
2013-07-04 11:35:56 +02:00
parent 7dd81eca30
commit 99c383f3d0
34 changed files with 123 additions and 326 deletions

View File

@@ -120,8 +120,6 @@ public:
Qt4ProjectFile(const QString &filePath, QObject *parent = 0);
bool save(QString *errorString, const QString &fileName, bool autoSave);
QString fileName() const;
virtual void rename(const QString &newName);
QString defaultPath() const;
QString suggestedFileName() const;
@@ -135,7 +133,6 @@ public:
private:
const QString m_mimeType;
QString m_filePath;
};
/// Watches folders for Qt4PriFile nodes
@@ -270,9 +267,9 @@ void ProjectFilesVisitor::visitFolderNode(FolderNode *folderNode)
namespace Internal {
Qt4ProjectFile::Qt4ProjectFile(const QString &filePath, QObject *parent)
: Core::IDocument(parent),
m_mimeType(QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)),
m_filePath(filePath)
m_mimeType(QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE))
{
setFileName(filePath);
}
bool Qt4ProjectFile::save(QString *, const QString &, bool)
@@ -281,18 +278,6 @@ bool Qt4ProjectFile::save(QString *, const QString &, bool)
return false;
}
void Qt4ProjectFile::rename(const QString &newName)
{
// Can't happen
Q_UNUSED(newName);
Q_ASSERT(false);
}
QString Qt4ProjectFile::fileName() const
{
return m_filePath;
}
QString Qt4ProjectFile::defaultPath() const
{
return QString();