code: removed unnecessary code

This commit is contained in:
itsmattkc
2022-05-30 08:59:25 -07:00
parent 2f7dc3c98b
commit e3c3ee9ac4
16 changed files with 22 additions and 146 deletions
-1
View File
@@ -25,7 +25,6 @@
#include "config/config.h"
#include "common/cpuoptimize.h"
#include "common/functiontimer.h"
namespace olive {
-1
View File
@@ -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"
-3
View File
@@ -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
-41
View File
@@ -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 <http://www.gnu.org/licenses/>.
***/
#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;
}
}
-34
View File
@@ -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 <http://www.gnu.org/licenses/>.
***/
#ifndef FLIPMODIFIERS_H
#define FLIPMODIFIERS_H
#include <QtCore>
#include "common/define.h"
namespace olive {
Qt::KeyboardModifiers FlipControlAndShiftModifiers(Qt::KeyboardModifiers e);
}
#endif // FLIPMODIFIERS_H
-55
View File
@@ -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 <http://www.gnu.org/licenses/>.
***/
#ifndef FUNCTIONTIMER_H
#define FUNCTIONTIMER_H
#include <QDateTime>
#include <QDebug>
#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
+17
View File
@@ -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;
}
}
+2
View File
@@ -64,6 +64,8 @@ public:
static QStringList WordWrapString(const QString &s, const QFontMetrics &fm, int bounding_width);
static Qt::KeyboardModifiers FlipControlAndShiftModifiers(Qt::KeyboardModifiers e);
};
}
-1
View File
@@ -25,7 +25,6 @@
#include <QTextDocument>
#include "common/cpuoptimize.h"
#include "common/functiontimer.h"
namespace olive {
-1
View File
@@ -24,7 +24,6 @@
#include <QDateTime>
#include <QTextDocument>
#include "common/functiontimer.h"
#include "common/html.h"
#include "node/project/project.h"
@@ -26,7 +26,6 @@
#include <QScrollBar>
#include <QSplitter>
#include "common/functiontimer.h"
#include "common/timecodefunctions.h"
#include "node/output/viewer/viewer.h"
#include "node/project/serializer/serializer.h"
+3 -4
View File
@@ -26,7 +26,6 @@
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#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);
}
-1
View File
@@ -20,7 +20,6 @@
#include "nodeviewscene.h"
#include "common/functiontimer.h"
#include "core.h"
#include "node/project/sequence/sequence.h"
#include "nodeviewedge.h"
@@ -24,7 +24,6 @@
#include <QToolTip>
#include "common/clamp.h"
#include "common/flipmodifiers.h"
#include "common/qtutils.h"
#include "common/range.h"
#include "common/timecodefunctions.h"
@@ -28,7 +28,6 @@
#include <QPen>
#include "config/config.h"
#include "common/flipmodifiers.h"
#include "common/qtutils.h"
#include "common/timecodefunctions.h"
#include "node/project/footage/footage.h"
-1
View File
@@ -35,7 +35,6 @@
#include <QTextEdit>
#include "common/define.h"
#include "common/functiontimer.h"
#include "common/html.h"
#include "common/qtutils.h"
#include "config/config.h"