summaryrefslogtreecommitdiff
path: root/Applications/TextEditor
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-07 01:08:07 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-07 01:08:07 +0100
commitc3bb84239ec0f8d2f9ed03008b24dbbef8c72dbe (patch)
tree29b91ad30e98e84b06c7d6f972b8e8b4a3064c6f /Applications/TextEditor
parent1f92636c6de2e3b39983dc5ca3d1f7696b150ae0 (diff)
downloadserenity-c3bb84239ec0f8d2f9ed03008b24dbbef8c72dbe.zip
TextEditor: Show the open filename in the window title.
Diffstat (limited to 'Applications/TextEditor')
-rw-r--r--Applications/TextEditor/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp
index 736a6cbc69..a35688c211 100644
--- a/Applications/TextEditor/main.cpp
+++ b/Applications/TextEditor/main.cpp
@@ -29,9 +29,10 @@ int main(int argc, char** argv)
statusbar->set_text(String::format("Line: %d, Column: %d", editor.cursor().line(), editor.cursor().column()));
};
+ String path = "/home/anon/ReadMe.md";
{
StringBuilder builder;
- int fd = open("/home/anon/ReadMe.md", O_RDONLY);
+ int fd = open(path.characters(), O_RDONLY);
if (fd < 0) {
perror("open");
return 1;
@@ -80,7 +81,7 @@ int main(int argc, char** argv)
app.set_menubar(move(menubar));
auto* window = new GWindow;
- window->set_title("TextEditor");
+ window->set_title(String::format("TextEditor: %s", path.characters()));
window->set_rect(20, 200, 640, 400);
window->set_main_widget(widget);
window->set_should_exit_app_on_close(true);