• Razvan Chitu's avatar
    trashmonitor: change trash monitoring process · 65687ba3
    Razvan Chitu authored
    The trash is monitored for state changes - going from empty to non-empty and the
    other way round. Monitoring is done by handling change signals from a regular
    file monitor. On each signal, an enumeration of the trash contents is started in
    order to see if it is empty or not. This causes issues when many files are
    trashed, because the gvfs trash backend is flooded with enumeration requests,
    resulting in CPU usage spikes. In order to fix this, the "item-count" attribute
    of the trash should be queried instead.
    
    Replace asynchronous enumeration with asynchronous information query and update
    the trash state based on the "item-count" attribute. Emit state change signal
    only when the state actually changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763600
    65687ba3
gtktrashmonitor.c 6.38 KB