mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-15 00:20:06 -05:00
Add support for opening file:// urls (#2311)
* Add support for opening file:// urls * Open file urls without file:// scheme
This commit is contained in:
parent
341635f6bd
commit
f8b997bcf4
2 changed files with 20 additions and 6 deletions
|
|
@ -148,6 +148,8 @@ void TestEntry::testResolveUrl()
|
|||
QScopedPointer<Entry> entry(new Entry());
|
||||
QString testUrl("www.google.com");
|
||||
QString testCmd("cmd://firefox " + testUrl);
|
||||
QString testFileUnix("/home/example/test.txt");
|
||||
QString testFileWindows("c:/WINDOWS/test.txt");
|
||||
QString testComplexCmd("cmd://firefox --start-now --url 'http://" + testUrl + "' --quit");
|
||||
QString nonHttpUrl("ftp://google.com");
|
||||
QString noUrl("random text inserted here");
|
||||
|
|
@ -156,6 +158,11 @@ void TestEntry::testResolveUrl()
|
|||
QCOMPARE(entry->resolveUrl(""), QString(""));
|
||||
QCOMPARE(entry->resolveUrl(testUrl), "https://" + testUrl);
|
||||
QCOMPARE(entry->resolveUrl("http://" + testUrl), "http://" + testUrl);
|
||||
// Test file:// URL's
|
||||
QCOMPARE(entry->resolveUrl("file://" + testFileUnix), "file://" + testFileUnix);
|
||||
QCOMPARE(entry->resolveUrl(testFileUnix), "file://" + testFileUnix);
|
||||
QCOMPARE(entry->resolveUrl("file:///" + testFileWindows), "file:///" + testFileWindows);
|
||||
QCOMPARE(entry->resolveUrl(testFileWindows), "file:///" + testFileWindows);
|
||||
// Test cmd:// with no URL
|
||||
QCOMPARE(entry->resolveUrl("cmd://firefox"), QString(""));
|
||||
QCOMPARE(entry->resolveUrl("cmd://firefox --no-url"), QString(""));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue