Support "file://" protocol

This commit is contained in:
Martchus 2018-06-12 21:47:38 +02:00
parent ca9ac4f747
commit 968e597c24
1 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,7 @@
#include "./entry.h"
#include "./parsingexception.h"
#include <c++utilities/conversion/stringconversion.h>
#include <c++utilities/io/catchiofailure.h>
#include <openssl/conf.h>
@ -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);
}
}
/*!