src: miscellaneous bug fixes for upcoming release

* only randomize parsing order of source files for multithreaded indexing
* fixed overview not displayed when switching projects due to MessageScrollCode being dispatched
* avoid adding duplicate TokenLocations that causes highlighting to break in QtCodeArea
* clear all controllers when switching project
* maximize unindexed file when clicking title instead of activating it
This commit is contained in:
Eberhard Graether
2016-06-09 12:30:00 +02:00
parent 5173400b8d
commit 7e3b2622ec
33 changed files with 210 additions and 90 deletions
+10 -2
View File
@@ -3,8 +3,9 @@
#include "utility/file/FileManager.h"
#include "utility/file/FileSystem.h"
FileRegister::FileRegister(const FileManager* fileManager)
FileRegister::FileRegister(const FileManager* fileManager, bool randomizeParseOrder)
: m_fileManager(fileManager)
, m_randomizeParseOrder(randomizeParseOrder)
{
}
@@ -144,7 +145,14 @@ FilePath FileRegister::consumeSourceFile()
if (paths.size())
{
path = paths[rand() % paths.size()];
if (m_randomizeParseOrder)
{
path = paths[rand() % paths.size()];
}
else
{
path = paths[0];
}
std::lock_guard<std::mutex> lock(m_sourceFileMutex);
m_sourceFilePaths[path] = STATE_PARSING;
+2 -1
View File
@@ -17,7 +17,7 @@ class FileManager;
class FileRegister
{
public:
explicit FileRegister(const FileManager* fileManager);
explicit FileRegister(const FileManager* fileManager, bool randomizeParseOrder);
void setFilePaths(const std::vector<FilePath>& filePaths);
@@ -49,6 +49,7 @@ private:
};
const FileManager* m_fileManager;
bool m_randomizeParseOrder;
mutable std::unordered_map<std::string, bool> m_projectFiles;
mutable std::mutex m_projectFilesMutex;