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:
+14
-14
@@ -39,11 +39,11 @@ ProxyTask::ProxyTask(const QString &source_filename, int stream_index,
|
||||
, params_(params)
|
||||
, output_filename_(output_filename)
|
||||
{
|
||||
SetTitle(tr("Generating Proxy %1:%2")
|
||||
set_title(tr("Generating Proxy %1:%2")
|
||||
.arg(source_filename_, QString::number(stream_index_)));
|
||||
}
|
||||
|
||||
QStringList ProxyTask::BuildArguments(const QString &source_filename,
|
||||
QStringList ProxyTask::build_arguments(const QString &source_filename,
|
||||
int stream_index,
|
||||
const ProxyManager::ProxyParams ¶ms,
|
||||
const QString &output_filename)
|
||||
@@ -82,12 +82,12 @@ QStringList ProxyTask::BuildArguments(const QString &source_filename,
|
||||
return args;
|
||||
}
|
||||
|
||||
bool ProxyTask::Run()
|
||||
bool ProxyTask::run()
|
||||
{
|
||||
const QString ffmpeg = ProxyManager::FindFFmpegExecutable(
|
||||
OLIVE_CONFIG("FFmpegPath").toString());
|
||||
const QString ffmpeg = ProxyManager::find_f_fmpeg_executable(
|
||||
OAK_CONFIG("FFmpegPath").toString());
|
||||
if (ffmpeg.isEmpty()) {
|
||||
SetError(
|
||||
set_error(
|
||||
tr("Failed to generate proxy: ffmpeg executable was not found. Set "
|
||||
"the ffmpeg path in Preferences > Disk > Proxy Settings."));
|
||||
qWarning() << "ProxyTask: ffmpeg executable not found";
|
||||
@@ -96,7 +96,7 @@ bool ProxyTask::Run()
|
||||
|
||||
QDir output_dir = QFileInfo(output_filename_).dir();
|
||||
if (!output_dir.exists() && !output_dir.mkpath(QStringLiteral("."))) {
|
||||
SetError(tr("Failed to create proxy output directory"));
|
||||
set_error(tr("Failed to create proxy output directory"));
|
||||
qWarning() << "ProxyTask: failed to create output directory"
|
||||
<< output_dir.absolutePath();
|
||||
return false;
|
||||
@@ -108,7 +108,7 @@ bool ProxyTask::Run()
|
||||
|
||||
QFile::remove(output_filename_);
|
||||
|
||||
const QStringList args = BuildArguments(source_filename_, stream_index_,
|
||||
const QStringList args = build_arguments(source_filename_, stream_index_,
|
||||
params_, output_filename_);
|
||||
|
||||
QProcess process;
|
||||
@@ -118,18 +118,18 @@ bool ProxyTask::Run()
|
||||
process.start();
|
||||
|
||||
if (!process.waitForStarted()) {
|
||||
SetError(tr("Failed to start ffmpeg for proxy generation"));
|
||||
set_error(tr("Failed to start ffmpeg for proxy generation"));
|
||||
qWarning()
|
||||
<< "ProxyTask: failed to start ffmpeg" << process.errorString();
|
||||
return false;
|
||||
}
|
||||
|
||||
while (!process.waitForFinished(100)) {
|
||||
if (IsCancelled()) {
|
||||
if (is_cancelled()) {
|
||||
process.kill();
|
||||
process.waitForFinished();
|
||||
QFile::remove(output_filename_);
|
||||
SetError(tr("Proxy generation was cancelled"));
|
||||
set_error(tr("Proxy generation was cancelled"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -138,21 +138,21 @@ bool ProxyTask::Run()
|
||||
process.exitCode() != 0) {
|
||||
const QString output = QString::fromUtf8(process.readAll()).trimmed();
|
||||
QFile::remove(output_filename_);
|
||||
SetError(tr("ffmpeg failed to generate proxy: %1").arg(output));
|
||||
set_error(tr("ffmpeg failed to generate proxy: %1").arg(output));
|
||||
qWarning() << "ProxyTask: ffmpeg failed with exit code"
|
||||
<< process.exitCode() << "output:" << output;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!QFileInfo::exists(output_filename_)) {
|
||||
SetError(tr("ffmpeg finished but proxy file was not created"));
|
||||
set_error(tr("ffmpeg finished but proxy file was not created"));
|
||||
qWarning() << "ProxyTask: ffmpeg finished but output file missing"
|
||||
<< output_filename_;
|
||||
return false;
|
||||
}
|
||||
|
||||
qDebug() << "ProxyTask: proxy generation succeeded:" << output_filename_;
|
||||
emit ProgressChanged(1.0);
|
||||
emit progress_changed(1.0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user