forked from qt-creator/qt-creator
CppEditor: Proliferate use of FilePath a bit
Change-Id: I7e314d73a427bf40c10f3ca6c4c5804e31482f88 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -3,29 +3,32 @@
|
||||
|
||||
#include "cppmodelmanagerbase.h"
|
||||
|
||||
#include <utils/filepath.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace CPlusPlus::CppModelManagerBase {
|
||||
|
||||
static bool (*setExtraDiagnosticsCallback)
|
||||
(const QString &, const QString &, const QList<Document::DiagnosticMessage> &) = nullptr;
|
||||
(const FilePath &, const QString &, const QList<Document::DiagnosticMessage> &) = nullptr;
|
||||
|
||||
static CPlusPlus::Snapshot (*snapshotCallback)() = nullptr;
|
||||
|
||||
|
||||
bool trySetExtraDiagnostics(const QString &fileName, const QString &kind,
|
||||
bool trySetExtraDiagnostics(const FilePath &filePath, const QString &kind,
|
||||
const QList<Document::DiagnosticMessage> &diagnostics)
|
||||
{
|
||||
if (!setExtraDiagnosticsCallback)
|
||||
return false;
|
||||
return setExtraDiagnosticsCallback(fileName, kind, diagnostics);
|
||||
return setExtraDiagnosticsCallback(filePath, kind, diagnostics);
|
||||
}
|
||||
|
||||
bool setExtraDiagnostics(const QString &fileName, const QString &kind,
|
||||
const QList<Document::DiagnosticMessage> &diagnostics)
|
||||
bool setExtraDiagnostics(const FilePath &filePath, const QString &kind,
|
||||
const QList<Document::DiagnosticMessage> &diagnostics)
|
||||
{
|
||||
QTC_ASSERT(setExtraDiagnosticsCallback, return false);
|
||||
return setExtraDiagnosticsCallback(fileName, kind, diagnostics);
|
||||
return setExtraDiagnosticsCallback(filePath, kind, diagnostics);
|
||||
}
|
||||
|
||||
Snapshot snapshot()
|
||||
@@ -42,7 +45,7 @@ bool hasSnapshots()
|
||||
// Installation
|
||||
|
||||
void registerSetExtraDiagnosticsCallback(
|
||||
bool (*callback)(const QString &, const QString &, const QList<Document::DiagnosticMessage> &))
|
||||
bool (*callback)(const FilePath &, const QString &, const QList<Document::DiagnosticMessage> &))
|
||||
{
|
||||
QTC_ASSERT(callback, return);
|
||||
QTC_CHECK(!setExtraDiagnosticsCallback); // bark when used twice
|
||||
|
||||
@@ -5,13 +5,15 @@
|
||||
|
||||
#include <cplusplus/CppDocument.h>
|
||||
|
||||
namespace Utils { class FilePath; }
|
||||
|
||||
namespace CPlusPlus::CppModelManagerBase {
|
||||
|
||||
CPLUSPLUS_EXPORT bool trySetExtraDiagnostics
|
||||
(const QString &, const QString &, const QList<Document::DiagnosticMessage> &);
|
||||
(const Utils::FilePath &filePath, const QString &, const QList<Document::DiagnosticMessage> &);
|
||||
|
||||
CPLUSPLUS_EXPORT bool setSetExtraDiagnostics
|
||||
(const QString &, const QString &, const QList<Document::DiagnosticMessage> &);
|
||||
(const Utils::FilePath &, const QString &, const QList<Document::DiagnosticMessage> &);
|
||||
|
||||
CPLUSPLUS_EXPORT bool hasSnapshots();
|
||||
|
||||
@@ -23,6 +25,6 @@ CPLUSPLUS_EXPORT CPlusPlus::Snapshot snapshot();
|
||||
CPLUSPLUS_EXPORT void registerSnapshotCallback(CPlusPlus::Snapshot (*)(void));
|
||||
|
||||
CPLUSPLUS_EXPORT void registerSetExtraDiagnosticsCallback(
|
||||
bool(*)(const QString &, const QString &, const QList<Document::DiagnosticMessage> &));
|
||||
bool(*)(const Utils::FilePath &, const QString &, const QList<Document::DiagnosticMessage> &));
|
||||
|
||||
} // CPlusPlus::CppModelManagerBase
|
||||
|
||||
Reference in New Issue
Block a user