• Carlos Soriano Sánchez's avatar
    search: done loading signal only if not restarting engine · ff6ccbaf
    Carlos Soriano Sánchez authored
    It was working as:
    - Search directory starts a new search
    - Search engine starts all search providers, each one in its
    own thread.
    - User changes query
    - Search engine stops all search providers
    - Searchs providers, since they are in its own thread, cancel
    in a unknown time.
    - Search directory starts a new search, even before all providers
    are finished.
    - Search engine is marked as need to restart.
    - Search providers finished.
    - Search engine emits finished signal, since all search providers
    now are stopped.
    - Clients doesn't have a way to know if the engine
    actually finished searching the current search, or the previous
    search that the client asked to stop. That might confuse clients
    if they ask for results.
    - Search engine restart the search providers without noticing the
    client, that thinks that the latest search it started was finished
    already.
    
    So to fix this confusion, only report that the engine actually finished
    if the engine is not going to restart the search providers.
    In this way a client can start a batch of consecutive searches without
    the risk of getting search finished signals from previous searches.
    Clients now will always get the search-finished signal of the
    latest search they started.
    ff6ccbaf
nautilus-private-enum-types.c.template 730 Bytes