forked from qt-creator/qt-creator
		
	Cancel code model indexing on project closing and full code model update
Task-Nr: QTCREATORBUG-1151
This commit is contained in:
		@@ -82,6 +82,7 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
 | 
			
		||||
 | 
			
		||||
GenericProject::~GenericProject()
 | 
			
		||||
{
 | 
			
		||||
    m_codeModelFuture.cancel();
 | 
			
		||||
    m_manager->unregisterProject(this);
 | 
			
		||||
 | 
			
		||||
    delete m_rootNode;
 | 
			
		||||
@@ -238,6 +239,8 @@ void GenericProject::refresh(RefreshOptions options)
 | 
			
		||||
        if (options & Configuration) {
 | 
			
		||||
            filesToUpdate = pinfo.sourceFiles;
 | 
			
		||||
            filesToUpdate.append(QLatin1String("<configuration>")); // XXX don't hardcode configuration file name
 | 
			
		||||
            // Full update, if there's a code model update, cancel it
 | 
			
		||||
            m_codeModelFuture.cancel();
 | 
			
		||||
        } else if (options & Files) {
 | 
			
		||||
            // Only update files that got added to the list
 | 
			
		||||
            QSet<QString> newFileList = m_files.toSet();
 | 
			
		||||
@@ -246,7 +249,7 @@ void GenericProject::refresh(RefreshOptions options)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        modelManager->updateProjectInfo(pinfo);
 | 
			
		||||
        modelManager->updateSourceFiles(filesToUpdate);
 | 
			
		||||
        m_codeModelFuture = modelManager->updateSourceFiles(filesToUpdate);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@
 | 
			
		||||
#include <projectexplorer/toolchain.h>
 | 
			
		||||
#include <projectexplorer/buildconfiguration.h>
 | 
			
		||||
#include <coreplugin/ifile.h>
 | 
			
		||||
 | 
			
		||||
#include <QFuture>
 | 
			
		||||
#include <QtGui/QLineEdit>
 | 
			
		||||
 | 
			
		||||
namespace Utils {
 | 
			
		||||
@@ -140,6 +140,7 @@ private:
 | 
			
		||||
    GenericProjectNode *m_rootNode;
 | 
			
		||||
    ProjectExplorer::ToolChain *m_toolChain;
 | 
			
		||||
    ProjectExplorer::ToolChain::ToolChainType m_toolChainType;
 | 
			
		||||
    QFuture<void> m_codeModelFuture;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class GenericProjectFile : public Core::IFile
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user