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:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user