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
-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);
};
}