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
+31 -33
View File
@@ -18,14 +18,14 @@ TEST(ProxyManager, BuildsStableProxyFilename)
params.version = 1;
const QString first = olive::ProxyManager::GetProxyFilename(
QStringLiteral("/tmp/oak-cache"),
QStringLiteral("/media/source.mov"), 0, params);
QStringLiteral("/tmp/oak-cache"), QStringLiteral("/media/source.mov"),
0, params);
const QString second = olive::ProxyManager::GetProxyFilename(
QStringLiteral("/tmp/oak-cache"),
QStringLiteral("/media/source.mov"), 0, params);
QStringLiteral("/tmp/oak-cache"), QStringLiteral("/media/source.mov"),
0, params);
const QString other_stream = olive::ProxyManager::GetProxyFilename(
QStringLiteral("/tmp/oak-cache"),
QStringLiteral("/media/source.mov"), 1, params);
QStringLiteral("/tmp/oak-cache"), QStringLiteral("/media/source.mov"),
1, params);
EXPECT_EQ(first, second);
EXPECT_NE(first, other_stream);
@@ -48,11 +48,11 @@ TEST(ProxyManager, ProxyFilenameIncludesPresetParameters)
mov_540p.extension = QStringLiteral("mov");
const QString first = olive::ProxyManager::GetProxyFilename(
QStringLiteral("/tmp/oak-cache"),
QStringLiteral("/media/source.mov"), 0, mp4_720p);
QStringLiteral("/tmp/oak-cache"), QStringLiteral("/media/source.mov"),
0, mp4_720p);
const QString second = olive::ProxyManager::GetProxyFilename(
QStringLiteral("/tmp/oak-cache"),
QStringLiteral("/media/source.mov"), 0, mov_540p);
QStringLiteral("/tmp/oak-cache"), QStringLiteral("/media/source.mov"),
0, mov_540p);
EXPECT_NE(first, second);
EXPECT_TRUE(first.contains(QStringLiteral(".1280x720.v1.")));
@@ -117,21 +117,21 @@ TEST(ProxyManager, ConvertsProxyStateToAndFromStrings)
olive::ProxyManager::kProxyFailed),
QStringLiteral("failed"));
EXPECT_EQ(olive::ProxyManager::ProxyStateFromString(
QStringLiteral("missing")),
olive::ProxyManager::kProxyMissing);
EXPECT_EQ(olive::ProxyManager::ProxyStateFromString(
QStringLiteral("generating")),
olive::ProxyManager::kProxyGenerating);
EXPECT_EQ(olive::ProxyManager::ProxyStateFromString(
QStringLiteral("ready")),
olive::ProxyManager::kProxyReady);
EXPECT_EQ(olive::ProxyManager::ProxyStateFromString(
QStringLiteral("failed")),
olive::ProxyManager::kProxyFailed);
EXPECT_EQ(olive::ProxyManager::ProxyStateFromString(
QStringLiteral("unknown")),
olive::ProxyManager::kProxyMissing);
EXPECT_EQ(
olive::ProxyManager::ProxyStateFromString(QStringLiteral("missing")),
olive::ProxyManager::kProxyMissing);
EXPECT_EQ(
olive::ProxyManager::ProxyStateFromString(QStringLiteral("generating")),
olive::ProxyManager::kProxyGenerating);
EXPECT_EQ(
olive::ProxyManager::ProxyStateFromString(QStringLiteral("ready")),
olive::ProxyManager::kProxyReady);
EXPECT_EQ(
olive::ProxyManager::ProxyStateFromString(QStringLiteral("failed")),
olive::ProxyManager::kProxyFailed);
EXPECT_EQ(
olive::ProxyManager::ProxyStateFromString(QStringLiteral("unknown")),
olive::ProxyManager::kProxyMissing);
}
TEST(ProxyManager, FootagePersistsProxyMetadata)
@@ -225,10 +225,10 @@ TEST(ProxyManager, EmitsProxyFinishedState)
received_state = state;
});
emit olive::ProxyManager::instance()->ProxyFinished(
QStringLiteral("/media/source.mov"), 0,
QStringLiteral("/cache/proxy/example.mp4"),
olive::ProxyManager::kProxyFailed);
emit olive::ProxyManager::instance()
-> ProxyFinished(QStringLiteral("/media/source.mov"), 0,
QStringLiteral("/cache/proxy/example.mp4"),
olive::ProxyManager::kProxyFailed);
EXPECT_TRUE(received);
EXPECT_EQ(received_source, QStringLiteral("/media/source.mov"));
@@ -241,10 +241,8 @@ TEST(ProxyManager, EmitsProxyFinishedState)
TEST(ProxyManager, WorkingProxyFilenamePrependsExtension)
{
const QString proxy =
QStringLiteral("/cache/proxy/example.mp4");
const QString working =
olive::ProxyManager::GetWorkingProxyFilename(proxy);
const QString proxy = QStringLiteral("/cache/proxy/example.mp4");
const QString working = olive::ProxyManager::GetWorkingProxyFilename(proxy);
EXPECT_EQ(working, QStringLiteral("/cache/proxy/example.mp4.working.mp4"));
}