Browse Source

qt: medialib: fix compatibility for Qt < 5.15

QThreadPool::start() could only be called with a QRunnable before Qt
5.15, not a lambda: https://doc.qt.io/qt-5/qthreadpool.html#start-1

Use the older method instead.

Signed-off-by: Pierre Lamot <pierre@videolabs.io>
pull/119/head
Romain Vimont 6 years ago
committed by Pierre Lamot
parent
commit
8fe56ab521
  1. 15
      modules/gui/qt/medialibrary/medialib.cpp

15
modules/gui/qt/medialibrary/medialib.cpp

@ -225,9 +225,18 @@ void MediaLib::insertIntoPlaylist(const size_t index, const QVariantList &itemId
void MediaLib::reload()
{
m_threadPool.start([ml = m_ml] {
vlc_ml_reload_folder(ml, nullptr);
});
/* m_threadPool.start(lambda) is only supported since Qt 5.15 */
struct Task : QRunnable {
vlc_medialibrary_t *m_ml;
Task(vlc_medialibrary_t *ml) : m_ml(ml) {}
void run() override
{
vlc_ml_reload_folder(m_ml, nullptr);
}
};
m_threadPool.start(new Task(m_ml));
}
vlc_medialibrary_t* MediaLib::vlcMl()

Loading…
Cancel
Save