1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:57:35 +00:00

Welcome: Use new format functions.

This commit is contained in:
asynts 2020-10-06 19:28:41 +02:00 committed by Andreas Kling
parent ff3552bb14
commit 9123920a19

View file

@ -80,7 +80,7 @@ static Optional<Vector<ContentPage>> parse_welcome_file(const String& path)
line = line.substring(0, line.length() - 1); // remove newline line = line.substring(0, line.length() - 1); // remove newline
switch (line[0]) { switch (line[0]) {
case '*': case '*':
dbg() << "menu_item line:\t" << line; dbgln("menu_item line:\t{}", line);
if (started) if (started)
pages.append(current); pages.append(current);
else else
@ -90,25 +90,25 @@ static Optional<Vector<ContentPage>> parse_welcome_file(const String& path)
current.menu_name = line.substring(2, line.length() - 2); current.menu_name = line.substring(2, line.length() - 2);
break; break;
case '$': case '$':
dbg() << "icon line: \t" << line; dbgln("icon line: \t{}", line);
current.icon = line.substring(2, line.length() - 2); current.icon = line.substring(2, line.length() - 2);
break; break;
case '>': case '>':
dbg() << "title line:\t" << line; dbgln("title line:\t{}", line);
current.title = line.substring(2, line.length() - 2); current.title = line.substring(2, line.length() - 2);
break; break;
case '\n': case '\n':
dbg() << "newline"; dbgln("newline");
if (!current_output_line.to_string().is_empty()) if (!current_output_line.to_string().is_empty())
current.content.append(current_output_line.to_string()); current.content.append(current_output_line.to_string());
current_output_line.clear(); current_output_line.clear();
break; break;
case '#': case '#':
dbg() << "comment line:\t" << line; dbgln("comment line:\t{}", line);
break; break;
default: default:
dbg() << "content line:\t" << line; dbgln("content line:\t", line);
if (current_output_line.length() != 0) if (current_output_line.length() != 0)
current_output_line.append(' '); current_output_line.append(' ');
current_output_line.append(line); current_output_line.append(line);