Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings with Qt 5.15 #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/dialogs/RestoreDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Dialog {

Connections {
target: drives
onLastRestoreableChanged: {
function onLastRestoreableChanged() {
if (drives.lastRestoreable == null) {
root.close()
}
Expand Down
2 changes: 1 addition & 1 deletion app/file_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
15 changes: 12 additions & 3 deletions app/linuxdrivemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ void LinuxDriveProvider::init(QDBusPendingCallWatcher *watcher) {
qDebug() << this->metaObject()->className() << "Got a reply to GetManagedObjects, parsing";

QDBusPendingReply<DBusIntrospection> reply = *watcher;
QSet<QDBusObjectPath> oldPaths = m_drives.keys().toSet();
//QSet<QDBusObjectPath> oldPaths = m_drives.keys().toSet();
QSet<QDBusObjectPath> oldPaths = m_drives.keys().isEmpty() ?
QSet<QDBusObjectPath>() :
QSet<QDBusObjectPath>(m_drives.keys().begin(), m_drives.keys().end());
QSet<QDBusObjectPath> newPaths;

if (reply.isError()) {
Expand Down Expand Up @@ -174,8 +177,14 @@ void LinuxDriveProvider::onPropertiesChanged(const QString &interface_name, cons
const QSet<QString> 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<QString> cProp = changed_properties.keys().isEmpty() ?
QSet<QString>() :
QSet<QString>(changed_properties.keys().begin(), changed_properties.keys().end());
QSet<QString> iProp = invalidated_properties.isEmpty() ?
QSet<QString>() :
QSet<QString>(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);

Expand Down
4 changes: 2 additions & 2 deletions app/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ApplicationWindow {

Connections {
target: drives
onLastRestoreableChanged: {
function onLastRestoreableChanged() {
if (drives.lastRestoreable != null && !dlDialog.visible) {
deviceNotification.open = true
}
Expand Down Expand Up @@ -133,7 +133,7 @@ ApplicationWindow {
}
Connections {
target: contentLoader.item
onStepForward: {
function onStepForward(index) {
contentList.currentIndex++
canGoBack = true
releases.selectedIndex = index
Expand Down
2 changes: 1 addition & 1 deletion app/release.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void Release::setSelectedVariantIndex(const int index) {
}

QQmlListProperty<Variant> Release::variants() {
return QQmlListProperty<Variant>(this, m_variants);
return QQmlListProperty<Variant>(this, &m_variants);
}

QList<Variant *> Release::variantList() const {
Expand Down
2 changes: 1 addition & 1 deletion app/releasemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ void ReleaseManager::onMetadataDownloaded() {
out_set.insert(md5sum_url);
}

const QList<QString> out = out_set.toList();
const QList<QString> out = out_set.values();

return out;
}();
Expand Down