Commit b89e89ce authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

Code gardening: Improvements for disabled deprecation versions

- Remove deprecated SHOW_DEPRECATIONS flag (see system/dolphin@dc3d153b)
- Fix and enable for Qt
parent dad45354
Pipeline #196821 passed with stage
in 5 minutes and 52 seconds
......@@ -69,8 +69,8 @@ if (NOT DEFINED QT_MAJOR_VERSION)
endif()
if (ECM_VERSION VERSION_GREATER_EQUAL "5.91.0")
ecm_set_disabled_deprecation_versions(SHOW_DEPRECATIONS
#QT ${QT_MIN_VERSION} // causes problems with QVariant, disable for know
ecm_set_disabled_deprecation_versions(
QT ${QT_MIN_VERSION}
KF ${KF_DEP_VERSION}
)
endif()
......
......@@ -166,7 +166,7 @@ void PreviewManager::loadChunks(QVariantList previewChunks, QVariantList dirtyCh
m_previewTrack->consolidate_blanks();
m_tractor->unlock();
if (!dirtyChunks.isEmpty()) {
std::sort(dirtyChunks.begin(), dirtyChunks.end());
std::sort(dirtyChunks.begin(), dirtyChunks.end(), chunkSort);
QMutexLocker lock(&m_dirtyMutex);
for (const auto &i : qAsConst(dirtyChunks)) {
if (!m_dirtyChunks.contains(i)) {
......@@ -369,7 +369,7 @@ void PreviewManager::invalidatePreviews()
}
}
if (!foundChunks.isEmpty()) {
std::sort(foundChunks.begin(), foundChunks.end());
std::sort(foundChunks.begin(), foundChunks.end(), chunkSort);
m_dirtyMutex.lock();
for (auto &ck : foundChunks) {
m_dirtyChunks.removeAll(ck);
......@@ -584,7 +584,7 @@ void PreviewManager::doPreviewRender(const QString &scene)
}
QMutexLocker lock(&m_dirtyMutex);
Q_ASSERT(m_previewProcess.state() == QProcess::NotRunning);
std::sort(m_dirtyChunks.begin(), m_dirtyChunks.end());
std::sort(m_dirtyChunks.begin(), m_dirtyChunks.end(), chunkSort);
qDebug() << ":: got dirty chks: " << m_dirtyChunks;
const QStringList dirtyChunks = getCompressedList(m_dirtyChunks);
m_chunksToRender = m_dirtyChunks.count();
......@@ -665,7 +665,7 @@ void PreviewManager::invalidatePreview(int startFrame, int endFrame)
int start = startFrame - startFrame % chunkSize;
int end = endFrame - endFrame % chunkSize;
std::sort(m_renderedChunks.begin(), m_renderedChunks.end());
std::sort(m_renderedChunks.begin(), m_renderedChunks.end(), chunkSort);
m_previewGatherTimer.stop();
bool stopPreview = m_previewProcess.state() == QProcess::Running;
if (m_renderedChunks.isEmpty() || ((workingPreview < m_renderedChunks.first().toInt() || workingPreview > m_renderedChunks.last().toInt()) &&
......@@ -788,7 +788,7 @@ void PreviewManager::corruptedChunk(int frame, const QString &fileName)
if (!m_dirtyChunks.contains(frame)) {
QMutexLocker lock(&m_dirtyMutex);
m_dirtyChunks << frame;
std::sort(m_dirtyChunks.begin(), m_dirtyChunks.end());
std::sort(m_dirtyChunks.begin(), m_dirtyChunks.end(), chunkSort);
}
}
......@@ -810,9 +810,9 @@ void PreviewManager::removeOverlayTrack()
QPair<QStringList, QStringList> PreviewManager::previewChunks()
{
QMutexLocker lock(&m_dirtyMutex);
std::sort(m_renderedChunks.begin(), m_renderedChunks.end());
std::sort(m_renderedChunks.begin(), m_renderedChunks.end(), chunkSort);
const QStringList renderedChunks = getCompressedList(m_renderedChunks);
std::sort(m_dirtyChunks.begin(), m_dirtyChunks.end());
std::sort(m_dirtyChunks.begin(), m_dirtyChunks.end(), chunkSort);
const QStringList dirtyChunks = getCompressedList(m_dirtyChunks);
lock.unlock();
return {renderedChunks, dirtyChunks};
......
......@@ -117,6 +117,11 @@ private:
/** @brief: Get a compressed list of chunks, like: "0-500,525,575". */
const QStringList getCompressedList(const QVariantList items) const;
/** @brief Compare two chunks for usage by std::sort
* @returns true if @param c1 is less than @param c2
*/
static bool chunkSort(const QVariant &c1, const QVariant &c2) { return c1.toString() < c2.toString(); };
private slots:
/** @brief: To avoid filling the hard drive, remove preview undo history after 5 steps. */
void doCleanupOldPreviews();
......
Supports Markdown
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