Mercurial > audlegacy-plugins
comparison src/xspf/xspf.c @ 2170:02cfac0efbdc
remove unnecessary code. (I can't recall why I used "uri", actually.)
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Sun, 18 Nov 2007 15:24:22 +0900 |
parents | 838098201ac9 |
children | 137187e7a379 |
comparison
equal
deleted
inserted
replaced
2169:838098201ac9 | 2170:02cfac0efbdc |
---|---|
78 | 78 |
79 static const gint xspf_nentries = (sizeof(xspf_entries) / sizeof(xspf_entry_t)); | 79 static const gint xspf_nentries = (sizeof(xspf_entries) / sizeof(xspf_entry_t)); |
80 | 80 |
81 /* we need encoding conversion */ | 81 /* we need encoding conversion */ |
82 #ifdef DEBUG | 82 #ifdef DEBUG |
83 //# define XSDEBUG(...) { fprintf(stderr, "xspf[%s:%d]: ", __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); } | |
84 # define XSDEBUG(...) { g_print("xspf[%s:%d]: ", __FUNCTION__, (int) __LINE__); g_print(__VA_ARGS__); } | 83 # define XSDEBUG(...) { g_print("xspf[%s:%d]: ", __FUNCTION__, (int) __LINE__); g_print(__VA_ARGS__); } |
85 #else | 84 #else |
86 # define XSDEBUG(...) /* stub */ | 85 # define XSDEBUG(...) /* stub */ |
87 #endif | 86 #endif |
88 | 87 |
185 } | 184 } |
186 } | 185 } |
187 } | 186 } |
188 | 187 |
189 if (location) { | 188 if (location) { |
190 gchar *uri = NULL, *realfn = NULL, *scratch = NULL; | 189 gchar *realfn = NULL, *scratch = NULL; |
191 | 190 |
192 /* filename and path in tuple must be unescaped. */ | 191 /* filename and path in tuple must be unescaped. */ |
193 scratch = g_filename_from_uri(location, NULL, NULL); | 192 scratch = g_filename_from_uri(location, NULL, NULL); |
194 | 193 realfn = aud_str_to_utf8(scratch ? scratch : location); |
195 if (scratch != NULL) { | 194 g_free(scratch); |
196 realfn = aud_str_to_utf8(scratch ? scratch : location); | |
197 uri = aud_str_to_utf8(scratch ? location : scratch); | |
198 g_free(scratch); | |
199 } else { | |
200 realfn = g_strdup(location); | |
201 uri = g_strdup(location); | |
202 } | |
203 | 195 |
204 scratch = g_path_get_basename(realfn); | 196 scratch = g_path_get_basename(realfn); |
205 aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch); | 197 aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch); |
206 g_free(scratch); | 198 g_free(scratch); |
207 | 199 |
213 | 205 |
214 XSDEBUG("tuple->file_name = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); | 206 XSDEBUG("tuple->file_name = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); |
215 XSDEBUG("tuple->file_path = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_PATH, NULL)); | 207 XSDEBUG("tuple->file_path = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_PATH, NULL)); |
216 | 208 |
217 /* add file to playlist */ | 209 /* add file to playlist */ |
218 aud_playlist_load_ins_file_tuple(playlist, uri, filename, pos, tuple); | 210 aud_playlist_load_ins_file_tuple(playlist, location, filename, pos, tuple); |
219 g_free(realfn); g_free(uri); | 211 g_free(realfn); |
220 pos++; | 212 pos++; |
221 } | 213 } |
222 | 214 |
223 g_free(location); | 215 g_free(location); |
224 } | 216 } |