refractor xdg dirs

This commit is contained in:
end-4
2025-05-16 16:02:05 +02:00
parent 9a68f80ffa
commit 8daa1702d0
12 changed files with 28 additions and 17 deletions
@@ -0,0 +1,12 @@
import Qt.labs.platform
import QtQuick
import Quickshell
pragma Singleton
pragma ComponentBehavior: Bound
Singleton {
readonly property string config: StandardPaths.standardLocations(StandardPaths.ConfigLocation)[0]
readonly property string state: StandardPaths.standardLocations(StandardPaths.StateLocation)[0]
readonly property string cache: StandardPaths.standardLocations(StandardPaths.CacheLocation)[0]
readonly property string pictures: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
}
@@ -15,7 +15,7 @@ import Quickshell.Hyprland
Item { // Wrapper
id: root
required property var panelWindow
readonly property string xdgConfigHome: StandardPaths.standardLocations(StandardPaths.ConfigLocation)[0]
readonly property string xdgConfigHome: XdgDirectories.config
property string searchingText: ""
property bool showResults: searchingText != ""
property real searchBarHeight: searchBar.height + Appearance.sizes.elevationMargin * 2
@@ -6,7 +6,6 @@ import "./aiChat/"
import "root:/modules/common/functions/fuzzysort.js" as Fuzzy
import "root:/modules/common/functions/string_utils.js" as StringUtils
import "root:/modules/common/functions/file_utils.js" as FileUtils
import Qt.labs.platform
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -21,7 +20,7 @@ Item {
property var inputField: messageInputField
readonly property var messages: Ai.messages
property string commandPrefix: "/"
property string faviconDownloadPath: FileUtils.trimFileProtocol(`${StandardPaths.standardLocations(StandardPaths.CacheLocation)[0]}/media/favicons`)
property string faviconDownloadPath: FileUtils.trimFileProtocol(`${XdgDirectories.cache}/media/favicons`)
property var suggestionQuery: ""
property var suggestionList: []
@@ -19,9 +19,9 @@ Item {
property var panelWindow
property var inputField: tagInputField
readonly property var responses: Booru.responses
property string previewDownloadPath: `${StandardPaths.standardLocations(StandardPaths.CacheLocation)[0]}/media/waifus`.replace("file://", "")
property string downloadPath: (StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0] + "/homework").replace("file://", "")
property string nsfwPath: (StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0] + "/homework/🌶️").replace("file://", "")
property string previewDownloadPath: `${XdgDirectories.cache}/media/waifus`.replace("file://", "")
property string downloadPath: (XdgDirectories.pictures + "/homework").replace("file://", "")
property string nsfwPath: (XdgDirectories.pictures + "/homework/🌶️").replace("file://", "")
property string commandPrefix: "/"
property real scrollOnNewResponse: 100
property int tagSuggestionDelay: 210
@@ -97,7 +97,7 @@ Button {
PointingHandInteraction {}
StyledToolTip {
content: StringUtils.wordWrap(root.imageData.tags, root.maxTagStringLineLength)
content: `${StringUtils.wordWrap(root.imageData.tags, root.maxTagStringLineLength)}\nClick for options`
}
background: Rectangle {