Commit 52b16a74 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Code quality fixes

parent 185e9b9d
Pipeline #157980 passed with stage
in 5 minutes and 54 seconds
......@@ -651,7 +651,7 @@ void RemapView::centerCurrentKeyframe()
QMap<int,int>nextKeyframes;
if (m_moveNext) {
QMap<int, int>::iterator it = m_keyframes.find(m_currentKeyframe.first);
if (*it != m_keyframes.last() && it != m_keyframes.end()) {
if (it != m_keyframes.end() && *it != m_keyframes.last()) {
it++;
while (it != m_keyframes.end()) {
nextKeyframes.insert(it.key(), it.value());
......@@ -697,7 +697,7 @@ void RemapView::centerCurrentTopKeyframe()
int offset = m_position + m_inFrame - m_currentKeyframe.second;
if (m_moveNext) {
QMap<int, int>::iterator it = m_keyframes.find(m_currentKeyframe.first);
if (*it != m_keyframes.last() && it != m_keyframes.end()) {
if (it != m_keyframes.end() && *it != m_keyframes.last()) {
it++;
while (it != m_keyframes.end()) {
nextKeyframes.insert(it.key(), it.value());
......
......@@ -86,16 +86,16 @@ void CacheTask::generateThumbnail(std::shared_ptr<ProjectClip>binClip)
}
thumbProd->seek(i);
QScopedPointer<Mlt::Frame> frame(thumbProd->get_frame());
if (frame != nullptr && frame->is_valid()) {
#if LIBMLT_VERSION_INT < QT_VERSION_CHECK(7, 5, 0)
frame->set("deinterlace_method", "onefield");
frame->set("top_field_first", -1);
frame->set("rescale.interp", "nearest");
frame->set("deinterlace_method", "onefield");
frame->set("top_field_first", -1);
frame->set("rescale.interp", "nearest");
#else
frame->set("consumer.deinterlacer", "onefield");
frame->set("consumer.top_field_first", -1);
frame->set("consumer.rescale", "nearest");
frame->set("consumer.deinterlacer", "onefield");
frame->set("consumer.top_field_first", -1);
frame->set("consumer.rescale", "nearest");
#endif
if (frame != nullptr && frame->is_valid()) {
QImage result = KThumb::getFrame(frame.data(), 0, 0, m_fullWidth);
if (!result.isNull()) {
qDebug()<<"==== CACHING FRAME: "<<i;
......
......@@ -273,16 +273,16 @@ void ClipLoadTask::generateThumbnail(std::shared_ptr<ProjectClip>binClip, std::s
thumbProd->seek(frameNumber);
}
QScopedPointer<Mlt::Frame> frame(thumbProd->get_frame());
if ((frame != nullptr) && frame->is_valid()) {
#if LIBMLT_VERSION_INT < QT_VERSION_CHECK(7, 5, 0)
frame->set("deinterlace_method", "onefield");
frame->set("top_field_first", -1);
frame->set("rescale.interp", "nearest");
frame->set("deinterlace_method", "onefield");
frame->set("top_field_first", -1);
frame->set("rescale.interp", "nearest");
#else
frame->set("consumer.deinterlacer", "onefield");
frame->set("consumer.top_field_first", -1);
frame->set("consumer.rescale", "nearest");
frame->set("consumer.deinterlacer", "onefield");
frame->set("consumer.top_field_first", -1);
frame->set("consumer.rescale", "nearest");
#endif
if ((frame != nullptr) && frame->is_valid()) {
int imageHeight(pCore->thumbProfile()->height());
int imageWidth(pCore->thumbProfile()->width());
int fullWidth(qRound(imageHeight * pCore->getCurrentDar()));
......
......@@ -143,7 +143,7 @@ void TaskManager::startTask(int ownerId, AbstractTask *task)
// First task for this clip
m_taskList[ownerId] = {task};
} else {
m_taskList[ownerId].emplace_back(std::move(task));
m_taskList[ownerId].emplace_back(task);
}
if (task->m_type == AbstractTask::TRANSCODEJOB || task->m_type == AbstractTask::PROXYJOB) {
// We only want a limited concurrent jobs for those as for example GPU usually only accept 2 concurrent encoding jobs
......
......@@ -142,6 +142,7 @@ MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent)
, m_activeTool(ToolType::SelectTool)
, m_mousePosition(0)
, m_effectBasket(nullptr)
{
// Init all action categories that are used by other parts of the software
// before we call MainWindow::init and therefore can't be initilized there
......
......@@ -35,7 +35,7 @@ struct ResourceItemInfo
QStringList downloadLabels;
QString imageUrl;
QString previewUrl;
int filesize;
//int filesize;
};
class ProviderModel : public QObject
......
......@@ -6246,7 +6246,7 @@ void TimelineModel::requestResizeMix(int cid, int duration, MixAlignment align,
emit selectedMixChanged(cid, getTrackById_const(tid)->mixModel(cid), true);
return;
}
if (qAbs(deltaLeft - deltaRight > 2)) {
if (qAbs(deltaLeft - deltaRight) > 2) {
// Mix not exactly centered
emit selectedMixChanged(cid, getTrackById_const(tid)->mixModel(cid), true);
return;
......
......@@ -1138,6 +1138,7 @@ std::pair<int, int> TrackModel::getClipIndexAt(int position, int playlist)
return {j, m_playlists[j].get_clip_index_at(position)};
}
}
return {-1, -1};
}
if (!m_playlists[playlist].is_blank_at(position)) {
return {playlist, m_playlists[playlist].get_clip_index_at(position)};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment