/* TRUE if the progress dialog doesn't exist and it looks like we'll take > 2s to load, FALSE otherwise.  */
static gboolean progress_is_slow(progdlg_t *progdlg, GTimer *prog_timer, gint64 size, gint64 pos)
/* TRUE if the progress dialog doesn't exist and it looks like we'll take > 2s to load, FALSE otherwise.  */
static gboolean progress_is_slow(progdlg_t *progdlg, GTimer *prog_timer, gint64 size, gint64 pos)
{
  double elapsed;
  if (progdlg) return FALSE;
  elapsed = g_timer_elapsed(prog_timer, NULL);
  if ((elapsed / 2 > PROGBAR_SHOW_DELAY && (size / pos) > 2)
      || elapsed > PROGBAR_SHOW_DELAY) {
    return TRUE;
  }
  return FALSE;
}