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
@@ -34,29 +34,29 @@ namespace olive
NodeParamViewContext::NodeParamViewContext(QWidget *parent)
: super(parent)
, type_(Track::kNone)
, type_(Track::k_none)
{
QWidget *body = new QWidget();
QHBoxLayout *body_layout = new QHBoxLayout(body);
SetBody(body);
set_body(body);
dock_area_ = new NodeParamViewDockArea();
body_layout->addWidget(dock_area_);
setBackgroundRole(QPalette::Base);
Retranslate();
retranslate();
connect(title_bar(), &NodeParamViewItemTitleBar::AddEffectButtonClicked,
this, &NodeParamViewContext::AddEffectButtonClicked);
connect(title_bar(), &NodeParamViewItemTitleBar::add_effect_button_clicked,
this, &NodeParamViewContext::add_effect_button_clicked);
}
NodeParamViewItem *NodeParamViewContext::GetItem(Node *node, Node *ctx)
NodeParamViewItem *NodeParamViewContext::get_item(Node *node, Node *ctx)
{
for (auto it = items_.begin(); it != items_.end(); it++) {
NodeParamViewItem *item = *it;
if (item->GetNode() == node && item->GetContext() == ctx) {
if (item->get_node() == node && item->get_context() == ctx) {
return item;
}
}
@@ -64,20 +64,20 @@ NodeParamViewItem *NodeParamViewContext::GetItem(Node *node, Node *ctx)
return nullptr;
}
void NodeParamViewContext::AddNode(NodeParamViewItem *item)
void NodeParamViewContext::add_node(NodeParamViewItem *item)
{
items_.append(item);
dock_area_->AddItem(item);
dock_area_->add_item(item);
}
void NodeParamViewContext::RemoveNode(Node *node, Node *ctx)
void NodeParamViewContext::remove_node(Node *node, Node *ctx)
{
for (auto it = items_.begin(); it != items_.end();) {
NodeParamViewItem *item = *it;
if (item->GetNode() == node && item->GetContext() == ctx) {
emit AboutToDeleteItem(item);
dock_area_->RemoveItem(item);
if (item->get_node() == node && item->get_context() == ctx) {
emit about_to_delete_item(item);
dock_area_->remove_item(item);
it = items_.erase(it);
} else {
it++;
@@ -85,14 +85,14 @@ void NodeParamViewContext::RemoveNode(Node *node, Node *ctx)
}
}
void NodeParamViewContext::RemoveNodesWithContext(Node *ctx)
void NodeParamViewContext::remove_nodes_with_context(Node *ctx)
{
for (auto it = items_.begin(); it != items_.end();) {
NodeParamViewItem *item = *it;
if (item->GetContext() == ctx) {
emit AboutToDeleteItem(item);
dock_area_->RemoveItem(item);
if (item->get_context() == ctx) {
emit about_to_delete_item(item);
dock_area_->remove_item(item);
it = items_.erase(it);
} else {
it++;
@@ -100,72 +100,72 @@ void NodeParamViewContext::RemoveNodesWithContext(Node *ctx)
}
}
void NodeParamViewContext::SetInputChecked(const NodeInput &input, bool e)
void NodeParamViewContext::set_input_checked(const NodeInput &input, bool e)
{
foreach (NodeParamViewItem *item, items_) {
if (item->GetNode() == input.node()) {
item->SetInputChecked(input, e);
if (item->get_node() == input.node()) {
item->set_input_checked(input, e);
}
}
}
void NodeParamViewContext::SetTimebase(const rational &timebase)
void NodeParamViewContext::set_timebase(const Rational &timebase)
{
foreach (NodeParamViewItem *item, items_) {
item->SetTimebase(timebase);
item->set_timebase(timebase);
}
}
void NodeParamViewContext::SetTimeTarget(ViewerOutput *n)
void NodeParamViewContext::set_time_target(ViewerOutput *n)
{
foreach (NodeParamViewItem *item, items_) {
item->SetTimeTarget(n);
item->set_time_target(n);
}
}
void NodeParamViewContext::SetEffectType(Track::Type type)
void NodeParamViewContext::set_effect_type(Track::Type type)
{
type_ = type;
}
void NodeParamViewContext::Retranslate()
void NodeParamViewContext::retranslate()
{
}
void NodeParamViewContext::AddEffectButtonClicked()
void NodeParamViewContext::add_effect_button_clicked()
{
Node::Flag flag = Node::kNone;
Node::Flag flag = Node::k_none;
if (type_ == Track::kVideo) {
flag = Node::kVideoEffect;
if (type_ == Track::k_video) {
flag = Node::k_video_effect;
} else {
flag = Node::kAudioEffect;
flag = Node::k_audio_effect;
}
if (flag == Node::kNone) {
if (flag == Node::k_none) {
return;
}
Menu *m =
NodeFactory::CreateMenu(this, false, Node::kCategoryUnknown, flag);
NodeFactory::create_menu(this, false, Node::k_category_unknown, flag);
connect(m, &Menu::triggered, this,
&NodeParamViewContext::AddEffectMenuItemTriggered);
&NodeParamViewContext::add_effect_menu_item_triggered);
m->exec(QCursor::pos());
delete m;
}
void NodeParamViewContext::AddEffectMenuItemTriggered(QAction *a)
void NodeParamViewContext::add_effect_menu_item_triggered(QAction *a)
{
Node *n = NodeFactory::CreateFromMenuAction(a);
if (n) {
NodeInput new_node_input = n->GetEffectInput();
NodeInput new_node_input = n->get_effect_input();
MultiUndoCommand *command = new MultiUndoCommand();
QVector<Project *> graphs_added_to;
foreach (Node *ctx, contexts_) {
NodeInput ctx_input = ctx->GetEffectInput();
NodeInput ctx_input = ctx->get_effect_input();
if (!graphs_added_to.contains(ctx->parent())) {
command->add_child(new NodeAddCommand(ctx->parent(), n));
@@ -173,12 +173,12 @@ void NodeParamViewContext::AddEffectMenuItemTriggered(QAction *a)
}
command->add_child(new NodeSetPositionCommand(
n, ctx, ctx->GetNodePositionInContext(ctx)));
n, ctx, ctx->get_node_position_in_context(ctx)));
command->add_child(new NodeSetPositionCommand(
ctx, ctx, ctx->GetNodePositionInContext(ctx) + QPointF(1, 0)));
ctx, ctx, ctx->get_node_position_in_context(ctx) + QPointF(1, 0)));
if (ctx_input.IsConnected()) {
Node *prev_output = ctx_input.GetConnectedOutput();
if (ctx_input.is_connected()) {
Node *prev_output = ctx_input.get_connected_output();
command->add_child(
new NodeEdgeRemoveCommand(prev_output, ctx_input));
@@ -190,7 +190,7 @@ void NodeParamViewContext::AddEffectMenuItemTriggered(QAction *a)
}
Core::instance()->undo_stack()->push(
command, tr("Added %1 to Node Chain").arg(n->Name()));
command, tr("Added %1 to Node Chain").arg(n->name()));
}
}