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