* implement the :erase message from the backend to properly clean up the

header buffer

  When we're doing a search while the results of a previous search are still
  coming in from the backend, this way we can tell the frontend that this is
  the right time to clear the buffer (previously, sometimes the results would
  be mixed).
This commit is contained in:
djcb
2012-03-25 13:25:55 +03:00
parent 50b50d87b7
commit 67261b614d
3 changed files with 23 additions and 2 deletions

View File

@ -376,6 +376,12 @@ cmd_find (MuStore *store, MuQuery *query, GSList *args, GError **err)
return server_error (err, MU_ERROR_INTERNAL,
"couldn't get iterator");
/* before sending new results, send an 'erase' message, so the
* frontend knows it should erase the headers buffer. this
* will ensure that the output of two finds quickly will not
* be mixed. */
send_expr ("(:erase t)");
/* return results + the number of results found */
send_expr ("(:found %u)\n", output_found_sexps (iter, maxnum));
mu_msg_iter_destroy (iter);