From 968e597c241851db1b6194054663080a043fe0a7 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 12 Jun 2018 21:47:38 +0200 Subject: [PATCH] Support "file://" protocol --- io/passwordfile.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/io/passwordfile.cpp b/io/passwordfile.cpp index f3d1436..63c8a81 100644 --- a/io/passwordfile.cpp +++ b/io/passwordfile.cpp @@ -3,6 +3,7 @@ #include "./entry.h" #include "./parsingexception.h" +#include #include #include @@ -485,12 +486,17 @@ const string &PasswordFile::path() const } /*! - * \brief Sets the current file path. Causes the file to be closed if currently opened. + * \brief Sets the current file path. Closes the file if currently opened. */ void PasswordFile::setPath(const string &value) { close(); m_path = value; + + // support "file://" protocol + if (ConversionUtilities::startsWith(m_path, "file:")) { + m_path = m_path.substr(5); + } } /*!