mirror of
https://github.com/logos-blockchain/logos-execution-zone-wallet-ui.git
synced 2026-07-29 22:23:30 +00:00
allow relative paths for wallet files
This commit is contained in:
parent
af12a03295
commit
940a9233f0
@ -47,9 +47,12 @@ namespace {
|
||||
|
||||
// Normalise file:// URLs and OS paths to a plain local path.
|
||||
QString toLocalPath(const QString& path) {
|
||||
if (path.startsWith("file://") || path.contains("/"))
|
||||
return QUrl::fromUserInput(path).toLocalFile();
|
||||
return path;
|
||||
QString p = path;
|
||||
if (p.startsWith(QLatin1Char('~')))
|
||||
p = QDir::homePath() + p.mid(1);
|
||||
if (p.startsWith("file://") || p.contains("/"))
|
||||
return QUrl::fromUserInput(p).toLocalFile();
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user