View | Details | Raw Unified
Collapse All | Expand All

(-) si_ui.c (-12 / +10 lines)
 Lines 219-231    Link Here 
static void
static void
si_ui_statusicon_cb_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp )
si_ui_statusicon_cb_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp )
{
{
  /* NOTE: this is quite intricated, but it works nicely and it's still
     much better than polling; wonder if it can be simplified with some
     help from the core player */
  si_hook_tchange_prevs_t *prevs = prevs_gp;
  si_hook_tchange_prevs_t *prevs = prevs_gp;
  PlaylistEntry *pl_entry = plentry_gp;
  PlaylistEntry *pl_entry = plentry_gp;
  if ( ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(prevs->evbox) , "popup_active" )) == 1 ) &&
  gboolean upd_pop = FALSE;
       ( plentry_gp != NULL ) )
  if ( pl_entry != NULL )
  {
  {
    if ( ( prevs->title != NULL ) && ( prevs->filename != NULL ) )
    if ( ( prevs->title != NULL ) && ( prevs->filename != NULL ) )
    {
    {
 Lines 235-244    Link Here 
        if ( ( pl_entry->title != NULL ) &&
        if ( ( pl_entry->title != NULL ) &&
             ( strcmp(pl_entry->title,prevs->title) ) )
             ( strcmp(pl_entry->title,prevs->title) ) )
        {
        {
          si_ui_statusicon_popup_hide( prevs->evbox );
          si_ui_statusicon_popup_timer_start( prevs->evbox );
          g_free( prevs->title );
          g_free( prevs->title );
          prevs->title = g_strdup(pl_entry->title);
          prevs->title = g_strdup(pl_entry->title);
          upd_pop = TRUE;
        }
        }
      }
      }
      else
      else
 Lines 246-253    Link Here 
        g_free(prevs->filename);
        g_free(prevs->filename);
        prevs->filename = g_strdup(pl_entry->filename);
        prevs->filename = g_strdup(pl_entry->filename);
        /* if filename changes, reset title as well */
        /* if filename changes, reset title as well */
        if ( prevs->title != NULL )
        g_free(prevs->title);
          g_free(prevs->title);
        prevs->title = g_strdup(pl_entry->title);
        prevs->title = g_strdup(pl_entry->title);
      }
      }
    }
    }
 Lines 261-270    Link Here 
      prevs->filename = g_strdup(pl_entry->filename);
      prevs->filename = g_strdup(pl_entry->filename);
    }
    }
  }
  }
  else if ( ( prevs->title != NULL ) && ( strcmp(pl_entry->title,prevs->title) ) )
  if ( ( upd_pop == TRUE ) &&
       ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(prevs->evbox) , "popup_active" )) == 1 ) )
  {
  {
    g_free(prevs->title);
    si_ui_statusicon_popup_hide( prevs->evbox );
    prevs->title = g_strdup(pl_entry->title);
    si_ui_statusicon_popup_timer_start( prevs->evbox );
  }
  }
}
}