summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-30 17:20:53 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-30 17:20:53 +0200
commit1a279c5b2aba17b0a22cfff0624124ebc3dbebc7 (patch)
tree93ffbe6e3b8ab2027304fa58fd7a49cef12a4ca2 /Applications
parentc5e057438c63a18c94251f0f350885152234f258 (diff)
downloadserenity-1a279c5b2aba17b0a22cfff0624124ebc3dbebc7.zip
GMessageBox: Hide the constructor and fix broken usages
We no longer support creating CObjects on the stack. Use construct().
Diffstat (limited to 'Applications')
-rw-r--r--Applications/PaintBrush/main.cpp3
-rw-r--r--Applications/TextEditor/TextEditorWidget.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/Applications/PaintBrush/main.cpp b/Applications/PaintBrush/main.cpp
index d7f87f8a80..aba425b811 100644
--- a/Applications/PaintBrush/main.cpp
+++ b/Applications/PaintBrush/main.cpp
@@ -50,8 +50,7 @@ int main(int argc, char** argv)
auto filename = picker.selected_file().string();
auto bitmap = load_png(filename);
if (!bitmap) {
- GMessageBox msgbox(String::format("Failed to load '%s'", filename.characters()), "Open failed", GMessageBox::Type::Error, GMessageBox::InputType::OK, window);
- msgbox.exec();
+ GMessageBox::show(String::format("Failed to load '%s'", filename.characters()), "Open failed", GMessageBox::Type::Error, GMessageBox::InputType::OK, window);
return;
}
paintable_widget->set_bitmap(*bitmap);
diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp
index 50ba9b5b4c..49e047bf75 100644
--- a/Applications/TextEditor/TextEditorWidget.cpp
+++ b/Applications/TextEditor/TextEditorWidget.cpp
@@ -118,8 +118,8 @@ TextEditorWidget::TextEditorWidget()
m_new_action = GAction::create("New", { Mod_Ctrl, Key_N }, GraphicsBitmap::load_from_file("/res/icons/16x16/new.png"), [this](const GAction&) {
if (m_document_dirty) {
- GMessageBox save_document_first_box("Save Document First?", "Warning", GMessageBox::Type::Warning, GMessageBox::InputType::OKCancel, window());
- auto save_document_first_result = save_document_first_box.exec();
+ auto save_document_first_box = GMessageBox::construct("Save Document First?", "Warning", GMessageBox::Type::Warning, GMessageBox::InputType::OKCancel, window());
+ auto save_document_first_result = save_document_first_box->exec();
if (save_document_first_result != GDialog::ExecResult::ExecOK)
return;