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("org.kde.kdeconnect.device.photo"),
QStringLiteral("requestPhoto"));
msg.setArguments({QString(QStandardPaths::standardLocations(QStandardPaths::DownloadLocation).first()
+ QDateTime::currentDateTime().toString(QStringLiteral("/dd-MM-yy_hh-mm-ss.png")))});
QStringList downloadDirs = QStandardPaths::standardLocations(QStandardPaths::DownloadLocation);
msg.setArguments({QString(downloadDirs.first() + QDateTime::currentDateTime().toString(QStringLiteral("/dd-MM-yy_hh-mm-ss.png")))});
blockOnReply(QDBusConnection::sessionBus().asyncCall(msg));
});
setWhenAvailable(