From 73ba2a8e5b8391eea6607027ba55d6e0567a5300 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 7 Feb 2018 08:53:37 +0000 Subject: [PATCH 1/2] Polyhedron: Add *STL to nameFilters() --- Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp index 9eada718ae9..8a2d74bd0e1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp @@ -55,7 +55,7 @@ public: }; QString Polyhedron_demo_stl_plugin::nameFilters() const { - return "STL files (*.stl)"; + return "STL files (*.stl *STL)"; } bool Polyhedron_demo_stl_plugin::canLoad() const { From dae33259c5b60f75606df72d0230b24f5b395abc Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 7 Feb 2018 11:18:45 +0100 Subject: [PATCH 2/2] Use toLower() in the mainWindow to read indistinctly lower and capital extensions. --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 4 ++-- Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 54cfde41e68..d4365323f33 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1015,7 +1015,7 @@ void MainWindow::open(QString filename) Q_FOREACH(CGAL::Three::Polyhedron_demo_io_plugin_interface* io_plugin, io_plugins) { if ( !io_plugin->canLoad() ) continue; all_items << io_plugin->name(); - if ( file_matches_filter(io_plugin->loadNameFilters(), filename) ) + if ( file_matches_filter(io_plugin->loadNameFilters(), filename.toLower()) ) selected_items << io_plugin->name(); } } @@ -1642,7 +1642,7 @@ void MainWindow::save(QString filename, CGAL::Three::Scene_item* item) { bool saved = false; Q_FOREACH(CGAL::Three::Polyhedron_demo_io_plugin_interface* plugin, io_plugins) { if( plugin->canSave(item) && - file_matches_filter(plugin->saveNameFilters(),filename) ) + file_matches_filter(plugin->saveNameFilters(),filename.toLower()) ) { if(plugin->save(item, fileinfo)) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp index 8a2d74bd0e1..9eada718ae9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp @@ -55,7 +55,7 @@ public: }; QString Polyhedron_demo_stl_plugin::nameFilters() const { - return "STL files (*.stl *STL)"; + return "STL files (*.stl)"; } bool Polyhedron_demo_stl_plugin::canLoad() const {