1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:27:43 +00:00

Base+LibCore: Store booleans in human-readable format

Fixes #10640.
This commit is contained in:
Ben Wiederhake 2021-11-04 22:28:05 +01:00 committed by Andreas Kling
parent 3e420b7590
commit f9167c9265
8 changed files with 58 additions and 60 deletions

View file

@ -1,3 +1,3 @@
[DNS] [DNS]
Nameservers=1.1.1.1,1.0.0.1 Nameservers=1.1.1.1,1.0.0.1
EnableServer=0 EnableServer=false

View file

@ -6,77 +6,77 @@ User=anon
[RequestServer] [RequestServer]
Socket=/tmp/portal/request Socket=/tmp/portal/request
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
Priority=low Priority=low
User=anon User=anon
SystemModes=text,graphical SystemModes=text,graphical
MultiInstance=1 MultiInstance=true
AcceptSocketConnections=1 AcceptSocketConnections=true
[FileSystemAccessServer] [FileSystemAccessServer]
Socket=/tmp/portal/filesystemaccess Socket=/tmp/portal/filesystemaccess
SocketPermissions=660 SocketPermissions=660
Lazy=1 Lazy=true
Priority=low Priority=low
User=anon User=anon
SystemModes=text,graphical SystemModes=text,graphical
MultiInstance=1 MultiInstance=true
AcceptSocketConnections=1 AcceptSocketConnections=true
[WebContent] [WebContent]
Socket=/tmp/portal/webcontent Socket=/tmp/portal/webcontent
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
User=anon User=anon
SystemModes=graphical SystemModes=graphical
MultiInstance=1 MultiInstance=true
AcceptSocketConnections=1 AcceptSocketConnections=true
[ImageDecoder] [ImageDecoder]
Socket=/tmp/portal/image Socket=/tmp/portal/image
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
User=anon User=anon
SystemModes=graphical SystemModes=graphical
MultiInstance=1 MultiInstance=true
AcceptSocketConnections=1 AcceptSocketConnections=true
[WebSocket] [WebSocket]
Socket=/tmp/portal/websocket Socket=/tmp/portal/websocket
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
Priority=low Priority=low
User=anon User=anon
SystemModes=text,graphical SystemModes=text,graphical
MultiInstance=1 MultiInstance=true
AcceptSocketConnections=1 AcceptSocketConnections=true
[LookupServer] [LookupServer]
Socket=/tmp/portal/lookup Socket=/tmp/portal/lookup
SocketPermissions=660 SocketPermissions=660
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
User=lookup User=lookup
SystemModes=text,graphical,self-test SystemModes=text,graphical,self-test
[DHCPClient] [DHCPClient]
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
User=root User=root
SystemModes=text,graphical,self-test SystemModes=text,graphical,self-test
[NotificationServer] [NotificationServer]
Socket=/tmp/portal/notify Socket=/tmp/portal/notify
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
User=anon User=anon
[LaunchServer] [LaunchServer]
Socket=/tmp/portal/launch Socket=/tmp/portal/launch
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
User=anon User=anon
SystemModes=text,graphical SystemModes=text,graphical
@ -84,13 +84,13 @@ SystemModes=text,graphical
Socket=/tmp/portal/window,/tmp/portal/wm Socket=/tmp/portal/window,/tmp/portal/wm
SocketPermissions=660 SocketPermissions=660
Priority=high Priority=high
KeepAlive=1 KeepAlive=true
User=window User=window
[InspectorServer] [InspectorServer]
Socket=/tmp/portal/inspector,/tmp/portal/inspectables Socket=/tmp/portal/inspector,/tmp/portal/inspectables
SocketPermissions=600,666 SocketPermissions=600,666
KeepAlive=1 KeepAlive=true
User=anon User=anon
[Clipboard] [Clipboard]
@ -103,7 +103,7 @@ User=anon
# TODO: It would be nice to make this lazy, but Audio.Applet connects to it immediately on startup anyway. # TODO: It would be nice to make this lazy, but Audio.Applet connects to it immediately on startup anyway.
Socket=/tmp/portal/audio Socket=/tmp/portal/audio
Priority=high Priority=high
KeepAlive=1 KeepAlive=true
User=anon User=anon
SystemModes=text,graphical SystemModes=text,graphical
@ -111,45 +111,45 @@ SystemModes=text,graphical
Executable=/bin/Shell Executable=/bin/Shell
StdIO=/dev/tty0 StdIO=/dev/tty0
Environment=TERM=xterm Environment=TERM=xterm
KeepAlive=1 KeepAlive=true
SystemModes=text SystemModes=text
[Shell@tty1] [Shell@tty1]
Executable=/bin/Shell Executable=/bin/Shell
StdIO=/dev/tty1 StdIO=/dev/tty1
Environment=TERM=xterm Environment=TERM=xterm
KeepAlive=1 KeepAlive=true
SystemModes=text SystemModes=text
[CppLanguageServer] [CppLanguageServer]
Socket=/tmp/portal/language/cpp Socket=/tmp/portal/language/cpp
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
User=anon User=anon
MultiInstance=1 MultiInstance=true
AcceptSocketConnections=1 AcceptSocketConnections=true
[ShellLanguageServer] [ShellLanguageServer]
Socket=/tmp/portal/language/shell Socket=/tmp/portal/language/shell
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=true
User=anon User=anon
MultiInstance=1 MultiInstance=true
AcceptSocketConnections=1 AcceptSocketConnections=true
[SQLServer] [SQLServer]
Socket=/tmp/portal/sql Socket=/tmp/portal/sql
SocketPermissions=600 SocketPermissions=600
Priority=low Priority=low
Lazy=1 Lazy=true
User=anon User=anon
[CrashDaemon] [CrashDaemon]
KeepAlive=1 KeepAlive=true
User=anon User=anon
[KeyboardPreferenceLoader] [KeyboardPreferenceLoader]
KeepAlive=0 KeepAlive=false
User=anon User=anon
[TestRunner@ttyS0] [TestRunner@ttyS0]
@ -169,7 +169,7 @@ WorkingDirectory=/root/
SystemModes=generate-manpages SystemModes=generate-manpages
[SpiceAgent] [SpiceAgent]
KeepAlive=0 KeepAlive=false
[LoginServer] [LoginServer]
User=root User=root

View file

@ -20,7 +20,7 @@ Name=Default
AccelerationFactor=1.0 AccelerationFactor=1.0
ScrollStepSize=4 ScrollStepSize=4
CursorTheme=Default CursorTheme=Default
ButtonsSwitched=0 ButtonsSwitched=false
[Graphics] [Graphics]
OverlayRectShadow=/res/graphics/overlay-rect-shadow.png OverlayRectShadow=/res/graphics/overlay-rect-shadow.png

View file

@ -1,6 +1,6 @@
[DirectoryView] [DirectoryView]
ViewMode=Icon ViewMode=Icon
ShowDotFiles=0 ShowDotFiles=false
[Window] [Window]
Left=150 Left=150
@ -9,7 +9,7 @@ Width=640
Height=480 Height=480
[Layout] [Layout]
ShowToolbar=1 ShowToolbar=true
ShowStatusBar=1 ShowStatusBar=true
ShowLocationBar=1 ShowLocationBar=true
ShowFolderPane=1 ShowFolderPane=true

View file

@ -1,9 +1,9 @@
[PixelGrid] [PixelGrid]
Threshold=15 Threshold=15
Show=1 Show=true
[Rulers] [Rulers]
Show=1 Show=true
[Guides] [Guides]
Show=1 Show=true

View file

@ -1,32 +1,32 @@
[DesktopPicker.Applet] [DesktopPicker.Applet]
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
[ResourceGraph.Applet] [ResourceGraph.Applet]
Arguments=--cpu=CPUGraph,#00bb00 --memory=MemoryGraph,#00bbbb Arguments=--cpu=CPUGraph,#00bb00 --memory=MemoryGraph,#00bbbb
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
[Audio.Applet] [Audio.Applet]
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
[Network.Applet] [Network.Applet]
Arguments=--name=Network Arguments=--name=Network
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
[ClipboardHistory.Applet] [ClipboardHistory.Applet]
Priority=low Priority=low
KeepAlive=1 KeepAlive=true
[Taskbar] [Taskbar]
KeepAlive=1 KeepAlive=true
[Desktop] [Desktop]
Executable=/bin/FileManager Executable=/bin/FileManager
Arguments=--desktop Arguments=--desktop
KeepAlive=1 KeepAlive=true
[Terminal] [Terminal]
WorkingDirectory=/home/anon WorkingDirectory=/home/anon

View file

@ -1,4 +1,4 @@
[Layout] [Layout]
ShowRuler=1 ShowRuler=true
ShowToolbar=1 ShowToolbar=true
ShowStatusBar=1 ShowStatusBar=true

View file

@ -134,10 +134,8 @@ int ConfigFile::read_num_entry(String const& group, String const& key, int defau
bool ConfigFile::read_bool_entry(String const& group, String const& key, bool default_value) const bool ConfigFile::read_bool_entry(String const& group, String const& key, bool default_value) const
{ {
auto value = read_entry(group, key, default_value ? "1" : "0"); auto value = read_entry(group, key, default_value ? "true" : "false");
if (value == "1" || value.to_lowercase() == "true") return value == "1" || value.equals_ignoring_case("true"sv);
return 1;
return 0;
} }
void ConfigFile::write_entry(String const& group, String const& key, String const& value) void ConfigFile::write_entry(String const& group, String const& key, String const& value)
@ -152,7 +150,7 @@ void ConfigFile::write_num_entry(String const& group, String const& key, int val
} }
void ConfigFile::write_bool_entry(String const& group, String const& key, bool value) void ConfigFile::write_bool_entry(String const& group, String const& key, bool value)
{ {
write_entry(group, key, value ? "1" : "0"); write_entry(group, key, value ? "true" : "false");
} }
void ConfigFile::write_color_entry(String const& group, String const& key, Color value) void ConfigFile::write_color_entry(String const& group, String const& key, Color value)
{ {