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:
@@ -29,7 +29,7 @@ namespace olive
|
||||
ColorCodingComboBox::ColorCodingComboBox(QWidget *parent)
|
||||
: QComboBox(parent)
|
||||
{
|
||||
SetColor(0);
|
||||
set_color(0);
|
||||
}
|
||||
|
||||
void ColorCodingComboBox::showPopup()
|
||||
@@ -41,14 +41,14 @@ void ColorCodingComboBox::showPopup()
|
||||
QAction *a = menu.exec(parentWidget()->mapToGlobal(pos()));
|
||||
|
||||
if (a) {
|
||||
SetColor(a->data().toInt());
|
||||
set_color(a->data().toInt());
|
||||
}
|
||||
}
|
||||
|
||||
void ColorCodingComboBox::SetColor(int index)
|
||||
void ColorCodingComboBox::set_color(int index)
|
||||
{
|
||||
clear();
|
||||
addItem(ColorCoding::GetColorName(index));
|
||||
addItem(ColorCoding::get_color_name(index));
|
||||
index_ = index;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef COLORCODINGCOMBOBOX_H
|
||||
#define COLORCODINGCOMBOBOX_H
|
||||
#ifndef OAK_COLORCODINGCOMBOBOX_H
|
||||
#define OAK_COLORCODINGCOMBOBOX_H
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
@@ -36,9 +36,9 @@ public:
|
||||
|
||||
virtual void showPopup() override;
|
||||
|
||||
void SetColor(int index);
|
||||
void set_color(int index);
|
||||
|
||||
int GetSelectedColor() const
|
||||
int get_selected_color() const
|
||||
{
|
||||
return index_;
|
||||
}
|
||||
@@ -49,4 +49,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // COLORCODINGCOMBOBOX_H
|
||||
#endif // OAK_COLORCODINGCOMBOBOX_H
|
||||
|
||||
@@ -44,41 +44,41 @@ ColorLabelMenu::ColorLabelMenu(QWidget *parent)
|
||||
QPainter painter(&p);
|
||||
painter.setPen(Qt::black);
|
||||
painter.setBrush(
|
||||
QtUtils::toQColor(ColorCoding::standard_colors().at(i)));
|
||||
QtUtils::to_q_color(ColorCoding::standard_colors().at(i)));
|
||||
painter.drawRect(p.rect().adjusted(0, 0, -1, -1));
|
||||
|
||||
QAction *a = AddItem(QStringLiteral("colorlabel%1").arg(i), this,
|
||||
&ColorLabelMenu::ActionTriggered);
|
||||
QAction *a = add_item(QStringLiteral("colorlabel%1").arg(i), this,
|
||||
&ColorLabelMenu::action_triggered);
|
||||
a->setIcon(p);
|
||||
a->setData(i);
|
||||
color_items_.replace(i, a);
|
||||
}
|
||||
|
||||
Retranslate();
|
||||
retranslate();
|
||||
}
|
||||
|
||||
void ColorLabelMenu::changeEvent(QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::LanguageChange) {
|
||||
Retranslate();
|
||||
retranslate();
|
||||
}
|
||||
|
||||
Menu::changeEvent(event);
|
||||
}
|
||||
|
||||
void ColorLabelMenu::Retranslate()
|
||||
void ColorLabelMenu::retranslate()
|
||||
{
|
||||
this->setTitle(tr("Color"));
|
||||
|
||||
for (int i = 0; i < color_items_.size(); i++) {
|
||||
color_items_.at(i)->setText(ColorCoding::GetColorName(i));
|
||||
color_items_.at(i)->setText(ColorCoding::get_color_name(i));
|
||||
}
|
||||
}
|
||||
|
||||
void ColorLabelMenu::ActionTriggered()
|
||||
void ColorLabelMenu::action_triggered()
|
||||
{
|
||||
QAction *a = static_cast<QAction *>(sender());
|
||||
emit ColorSelected(a->data().toInt());
|
||||
emit color_selected(a->data().toInt());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef COLORLABELMENU_H
|
||||
#define COLORLABELMENU_H
|
||||
#ifndef OAK_COLORLABELMENU_H
|
||||
#define OAK_COLORLABELMENU_H
|
||||
|
||||
#include "widget/menu/menu.h"
|
||||
|
||||
@@ -35,17 +35,17 @@ public:
|
||||
virtual void changeEvent(QEvent *event) override;
|
||||
|
||||
signals:
|
||||
void ColorSelected(int i);
|
||||
void color_selected(int i);
|
||||
|
||||
private:
|
||||
void Retranslate();
|
||||
void retranslate();
|
||||
|
||||
QVector<QAction *> color_items_;
|
||||
|
||||
private slots:
|
||||
void ActionTriggered();
|
||||
void action_triggered();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // COLORLABELMENU_H
|
||||
#endif // OAK_COLORLABELMENU_H
|
||||
|
||||
Reference in New Issue
Block a user