paths: better to string
This commit is contained in:
parent
b504587456
commit
66c012300a
2 changed files with 8 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ JsonObject {
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
property int dragThreshold: 30
|
property int dragThreshold: 30
|
||||||
property bool vimKeybinds: false
|
property bool vimKeybinds: false
|
||||||
property Commands commands: Commands{}
|
property Commands commands: Commands {}
|
||||||
|
|
||||||
property Sizes sizes: Sizes {}
|
property Sizes sizes: Sizes {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,12 @@ Singleton {
|
||||||
readonly property url imagecache: `${cache}/imagecache`
|
readonly property url imagecache: `${cache}/imagecache`
|
||||||
|
|
||||||
function stringify(path: url): string {
|
function stringify(path: url): string {
|
||||||
return path.toString().replace(/%20/g, " ");
|
let str = path.toString();
|
||||||
|
if (str.startsWith("root:/"))
|
||||||
|
str = `file://${Quickshell.shellDir}/${str.slice(6)}`;
|
||||||
|
else if (str.startsWith("/"))
|
||||||
|
str = `file://${str}`;
|
||||||
|
return new URL(str).pathname;
|
||||||
}
|
}
|
||||||
|
|
||||||
function expandTilde(path: string): string {
|
function expandTilde(path: string): string {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue