Fix Removable device category
This commit is contained in:
parent
152a537f5a
commit
4d9ba4c431
3 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) // 设备挂载上后,模拟点击了该设备以打开该页面
|
||||||
|
|
|
@ -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()) {
|
||||||
|
|
Loading…
Reference in a new issue