Do not call first() on a temporary list

This commit is contained in:
Albert Vaca Cintora 2023-07-20 23:35:59 +02:00
parent 6c1b81a384
commit c3a2665477

View file

@ -98,8 +98,8 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface *device)
QStringLiteral("/modules/kdeconnect/devices/") + device->id() + QStringLiteral("/photo"), QStringLiteral("/modules/kdeconnect/devices/") + device->id() + QStringLiteral("/photo"),
QStringLiteral("org.kde.kdeconnect.device.photo"), QStringLiteral("org.kde.kdeconnect.device.photo"),
QStringLiteral("requestPhoto")); QStringLiteral("requestPhoto"));
msg.setArguments({QString(QStandardPaths::standardLocations(QStandardPaths::DownloadLocation).first() QStringList downloadDirs = QStandardPaths::standardLocations(QStandardPaths::DownloadLocation);
+ QDateTime::currentDateTime().toString(QStringLiteral("/dd-MM-yy_hh-mm-ss.png")))}); msg.setArguments({QString(downloadDirs.first() + QDateTime::currentDateTime().toString(QStringLiteral("/dd-MM-yy_hh-mm-ss.png")))});
blockOnReply(QDBusConnection::sessionBus().asyncCall(msg)); blockOnReply(QDBusConnection::sessionBus().asyncCall(msg));
}); });
setWhenAvailable( setWhenAvailable(