forked from qt-creator/qt-creator
		
	Fixed QTCREATORBUG-1397.
When adding a new file, refreshing semantic errors in the open editor should have worked. It now also works for removing existing files. Done-with: Christian Kamm
This commit is contained in:
		@@ -254,9 +254,7 @@ void Snapshot::insert(const Document::Ptr &document)
 | 
			
		||||
        const QString fileName = document->fileName();
 | 
			
		||||
        const QString path = document->path();
 | 
			
		||||
 | 
			
		||||
        Document::Ptr old = _documents.value(fileName);
 | 
			
		||||
        if (old)
 | 
			
		||||
            _documentsByPath.remove(path, old);
 | 
			
		||||
        remove(fileName);
 | 
			
		||||
        _documentsByPath.insert(path, document);
 | 
			
		||||
        _documents.insert(fileName, document);
 | 
			
		||||
    }
 | 
			
		||||
@@ -267,6 +265,15 @@ void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info)
 | 
			
		||||
    _libraries.insert(QDir::cleanPath(path), info);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Snapshot::remove(const QString &fileName)
 | 
			
		||||
{
 | 
			
		||||
    Document::Ptr doc = _documents.value(fileName);
 | 
			
		||||
    if (!doc.isNull()) {
 | 
			
		||||
        _documentsByPath.remove(doc->path(), doc);
 | 
			
		||||
        _documents.remove(fileName);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Document::Ptr Snapshot::documentFromSource(const QString &code,
 | 
			
		||||
                                           const QString &fileName) const
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -148,6 +148,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    void insert(const Document::Ptr &document);
 | 
			
		||||
    void insertLibraryInfo(const QString &path, const LibraryInfo &info);
 | 
			
		||||
    void remove(const QString &fileName);
 | 
			
		||||
 | 
			
		||||
    Document::Ptr document(const QString &fileName) const;
 | 
			
		||||
    QList<Document::Ptr> documentsInDirectory(const QString &path) const;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user