diff options
author | Nikolai Kosjar <[email protected]> | 2019-01-22 15:31:53 +0100 |
---|---|---|
committer | Nikolai Kosjar <[email protected]> | 2019-01-25 14:31:54 +0000 |
commit | 171f3aec26f561a234a1225c16e2d92abee4e6e5 (patch) | |
tree | af2e0f09ac2575070b6f04cc3863cf16abb8d294 /src/plugins/clangtools/clangtoolslogfilereader.cpp | |
parent | 9ec8deb55e8dbb0aae4a044d207f0ff2a363830f (diff) |
ClangTools: Clean up
Remove pointless classes and members.
Change-Id: I0f65934191c9db8b273aff85b70d45d510413cdb
Reviewed-by: Ivan Donchevskii <[email protected]>
Diffstat (limited to 'src/plugins/clangtools/clangtoolslogfilereader.cpp')
-rw-r--r-- | src/plugins/clangtools/clangtoolslogfilereader.cpp | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/src/plugins/clangtools/clangtoolslogfilereader.cpp b/src/plugins/clangtools/clangtoolslogfilereader.cpp index ecf4b8fbec1..d7602a26691 100644 --- a/src/plugins/clangtools/clangtoolslogfilereader.cpp +++ b/src/plugins/clangtools/clangtoolslogfilereader.cpp @@ -43,37 +43,6 @@ namespace ClangTools { namespace Internal { -class ClangSerializedDiagnosticsReader -{ -public: - QList<Diagnostic> read(const QString &filePath, const QString &logFilePath); -}; - -static bool checkFilePath(const QString &filePath, QString *errorMessage) -{ - QFileInfo fi(filePath); - if (!fi.exists() || !fi.isReadable()) { - if (errorMessage) { - *errorMessage - = QString(QT_TRANSLATE_NOOP("LogFileReader", - "File \"%1\" does not exist or is not readable.")) - .arg(filePath); - } - return false; - } - return true; -} - -QList<Diagnostic> LogFileReader::readSerialized(const QString &filePath, const QString &logFilePath, - QString *errorMessage) -{ - if (!checkFilePath(logFilePath, errorMessage)) - return QList<Diagnostic>(); - - ClangSerializedDiagnosticsReader reader; - return reader.read(filePath, logFilePath); -} - static QString fromCXString(CXString &&cxString) { QString result = QString::fromUtf8(clang_getCString(cxString)); @@ -195,8 +164,8 @@ static Diagnostic buildDiagnostic(const CXDiagnostic cxDiagnostic, const QString return diagnostic; } -QList<Diagnostic> ClangSerializedDiagnosticsReader::read(const QString &filePath, - const QString &logFilePath) +static QList<Diagnostic> readSerializedDiagnostics_helper(const QString &filePath, + const QString &logFilePath) { QList<Diagnostic> list; CXLoadDiag_Error error; @@ -228,5 +197,30 @@ QList<Diagnostic> ClangSerializedDiagnosticsReader::read(const QString &filePath return list; } +static bool checkFilePath(const QString &filePath, QString *errorMessage) +{ + QFileInfo fi(filePath); + if (!fi.exists() || !fi.isReadable()) { + if (errorMessage) { + *errorMessage + = QString(QT_TRANSLATE_NOOP("LogFileReader", + "File \"%1\" does not exist or is not readable.")) + .arg(filePath); + } + return false; + } + return true; +} + +QList<Diagnostic> readSerializedDiagnostics(const QString &filePath, + const QString &logFilePath, + QString *errorMessage) +{ + if (!checkFilePath(logFilePath, errorMessage)) + return QList<Diagnostic>(); + + return readSerializedDiagnostics_helper(filePath, logFilePath); +} + } // namespace Internal } // namespace ClangTools |