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:
@@ -35,8 +35,8 @@ TEST(WidgetLayout, FlowLayoutSpacingGetters)
|
||||
QWidget container;
|
||||
FlowLayout *layout = new FlowLayout(&container, 0, 7, 9);
|
||||
|
||||
EXPECT_EQ(layout->horizontalSpacing(), 7);
|
||||
EXPECT_EQ(layout->verticalSpacing(), 9);
|
||||
EXPECT_EQ(layout->horizontal_spacing(), 7);
|
||||
EXPECT_EQ(layout->vertical_spacing(), 9);
|
||||
}
|
||||
|
||||
TEST(WidgetLayout, FlowLayoutWrapsAndComputesHeightForWidth)
|
||||
@@ -44,8 +44,8 @@ TEST(WidgetLayout, FlowLayoutWrapsAndComputesHeightForWidth)
|
||||
QWidget container;
|
||||
FlowLayout *layout = new FlowLayout(&container, 0, 0, 0);
|
||||
|
||||
const int kButtonCount = 5;
|
||||
for (int i = 0; i < kButtonCount; i++) {
|
||||
const int k_button_count = 5;
|
||||
for (int i = 0; i < k_button_count; i++) {
|
||||
auto *b = new QPushButton(QStringLiteral("Btn"));
|
||||
b->setFixedSize(100, 30);
|
||||
layout->addWidget(b);
|
||||
@@ -61,7 +61,7 @@ TEST(WidgetLayout, FlowLayoutWrapsAndComputesHeightForWidth)
|
||||
|
||||
// Lay out for real and inspect positions
|
||||
layout->setGeometry(QRect(0, 0, 250, 90));
|
||||
ASSERT_EQ(layout->count(), kButtonCount);
|
||||
ASSERT_EQ(layout->count(), k_button_count);
|
||||
|
||||
EXPECT_EQ(layout->itemAt(0)->geometry().topLeft(), QPoint(0, 0));
|
||||
EXPECT_EQ(layout->itemAt(1)->geometry().topLeft(), QPoint(100, 0));
|
||||
@@ -83,10 +83,10 @@ TEST(WidgetLayout, ColumnedGridLayoutArrangesByMaximumColumns)
|
||||
for (int i = 0; i < 7; i++) {
|
||||
auto *b = new QPushButton(QString::number(i));
|
||||
buttons.append(b);
|
||||
layout->Add(b);
|
||||
layout->add(b);
|
||||
}
|
||||
|
||||
EXPECT_EQ(layout->MaximumColumns(), 3);
|
||||
EXPECT_EQ(layout->maximum_columns(), 3);
|
||||
EXPECT_EQ(layout->count(), 7);
|
||||
|
||||
// Widgets are placed row-major with at most three columns
|
||||
@@ -99,8 +99,8 @@ TEST(WidgetLayout, ColumnedGridLayoutArrangesByMaximumColumns)
|
||||
// Nothing beyond the last populated cell
|
||||
EXPECT_EQ(layout->itemAtPosition(2, 1), nullptr);
|
||||
|
||||
layout->SetMaximumColumns(4);
|
||||
EXPECT_EQ(layout->MaximumColumns(), 4);
|
||||
layout->set_maximum_columns(4);
|
||||
EXPECT_EQ(layout->maximum_columns(), 4);
|
||||
}
|
||||
|
||||
TEST(WidgetLayout, ColumnedGridLayoutWithoutColumnLimitStillAdds)
|
||||
@@ -108,12 +108,12 @@ TEST(WidgetLayout, ColumnedGridLayoutWithoutColumnLimitStillAdds)
|
||||
QWidget container;
|
||||
olive::ColumnedGridLayout *layout = new olive::ColumnedGridLayout(&container);
|
||||
|
||||
EXPECT_EQ(layout->MaximumColumns(), 0);
|
||||
EXPECT_EQ(layout->maximum_columns(), 0);
|
||||
|
||||
auto *a = new QPushButton(QStringLiteral("A"));
|
||||
auto *b = new QPushButton(QStringLiteral("B"));
|
||||
layout->Add(a);
|
||||
layout->Add(b);
|
||||
layout->add(a);
|
||||
layout->add(b);
|
||||
|
||||
EXPECT_EQ(layout->count(), 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user