mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-12 07:48:04 +00:00
Merge pull request #1782 from sorokin/alert-disp-qt5
Fix alertdispatcher.cpp compilability on Qt5.
This commit is contained in:
commit
8f32f86453
@ -82,13 +82,21 @@ void QAlertDispatcher::getPendingAlerts(std::deque<libtorrent::alert*>& out, uns
|
|||||||
|
|
||||||
void QAlertDispatcher::dispatch(QSharedPointer<QAtomicPointer<QAlertDispatcher> > tag,
|
void QAlertDispatcher::dispatch(QSharedPointer<QAtomicPointer<QAlertDispatcher> > tag,
|
||||||
std::auto_ptr<libtorrent::alert> alert_ptr) {
|
std::auto_ptr<libtorrent::alert> alert_ptr) {
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||||
|
QAlertDispatcher* that = tag->loadAcquire();
|
||||||
|
#else
|
||||||
QAlertDispatcher* that = *tag;
|
QAlertDispatcher* that = *tag;
|
||||||
|
#endif
|
||||||
if (!that)
|
if (!that)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QMutexLocker lock(&(that->alerts_mutex));
|
QMutexLocker lock(&(that->alerts_mutex));
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||||
|
if (!tag->load())
|
||||||
|
#else
|
||||||
if (!*tag)
|
if (!*tag)
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool was_empty = that->alerts.empty();
|
bool was_empty = that->alerts.empty();
|
||||||
|
Loading…
Reference in New Issue
Block a user