Skip to content
  • Harald Sitter's avatar
    smb-notifier: do not send remove events on moving files · 5abd1e8e
    Harald Sitter authored
    windows (but not samba interestingly) will send a REMOVE event before
    the actual MOVE event this would mess with kio's dirlister's internal
    state as it'd remove the file from the model and then never try to learn
    about it again when it receives the move event. effectively this would
    remove a file from the view in dolphin when renaming it as now both the
    old name and the new name aren't in the dirlister model anymore.
    
    to prevent this from happening a similar hack is applied to the event
    order as with move merging.
    
    when a remove arrives it's not immediately emitted but queued for up to
    1000ms if a move event also arrives during that time frame the remove is
    entirely discarded and we are left with only the move.
    if any other event arrives the remove is immediately sent.
    if nothing else arrives the timer runs out and the remove is sent.
    
    so worst case a remove is only represented in the GUI after 1s, best
    case it's more or less same as before with the added benefit that
    renaming doesn't make files disappear
    
    CCBUG: 430585
    5abd1e8e