Convert devicemanager to QAbstractItemModel

This commit is contained in:
Jonas Kvinge
2018-12-29 02:57:22 +01:00
parent fc9f93791d
commit 404283be19
35 changed files with 574 additions and 379 deletions

View File

@@ -2,6 +2,7 @@
* Strawberry Music Player
* This file was part of Clementine.
* Copyright 2010, David Sansome <me@davidsansome.com>
* Copyright 2018, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -110,12 +111,12 @@ void ConnectedDevice::FinishDelete(bool) {
MusicStorage::TranscodeMode ConnectedDevice::GetTranscodeMode() const {
int index = manager_->FindDeviceById(unique_id_);
return MusicStorage::TranscodeMode(manager_->index(index).data(DeviceManager::Role_TranscodeMode).toInt());
return MusicStorage::TranscodeMode(manager_->index(index, 0, QModelIndex()).data(DeviceManager::Role_TranscodeMode).toInt());
}
Song::FileType ConnectedDevice::GetTranscodeFormat() const {
int index = manager_->FindDeviceById(unique_id_);
return Song::FileType(manager_->index(index).data(DeviceManager::Role_TranscodeFormat).toInt());
return Song::FileType(manager_->index(index, 0, QModelIndex()).data(DeviceManager::Role_TranscodeFormat).toInt());
}
void ConnectedDevice::BackendTotalSongCountUpdated(int count) {