diff --git a/model/placesmodel.cpp b/model/placesmodel.cpp index 9c27838..337da74 100644 --- a/model/placesmodel.cpp +++ b/model/placesmodel.cpp @@ -254,6 +254,7 @@ void PlacesModel::onDeviceAdded(const QString &udi) beginInsertRows(QModelIndex(), rowCount(), rowCount()); PlacesItem *deviceItem = new PlacesItem; deviceItem->setUdi(udi); + deviceItem->setCategory(tr("Drives")); m_items.append(deviceItem); endInsertRows(); } diff --git a/qml/SideBar.qml b/qml/SideBar.qml index 590ad84..24001be 100644 --- a/qml/SideBar.qml +++ b/qml/SideBar.qml @@ -29,6 +29,10 @@ ListView { signal clicked(string path) + FishUI.WheelHandler { + target: sideBar + } + PlacesModel { id: placesModel onDeviceSetupDone: sideBar.clicked(filePath) // 设备挂载上后,模拟点击了该设备以打开该页面 diff --git a/thumbnailer/thumbnailprovider.cpp b/thumbnailer/thumbnailprovider.cpp index f77399d..c76bcce 100644 --- a/thumbnailer/thumbnailprovider.cpp +++ b/thumbnailer/thumbnailprovider.cpp @@ -33,6 +33,9 @@ QImage ThumbnailProvider::requestImage(const QString &id, QSize *size, const QSi if (size) *size = requestedSize; + QString f = id; + qDebug() << id << QFile::exists(f.replace("file://", "")); + QString thumbnail = ThumbnailCache::self()->requestThumbnail(id, requestedSize); if (!thumbnail.isEmpty()) {