move common dirs to Directories <--renamed-- XdgDirectories

This commit is contained in:
end-4
2025-05-27 22:49:03 +02:00
parent 5ea497068c
commit 66c75342d4
17 changed files with 63 additions and 65 deletions
@@ -19,7 +19,7 @@ IconImage {
property real size: 32
property string downloadUserAgent: ConfigOptions?.networking.userAgent ?? ""
property string faviconDownloadPath: FileUtils.trimFileProtocol(`${XdgDirectories.cache}/media/favicons`)
property string faviconDownloadPath: Directories.favicons
property string domainName: url.includes("vertexaisearch") ? displayText : StringUtils.getDomain(url)
property string faviconUrl: `https://www.google.com/s2/favicons?domain=${domainName}&sz=32`
property string fileName: `${domainName}.ico`
@@ -31,21 +31,11 @@ IconImage {
running: false
command: ["bash", "-c", `[ -f ${faviconFilePath} ] || curl -s '${root.faviconUrl}' -o '${faviconFilePath}' -L -H 'User-Agent: ${downloadUserAgent}'`]
onExited: (exitCode, exitStatus) => {
console.log("Favicon download process exited with code:", exitCode, "and status:", exitStatus)
console.log("Favicon file path:", faviconFilePath)
root.urlToLoad = root.faviconFilePath
}
}
Component.onCompleted: {
console.log("URL: ", root.url)
console.log("DOMAIN: ", root.domainName)
console.log("faviconDownloadPath: ", faviconDownloadPath)
console.log("faviconFilePath: ", faviconFilePath)
console.log("faviconUrl: ", root.faviconUrl)
console.log("domainName: ", root.domainName)
console.log("fileName: ", root.fileName)
console.log("downloading to ", faviconFilePath, "from", root.faviconUrl)
faviconDownloadProcess.running = true
}