From a4cf207bd1014ad717c0c45b84aca56d43e69b14 Mon Sep 17 00:00:00 2001 From: Phil Olynyk Date: Wed, 15 May 2019 17:26:56 -0400 Subject: [PATCH] replace QDir.isEmpty() with QDir.count() == 0 for QT < 5.9 --- oscar/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/oscar/main.cpp b/oscar/main.cpp index ce3477b0..b6723b28 100644 --- a/oscar/main.cpp +++ b/oscar/main.cpp @@ -457,7 +457,11 @@ int main(int argc, char *argv[]) { qDebug() << "Using " + GetAppData() + " as OSCAR data folder"; QDir newDir(GetAppData()); - if ( ! newDir.exists() || newDir.isEmpty() ) { // directoy doesn't exist yet or is empty, try to migrate old data +#if QT_VERSION < QT_VERSION_CHECK(5,9,0) + if ( ! newDir.exists() || newDir.count() == 0 ) { // directoy doesn't exist yet or is empty, try to migrate old data +#else + if ( ! newDir.exists() || newDir.isEmpty() ) { // directoy doesn't exist yet or is empty, try to migrate old data +#endif if (QMessageBox::question(nullptr, QObject::tr("Migrate SleepyHead Data?"), QObject::tr("On the next screen OSCAR will ask you to select a folder with SleepyHead data") +"\n" + QObject::tr("Click [OK] to go to the next screen or [No] if you do not wish to use any SleepyHead data."),