D10804: Show "Empty Trash" button inside trash directory

Henrik Fehlauer noreply at phabricator.kde.org
Wed Feb 28 10:53:18 GMT 2018


rkflx added a comment.


  The button now gets enabled when I move something to the trash.
  
  Still it's not always in sync with the context menu or the sidebar, e.g. for Split, sometimes when visiting the trash for the first time even after your latest update. Depending on the situation it is either enabled when it shouldn't be enabled, and the other way round. Try testing more systematically, i.e. make a list of workflows and test those.
  
  > I wanted to minimize watched directory by using trash:/ path, but it didn't work that way.
  
  Looking at the API docs, `path` might be terminology relating to DBus services, not file paths. `InformationPanel` implements it similarly, so you should be fine.
  
  ---
  
  There are more issues I noticed:
  
  - Split results in `QLayout: Attempting to add QLayout "" to DolphinViewContainer "", which already has a layout`
  - Sometimes the hover outline stays visible after accepting the dialog, and `QXcbConnection: XCB error: 3 (BadWindow), sequence: 4354, resource id: 50331725, major code: 40 (TranslateCoords), minor code: 0` is logged.

INLINE COMMENTS

> markg wrote in dolphintrash.cpp:50-51
> You probably don't want to do that. As a mere setting would decide if the trash is empty or not.
> You can do this in a few different ways.
> 
> 1. Look at placesitem.cpp at the "m_trashDirLister" how that is used to update the trash icon in the places menu with whatever the trash state is.
> 
> Spoiler:
> 
>   void PlacesItem::onTrashDirListerCompleted()
>   {
>       Q_ASSERT(url().scheme() == QLatin1String("trash"));
>   
>       const bool isTrashEmpty = m_trashDirLister->items().isEmpty();
>       setIcon(isTrashEmpty ? QStringLiteral("user-trash") : QStringLiteral("user-trash-full"));
>   }
> 
> Also, you already have the information if the trash is empty. You have the view status information (the thingy below the view that says "x Folders, X files". Follow that to figure out how it fills that information which would also give you the trash state. This would be the way to go imho.

@rominf Did you look at Mark's comment already?

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D10804

To: rominf, #dolphin, #kde_applications, ngraham, rkflx, markg
Cc: markg, emateli, broulik, elvisangelaccio, rkflx, mmustac, ngraham, #dolphin, spoorun, navarromorales, isidorov, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180228/8726e2ea/attachment.htm>


More information about the kfm-devel mailing list