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
+19 -19
View File
@@ -37,27 +37,27 @@ NodeTableView::NodeTableView(QWidget *parent)
tr("A/W") });
}
void NodeTableView::SelectNodes(const QVector<Node *> &nodes)
void NodeTableView::select_nodes(const QVector<Node *> &nodes)
{
foreach (Node *n, nodes) {
QTreeWidgetItem *top_item = new QTreeWidgetItem();
top_item->setText(0, n->GetLabelAndName());
top_item->setText(0, n->get_label_and_name());
top_item->setFirstColumnSpanned(true);
this->addTopLevelItem(top_item);
top_level_item_map_.insert(n, top_item);
}
SetTime(last_time_);
set_time(last_time_);
}
void NodeTableView::DeselectNodes(const QVector<Node *> &nodes)
void NodeTableView::deselect_nodes(const QVector<Node *> &nodes)
{
foreach (Node *n, nodes) {
delete top_level_item_map_.take(n);
}
}
void NodeTableView::SetTime(const rational &time)
void NodeTableView::set_time(const Rational &time)
{
last_time_ = time;
@@ -70,7 +70,7 @@ void NodeTableView::SetTime(const rational &time)
// Generate a value database for this node at this time
NodeValueDatabase db =
traverser.GenerateDatabase(node, TimeRange(time, time));
traverser.generate_database(node, TimeRange(time, time));
// Delete any children of this item that aren't in this database
for (int j = 0; j < item->childCount(); j++) {
@@ -85,7 +85,7 @@ void NodeTableView::SetTime(const rational &time)
for (auto l = db.begin(); l != db.end(); l++) {
const NodeValueTable &table = l.value();
if (!node->HasInputWithID(l.key())) {
if (!node->has_input_with_id(l.key())) {
// Filters out table entries that aren't inputs (like "global")
continue;
}
@@ -103,49 +103,49 @@ void NodeTableView::SetTime(const rational &time)
if (!input_item) {
input_item = new QTreeWidgetItem();
input_item->setText(0, node->GetInputName(l.key()));
input_item->setText(0, node->get_input_name(l.key()));
input_item->setData(0, Qt::UserRole, l.key());
input_item->setFirstColumnSpanned(true);
item->addChild(input_item);
}
// Create children if necessary
while (input_item->childCount() < table.Count()) {
while (input_item->childCount() < table.count()) {
input_item->addChild(new QTreeWidgetItem());
}
// Remove children if necessary
while (input_item->childCount() > table.Count()) {
while (input_item->childCount() > table.count()) {
delete input_item->takeChild(input_item->childCount() - 1);
}
for (int j = 0; j < table.Count(); j++) {
const NodeValue &value = table.at(table.Count() - 1 - j);
for (int j = 0; j < table.count(); j++) {
const NodeValue &value = table.at(table.count() - 1 - j);
// Create item
QTreeWidgetItem *sub_item = input_item->child(j);
// Set data type name
sub_item->setText(
0, NodeValue::GetPrettyDataTypeName(value.type()));
0, NodeValue::get_pretty_data_type_name(value.type()));
// Determine source
QString source_name;
if (value.source()) {
source_name = value.source()->GetLabelAndName();
source_name = value.source()->get_label_and_name();
} else {
source_name = tr("(unknown)");
}
sub_item->setText(1, source_name);
switch (value.type()) {
case NodeValue::kVideoParams:
case NodeValue::kAudioParams:
case NodeValue::k_video_params:
case NodeValue::k_audio_params:
// These types have no string representation
break;
case NodeValue::kTexture: {
case NodeValue::k_texture: {
// NodeTraverser puts video params in here
for (int k = 0; k < VideoParams::kRGBAChannelCount; k++) {
for (int k = 0; k < VideoParams::k_rgba_channel_count; k++) {
this->setItemWidget(sub_item, 2 + k, new QCheckBox());
}
break;
@@ -153,7 +153,7 @@ void NodeTableView::SetTime(const rational &time)
default: {
QVector<QVariant> split_values = value.to_split_value();
for (int k = 0; k < split_values.size(); k++) {
sub_item->setText(2 + k, NodeValue::ValueToString(
sub_item->setText(2 + k, NodeValue::value_to_string(
value.type(),
split_values.at(k), true));
}