Fix Removable device category

This commit is contained in:
reionwong 2021-08-27 01:25:53 +08:00
parent 152a537f5a
commit 4d9ba4c431
3 changed files with 8 additions and 0 deletions

View file

@ -254,6 +254,7 @@ void PlacesModel::onDeviceAdded(const QString &udi)
beginInsertRows(QModelIndex(), rowCount(), rowCount()); beginInsertRows(QModelIndex(), rowCount(), rowCount());
PlacesItem *deviceItem = new PlacesItem; PlacesItem *deviceItem = new PlacesItem;
deviceItem->setUdi(udi); deviceItem->setUdi(udi);
deviceItem->setCategory(tr("Drives"));
m_items.append(deviceItem); m_items.append(deviceItem);
endInsertRows(); endInsertRows();
} }

View file

@ -29,6 +29,10 @@ ListView {
signal clicked(string path) signal clicked(string path)
FishUI.WheelHandler {
target: sideBar
}
PlacesModel { PlacesModel {
id: placesModel id: placesModel
onDeviceSetupDone: sideBar.clicked(filePath) // onDeviceSetupDone: sideBar.clicked(filePath) //

View file

@ -33,6 +33,9 @@ QImage ThumbnailProvider::requestImage(const QString &id, QSize *size, const QSi
if (size) if (size)
*size = requestedSize; *size = requestedSize;
QString f = id;
qDebug() << id << QFile::exists(f.replace("file://", ""));
QString thumbnail = ThumbnailCache::self()->requestThumbnail(id, requestedSize); QString thumbnail = ThumbnailCache::self()->requestThumbnail(id, requestedSize);
if (!thumbnail.isEmpty()) { if (!thumbnail.isEmpty()) {