diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-12-28 23:22:12 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-30 14:17:18 +0100 |
commit | e3d5b67eaf6518810f960e77bde92eec6b648eb7 (patch) | |
tree | 48e6def46c801733e1b070c4afddf8543377a41f /Userland | |
parent | 690389ae813aa87b87aa20d9e4e552d07952b9da (diff) | |
download | serenity-e3d5b67eaf6518810f960e77bde92eec6b648eb7.zip |
SQLStudio: Remove (unimplemented) ability to open database storage files
It may be handy to have some sort of storage inspector at some point but
for now, it doesn't make sense to open a database file. So only allow
opening script files, and don't make assumptions on their extension.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/DevTools/SQLStudio/MainWidget.cpp | 10 | ||||
-rw-r--r-- | Userland/DevTools/SQLStudio/MainWidget.h | 1 | ||||
-rw-r--r-- | Userland/DevTools/SQLStudio/main.cpp | 12 |
3 files changed, 4 insertions, 19 deletions
diff --git a/Userland/DevTools/SQLStudio/MainWidget.cpp b/Userland/DevTools/SQLStudio/MainWidget.cpp index 5c5ca3c694..3eb924e0a1 100644 --- a/Userland/DevTools/SQLStudio/MainWidget.cpp +++ b/Userland/DevTools/SQLStudio/MainWidget.cpp @@ -352,11 +352,6 @@ void MainWidget::open_script_from_file(LexicalPath const& file_path) m_tab_widget->set_active_widget(&editor); } -void MainWidget::open_database_from_file(LexicalPath const&) -{ - TODO(); -} - bool MainWidget::request_close() { auto any_scripts_modified { false }; @@ -485,10 +480,7 @@ void MainWidget::drop_event(GUI::DropEvent& drop_event) continue; auto lexical_path = LexicalPath(url.path()); - if (lexical_path.extension().equals_ignoring_case("sql"sv)) - open_script_from_file(lexical_path); - if (lexical_path.extension().equals_ignoring_case("db"sv)) - open_database_from_file(lexical_path); + open_script_from_file(lexical_path); } } } diff --git a/Userland/DevTools/SQLStudio/MainWidget.h b/Userland/DevTools/SQLStudio/MainWidget.h index a068cfd085..d0fc29ba7f 100644 --- a/Userland/DevTools/SQLStudio/MainWidget.h +++ b/Userland/DevTools/SQLStudio/MainWidget.h @@ -25,7 +25,6 @@ public: void initialize_menu(GUI::Window*); void open_new_script(); void open_script_from_file(LexicalPath const&); - void open_database_from_file(LexicalPath const&); bool request_close(); diff --git a/Userland/DevTools/SQLStudio/main.cpp b/Userland/DevTools/SQLStudio/main.cpp index c08746ccdb..ea93c93c0e 100644 --- a/Userland/DevTools/SQLStudio/main.cpp +++ b/Userland/DevTools/SQLStudio/main.cpp @@ -39,18 +39,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) return GUI::Window::CloseRequestDecision::StayOpen; }; - auto needs_new_script = true; if (file_to_open) { auto path = LexicalPath(file_to_open); - if (path.extension().equals_ignoring_case("sql"sv)) { - main_widget->open_script_from_file(path); - needs_new_script = false; - } else if (path.extension().equals_ignoring_case("db"sv)) { - main_widget->open_database_from_file(path); - } - } - if (needs_new_script) + main_widget->open_script_from_file(path); + } else { main_widget->open_new_script(); + } window->show(); return app->exec(); |