77#include < qpalette.h>
88
99#include < memory>
10- #include < sstream >
10+ #include < print >
1111#include < string>
1212
1313#include " ../ffi/namespace/include/config.hxx"
1414#include " ../ffi/namespace/include/utils.hxx"
1515#include " include/theme_manager.hxx"
1616
1717#if defined(LAZY_DEBUG)
18- #include < iostream>
19- using std::cout;
18+ #include < format>
19+
20+ #include " ../front_end_utils/include/utils.hxx"
21+ using Lazyboard::front_end_utils::dump_ptr_address;
22+ using std::println;
2023#endif
2124
2225#include " ../front_end_utils/include/error_types.hxx"
@@ -25,9 +28,9 @@ using std::cout;
2528using Lazyboard::front_end::MainWindowPreload;
2629using Self = MainWindowPreload;
2730
31+ using std::format;
2832using std::make_unique;
2933using std::string;
30- using std::stringstream;
3134using namespace Lazyboard ::ffi;
3235using Lazyboard::front_end_utils::error_dialog_show;
3336using Lazyboard::front_end_utils::ErrorTypes;
@@ -96,11 +99,7 @@ void Self::on_read_exists_cfg_error(RawReadAppConfigStatus status,
9699
97100string Self::application_config () {
98101 auto config_dir_raw = ffi::config_dir ();
99-
100- stringstream string_stream;
101- string_stream << config_dir_raw << " /Lazyboard"
102- << " /settings.toml" ;
103- string config_path = string_stream.str ();
102+ string config_path = format (" {}/Lazyboard/settings.toml" , config_dir_raw);
104103
105104 ffi::free_c_str (config_dir_raw);
106105 return config_path;
@@ -116,14 +115,14 @@ void Self::create_default_config(QMainWindow *main_window) {
116115
117116 // clang-format off
118117 #if defined(LAZY_DEBUG)
119- cout << " [DEBUG] " << " Config path not found, generate at: " << config_path << " \n " ;
118+ println ( " [DEBUG] Config path not found, generate at: {} " , config_path) ;
120119 #endif
121120
122121 return ;
123122 }
124123
125124 #if defined(LAZY_DEBUG)
126- cout << " [DEBUG] " << " Found config path at: " << config_path << " \n " ;
125+ println ( " [DEBUG] Found config path at: {} " , config_path) ;
127126 #endif // clang-format on
128127}
129128
@@ -136,4 +135,12 @@ void Self::read_if_exists_config(QMainWindow *main_window) {
136135 this ->on_read_exists_cfg_error (status, main_window);
137136
138137 theme_manager->set_main_window_theme (main_window, raw_app_config.get ());
138+
139+ // clang-format off
140+ #if defined (LAZY_DEBUG)
141+ dump_ptr_address (raw_app_config.get ());
142+ dump_ptr_address (theme_manager.get ());
143+ dump_ptr_address (main_window);
144+
145+ #endif // clang-format on
139146}
0 commit comments