mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 08:48:07 -06:00
Workaround problem with moc from Qt4 and #if
moc from Qt4 ignores Q_ENUMS when it is behind #if QT_VERSION check. Therefore moc entries for enum in TorrentFileGuard were not generated and the setting was not saving/loading. This closes #6103, #5451
This commit is contained in:
committed by
sledgehammer999
parent
93f972bfca
commit
ab2411930a
@@ -92,9 +92,11 @@ void TorrentFileGuard::setAutoDeleteMode(TorrentFileGuard::AutoDeleteMode mode)
|
||||
|
||||
QMetaEnum TorrentFileGuard::modeMetaEnum()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
|
||||
return QMetaEnum::fromType<AutoDeleteMode>();
|
||||
#else
|
||||
return staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("AutoDeleteMode"));
|
||||
const int enumeratorIndex = staticMetaObject.indexOfEnumerator("AutoDeleteMode");
|
||||
Q_ASSERT(enumeratorIndex >= 0);
|
||||
return staticMetaObject.enumerator(enumeratorIndex);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user