mirror of
https://github.com/RustyRaptor/plasma-applet-tiledmenu.git
synced 2026-12-03 15:45:15 -07:00
Use StandardPaths to show the localized xdg folder label.
Requires Qt 5.8 (Plasma 5.12 depends on Qt 5.9). So next dependency must be plasma-5.12.
This commit is contained in:
1 parent
b9555888be
commit
88fe59eaae
2 files changed
+19
-2
No files matched your search
@@ -14,7 +14,7 @@ fi
|
||||
plasmoidName=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name")
|
||||
plasmoidName="${plasmoidName##*.}" # Strip namespace (Eg: "org.kde.plasma.")
|
||||
plasmoidVersion=$(kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Version")
|
||||
filenameTag="-plasma5.9"
|
||||
filenameTag="-plasma5.12"
|
||||
rm ${plasmoidName}-v*.plasmoid
|
||||
cd package
|
||||
filename=${plasmoidName}-v${plasmoidVersion}${filenameTag}.plasmoid
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import QtQuick 2.0
|
||||
import Qt.labs.platform 1.0 // Qt 5.8+
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
@@ -8,7 +9,7 @@ Repeater {
|
||||
|
||||
delegate: SidebarItem {
|
||||
icon: symbolicIconName || model.iconName || model.decoration
|
||||
text: model.name || model.display
|
||||
text: xdgDisplayName || model.name || model.display
|
||||
sidebarMenu: repeater.parent.parent // SidebarContextMenu { Column { Repeater{} } }
|
||||
onClicked: {
|
||||
repeater.parent.parent.open = false // SidebarContextMenu { Column { Repeater{} } }
|
||||
@@ -53,6 +54,22 @@ Repeater {
|
||||
function endsWith(s, sub) {
|
||||
return s.indexOf(sub) === s.length - sub.length
|
||||
}
|
||||
property string xdgDisplayName: {
|
||||
var xdgFolder = isLocalizedFolder()
|
||||
if (xdgFolder === 'DOCUMENTS') {
|
||||
return StandardPaths.displayName(StandardPaths.DocumentsLocation)
|
||||
} else if (xdgFolder === 'DOWNLOAD') {
|
||||
return StandardPaths.displayName(StandardPaths.DownloadLocation)
|
||||
} else if (xdgFolder === 'MUSIC') {
|
||||
return StandardPaths.displayName(StandardPaths.MusicLocation)
|
||||
} else if (xdgFolder === 'PICTURES') {
|
||||
return StandardPaths.displayName(StandardPaths.PicturesLocation)
|
||||
} else if (xdgFolder === 'VIDEOS') {
|
||||
return StandardPaths.displayName(StandardPaths.MoviesLocation)
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
property string symbolicIconName: {
|
||||
if (model.url) {
|
||||
var s = model.url.toString()
|
||||
|
||||
Reference in new issue
Block a user