summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
Diffstat (limited to 'Applications')
-rw-r--r--Applications/About/main.cpp2
-rw-r--r--Applications/Calculator/main.cpp2
-rw-r--r--Applications/ChanViewer/main.cpp2
-rw-r--r--Applications/FileManager/main.cpp2
-rw-r--r--Applications/FontEditor/main.cpp2
-rw-r--r--Applications/Launcher/main.cpp8
-rw-r--r--Applications/PaintBrush/main.cpp2
-rw-r--r--Applications/Piano/main.cpp2
-rw-r--r--Applications/QuickShow/main.cpp2
-rw-r--r--Applications/SoundPlayer/main.cpp2
-rw-r--r--Applications/Terminal/main.cpp12
-rw-r--r--Applications/TextEditor/main.cpp2
-rw-r--r--Applications/Welcome/main.cpp2
13 files changed, 21 insertions, 21 deletions
diff --git a/Applications/About/main.cpp b/Applications/About/main.cpp
index e14e07d330..803593c090 100644
--- a/Applications/About/main.cpp
+++ b/Applications/About/main.cpp
@@ -10,7 +10,7 @@ int main(int argc, char** argv)
{
GApplication app(argc, argv);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("About Serenity");
Rect window_rect { 0, 0, 240, 150 };
window_rect.center_within(GDesktop::the().rect());
diff --git a/Applications/Calculator/main.cpp b/Applications/Calculator/main.cpp
index 082dacb9e8..9e7208a293 100644
--- a/Applications/Calculator/main.cpp
+++ b/Applications/Calculator/main.cpp
@@ -6,7 +6,7 @@ int main(int argc, char** argv)
{
GApplication app(argc, argv);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Calculator");
window->set_resizable(false);
window->set_rect({ 300, 200, 254, 213 });
diff --git a/Applications/ChanViewer/main.cpp b/Applications/ChanViewer/main.cpp
index 095710f270..9ebda060c9 100644
--- a/Applications/ChanViewer/main.cpp
+++ b/Applications/ChanViewer/main.cpp
@@ -12,7 +12,7 @@ int main(int argc, char** argv)
{
GApplication app(argc, argv);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("ChanViewer");
window->set_rect(100, 100, 800, 500);
window->set_icon(load_png("/res/icons/16x16/app-chanviewer.png"));
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp
index 363cd0b878..7ac0d0a8f0 100644
--- a/Applications/FileManager/main.cpp
+++ b/Applications/FileManager/main.cpp
@@ -40,7 +40,7 @@ int main(int argc, char** argv)
GApplication app(argc, argv);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("File Manager");
window->set_rect(20, 200, 640, 480);
diff --git a/Applications/FontEditor/main.cpp b/Applications/FontEditor/main.cpp
index 93f74eee70..d8799c4279 100644
--- a/Applications/FontEditor/main.cpp
+++ b/Applications/FontEditor/main.cpp
@@ -25,7 +25,7 @@ int main(int argc, char** argv)
else
edited_font = Font::default_font().clone();
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Font Editor");
window->set_rect({ 50, 50, 390, 342 });
auto* font_editor = new FontEditorWidget(path, move(edited_font));
diff --git a/Applications/Launcher/main.cpp b/Applications/Launcher/main.cpp
index 857b4f0356..51aea7ea1c 100644
--- a/Applications/Launcher/main.cpp
+++ b/Applications/Launcher/main.cpp
@@ -12,7 +12,7 @@
#include <sys/wait.h>
#include <unistd.h>
-static GWindow* make_launcher_window();
+static ObjectPtr<GWindow> make_launcher_window();
void handle_sigchld(int)
{
@@ -31,7 +31,7 @@ int main(int argc, char** argv)
signal(SIGCHLD, handle_sigchld);
- auto* launcher_window = make_launcher_window();
+ auto launcher_window = make_launcher_window();
launcher_window->show();
return app.exec();
@@ -63,12 +63,12 @@ private:
String m_executable_path;
};
-GWindow* make_launcher_window()
+ObjectPtr<GWindow> make_launcher_window()
{
auto config = CConfigFile::get_for_app("Launcher");
auto vertical = config->read_bool_entry("Launcher", "Vertical", true);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Launcher");
int launcher_size = (config->groups().size() - 1) * 50;
window->set_rect(50, 50, vertical ? 50 : launcher_size, vertical ? launcher_size : 50);
diff --git a/Applications/PaintBrush/main.cpp b/Applications/PaintBrush/main.cpp
index 60bea29517..453da4a42c 100644
--- a/Applications/PaintBrush/main.cpp
+++ b/Applications/PaintBrush/main.cpp
@@ -15,7 +15,7 @@ int main(int argc, char** argv)
{
GApplication app(argc, argv);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("PaintBrush");
window->set_rect(100, 100, 640, 480);
diff --git a/Applications/Piano/main.cpp b/Applications/Piano/main.cpp
index 21d896f0d6..22699a1ada 100644
--- a/Applications/Piano/main.cpp
+++ b/Applications/Piano/main.cpp
@@ -17,7 +17,7 @@ int main(int argc, char** argv)
AClientConnection audio_connection;
audio_connection.handshake();
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Piano");
window->set_rect(100, 100, 512, 512);
diff --git a/Applications/QuickShow/main.cpp b/Applications/QuickShow/main.cpp
index b8097d62e1..22cadbb3a7 100644
--- a/Applications/QuickShow/main.cpp
+++ b/Applications/QuickShow/main.cpp
@@ -50,7 +50,7 @@ int main(int argc, char** argv)
return 1;
}
- auto* window = new GWindow;
+ auto window = GWindow::construct();
auto update_window_title = [&](int scale) {
window->set_title(String::format("QuickShow: %s %s %d%%", path, bitmap->size().to_string().characters(), scale));
diff --git a/Applications/SoundPlayer/main.cpp b/Applications/SoundPlayer/main.cpp
index e5a2c95188..26a64f42d5 100644
--- a/Applications/SoundPlayer/main.cpp
+++ b/Applications/SoundPlayer/main.cpp
@@ -30,7 +30,7 @@ int main(int argc, char** argv)
AClientConnection audio_client;
audio_client.handshake();
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("SoundPlayer");
window->set_rect(300, 300, 300, 200);
diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp
index 55971ad5e1..bec782c3dc 100644
--- a/Applications/Terminal/main.cpp
+++ b/Applications/Terminal/main.cpp
@@ -88,9 +88,9 @@ static void run_command(int ptm_fd, String command)
}
}
-GWindow* create_settings_window(TerminalWidget& terminal, RefPtr<CConfigFile> config)
+ObjectPtr<GWindow> create_settings_window(TerminalWidget& terminal, RefPtr<CConfigFile> config)
{
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Terminal Settings");
window->set_rect(50, 50, 200, 140);
@@ -156,7 +156,7 @@ int main(int argc, char** argv)
run_command(ptm_fd, args.get("e"));
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Terminal");
window->set_background_color(Color::Black);
window->set_double_buffering_enabled(false);
@@ -170,7 +170,7 @@ int main(int argc, char** argv)
window->set_icon(load_png("/res/icons/16x16/app-terminal.png"));
terminal->set_should_beep(config->read_bool_entry("Window", "AudibleBeep", false));
- WeakPtr<GWindow> settings_window;
+ ObjectPtr<GWindow> settings_window;
auto new_opacity = config->read_num_entry("Window", "Opacity", 255);
terminal->set_opacity(new_opacity);
@@ -180,9 +180,9 @@ int main(int argc, char** argv)
auto app_menu = make<GMenu>("Terminal");
app_menu->add_action(GAction::create("Settings...", load_png("/res/icons/gear16.png"),
- [&settings_window, terminal, &config](const GAction&) {
+ [&](const GAction&) {
if (!settings_window)
- settings_window = create_settings_window(*terminal, config)->make_weak_ptr();
+ settings_window = create_settings_window(*terminal, config);
settings_window->show();
settings_window->move_to_front();
}));
diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp
index 80f7925da2..66d4699f17 100644
--- a/Applications/TextEditor/main.cpp
+++ b/Applications/TextEditor/main.cpp
@@ -5,7 +5,7 @@ int main(int argc, char** argv)
{
GApplication app(argc, argv);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Text Editor");
window->set_rect(20, 200, 640, 400);
diff --git a/Applications/Welcome/main.cpp b/Applications/Welcome/main.cpp
index 85608ce286..e126f8dc16 100644
--- a/Applications/Welcome/main.cpp
+++ b/Applications/Welcome/main.cpp
@@ -62,7 +62,7 @@ int main(int argc, char** argv)
GApplication app(argc, argv);
- auto* window = new GWindow;
+ auto window = GWindow::construct();
window->set_title("Welcome to Serenity");
Rect window_rect { 0, 0, 640, 360 };
window_rect.center_within(GDesktop::the().rect());