diff --git a/app/dialogs/RestoreDialog.qml b/app/dialogs/RestoreDialog.qml index d3731c88..decd4b7c 100644 --- a/app/dialogs/RestoreDialog.qml +++ b/app/dialogs/RestoreDialog.qml @@ -37,7 +37,7 @@ Dialog { Connections { target: drives - onLastRestoreableChanged: { + function onLastRestoreableChanged() { if (drives.lastRestoreable == null) { root.close() } diff --git a/app/file_type.cpp b/app/file_type.cpp index db862af1..f457e368 100644 --- a/app/file_type.cpp +++ b/app/file_type.cpp @@ -53,7 +53,7 @@ FileType file_type_from_filename(const QString &filename) { for (const FileType &type : file_type_all) { const QStringList strings = file_type_strings(type); - for (const QString string : strings) { + for (const QString &string : strings) { // NOTE: need to select the longest string for cases like ".tar" and "recovery.tar" const bool string_matches = filename.endsWith(string, Qt::CaseInsensitive); const bool this_string_is_longer = (string.length() > matching_string.length()); diff --git a/app/linuxdrivemanager.cpp b/app/linuxdrivemanager.cpp index 195f6750..e25a4474 100644 --- a/app/linuxdrivemanager.cpp +++ b/app/linuxdrivemanager.cpp @@ -117,7 +117,10 @@ void LinuxDriveProvider::init(QDBusPendingCallWatcher *watcher) { qDebug() << this->metaObject()->className() << "Got a reply to GetManagedObjects, parsing"; QDBusPendingReply reply = *watcher; - QSet oldPaths = m_drives.keys().toSet(); + //QSet oldPaths = m_drives.keys().toSet(); + QSet oldPaths = m_drives.keys().isEmpty() ? + QSet() : + QSet(m_drives.keys().begin(), m_drives.keys().end()); QSet newPaths; if (reply.isError()) { @@ -174,8 +177,14 @@ void LinuxDriveProvider::onPropertiesChanged(const QString &interface_name, cons const QSet watchedProperties = {"MediaAvailable", "Size"}; // not ideal but it works alright without a huge lot of code - if (!changed_properties.keys().toSet().intersect(watchedProperties).isEmpty() || - !invalidated_properties.toSet().intersect(watchedProperties).isEmpty()) { + QSet cProp = changed_properties.keys().isEmpty() ? + QSet() : + QSet(changed_properties.keys().begin(), changed_properties.keys().end()); + QSet iProp = invalidated_properties.isEmpty() ? + QSet() : + QSet(invalidated_properties.begin(), invalidated_properties.end()); + if (!cProp.intersect(watchedProperties).isEmpty() || + !iProp.intersect(watchedProperties).isEmpty()) { QDBusPendingCall pcall = m_objManager->asyncCall("GetManagedObjects"); QDBusPendingCallWatcher *w = new QDBusPendingCallWatcher(pcall, this); diff --git a/app/main.qml b/app/main.qml index 72b33b19..958feaed 100644 --- a/app/main.qml +++ b/app/main.qml @@ -81,7 +81,7 @@ ApplicationWindow { Connections { target: drives - onLastRestoreableChanged: { + function onLastRestoreableChanged() { if (drives.lastRestoreable != null && !dlDialog.visible) { deviceNotification.open = true } @@ -133,7 +133,7 @@ ApplicationWindow { } Connections { target: contentLoader.item - onStepForward: { + function onStepForward(index) { contentList.currentIndex++ canGoBack = true releases.selectedIndex = index diff --git a/app/release.cpp b/app/release.cpp index bc6c4db9..de2b2636 100644 --- a/app/release.cpp +++ b/app/release.cpp @@ -145,7 +145,7 @@ void Release::setSelectedVariantIndex(const int index) { } QQmlListProperty Release::variants() { - return QQmlListProperty(this, m_variants); + return QQmlListProperty(this, &m_variants); } QList Release::variantList() const { diff --git a/app/releasemanager.cpp b/app/releasemanager.cpp index 68446def..f301d0e6 100644 --- a/app/releasemanager.cpp +++ b/app/releasemanager.cpp @@ -370,7 +370,7 @@ void ReleaseManager::onMetadataDownloaded() { out_set.insert(md5sum_url); } - const QList out = out_set.toList(); + const QList out = out_set.values(); return out; }();