~ubuntu-branches/ubuntu/quantal/cairo-dock-plug-ins/quantal-201208191523

« back to all changes in this revision

Viewing changes to musicPlayer/src/applet-cover.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-10 00:05:57 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810000557-pfxoz5w7hbyclcqh
Tags: 2.2.0~0beta4-0ubuntu1
* New Upstream Version (LP: #614625)
* Fixed a few bugs on LP:
 - LP: #483963: Dustbin applet does not display trashes on all volumes
 - LP: #485159: Some apps have problem with Systray
 - LP: #500677: ~/.xsession-errors is too much used by CD
 - LP: #500979: Shortcuts: the order gets messed up
 - LP: #521531: Mail: crashes on Maildir
 - LP: #519915: GTG: create a new applet to control GTG
 - LP: #526138: GMenu doesn't handle desktop file exec strings properly
 - LP: #531317: CMake: Added an error if the prefix of 'cairo-dock-plugins'
                 is not the same 'cairo-dock-core'
 - LP: #531319: CMake: check the version of 'cairo-dock' when building
                 'cairo-dock-plugins'
 - LP: #537115: Click at the position where icon lavel was, the icon
                 and dock still receive the event
 - LP: #537943: Terminal applet shortkey behaviour
 - LP: #538637: Trash applet doesn't create .trashinfo files on XFCE
 - More details on the 'ChangeLog' file
* debian/rules:
 - Autotools has been replaced by CMake
 - cdbs is now used.
* debian/copyright:
 - Updated with the new applets
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev, libindicator-dev, libdbusmenu-glib-dev
   libido-0.1-dev, libical-dev, libdbusmenu-gtk-dev as Build-deps
 - Bump Standard-Version to 3.9.1
 - Wget is required for dnd2share applet
 - Added the exact realease for 'cairo-dock-dev' in order to prevent any
    build error if this package is not already available (thx to didrocks)
* debian/cairo-dock-plug-ins*.install:
 - All sonames are now installed into lib32 or lib64 (lib*)

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
                        g_free (cSongPath);
131
131
                        
132
132
                        myData.cCoverPath = g_strdup_printf ("%s/%s - %s.jpg", cSongDir, myData.cArtist, myData.cAlbum);
133
 
                        cd_debug ("  test de %s", myData.cCoverPath);
 
133
                        cd_debug ("MP -   test de %s", myData.cCoverPath);
134
134
                        if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
135
135
                        {
136
136
                                g_free (myData.cCoverPath);
137
137
                                myData.cCoverPath = g_strdup_printf ("%s/cover.jpg", cSongDir);
138
 
                                cd_debug ("  test de %s", myData.cCoverPath);
 
138
                                cd_debug ("MP -   test de %s", myData.cCoverPath);
139
139
                                if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
140
140
                                {
141
141
                                        g_free (myData.cCoverPath);
142
142
                                        myData.cCoverPath = g_strdup_printf ("%s/Cover.jpg", cSongDir);
143
 
                                        cd_debug ("  test de %s", myData.cCoverPath);
 
143
                                        cd_debug ("MP -   test de %s", myData.cCoverPath);
144
144
                                        if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
145
145
                                        {
146
146
                                                g_free (myData.cCoverPath);
147
147
                                                myData.cCoverPath = g_strdup_printf ("%s/cover.jpeg", cSongDir);
148
 
                                                cd_debug ("  test de %s", myData.cCoverPath);
 
148
                                                cd_debug ("MP -   test de %s", myData.cCoverPath);
149
149
                                                if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
150
150
                                                {
151
151
                                                        g_free (myData.cCoverPath);
152
152
                                                        myData.cCoverPath = g_strdup_printf ("%s/album.jpg", cSongDir);
153
 
                                                        cd_debug ("  test de %s", myData.cCoverPath);
 
153
                                                        cd_debug ("MP -   test de %s", myData.cCoverPath);
154
154
                                                        if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
155
155
                                                        {
156
156
                                                                g_free (myData.cCoverPath);
157
157
                                                                myData.cCoverPath = g_strdup_printf ("%s/albumart.jpg", cSongDir);
158
 
                                                                cd_debug ("  test de %s", myData.cCoverPath);
 
158
                                                                cd_debug ("MP -   test de %s", myData.cCoverPath);
159
159
                                                                if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
160
160
                                                                {
161
161
                                                                        g_free (myData.cCoverPath);
162
162
                                                                        myData.cCoverPath = g_strdup_printf ("%s/folder.jpg", cSongDir);
163
 
                                                                        cd_debug ("  test de %s", myData.cCoverPath);
 
163
                                                                        cd_debug ("MP -   test de %s", myData.cCoverPath);
164
164
                                                                        if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
165
165
                                                                        {
166
166
                                                                                g_free (myData.cCoverPath);
201
201
 
202
202
        if (myData.cCoverPath == NULL || cairo_dock_strings_differ (myData.cPreviousCoverPath, myData.cCoverPath))  // la couverture a change, son existence est incertaine et il faudra charger la surface/texture avec une transition. Sinon son existence ne change pas et il n'y a rien a faire.
203
203
        {
204
 
                cd_debug (" c'est une nouvelle couverture (%s -> %s)\n", myData.cPreviousCoverPath, myData.cCoverPath);
 
204
                cd_debug ("MP -  c'est une nouvelle couverture (%s -> %s)\n", myData.cPreviousCoverPath, myData.cCoverPath);
205
205
                myData.cover_exist = FALSE;
206
206
        }
207
207
}
216
216
        if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
217
217
        {
218
218
                gchar *cCommand = g_strdup_printf ("wget \"%s\" -O \"%s\" -t 2 -T 30 > /dev/null 2>&1", cURL, myData.cCoverPath);
219
 
                cd_debug ("%s\n",cCommand);
 
219
                cd_debug ("MP - %s\n",cCommand);
220
220
                cairo_dock_launch_command (cCommand);
221
221
                g_free (cCommand);
222
222
                g_free (myData.cMissingCover);
236
236
                {
237
237
                        cd_message ("MP : sa taille est constante (%d)", myData.iCurrentFileSize);
238
238
                        
239
 
                        cd_debug ("avant extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
 
239
                        cd_debug ("MP - avant extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
240
240
                        gchar *cURL = cd_extract_url_from_xml_file (myData.cCurrentXmlFile, &myData.cArtist, &myData.cAlbum, &myData.cTitle);
241
 
                        cd_debug ("apres extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
242
 
                        cd_debug ("on s'apprete a telecharger la pochette : %s -> %s\n", cURL, myData.cCoverPath);
 
241
                        cd_debug ("MP - apres extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
 
242
                        cd_debug ("MP - on s'apprete a telecharger la pochette : %s -> %s\n", cURL, myData.cCoverPath);
243
243
                        if (g_strstr_len (myData.cCoverPath, -1, "(null)") != NULL && myData.cArtist && myData.cAlbum)
244
244
                        {
245
 
                                cd_debug ("on corrige cCoverPath\n");
 
245
                                cd_debug ("MP - on corrige cCoverPath\n");
246
246
                                g_free (myData.cCoverPath);
247
247
                                if (myData.pCurrentHandeler->cCoverDir)
248
248
                                {
276
276
        myData.iNbCheckFile ++;
277
277
        if (myData.iNbCheckFile > 12)  // on abandonne au bout de 3s.
278
278
        {
279
 
                cd_debug ("on abandonne le XML\n");
 
279
                cd_debug ("MP - on abandonne le XML\n");
280
280
                g_remove (myData.cCurrentXmlFile);
281
281
                g_free (myData.cCurrentXmlFile);
282
282
                myData.cCurrentXmlFile = NULL;
290
290
}
291
291
void cd_musicplayer_dl_cover (void)
292
292
{
293
 
        cd_debug ("%s (%s, %s, %s)\n", __func__, myData.cArtist, myData.cAlbum, myData.cPlayingUri);
 
293
        cd_debug ("MP - %s (%s, %s, %s)\n", __func__, myData.cArtist, myData.cAlbum, myData.cPlayingUri);
294
294
        // on oublie ce qu'on etait en train de recuperer.
295
295
        g_free (myData.cCurrentXmlFile);
296
296
        myData.cCurrentXmlFile = NULL;