From 55d51a1ee5d0b02f12aad714c2c36926c73cd883 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sun, 4 Dec 2022 17:45:27 -0800 Subject: [PATCH 1/3] config: default to rectified waveforms on --- app/config/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/config.cpp b/app/config/config.cpp index 192fcdb74..82d358a28 100644 --- a/app/config/config.cpp +++ b/app/config/config.cpp @@ -91,7 +91,7 @@ void Config::SetDefaults() SetEntryInternal(QStringLiteral("Autoscroll"), NodeValue::kInt, AutoScroll::kPage); SetEntryInternal(QStringLiteral("AutoSelectDivider"), NodeValue::kBoolean, true); SetEntryInternal(QStringLiteral("SetNameWithMarker"), NodeValue::kBoolean, false); - SetEntryInternal(QStringLiteral("RectifiedWaveforms"), NodeValue::kBoolean, false); + SetEntryInternal(QStringLiteral("RectifiedWaveforms"), NodeValue::kBoolean, true); SetEntryInternal(QStringLiteral("DropWithoutSequenceBehavior"), NodeValue::kInt, ImportTool::kDWSAsk); SetEntryInternal(QStringLiteral("Loop"), NodeValue::kBoolean, false); SetEntryInternal(QStringLiteral("SplitClipsCopyNodes"), NodeValue::kBoolean, true); From b99d1e5797e02e692a8fc7e532ab4730101cf0fd Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sun, 4 Dec 2022 17:47:48 -0800 Subject: [PATCH 2/3] debug: remove function and line Generally we know where our own debug lines are coming from and it ends up causing a really long debug string. --- app/common/debug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common/debug.cpp b/app/common/debug.cpp index c132b48ee..c289c2f7c 100644 --- a/app/common/debug.cpp +++ b/app/common/debug.cpp @@ -45,7 +45,8 @@ void DebugHandler(QtMsgType type, const QMessageLogContext &context, const QStri break; } - fprintf(stderr, "[%s] %s (%s:%u)\n", msg_type, localMsg.constData(), context.function, context.line); + //fprintf(stderr, "[%s] %s (%s:%u)\n", msg_type, localMsg.constData(), context.function, context.line); + fprintf(stderr, "[%s] %s\n", msg_type, localMsg.constData()); #ifdef Q_OS_WINDOWS // Windows still seems to buffer stderr and we want to see debug messages immediately, so here we make sure each line From af76fbf0e189b73663fe2b5d20007fe7c69b6081 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Thu, 8 Dec 2022 11:25:03 -0800 Subject: [PATCH 3/3] folder: revise child exists to find child function --- app/node/project/folder/folder.cpp | 18 ++++++++---------- app/node/project/folder/folder.h | 6 +++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/node/project/folder/folder.cpp b/app/node/project/folder/folder.cpp index 4bcd7cabc..d39c2e9e5 100644 --- a/app/node/project/folder/folder.cpp +++ b/app/node/project/folder/folder.cpp @@ -49,28 +49,26 @@ void Folder::Retranslate() SetInputName(kChildInput, tr("Children")); } -bool ChildExistsWithNameInternal(const Folder* n, const QString& s) +Node *GetChildWithNameInternal(const Folder* n, const QString& s) { for (int i=0; iitem_child_count(); i++) { Node* child = n->item_child(i); if (child->GetLabel() == s) { - return true; - } else { - Folder* subfolder = dynamic_cast(child); - - if (subfolder && ChildExistsWithNameInternal(subfolder, s)) { - return true; + return child; + } else if (Folder* subfolder = dynamic_cast(child)) { + if (Node *n2 = GetChildWithNameInternal(subfolder, s)) { + return n2; } } } - return false; + return nullptr; } -bool Folder::ChildExistsWithName(const QString &s) const +Node *Folder::GetChildWithName(const QString &s) const { - return ChildExistsWithNameInternal(this, s); + return GetChildWithNameInternal(this, s); } bool Folder::HasChildRecursive(Node *child) const diff --git a/app/node/project/folder/folder.h b/app/node/project/folder/folder.h index 22d25f110..2afb0ac1c 100644 --- a/app/node/project/folder/folder.h +++ b/app/node/project/folder/folder.h @@ -63,7 +63,11 @@ public: virtual void Retranslate() override; - bool ChildExistsWithName(const QString& s) const; + Node *GetChildWithName(const QString& s) const; + bool ChildExistsWithName(const QString& s) const + { + return GetChildWithName(s); + } bool HasChildRecursive(Node *child) const;