change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 03:09:40 +08:00
parent 65ab76edc8
commit 74f73ab3be
789 changed files with 77113 additions and 68888 deletions
+23 -19
View File
@@ -22,7 +22,8 @@
#include <QDateTime>
namespace olive {
namespace olive
{
#define super Node
@@ -32,48 +33,51 @@ const QString TimeFormatNode::kLocalTimeInput = QStringLiteral("localtime_in");
TimeFormatNode::TimeFormatNode()
{
AddInput(kTimeInput, NodeValue::kFloat);
AddInput(kFormatInput, NodeValue::kText, QStringLiteral("hh:mm:ss"));
AddInput(kLocalTimeInput, NodeValue::kBoolean);
AddInput(kTimeInput, NodeValue::kFloat);
AddInput(kFormatInput, NodeValue::kText, QStringLiteral("hh:mm:ss"));
AddInput(kLocalTimeInput, NodeValue::kBoolean);
}
QString TimeFormatNode::Name() const
{
return tr("Time Format");
return tr("Time Format");
}
QString TimeFormatNode::id() const
{
return QStringLiteral("org.olivevideoeditor.Olive.timeformat");
return QStringLiteral("org.olivevideoeditor.Olive.timeformat");
}
QVector<Node::CategoryID> TimeFormatNode::Category() const
{
return {kCategoryGenerator};
return { kCategoryGenerator };
}
QString TimeFormatNode::Description() const
{
return tr("Format time (in Unix epoch seconds) into a string.");
return tr("Format time (in Unix epoch seconds) into a string.");
}
void TimeFormatNode::Retranslate()
{
super::Retranslate();
super::Retranslate();
SetInputName(kTimeInput, tr("Time"));
SetInputName(kFormatInput, tr("Format"));
SetInputName(kLocalTimeInput, tr("Interpret time as local time"));
SetInputName(kTimeInput, tr("Time"));
SetInputName(kFormatInput, tr("Format"));
SetInputName(kLocalTimeInput, tr("Interpret time as local time"));
}
void TimeFormatNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
void TimeFormatNode::Value(const NodeValueRow &value,
const NodeGlobals &globals,
NodeValueTable *table) const
{
qint64 ms_since_epoch = value[kTimeInput].toDouble()*1000;
bool time_is_local = value[kLocalTimeInput].toBool();
QDateTime dt = QDateTime::fromMSecsSinceEpoch(ms_since_epoch, time_is_local ? Qt::LocalTime : Qt::UTC);
QString format = value[kFormatInput].toString();
QString output = dt.toString(format);
table->Push(NodeValue(NodeValue::kText, output, this));
qint64 ms_since_epoch = value[kTimeInput].toDouble() * 1000;
bool time_is_local = value[kLocalTimeInput].toBool();
QDateTime dt = QDateTime::fromMSecsSinceEpoch(
ms_since_epoch, time_is_local ? Qt::LocalTime : Qt::UTC);
QString format = value[kFormatInput].toString();
QString output = dt.toString(format);
table->Push(NodeValue(NodeValue::kText, output, this));
}
}
+16 -16
View File
@@ -23,29 +23,29 @@
#include "node/node.h"
namespace olive {
class TimeFormatNode : public Node
namespace olive
{
Q_OBJECT
class TimeFormatNode : public Node {
Q_OBJECT
public:
TimeFormatNode();
TimeFormatNode();
NODE_DEFAULT_FUNCTIONS(TimeFormatNode)
NODE_DEFAULT_FUNCTIONS(TimeFormatNode)
virtual QString Name() const override;
virtual QString id() const override;
virtual QVector<CategoryID> Category() const override;
virtual QString Description() const override;
virtual QString Name() const override;
virtual QString id() const override;
virtual QVector<CategoryID> Category() const override;
virtual QString Description() const override;
virtual void Retranslate() override;
virtual void Retranslate() override;
virtual void Value(const NodeValueRow& value, const NodeGlobals &globals, NodeValueTable *table) const override;
static const QString kTimeInput;
static const QString kFormatInput;
static const QString kLocalTimeInput;
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
NodeValueTable *table) const override;
static const QString kTimeInput;
static const QString kFormatInput;
static const QString kLocalTimeInput;
};
}