diff --git a/app/audio/audiovisualwaveform.cpp b/app/audio/audiovisualwaveform.cpp
index c9b2ef50e..58aabc788 100644
--- a/app/audio/audiovisualwaveform.cpp
+++ b/app/audio/audiovisualwaveform.cpp
@@ -25,7 +25,6 @@
#include "config/config.h"
#include "common/cpuoptimize.h"
-#include "common/functiontimer.h"
namespace olive {
diff --git a/app/codec/ffmpeg/ffmpegdecoder.cpp b/app/codec/ffmpeg/ffmpegdecoder.cpp
index 29af60cd6..10d79b2bc 100644
--- a/app/codec/ffmpeg/ffmpegdecoder.cpp
+++ b/app/codec/ffmpeg/ffmpegdecoder.cpp
@@ -43,7 +43,6 @@ extern "C" {
#include "common/define.h"
#include "common/ffmpegutils.h"
#include "common/filefunctions.h"
-#include "common/functiontimer.h"
#include "common/timecodefunctions.h"
#include "render/framehashcache.h"
#include "render/diskmanager.h"
diff --git a/app/common/CMakeLists.txt b/app/common/CMakeLists.txt
index b4bdea348..88d4e5d12 100644
--- a/app/common/CMakeLists.txt
+++ b/app/common/CMakeLists.txt
@@ -34,9 +34,6 @@ set(OLIVE_SOURCES
common/ffmpegutils.h
common/filefunctions.cpp
common/filefunctions.h
- common/flipmodifiers.cpp
- common/flipmodifiers.h
- common/functiontimer.h
common/html.cpp
common/html.h
common/jobtime.cpp
diff --git a/app/common/flipmodifiers.cpp b/app/common/flipmodifiers.cpp
deleted file mode 100644
index ad48704c7..000000000
--- a/app/common/flipmodifiers.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/***
-
- Olive - Non-Linear Video Editor
- Copyright (C) 2022 Olive Team
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-***/
-
-#include "flipmodifiers.h"
-
-namespace olive {
-
-Qt::KeyboardModifiers FlipControlAndShiftModifiers(Qt::KeyboardModifiers e) {
- if (e & Qt::ControlModifier & Qt::ShiftModifier) {
- return e;
- }
-
- if (e & Qt::ShiftModifier) {
- e |= Qt::ControlModifier;
- e &= ~Qt::ShiftModifier;
- } else if (e & Qt::ControlModifier) {
- e |= Qt::ShiftModifier;
- e &= ~Qt::ControlModifier;
- }
-
- return e;
-}
-
-}
diff --git a/app/common/flipmodifiers.h b/app/common/flipmodifiers.h
deleted file mode 100644
index 12b408e39..000000000
--- a/app/common/flipmodifiers.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/***
-
- Olive - Non-Linear Video Editor
- Copyright (C) 2022 Olive Team
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-***/
-
-#ifndef FLIPMODIFIERS_H
-#define FLIPMODIFIERS_H
-
-#include
-
-#include "common/define.h"
-
-namespace olive {
-
-Qt::KeyboardModifiers FlipControlAndShiftModifiers(Qt::KeyboardModifiers e);
-
-}
-
-#endif // FLIPMODIFIERS_H
diff --git a/app/common/functiontimer.h b/app/common/functiontimer.h
deleted file mode 100644
index ba1aadbdc..000000000
--- a/app/common/functiontimer.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/***
-
- Olive - Non-Linear Video Editor
- Copyright (C) 2022 Olive Team
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-***/
-
-#ifndef FUNCTIONTIMER_H
-#define FUNCTIONTIMER_H
-
-#include
-#include
-
-#define TIME_THIS_FUNCTION FunctionTimer __f(__FUNCTION__)
-#define START_TIMING {FunctionTimer *__f = new FunctionTimer(__FUNCTION__)
-#define STOP_TIMING delete __f;}void()
-
-class FunctionTimer {
-public:
- FunctionTimer(const char* s)
- {
- name_ = s;
- time_ = QDateTime::currentMSecsSinceEpoch();
- }
-
- ~FunctionTimer()
- {
- qint64 elapsed = (QDateTime::currentMSecsSinceEpoch() - time_);
-
- if (elapsed > 1) {
- qDebug() << name_ << "took" << elapsed;
- }
- }
-
-private:
- const char* name_;
-
- qint64 time_;
-
-};
-
-#endif // FUNCTIONTIMER_H
diff --git a/app/common/qtutils.cpp b/app/common/qtutils.cpp
index e4cc56c28..cfcaeac08 100644
--- a/app/common/qtutils.cpp
+++ b/app/common/qtutils.cpp
@@ -115,4 +115,21 @@ QStringList QtUtils::WordWrapString(const QString &s, const QFontMetrics &fm, in
return list;
}
+Qt::KeyboardModifiers QtUtils::FlipControlAndShiftModifiers(Qt::KeyboardModifiers e)
+{
+ if (e & Qt::ControlModifier & Qt::ShiftModifier) {
+ return e;
+ }
+
+ if (e & Qt::ShiftModifier) {
+ e |= Qt::ControlModifier;
+ e &= ~Qt::ShiftModifier;
+ } else if (e & Qt::ControlModifier) {
+ e |= Qt::ShiftModifier;
+ e &= ~Qt::ControlModifier;
+ }
+
+ return e;
+}
+
}
diff --git a/app/common/qtutils.h b/app/common/qtutils.h
index 122a5022c..0d1f5adb3 100644
--- a/app/common/qtutils.h
+++ b/app/common/qtutils.h
@@ -64,6 +64,8 @@ public:
static QStringList WordWrapString(const QString &s, const QFontMetrics &fm, int bounding_width);
+ static Qt::KeyboardModifiers FlipControlAndShiftModifiers(Qt::KeyboardModifiers e);
+
};
}
diff --git a/app/node/generator/text/textv2.cpp b/app/node/generator/text/textv2.cpp
index 0df750fc6..7f1bdd6d0 100644
--- a/app/node/generator/text/textv2.cpp
+++ b/app/node/generator/text/textv2.cpp
@@ -25,7 +25,6 @@
#include
#include "common/cpuoptimize.h"
-#include "common/functiontimer.h"
namespace olive {
diff --git a/app/node/generator/text/textv3.cpp b/app/node/generator/text/textv3.cpp
index da6f9bfe8..f3f9cdecf 100644
--- a/app/node/generator/text/textv3.cpp
+++ b/app/node/generator/text/textv3.cpp
@@ -24,7 +24,6 @@
#include
#include
-#include "common/functiontimer.h"
#include "common/html.h"
#include "node/project/project.h"
diff --git a/app/widget/nodeparamview/nodeparamview.cpp b/app/widget/nodeparamview/nodeparamview.cpp
index 99a4cd95f..10b944a43 100644
--- a/app/widget/nodeparamview/nodeparamview.cpp
+++ b/app/widget/nodeparamview/nodeparamview.cpp
@@ -26,7 +26,6 @@
#include
#include
-#include "common/functiontimer.h"
#include "common/timecodefunctions.h"
#include "node/output/viewer/viewer.h"
#include "node/project/serializer/serializer.h"
diff --git a/app/widget/nodeview/nodeviewitem.cpp b/app/widget/nodeview/nodeviewitem.cpp
index 9a04ee961..5fcac4548 100644
--- a/app/widget/nodeview/nodeviewitem.cpp
+++ b/app/widget/nodeview/nodeviewitem.cpp
@@ -26,7 +26,6 @@
#include
#include
-#include "common/flipmodifiers.h"
#include "common/qtutils.h"
#include "config/config.h"
#include "core.h"
@@ -434,7 +433,7 @@ void NodeViewItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
return;
}
- event->setModifiers(FlipControlAndShiftModifiers(event->modifiers()));
+ event->setModifiers(QtUtils::FlipControlAndShiftModifiers(event->modifiers()));
QGraphicsRectItem::mousePressEvent(event);
}
@@ -445,7 +444,7 @@ void NodeViewItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
return;
}
- event->setModifiers(FlipControlAndShiftModifiers(event->modifiers()));
+ event->setModifiers(QtUtils::FlipControlAndShiftModifiers(event->modifiers()));
QGraphicsRectItem::mouseMoveEvent(event);
}
@@ -457,7 +456,7 @@ void NodeViewItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
return;
}
- event->setModifiers(FlipControlAndShiftModifiers(event->modifiers()));
+ event->setModifiers(QtUtils::FlipControlAndShiftModifiers(event->modifiers()));
QGraphicsRectItem::mouseReleaseEvent(event);
}
diff --git a/app/widget/nodeview/nodeviewscene.cpp b/app/widget/nodeview/nodeviewscene.cpp
index 833a83d99..f2ae527e2 100644
--- a/app/widget/nodeview/nodeviewscene.cpp
+++ b/app/widget/nodeview/nodeviewscene.cpp
@@ -20,7 +20,6 @@
#include "nodeviewscene.h"
-#include "common/functiontimer.h"
#include "core.h"
#include "node/project/sequence/sequence.h"
#include "nodeviewedge.h"
diff --git a/app/widget/timelinewidget/tool/pointer.cpp b/app/widget/timelinewidget/tool/pointer.cpp
index a05311395..71f57b63c 100644
--- a/app/widget/timelinewidget/tool/pointer.cpp
+++ b/app/widget/timelinewidget/tool/pointer.cpp
@@ -24,7 +24,6 @@
#include
#include "common/clamp.h"
-#include "common/flipmodifiers.h"
#include "common/qtutils.h"
#include "common/range.h"
#include "common/timecodefunctions.h"
diff --git a/app/widget/timelinewidget/view/timelineview.cpp b/app/widget/timelinewidget/view/timelineview.cpp
index 7c105e2a8..7adf8f38d 100644
--- a/app/widget/timelinewidget/view/timelineview.cpp
+++ b/app/widget/timelinewidget/view/timelineview.cpp
@@ -28,7 +28,6 @@
#include
#include "config/config.h"
-#include "common/flipmodifiers.h"
#include "common/qtutils.h"
#include "common/timecodefunctions.h"
#include "node/project/footage/footage.h"
diff --git a/app/widget/viewer/viewerdisplay.cpp b/app/widget/viewer/viewerdisplay.cpp
index cdbe6fdc6..18bbcd1c0 100644
--- a/app/widget/viewer/viewerdisplay.cpp
+++ b/app/widget/viewer/viewerdisplay.cpp
@@ -35,7 +35,6 @@
#include
#include "common/define.h"
-#include "common/functiontimer.h"
#include "common/html.h"
#include "common/qtutils.h"
#include "config/config.h"