From 169498f9db0aa5c8808edefe49c2e7bcb2fb3b71 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sat, 21 May 2022 19:36:28 +0200 Subject: [PATCH] Spreadsheet: Recognize sheets files by mime type, not by file extension These conditions weren't executed since 933a717f3b and always showed a file import/export wizard. --- Userland/Applications/Spreadsheet/ExportDialog.cpp | 2 +- Userland/Applications/Spreadsheet/ImportDialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/Spreadsheet/ExportDialog.cpp b/Userland/Applications/Spreadsheet/ExportDialog.cpp index 6139060904..37c8f2e72d 100644 --- a/Userland/Applications/Spreadsheet/ExportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ExportDialog.cpp @@ -292,7 +292,7 @@ Result ExportDialog::make_and_run_for(StringView mime, Core::File& if (mime == "text/csv") { return export_xsv(); - } else if (mime == "text/plain" && file.filename().ends_with(".sheets")) { + } else if (mime == "application/x-sheets+json") { return export_worksheet(); } else { auto page = GUI::WizardPage::construct( diff --git a/Userland/Applications/Spreadsheet/ImportDialog.cpp b/Userland/Applications/Spreadsheet/ImportDialog.cpp index 50d74c7089..3b5c794f65 100644 --- a/Userland/Applications/Spreadsheet/ImportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ImportDialog.cpp @@ -245,7 +245,7 @@ Result, String> ImportDialog::make_and_run_for(GUI::W if (mime == "text/csv") { return import_xsv(); - } else if (mime == "text/plain" && file.filename().ends_with(".sheets")) { + } else if (mime == "application/x-sheets+json") { return import_worksheet(); } else { auto page = GUI::WizardPage::construct(