summaryrefslogtreecommitdiffstats
path: root/src/tools/syncqt/main.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <[email protected]>2025-06-03 13:43:30 +0300
committerTarja Sundqvist <[email protected]>2025-06-03 13:43:30 +0300
commit4a6a9dcc73b82cd49a846d5eadadc1835d7b0ec8 (patch)
tree2f027d908308b8ad503b746cd9012fbc98ea32f2 /src/tools/syncqt/main.cpp
parent3fe9e69e4d7510480544f928e8a07f0f110b2181 (diff)
parent5d8e9a8415562ba004b38508d91e1fa0254c17d3 (diff)
Merge tag 'v6.5.6-lts-lgpl' into 6.56.5
Qt 6.5.6-lts-lgpl release
Diffstat (limited to 'src/tools/syncqt/main.cpp')
-rw-r--r--src/tools/syncqt/main.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/tools/syncqt/main.cpp b/src/tools/syncqt/main.cpp
index b9027ef768f..bf901c02a4e 100644
--- a/src/tools/syncqt/main.cpp
+++ b/src/tools/syncqt/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2022 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
/*
* The tool generates deployment artifacts for the Qt builds such as:
@@ -135,17 +135,23 @@ void printInternalError()
<< std::endl;
}
-std::filesystem::path normilizedPath(const std::string &path)
-{
- return std::filesystem::path(std::filesystem::weakly_canonical(path).generic_string());
-}
-
void printFilesystemError(const std::filesystem::filesystem_error &fserr, std::string_view errorMsg)
{
std::cerr << errorMsg << ": " << fserr.path1() << ".\n"
<< fserr.what() << "(" << fserr.code().value() << ")" << std::endl;
}
+std::filesystem::path normilizedPath(const std::string &path)
+{
+ try {
+ auto result = std::filesystem::path(std::filesystem::weakly_canonical(path).generic_string());
+ return result;
+ } catch (const std::filesystem::filesystem_error &fserr) {
+ printFilesystemError(fserr, "Unable to normalize path");
+ throw;
+ }
+}
+
bool createDirectories(const std::string &path, std::string_view errorMsg, bool *exists = nullptr)
{
bool result = true;
@@ -1130,6 +1136,11 @@ public:
std::size_t linesProcessed = 0;
int faults = NoChecks;
+ const auto error = [&] () -> decltype(auto) {
+ return std::cerr << ErrorMessagePreamble << m_currentFileString
+ << ":" << m_currentFileLineNumber << " ";
+ };
+
// Read file line by line
while (std::getline(input, tmpLine)) {
++m_currentFileLineNumber;
@@ -1253,9 +1264,7 @@ public:
.filename()
.generic_string())) {
faults |= PrivateHeaderChecks;
- std::cerr << ErrorMessagePreamble << m_currentFileString
- << ":" << m_currentFileLineNumber
- << " includes private header " << includedHeader << std::endl;
+ error() << "includes private header " << includedHeader << std::endl;
}
for (const auto &module : m_commandLineArgs->knownModules()) {
std::string suggestedHeader = "Qt" + module + '/' + includedHeader;