diff options
-rw-r--r-- | Userland/Applications/AnalogClock/main.cpp | 3 | ||||
-rw-r--r-- | Userland/Applications/Browser/main.cpp | 3 | ||||
-rw-r--r-- | Userland/Applications/Calendar/main.cpp | 3 | ||||
-rw-r--r-- | Userland/Services/RequestServer/main.cpp | 3 | ||||
-rw-r--r-- | Userland/Services/Taskbar/ClockWidget.h | 6 | ||||
-rw-r--r-- | Userland/Services/WebContent/main.cpp | 3 | ||||
-rw-r--r-- | Userland/Utilities/date.cpp | 2 | ||||
-rw-r--r-- | Userland/Utilities/ddate.cpp | 3 | ||||
-rw-r--r-- | Userland/Utilities/fortune.cpp | 3 | ||||
-rw-r--r-- | Userland/Utilities/js.cpp | 3 | ||||
-rw-r--r-- | Userland/Utilities/w.cpp | 2 |
11 files changed, 33 insertions, 1 deletions
diff --git a/Userland/Applications/AnalogClock/main.cpp b/Userland/Applications/AnalogClock/main.cpp index 719103410e..426d84a5f6 100644 --- a/Userland/Applications/AnalogClock/main.cpp +++ b/Userland/Applications/AnalogClock/main.cpp @@ -14,6 +14,7 @@ #include <LibGUI/Menubar.h> #include <LibGUI/Window.h> #include <LibMain/Main.h> +#include <time.h> ErrorOr<int> serenity_main(Main::Arguments arguments) { @@ -24,6 +25,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); + tzset(); + auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-analog-clock")); auto window = TRY(GUI::Window::try_create()); window->set_title(Core::DateTime::now().to_string("%Y-%m-%d")); diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 413bb68059..cbba6d7552 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -21,6 +21,7 @@ #include <LibGUI/Icon.h> #include <LibGUI/TabWidget.h> #include <LibMain/Main.h> +#include <time.h> #include <unistd.h> namespace Browser { @@ -82,6 +83,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/tmp/portal/request", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); + tzset(); + auto app_icon = GUI::Icon::default_icon("app-browser"); Browser::g_home_url = Config::read_string("Browser", "Preferences", "Home", "file:///res/html/misc/welcome.html"); diff --git a/Userland/Applications/Calendar/main.cpp b/Userland/Applications/Calendar/main.cpp index 57aceb613e..3270a8ac4f 100644 --- a/Userland/Applications/Calendar/main.cpp +++ b/Userland/Applications/Calendar/main.cpp @@ -19,6 +19,7 @@ #include <LibGUI/Toolbar.h> #include <LibGUI/Window.h> #include <LibMain/Main.h> +#include <time.h> ErrorOr<int> serenity_main(Main::Arguments arguments) { @@ -31,6 +32,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); + tzset(); + auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-calendar")); auto window = TRY(GUI::Window::try_create()); window->set_title("Calendar"); diff --git a/Userland/Services/RequestServer/main.cpp b/Userland/Services/RequestServer/main.cpp index c9b1884b63..9972401f5f 100644 --- a/Userland/Services/RequestServer/main.cpp +++ b/Userland/Services/RequestServer/main.cpp @@ -16,6 +16,7 @@ #include <RequestServer/HttpProtocol.h> #include <RequestServer/HttpsProtocol.h> #include <signal.h> +#include <time.h> ErrorOr<int> serenity_main(Main::Arguments) { @@ -32,6 +33,8 @@ ErrorOr<int> serenity_main(Main::Arguments) TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil(nullptr, nullptr)); + tzset(); + [[maybe_unused]] auto gemini = make<RequestServer::GeminiProtocol>(); [[maybe_unused]] auto http = make<RequestServer::HttpProtocol>(); [[maybe_unused]] auto https = make<RequestServer::HttpsProtocol>(); diff --git a/Userland/Services/Taskbar/ClockWidget.h b/Userland/Services/Taskbar/ClockWidget.h index da9962486b..0e8eafae54 100644 --- a/Userland/Services/Taskbar/ClockWidget.h +++ b/Userland/Services/Taskbar/ClockWidget.h @@ -30,7 +30,11 @@ private: virtual void paint_event(GUI::PaintEvent&) override; virtual void mousedown_event(GUI::MouseEvent&) override; - void tick_clock() { update(); } + void tick_clock() + { + tzset(); + update(); + } void open(); void close(); diff --git a/Userland/Services/WebContent/main.cpp b/Userland/Services/WebContent/main.cpp index 2c51f2f761..02d04d4786 100644 --- a/Userland/Services/WebContent/main.cpp +++ b/Userland/Services/WebContent/main.cpp @@ -10,6 +10,7 @@ #include <LibIPC/SingleServer.h> #include <LibMain/Main.h> #include <WebContent/ClientConnection.h> +#include <time.h> ErrorOr<int> serenity_main(Main::Arguments) { @@ -22,6 +23,8 @@ ErrorOr<int> serenity_main(Main::Arguments) TRY(Core::System::unveil("/tmp/portal/websocket", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); + tzset(); + auto client = TRY(IPC::take_over_accepted_client_from_system_server<WebContent::ClientConnection>()); return event_loop.exec(); } diff --git a/Userland/Utilities/date.cpp b/Userland/Utilities/date.cpp index 12d6bae420..28ae833449 100644 --- a/Userland/Utilities/date.cpp +++ b/Userland/Utilities/date.cpp @@ -29,6 +29,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) args_parser.add_option(print_rfc_5322, "Print date in RFC 5322 format", "rfc-5322", 'R'); args_parser.parse(arguments); + tzset(); + if (set_date != nullptr) { auto number = String(set_date).to_uint(); diff --git a/Userland/Utilities/ddate.cpp b/Userland/Utilities/ddate.cpp index 9e7d8ce66b..e6f5c3c63a 100644 --- a/Userland/Utilities/ddate.cpp +++ b/Userland/Utilities/ddate.cpp @@ -8,6 +8,7 @@ #include <LibCore/DateTime.h> #include <LibCore/System.h> #include <LibMain/Main.h> +#include <time.h> #include <unistd.h> class DiscordianDate { @@ -104,6 +105,8 @@ ErrorOr<int> serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); + tzset(); + auto date = Core::DateTime::now(); outln("Today is {}", DiscordianDate(date).to_string()); diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp index 324ec17874..5d5aac3641 100644 --- a/Userland/Utilities/fortune.cpp +++ b/Userland/Utilities/fortune.cpp @@ -17,6 +17,7 @@ #include <LibMain/Main.h> #include <stdio.h> #include <stdlib.h> +#include <time.h> #include <unistd.h> class Quote { @@ -87,6 +88,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil(nullptr, nullptr)); + tzset(); + auto file_contents = file->read_all(); auto json = TRY(JsonValue::from_string(file_contents)); if (!json.is_array()) { diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index c77c563f80..66bec4ccb7 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -68,6 +68,7 @@ #include <fcntl.h> #include <signal.h> #include <stdio.h> +#include <time.h> #include <unistd.h> RefPtr<JS::VM> vm; @@ -1287,6 +1288,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(script_paths, "Path to script files", "scripts", Core::ArgsParser::Required::No); args_parser.parse(arguments); + tzset(); + bool syntax_highlight = !disable_syntax_highlight; vm = JS::VM::create(); diff --git a/Userland/Utilities/w.cpp b/Userland/Utilities/w.cpp index 2d4ed240f1..f59d7fc888 100644 --- a/Userland/Utilities/w.cpp +++ b/Userland/Utilities/w.cpp @@ -25,6 +25,8 @@ ErrorOr<int> serenity_main(Main::Arguments) TRY(Core::System::unveil("/proc", "r")); TRY(Core::System::unveil(nullptr, nullptr)); + tzset(); + auto file = TRY(Core::File::open("/var/run/utmp", Core::OpenMode::ReadOnly)); auto json = TRY(JsonValue::from_string(file->read_all())); if (!json.is_object()) { |