plasma-applet-tiledmenu icon indicating copy to clipboard operation
plasma-applet-tiledmenu copied to clipboard

Feature request: List recent files too

Open cipricus opened this issue 2 years ago • 5 comments

Cannot seem to find this rather common option in the otherwise so complete tool. It is present in other launchers.

Can this be enabled?

cipricus avatar Nov 17 '22 22:11 cipricus

Is that hard to add? I have no real competence but I could try to add it.

cipricus avatar Nov 20 '22 18:11 cipricus

You'd need to use Recent Apps as a model. You need to enable RootModel { showRecentDocs: true }.

  • https://github.com/Zren/plasma-applet-tiledmenu/blob/master/package/contents/ui/AppsModel.qml#L48

I parse the RootModel and all it's nested models and convert it to a ListModel and use a single ListView.

The RootModel is:

  • RootModel
    • [0] = RecentApps
      • [0] Firefox
      • [1] Dolphin
    • [1] = All Apps
      • A
        • [0] Ark
        • [1] Audacity
    • [2] = Development
      • [...]
    • [3] = Education
    • [4] = Games
    • [...]
    • [9] = Power

I have the following properties in AppsModel that hardcode the numbers.

property int categoryStartIndex: 2 // Skip Recent Apps, All Apps
property int categoryEndIndex: rootModel.count - 1 // Skip Power

The RecentDocs should modify the model to be like the following:

  • RootModel
    • [0] = RecentApps
      • [0] Firefox
      • [1] Dolphin
    • [1] = RecentDocs
      • [0] ?
      • [1] ?
    • [2] = All Apps
    • [3] = Development
    • [...]

Since I might reference the AllApps in many places with rootModel.modelForRow(1) you'll need to update those hardcoded indexes.

Zren avatar Nov 20 '22 19:11 Zren

If you don't want Recent Apps, then you can probably easily set showRecentApps: false and set showRecentDocs: true as a simple workaround.

Zren avatar Nov 20 '22 21:11 Zren

Consider this a feature request please!

cipricus avatar Nov 28 '22 14:11 cipricus

I have succeeded but the result is surprisingly bad.

Edited plasma-applet-tiledmenu/package/contents/ui/AppsModel.qml- and there set RootModel { showRecentDocs: true }.

Also set showRecentApps to false.

Sadly that involves using some of the bad parts in plasma, a kio-slave or something that doesn't work properly. It shows me under "most used" 5 documents that I haven't opened in weeks instead of the last ones. I don't know how this works, I suppose it should show what dolphin shows at recentlyused:/files/?limit=10 or recentdocuments:/, or timeline:/today/, but it does not.

(What file/resource is showRecentDocs referring to?)

As a workaround I have added in Tiled Menu configuration > Sidebar shortcuts a recent_files_dolphin.desktop which was created with the line Exec=dolphin recentlyused:/files/?limit=15.

cipricus avatar Nov 28 '22 14:11 cipricus