loginui+2048: Replace String with RefString
This commit is contained in:
parent
53f8a583dc
commit
e3613d1653
@ -1,4 +1,4 @@
|
||||
#include <luna/String.h>
|
||||
#include <luna/RefString.h>
|
||||
#include <luna/Utf8.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@ -325,7 +325,7 @@ class GameWidget final : public ui::Widget
|
||||
|
||||
canvas.fill(colors[tile.color]);
|
||||
|
||||
auto fmt = TRY(String::format("%d"_sv, tile.number));
|
||||
auto fmt = TRY(RefString::format("%d"_sv, tile.number));
|
||||
|
||||
auto font = ui::Font::default_bold_font();
|
||||
auto rect = ui::align({ 0, 0, canvas.width, canvas.height },
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <luna/String.h>
|
||||
#include <luna/RefString.h>
|
||||
#include <os/ArgumentParser.h>
|
||||
#include <os/Config.h>
|
||||
#include <os/File.h>
|
||||
@ -68,7 +68,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
|
||||
if (!username.is_empty())
|
||||
{
|
||||
auto flag = String::format("--user=%s"_sv, username.chars()).release_value();
|
||||
auto flag = RefString::format("--user=%s"_sv, username.chars()).release_value();
|
||||
|
||||
StringView startui_command[] = { "/usr/bin/startui", flag.view() };
|
||||
os::Process::exec(startui_command[0], Slice<StringView>(startui_command, 2));
|
||||
@ -118,7 +118,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
stage = Stage::PasswordInput;
|
||||
label.set_text("Password:");
|
||||
|
||||
String title = String::format("Log in: %s"_sv, data.chars()).release_value();
|
||||
RefString title = RefString::format("Log in: %s"_sv, data.chars()).release_value();
|
||||
window->set_title(title.view());
|
||||
|
||||
input.clear();
|
||||
@ -160,7 +160,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
return;
|
||||
}
|
||||
|
||||
auto flag = String::format("--user=%s"_sv, pw->pw_name).release_value();
|
||||
auto flag = RefString::format("--user=%s"_sv, pw->pw_name).release_value();
|
||||
|
||||
StringView startui_command[] = { "/usr/bin/startui", flag.view() };
|
||||
os::Process::exec(startui_command[0], Slice<StringView>(startui_command, 2));
|
||||
|
Loading…
Reference in New Issue
Block a user