From 1b62c663c89c00c6f90ee82ff7be25fcc1ff263e Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Sun, 18 Apr 2021 09:28:33 +0200 Subject: [PATCH] Make filters Calligra-aware --- qml/components/DocumentFilter.notqml | 39 ------------- qml/components/DocumentFilterOffice.notqml | 64 ++++++++++++++++++++++ qml/pages/FirstPage.qml | 2 +- 3 files changed, 65 insertions(+), 40 deletions(-) create mode 100644 qml/components/DocumentFilterOffice.notqml diff --git a/qml/components/DocumentFilter.notqml b/qml/components/DocumentFilter.notqml index 302fd8c..91d30be 100644 --- a/qml/components/DocumentFilter.notqml +++ b/qml/components/DocumentFilter.notqml @@ -22,43 +22,4 @@ GalleryFilterUnion { value: ".PS" } - GalleryEndsWithFilter { - property: "fileName" - value: ".odt" - } - - GalleryEndsWithFilter { - property: "fileName" - value: ".doc" - } - - GalleryEndsWithFilter { - property: "fileName" - value: ".docx" - } - - GalleryEndsWithFilter { - property: "fileName" - value: ".rtf" - } - - GalleryEndsWithFilter { - property: "fileName" - value: ".ODT" - } - - GalleryEndsWithFilter { - property: "fileName" - value: ".DOC" - } - - GalleryEndsWithFilter { - property: "fileName" - value: ".DOCX" - } - - GalleryEndsWithFilter { - property: "fileName" - value: ".RTF" - } } diff --git a/qml/components/DocumentFilterOffice.notqml b/qml/components/DocumentFilterOffice.notqml new file mode 100644 index 0000000..302fd8c --- /dev/null +++ b/qml/components/DocumentFilterOffice.notqml @@ -0,0 +1,64 @@ +import QtDocGallery 5.0 + +GalleryFilterUnion { + + GalleryEndsWithFilter { + property: "fileName" + value: ".pdf" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".ps" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".PDF" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".PS" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".odt" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".doc" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".docx" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".rtf" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".ODT" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".DOC" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".DOCX" + } + + GalleryEndsWithFilter { + property: "fileName" + value: ".RTF" + } +} diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml index dd7fd48..76f812f 100644 --- a/qml/pages/FirstPage.qml +++ b/qml/pages/FirstPage.qml @@ -407,7 +407,7 @@ Page { allowedOrientations: Orientation.All Component.onCompleted: { - var thingy = Qt.createComponent("../components/DocumentFilter.notqml"); + var thingy = Qt.createComponent(ConvertChecker.calligra ? "../components/DocumentFilterOffice.notqml" : "../components/DocumentFilter.notqml"); if (thingy.status == Component.Ready) { _contentModel.contentFilter = thingy.createObject(this); }