style: reformat C/C++ sources and headers with clang-format

Run clang-format over all project C/C++ source and header files
(.c, .cpp, .cc, .h, .hpp, .hh, .m, .mm) under app/ and tests/.
Non-source files (svg, qm, qrc, etc.) were not touched.
This commit is contained in:
2026-07-13 15:34:11 +08:00
parent 6a696bc234
commit f03b6b58ff
61 changed files with 2873 additions and 2740 deletions
+12 -7
View File
@@ -16,7 +16,9 @@ TEST(CommonFileFunctions, EnsureFilenameExtension)
EXPECT_EQ(olive::FileFunctions::EnsureFilenameExtension(
QStringLiteral("PROJECT"), QStringLiteral("ove")),
QStringLiteral("PROJECT.ove"));
EXPECT_TRUE(olive::FileFunctions::EnsureFilenameExtension(QString(), QStringLiteral("ove")).isEmpty());
EXPECT_TRUE(olive::FileFunctions::EnsureFilenameExtension(
QString(), QStringLiteral("ove"))
.isEmpty());
EXPECT_EQ(olive::FileFunctions::EnsureFilenameExtension(
QStringLiteral("project"), QString()),
QStringLiteral("project"));
@@ -46,7 +48,8 @@ TEST(CommonFileFunctions, DirectoryIsValid)
QTemporaryDir dir;
ASSERT_TRUE(dir.isValid());
EXPECT_TRUE(olive::FileFunctions::DirectoryIsValid(QDir(dir.path()), false));
EXPECT_TRUE(
olive::FileFunctions::DirectoryIsValid(QDir(dir.path()), false));
QDir nonexistent(dir.filePath(QStringLiteral("subdir/nested")));
EXPECT_TRUE(olive::FileFunctions::DirectoryIsValid(nonexistent, true));
@@ -133,7 +136,8 @@ TEST(CommonFileFunctions, ReadFileAsString)
EXPECT_EQ(olive::FileFunctions::ReadFileAsString(f.fileName()),
QStringLiteral("hello world"));
EXPECT_TRUE(olive::FileFunctions::ReadFileAsString(
QStringLiteral("/nonexistent/path")).isEmpty());
QStringLiteral("/nonexistent/path"))
.isEmpty());
}
TEST(CommonFileFunctions, GetUniqueFileIdentifier)
@@ -148,10 +152,10 @@ TEST(CommonFileFunctions, GetUniqueFileIdentifier)
EXPECT_EQ(id1, id2);
EXPECT_TRUE(olive::FileFunctions::GetUniqueFileIdentifier(
QStringLiteral("/nonexistent")).isEmpty());
QStringLiteral("/nonexistent"))
.isEmpty());
}
TEST(CommonFileFunctions, GetConfigurationLocation)
{
QString loc = olive::FileFunctions::GetConfigurationLocation();
@@ -176,7 +180,8 @@ TEST(CommonFileFunctions, DirectoryIsValidExisting)
{
QTemporaryDir dir;
ASSERT_TRUE(dir.isValid());
EXPECT_TRUE(olive::FileFunctions::DirectoryIsValid(QDir(dir.path()), false));
EXPECT_TRUE(
olive::FileFunctions::DirectoryIsValid(QDir(dir.path()), false));
}
TEST(CommonFileFunctions, CopyDirectoryWithOverwrite)
@@ -212,5 +217,5 @@ TEST(CommonFileFunctions, CopyDirectorySourceMissing)
// Should not crash even if source doesn't exist
olive::FileFunctions::CopyDirectory(QStringLiteral("/nonexistent/path"),
dst.path(), false);
dst.path(), false);
}