Add better error messages for device and organize

Fixes #1364
This commit is contained in:
Jonas Kvinge
2024-01-24 19:27:30 +01:00
parent 269f13de76
commit 226a6c50e0
15 changed files with 123 additions and 51 deletions

View File

@@ -68,11 +68,16 @@ bool MtpLoader::TryLoad() {
connection_ = make_unique<MtpConnection>(url_);
if (!connection_ || !connection_->is_valid()) {
if (!connection_) {
emit Error(tr("Error connecting MTP device %1").arg(url_.toString()));
return false;
}
if (!connection_->is_valid()) {
emit Error(tr("Error connecting MTP device %1: %2").arg(url_.toString(), connection_->error_text()));
return false;
}
// Load the list of songs on the device
SongList songs;
LIBMTP_track_t *tracks = LIBMTP_Get_Tracklisting_With_Callback(connection_->device(), nullptr, nullptr);