forked from qt-creator/qt-creator
CompilationDbProjectManager: Sanitize project parsing
The parsing code used to access all kinds of stuff (e.g. the project tree and the toolchain manager) from the non-UI thread, which is not allowed. Fixes: QTCREATORBUG-22420 Change-Id: I4be47919d7e543376d31826dd380f66f4e060458 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -28,7 +28,9 @@
|
||||
#include "compilationdatabaseconstants.h"
|
||||
|
||||
#include <cpptools/cppprojectfile.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QHash>
|
||||
#include <QStringList>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -37,6 +39,23 @@ class Macro;
|
||||
}
|
||||
|
||||
namespace CompilationDatabaseProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class DbEntry {
|
||||
public:
|
||||
QStringList flags;
|
||||
Utils::FileName fileName;
|
||||
QString workingDir;
|
||||
};
|
||||
|
||||
class DbContents {
|
||||
public:
|
||||
std::vector<DbEntry> entries;
|
||||
QString extraFileName;
|
||||
QStringList extras;
|
||||
};
|
||||
|
||||
using MimeBinaryCache = QHash<QString, bool>;
|
||||
|
||||
QStringList filterFromFileName(const QStringList &flags, QString baseName);
|
||||
|
||||
@@ -50,4 +69,5 @@ void filteredFlags(const QString &fileName,
|
||||
|
||||
QStringList splitCommandLine(QString commandLine, QSet<QString> &flagsCache);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CompilationDatabaseProjectManager
|
||||
|
||||
Reference in New Issue
Block a user