comparison src/audacious/ui_fileinfopopup.c @ 2484:adc63272c9ff trunk

[svn] - add some debugging assertions to this code
author nenolod
date Wed, 07 Feb 2007 10:23:29 -0800
parents 44df6c17411b
children ba8c2a94262c
comparison
equal deleted inserted replaced
2483:2f740814b468 2484:adc63272c9ff
91 static void 91 static void
92 filepopup_entry_set_text_free(GtkWidget *filepopup_win, const char *entry_name, char *text) 92 filepopup_entry_set_text_free(GtkWidget *filepopup_win, const char *entry_name, char *text)
93 { 93 {
94 GtkWidget *widget = g_object_get_data(G_OBJECT(filepopup_win), entry_name); 94 GtkWidget *widget = g_object_get_data(G_OBJECT(filepopup_win), entry_name);
95 95
96 if (widget == NULL) 96 if (widget == NULL || text == NULL)
97 return; 97 return;
98 98
99 gtk_label_set_text(GTK_LABEL(widget), text); 99 gtk_label_set_text(GTK_LABEL(widget), text);
100 100
101 g_free(text); 101 g_free(text);
111 gint length = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(filepopup_win) , "length" )); 111 gint length = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(filepopup_win) , "length" ));
112 gint pos; 112 gint pos;
113 gint time; 113 gint time;
114 114
115 pl = playlist_get_active(); 115 pl = playlist_get_active();
116
117 g_return_if_fail(pl != NULL);
118
116 pos = playlist_get_position(pl); 119 pos = playlist_get_position(pl);
117 120
118 current_file = playlist_get_filename( pl , pos ); 121 current_file = playlist_get_filename( pl , pos );
119 time = playback_get_time(); 122 time = playback_get_time();
123
124 if (current_file == NULL)
125 return FALSE;
120 126
121 if ( ( time != -1 ) && 127 if ( ( time != -1 ) &&
122 ( length != -1 ) && 128 ( length != -1 ) &&
123 ( ( current_file != NULL ) && ( tooltip_file != NULL ) && 129 ( ( current_file != NULL ) && ( tooltip_file != NULL ) &&
124 ( !strcmp(tooltip_file, current_file) ) && ( cfg.filepopup_showprogressbar ) ) ) 130 ( !strcmp(tooltip_file, current_file) ) && ( cfg.filepopup_showprogressbar ) ) )