style: unify identifier naming per updated conventions

Automated with clang-tidy readability-identifier-naming (config added to
.clang-tidy) plus scripted passes, per the updated rules now documented
in CONTRIBUTING.md:

- types (class/struct/enum/alias/template params): PascalCase
- functions, variables, members: snake_case (incl. rational -> Rational)
- private/protected members: trailing underscore; static member
  variables likewise (instance_, available_themes_)
- constants and enum values: snake_case (kLinear -> k_linear,
  F32P -> f32p); ALL_CAPS reserved for macros
- macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG ->
  OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE,
  include guards -> OAK_*)
- file names: all lowercase (Current/Plugin/OliveHost/OliveClip/
  OlivePluginInstance -> current/plugin/olivehost/oliveclip/
  oliveplugininstance)
- getters share the member name sans underscore, setters set_foo()
- Qt and third-party (OpenFX) virtual overrides and framework callbacks
  keep their original names (exempt in .clang-tidy)

Manual follow-ups required where automation could not reach:
- string-based QMetaObject/SIGNAL/SLOT references updated to renamed
  methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...)
- macro bodies referencing renamed methods (OLIVE_CONFIG,
  NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*)
- self-shadowing locals renamed where signals/methods became same-named
  (size_changed, worker_count, selected_items, import param, filters)
- third_party OFX member/namespace usages restored (OFX::Host::*,
  _created, _clipPrefsDirty, createInstance, clearPersistentMessage)
- STL protocol aliases restored (const_iterator) with .clang-tidy
  ignore rules; qHash overloads restored

Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
2026-07-19 16:10:54 +08:00
parent cb1718a103
commit bb40b4923e
1014 changed files with 44257 additions and 44220 deletions
+26 -26
View File
@@ -11,9 +11,9 @@
namespace
{
QVariant ProxyDialogConfigValue(const char *key)
QVariant proxy_dialog_config_value(const char *key)
{
return olive::Config::Current()[QString::fromUtf8(key)];
return olive::Config::current()[QString::fromUtf8(key)];
}
} // namespace
@@ -23,18 +23,18 @@ TEST(ProxyDialog, ConstructsInGlobalModeWithNullParent)
olive::ProxyDialog dialog(nullptr);
// The global settings editors must reflect the current config values
EXPECT_EQ(dialog.ProxyWidth(),
ProxyDialogConfigValue("ProxyWidth").value<int>());
EXPECT_EQ(dialog.ProxyHeight(),
ProxyDialogConfigValue("ProxyHeight").value<int>());
EXPECT_EQ(dialog.ProxyCRF(),
ProxyDialogConfigValue("ProxyCRF").value<int>());
EXPECT_EQ(dialog.ProxyPreset(),
ProxyDialogConfigValue("ProxyPreset").toString());
EXPECT_EQ(dialog.ProxyIncludeAudio(),
ProxyDialogConfigValue("ProxyIncludeAudio").toBool());
EXPECT_EQ(dialog.FFmpegPath(),
ProxyDialogConfigValue("FFmpegPath").toString());
EXPECT_EQ(dialog.proxy_width(),
proxy_dialog_config_value("ProxyWidth").value<int>());
EXPECT_EQ(dialog.proxy_height(),
proxy_dialog_config_value("ProxyHeight").value<int>());
EXPECT_EQ(dialog.proxy_crf(),
proxy_dialog_config_value("ProxyCRF").value<int>());
EXPECT_EQ(dialog.proxy_preset(),
proxy_dialog_config_value("ProxyPreset").toString());
EXPECT_EQ(dialog.proxy_include_audio(),
proxy_dialog_config_value("ProxyIncludeAudio").toBool());
EXPECT_EQ(dialog.f_fmpeg_path(),
proxy_dialog_config_value("FFmpegPath").toString());
}
TEST(ProxyDialog, ConstructsWithFootageList)
@@ -82,29 +82,29 @@ TEST(ProxyDialog, ConstructsWithFootageList)
TEST(ProxyDialog, AcceptSavesGlobalSettingsToConfig)
{
const int old_width = ProxyDialogConfigValue("ProxyWidth").value<int>();
const int old_width = proxy_dialog_config_value("ProxyWidth").value<int>();
const bool old_include_audio =
ProxyDialogConfigValue("ProxyIncludeAudio").toBool();
proxy_dialog_config_value("ProxyIncludeAudio").toBool();
const QString old_ffmpeg_path =
ProxyDialogConfigValue("FFmpegPath").toString();
proxy_dialog_config_value("FFmpegPath").toString();
{
olive::ProxyDialog dialog(nullptr);
dialog.SetProxyWidth(640);
dialog.SetProxyIncludeAudio(!old_include_audio);
dialog.SetFFmpegPath(QStringLiteral("/tmp/oak-test-ffmpeg"));
dialog.set_proxy_width(640);
dialog.set_proxy_include_audio(!old_include_audio);
dialog.set_f_fmpeg_path(QStringLiteral("/tmp/oak-test-ffmpeg"));
dialog.accept();
}
EXPECT_EQ(ProxyDialogConfigValue("ProxyWidth").value<int>(), 640);
EXPECT_EQ(ProxyDialogConfigValue("ProxyIncludeAudio").toBool(),
EXPECT_EQ(proxy_dialog_config_value("ProxyWidth").value<int>(), 640);
EXPECT_EQ(proxy_dialog_config_value("ProxyIncludeAudio").toBool(),
!old_include_audio);
EXPECT_EQ(ProxyDialogConfigValue("FFmpegPath").toString(),
EXPECT_EQ(proxy_dialog_config_value("FFmpegPath").toString(),
QStringLiteral("/tmp/oak-test-ffmpeg"));
// Restore previous config values so other tests are unaffected
olive::Config::Current()[QStringLiteral("ProxyWidth")] = old_width;
olive::Config::Current()[QStringLiteral("ProxyIncludeAudio")] =
olive::Config::current()[QStringLiteral("ProxyWidth")] = old_width;
olive::Config::current()[QStringLiteral("ProxyIncludeAudio")] =
old_include_audio;
olive::Config::Current()[QStringLiteral("FFmpegPath")] = old_ffmpeg_path;
olive::Config::current()[QStringLiteral("FFmpegPath")] = old_ffmpeg_path;
}