mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
file: Remove unused static description strings
This commit is contained in:
parent
d7446e05db
commit
2ddd2d0866
Notes:
sideshowbarker
2024-07-18 18:36:08 +09:00
Author: https://github.com/linusg
Commit: 2ddd2d0866
1 changed files with 17 additions and 22 deletions
|
@ -34,31 +34,26 @@ static Optional<String> image_details(const String& description, const String& p
|
|||
return String::formatted("{}, {} x {}", description, image_decoder->width(), image_decoder->height());
|
||||
}
|
||||
|
||||
#define ENUMERATE_DESCRIPTION_CONTENTS(V) \
|
||||
V(pbm, "image/x-portable-bitmap", "PBM image data", image_details) \
|
||||
V(pgm, "image/x-portable-graymap", "PGM image data", image_details) \
|
||||
V(png, "image/png", "PNG image data", image_details) \
|
||||
V(ppm, "image/x-portable-pixmap", "PPM image data", image_details) \
|
||||
V(gif_87, "image/gif", "GIF image data", image_details) \
|
||||
V(gif_89, "image/gif", "GIF image data", image_details) \
|
||||
V(bmp, "image/bmp", "BMP image data", image_details) \
|
||||
V(jpeg, "image/jpeg", "JPEG image data", image_details) \
|
||||
V(jpeg_jfif, "image/jpeg", "JFIF image data", image_details) \
|
||||
V(jpeg_huh, "image/jpeg", "JPEG image data", image_details) \
|
||||
V(shell, "text/x-shellscript", "POSIX shell script text executable", description_only) \
|
||||
V(json, "application/json", "JSON data", description_only) \
|
||||
V(javascript, "application/javascript", "JavaScript source", description_only) \
|
||||
V(markdown, "text/markdown", "Markdown document", description_only)
|
||||
|
||||
#define V(var_name, mime_type, description, details) \
|
||||
static const String var_name = description;
|
||||
ENUMERATE_DESCRIPTION_CONTENTS(V)
|
||||
#undef V
|
||||
#define ENUMERATE_DESCRIPTION_CONTENTS(V) \
|
||||
V("image/x-portable-bitmap", "PBM image data", image_details) \
|
||||
V("image/x-portable-graymap", "PGM image data", image_details) \
|
||||
V("image/png", "PNG image data", image_details) \
|
||||
V("image/x-portable-pixmap", "PPM image data", image_details) \
|
||||
V("image/gif", "GIF image data", image_details) \
|
||||
V("image/gif", "GIF image data", image_details) \
|
||||
V("image/bmp", "BMP image data", image_details) \
|
||||
V("image/jpeg", "JPEG image data", image_details) \
|
||||
V("image/jpeg", "JFIF image data", image_details) \
|
||||
V("image/jpeg", "JPEG image data", image_details) \
|
||||
V("text/x-shellscript", "POSIX shell script text executable", description_only) \
|
||||
V("application/json", "JSON data", description_only) \
|
||||
V("application/javascript", "JavaScript source", description_only) \
|
||||
V("text/markdown", "Markdown document", description_only)
|
||||
|
||||
static Optional<String> get_description_from_mime_type(const String& mime, const String& path)
|
||||
{
|
||||
#define V(var_name, mime_type, description, details) \
|
||||
if (String(mime_type) == mime) \
|
||||
#define V(mime_type, description, details) \
|
||||
if (String(mime_type) == mime) \
|
||||
return details(String(description), path);
|
||||
ENUMERATE_DESCRIPTION_CONTENTS(V);
|
||||
#undef V
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue