forked from qt-creator/qt-creator
		
	DocumentModel: automatically use id from entry's document if that exists
Avoids some manual assignment and is in line with what we do for the file path and display name. Change-Id: I4e98af08b44978493987e63962d26f8595c6990b Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
		@@ -131,7 +131,7 @@ QString DocumentModel::Entry::displayName() const
 | 
			
		||||
 | 
			
		||||
Id DocumentModel::Entry::id() const
 | 
			
		||||
{
 | 
			
		||||
    return m_id;
 | 
			
		||||
    return document ? document->id() : m_id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int DocumentModelPrivate::columnCount(const QModelIndex &parent) const
 | 
			
		||||
@@ -161,7 +161,6 @@ void DocumentModel::addEditor(IEditor *editor, bool *isNewDocument)
 | 
			
		||||
    if (isNew) {
 | 
			
		||||
        Entry *entry = new Entry;
 | 
			
		||||
        entry->document = editor->document();
 | 
			
		||||
        entry->m_id = editor->document()->id();
 | 
			
		||||
        d->addEntry(entry);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user