Skip to content

Commit

Permalink
Local RPMs: Replace QTSparql with QtDocGallery (#462)
Browse files Browse the repository at this point in the history
Because libqtsparql's QML API was dropped from Sailfish OS 4.5.0.
  • Loading branch information
citronalco authored Mar 18, 2024
1 parent 4931682 commit fdd9c5b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions qml/pages/LocalRpmsPage.qml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import QtSparql 1.0
import QtDocGallery 5.0
import harbour.orn 1.0

Page {
// Duplicate count property because items are not really deleted from the model
property int _count: 0

readonly property bool _ready: page.status === PageStatus.Active && queryModel.status === SparqlListModel.Ready
readonly property bool _ready: page.status === PageStatus.Active && (queryModel.status === DocumentGalleryModel.Idle || queryModel.status === DocumentGalleryModel.Finished)

on_ReadyChanged: _ready && (_count = queryModel.count)

id: page
allowedOrientations: defaultAllowedOrientations

SparqlListModel {
DocumentGalleryModel {
id: queryModel
query: "SELECT strafter(nie:url(?r), 'file://') as ?filePath WHERE { ?r nie:mimeType 'application/x-rpm' }"
connection: SparqlConnection {
driver: "QTRACKER_DIRECT"
properties: ["fileName", "filePath"]
sortProperties: ["+fileName"]
rootType: DocumentGallery.File
filter: GalleryFilterUnion {
filters: [
GalleryEqualsFilter { property: "fileExtension"; value: "rpm" },
GalleryEqualsFilter { property: "fileExtension"; value: "RPM" }
]
}
}

Expand Down

0 comments on commit fdd9c5b

Please sign in to comment.