The real reason to change the %C was to remove a very nasty hack!
%CL - load the AA
%C - check if AA is avilable
%Cd - display the AA


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26696 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index f5d49f9..293358b 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -391,6 +391,7 @@
 #ifdef HAVE_ALBUMART
     { WPS_NO_TOKEN,                       "Cl",  0,    parse_albumart_load },
     { WPS_TOKEN_ALBUMART_DISPLAY,         "Cd",   WPS_REFRESH_STATIC,  parse_albumart_display },
+    { WPS_TOKEN_ALBUMART_FOUND,           "C", WPS_REFRESH_STATIC, NULL },
 #endif
 
     { WPS_VIEWPORT_ENABLE,                "Vd",  WPS_REFRESH_DYNAMIC,
@@ -1482,11 +1483,7 @@
 {
     (void)wps_bufptr;
     struct wps_token *prev = token-1;
-    if ((wps_data->num_tokens >= 1) && (prev->type == WPS_TOKEN_CONDITIONAL))
-    {
-        token->type = WPS_TOKEN_ALBUMART_FOUND;
-    }
-    else if (wps_data->albumart)
+    if (wps_data->albumart)
     {
         wps_data->albumart->vp = &curr_vp->vp;
     }
diff --git a/manual/appendix/wps_tags.tex b/manual/appendix/wps_tags.tex
index 7b1c5cd..a60c4d2 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -389,7 +389,8 @@
         & \config{y}: y coordinate\\
         & \config{maxwidth}: Maximum height\\
         & \config{maxheight}: Maximum width\\
-    \config{\%Cd}  & Display the album art as configured. This tag can also be used as a conditional.\\
+    \config{\%Cd}  & Display the album art as configured. \\
+    \config{\%C}  & USe in a conditional to determine if an image is available. \\
   \end{tagmap}
 
 The picture will be rescaled, preserving aspect ratio to fit the given
diff --git a/utils/skinupdater/skinupdater.c b/utils/skinupdater/skinupdater.c
index dd4d2f3..e249996 100644
--- a/utils/skinupdater/skinupdater.c
+++ b/utils/skinupdater/skinupdater.c
@@ -116,6 +116,12 @@
         fprintf(out, "%s", tag->name);
         return strlen(tag->name);
     }
+    if (!strcmp(tag->name, "C"))
+    {
+        fprintf(out, "Cd");
+        return 1;
+    }
+        
     fprintf(out, "%s", tag->name);
     len += strlen(tag->name);
     start += len;
@@ -190,10 +196,6 @@
         PUTCH(out, '(');
         len += 1+dump_arg(out, start+1, 2, true);
     }
-    else if (MATCH("C"))
-    {
-        fprintf(out, "%%Cd");
-    }
     else if (MATCH("Cl"))
     {
         int read;
@@ -365,7 +367,16 @@
                     goto top;
                     break;
                 case '?':
-                    PUTCH(out, *in++);
+                    if (in[1] == 'C' && in[2] == '<')
+                    {
+                        fprintf(out, "?C");
+                        in += 2;
+                        goto top;
+                    }
+                    else
+                    {
+                        PUTCH(out, *in++);
+                    }
                     break;
             }
             len = parse_tag(out, in, level>0);
diff --git a/utils/skinupdater/tag_table.c b/utils/skinupdater/tag_table.c
index 96b237d..a1a5863 100644
--- a/utils/skinupdater/tag_table.c
+++ b/utils/skinupdater/tag_table.c
@@ -173,7 +173,7 @@
     
     { "Fl" , "IF"},
     { "Cl" , "IISS"},
-    { "C" , ""},
+    { "C" , "important"},
     
     { "Vd" , "S"},
     { "VI" , "S"},