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:
@@ -53,10 +53,10 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
QDir language_dir(QStringLiteral(":/ts"));
|
||||
QStringList languages = language_dir.entryList();
|
||||
foreach (const QString &l, languages) {
|
||||
AddLanguage(l);
|
||||
add_language(l);
|
||||
}
|
||||
|
||||
QString current_language = OLIVE_CONFIG("Language").toString();
|
||||
QString current_language = OAK_CONFIG("Language").toString();
|
||||
if (current_language.isEmpty()) {
|
||||
// No configured language, use system language
|
||||
current_language = QLocale::system().name();
|
||||
@@ -86,11 +86,11 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
|
||||
// ComboBox indices match enum indices
|
||||
autoscroll_method_ = new QComboBox();
|
||||
autoscroll_method_->addItem(tr("None"), AutoScroll::kNone);
|
||||
autoscroll_method_->addItem(tr("Page Scrolling"), AutoScroll::kPage);
|
||||
autoscroll_method_->addItem(tr("None"), AutoScroll::k_none);
|
||||
autoscroll_method_->addItem(tr("Page Scrolling"), AutoScroll::k_page);
|
||||
autoscroll_method_->addItem(tr("Smooth Scrolling"),
|
||||
AutoScroll::kSmooth);
|
||||
autoscroll_method_->setCurrentIndex(OLIVE_CONFIG("Autoscroll").toInt());
|
||||
AutoScroll::k_smooth);
|
||||
autoscroll_method_->setCurrentIndex(OAK_CONFIG("Autoscroll").toInt());
|
||||
timeline_layout->addWidget(autoscroll_method_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -100,7 +100,7 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
|
||||
rectified_waveforms_ = new QCheckBox();
|
||||
rectified_waveforms_->setChecked(
|
||||
OLIVE_CONFIG("RectifiedWaveforms").toBool());
|
||||
OAK_CONFIG("RectifiedWaveforms").toBool());
|
||||
timeline_layout->addWidget(rectified_waveforms_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -109,11 +109,11 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
new QLabel(tr("Default Still Image Length:")), row, 0);
|
||||
|
||||
default_still_length_ = new RationalSlider();
|
||||
default_still_length_->SetMinimum(rational(100, 1000));
|
||||
default_still_length_->SetTimebase(rational(100, 1000));
|
||||
default_still_length_->SetFormat(tr("%1 seconds"));
|
||||
default_still_length_->SetValue(
|
||||
OLIVE_CONFIG("DefaultStillLength").value<rational>());
|
||||
default_still_length_->set_minimum(Rational(100, 1000));
|
||||
default_still_length_->set_timebase(Rational(100, 1000));
|
||||
default_still_length_->set_format(tr("%1 seconds"));
|
||||
default_still_length_->set_value(
|
||||
OAK_CONFIG("DefaultStillLength").value<Rational>());
|
||||
timeline_layout->addWidget(default_still_length_);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
|
||||
autorecovery_enabled_ = new QCheckBox();
|
||||
autorecovery_enabled_->setChecked(
|
||||
OLIVE_CONFIG("AutorecoveryEnabled").toBool());
|
||||
OAK_CONFIG("AutorecoveryEnabled").toBool());
|
||||
autorecovery_layout->addWidget(autorecovery_enabled_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -139,12 +139,12 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
new QLabel(tr("Auto-Recovery Interval:")), row, 0);
|
||||
|
||||
autorecovery_interval_ = new IntegerSlider();
|
||||
autorecovery_interval_->SetMinimum(1);
|
||||
autorecovery_interval_->SetMaximum(60);
|
||||
autorecovery_interval_->SetFormat(
|
||||
autorecovery_interval_->set_minimum(1);
|
||||
autorecovery_interval_->set_maximum(60);
|
||||
autorecovery_interval_->set_format(
|
||||
QT_TRANSLATE_N_NOOP("olive::SliderBase", "%n minute(s)"), true);
|
||||
autorecovery_interval_->SetValue(
|
||||
OLIVE_CONFIG("AutorecoveryInterval").toLongLong());
|
||||
autorecovery_interval_->set_value(
|
||||
OAK_CONFIG("AutorecoveryInterval").toLongLong());
|
||||
autorecovery_layout->addWidget(autorecovery_interval_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -153,10 +153,10 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
new QLabel(tr("Maximum Versions Per Project:")), row, 0);
|
||||
|
||||
autorecovery_maximum_ = new IntegerSlider();
|
||||
autorecovery_maximum_->SetMinimum(1);
|
||||
autorecovery_maximum_->SetMaximum(1000);
|
||||
autorecovery_maximum_->SetValue(
|
||||
OLIVE_CONFIG("AutorecoveryMaximum").toLongLong());
|
||||
autorecovery_maximum_->set_minimum(1);
|
||||
autorecovery_maximum_->set_maximum(1000);
|
||||
autorecovery_maximum_->set_value(
|
||||
OAK_CONFIG("AutorecoveryMaximum").toLongLong());
|
||||
autorecovery_layout->addWidget(autorecovery_maximum_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -164,50 +164,50 @@ PreferencesGeneralTab::PreferencesGeneralTab()
|
||||
QPushButton *browse_autorecoveries =
|
||||
new QPushButton(tr("Browse Auto-Recoveries"));
|
||||
connect(browse_autorecoveries, &QPushButton::clicked, Core::instance(),
|
||||
&Core::BrowseAutoRecoveries);
|
||||
&Core::browse_auto_recoveries);
|
||||
autorecovery_layout->addWidget(browse_autorecoveries, row, 1);
|
||||
}
|
||||
|
||||
{
|
||||
QGroupBox *behavior_groupbox =
|
||||
new QGroupBox(PreferencesBehaviorTab::BehaviorPrefTr("Behavior"));
|
||||
new QGroupBox(PreferencesBehaviorTab::behavior_pref_tr("Behavior"));
|
||||
QVBoxLayout *behavior_layout = new QVBoxLayout(behavior_groupbox);
|
||||
layout->addWidget(behavior_groupbox);
|
||||
|
||||
hover_focus_ = new QCheckBox(
|
||||
PreferencesBehaviorTab::BehaviorPrefTr("Enable hover focus"));
|
||||
hover_focus_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
|
||||
PreferencesBehaviorTab::behavior_pref_tr("Enable hover focus"));
|
||||
hover_focus_->setToolTip(PreferencesBehaviorTab::behavior_pref_tr(
|
||||
"Panels will be considered focused when the mouse cursor is over them without having to click them."));
|
||||
hover_focus_->setChecked(OLIVE_CONFIG("HoverFocus").toBool());
|
||||
hover_focus_->setChecked(OAK_CONFIG("HoverFocus").toBool());
|
||||
behavior_layout->addWidget(hover_focus_);
|
||||
|
||||
slider_ladder_ = new QCheckBox(
|
||||
PreferencesBehaviorTab::BehaviorPrefTr("Enable slider ladder"));
|
||||
slider_ladder_->setChecked(OLIVE_CONFIG("UseSliderLadders").toBool());
|
||||
PreferencesBehaviorTab::behavior_pref_tr("Enable slider ladder"));
|
||||
slider_ladder_->setChecked(OAK_CONFIG("UseSliderLadders").toBool());
|
||||
behavior_layout->addWidget(slider_ladder_);
|
||||
|
||||
scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr(
|
||||
scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::behavior_pref_tr(
|
||||
"Scrolling zooms by default"));
|
||||
scroll_zooms_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
|
||||
scroll_zooms_->setToolTip(PreferencesBehaviorTab::behavior_pref_tr(
|
||||
"By default, scrolling will move the view around, and holding Ctrl/Cmd will make it zoom instead. "
|
||||
"Enabling this will switch those, scrolling will zoom by default, and holding Ctrl/Cmd will move the view instead."));
|
||||
scroll_zooms_->setChecked(OLIVE_CONFIG("ScrollZooms").toBool());
|
||||
scroll_zooms_->setChecked(OAK_CONFIG("ScrollZooms").toBool());
|
||||
behavior_layout->addWidget(scroll_zooms_);
|
||||
}
|
||||
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
void PreferencesGeneralTab::Accept(MultiUndoCommand *command)
|
||||
void PreferencesGeneralTab::accept(MultiUndoCommand *command)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
|
||||
OLIVE_CONFIG("RectifiedWaveforms") = rectified_waveforms_->isChecked();
|
||||
OAK_CONFIG("RectifiedWaveforms") = rectified_waveforms_->isChecked();
|
||||
|
||||
OLIVE_CONFIG("Autoscroll") = autoscroll_method_->currentData();
|
||||
OAK_CONFIG("Autoscroll") = autoscroll_method_->currentData();
|
||||
|
||||
OLIVE_CONFIG("DefaultStillLength") =
|
||||
QVariant::fromValue(default_still_length_->GetValue());
|
||||
OAK_CONFIG("DefaultStillLength") =
|
||||
QVariant::fromValue(default_still_length_->get_value());
|
||||
|
||||
QString set_language = language_combobox_->currentData().toString();
|
||||
if (QLocale::system().name() == set_language) {
|
||||
@@ -216,26 +216,26 @@ void PreferencesGeneralTab::Accept(MultiUndoCommand *command)
|
||||
}
|
||||
|
||||
// If the language has changed, set it now
|
||||
if (OLIVE_CONFIG("Language").toString() != set_language) {
|
||||
OLIVE_CONFIG("Language") = set_language;
|
||||
Core::instance()->SetLanguage(
|
||||
if (OAK_CONFIG("Language").toString() != set_language) {
|
||||
OAK_CONFIG("Language") = set_language;
|
||||
Core::instance()->set_language(
|
||||
set_language.isEmpty() ? QLocale::system().name() : set_language);
|
||||
}
|
||||
|
||||
OLIVE_CONFIG("AutorecoveryEnabled") = autorecovery_enabled_->isChecked();
|
||||
OLIVE_CONFIG("AutorecoveryInterval") =
|
||||
QVariant::fromValue(autorecovery_interval_->GetValue());
|
||||
OLIVE_CONFIG("AutorecoveryMaximum") =
|
||||
QVariant::fromValue(autorecovery_maximum_->GetValue());
|
||||
Core::instance()->SetAutorecoveryInterval(
|
||||
autorecovery_interval_->GetValue());
|
||||
OAK_CONFIG("AutorecoveryEnabled") = autorecovery_enabled_->isChecked();
|
||||
OAK_CONFIG("AutorecoveryInterval") =
|
||||
QVariant::fromValue(autorecovery_interval_->get_value());
|
||||
OAK_CONFIG("AutorecoveryMaximum") =
|
||||
QVariant::fromValue(autorecovery_maximum_->get_value());
|
||||
Core::instance()->set_autorecovery_interval(
|
||||
autorecovery_interval_->get_value());
|
||||
|
||||
OLIVE_CONFIG("HoverFocus") = hover_focus_->isChecked();
|
||||
OLIVE_CONFIG("UseSliderLadders") = slider_ladder_->isChecked();
|
||||
OLIVE_CONFIG("ScrollZooms") = scroll_zooms_->isChecked();
|
||||
OAK_CONFIG("HoverFocus") = hover_focus_->isChecked();
|
||||
OAK_CONFIG("UseSliderLadders") = slider_ladder_->isChecked();
|
||||
OAK_CONFIG("ScrollZooms") = scroll_zooms_->isChecked();
|
||||
}
|
||||
|
||||
void PreferencesGeneralTab::AddLanguage(const QString &locale_name)
|
||||
void PreferencesGeneralTab::add_language(const QString &locale_name)
|
||||
{
|
||||
language_combobox_->addItem(tr("%1 (%2)").arg(
|
||||
QLocale(locale_name).nativeLanguageName(), locale_name));
|
||||
|
||||
Reference in New Issue
Block a user