Workaround open profiles from toot

Opening profiles (@user) in toots via function onLinkActivated shows user via search. This is a workaround - aim is to open profiles directly in profile.qml
This commit is contained in:
molan-git 2020-01-24 21:56:13 +01:00 committed by GitHub
parent d388de5f9f
commit c8545cca65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,10 +69,11 @@ Page {
onOpenDrawer: infoPanel.open = setDrawer onOpenDrawer: infoPanel.open = setDrawer
} }
MyList{ MyList{
id: tlPublic; id: tlNotifications;
title: qsTr("Federated") title: qsTr("Notifications")
type: "timelines/public" type: "notifications"
mdl: Logic.modelTLpublic notifier: true
mdl: Logic.modelTLnotifications
width: parent.itemWidth width: parent.itemWidth
height: parent.itemHeight height: parent.itemHeight
onOpenDrawer: infoPanel.open = setDrawer onOpenDrawer: infoPanel.open = setDrawer
@ -88,11 +89,10 @@ Page {
onOpenDrawer: infoPanel.open = setDrawer onOpenDrawer: infoPanel.open = setDrawer
} }
MyList{ MyList{
id: tlNotifications; id: tlPublic;
title: qsTr("Notifications") title: qsTr("Federated")
type: "notifications" type: "timelines/public"
notifier: true mdl: Logic.modelTLpublic
mdl: Logic.modelTLnotifications
width: parent.itemWidth width: parent.itemWidth
height: parent.itemHeight height: parent.itemHeight
onOpenDrawer: infoPanel.open = setDrawer onOpenDrawer: infoPanel.open = setDrawer
@ -260,6 +260,11 @@ Page {
slideshow.positionViewAtIndex(4, ListView.SnapToItem) slideshow.positionViewAtIndex(4, ListView.SnapToItem)
navigation.navigateTo('search') navigation.navigateTo('search')
} else if (test.length === 4 && test[3][0] === "@" ) {
tlSearch.search = decodeURIComponent("@"+test[3].substring(1)+"@"+test[2])
slideshow.positionViewAtIndex(4, ListView.SnapToItem)
navigation.navigateTo('search')
} else { } else {
Qt.openUrlExternally(href); Qt.openUrlExternally(href);
} }