Merge remote-tracking branch 'origin/develop' into release/2.2.0

This commit is contained in:
Jonathan White
2017-06-21 17:20:57 -04:00
9 changed files with 199 additions and 23 deletions

View File

@@ -24,6 +24,7 @@
#include <QTimer>
#include <QXmlStreamReader>
#include "cli/PasswordInput.h"
#include "core/Group.h"
#include "core/Metadata.h"
#include "crypto/Random.h"
@@ -398,13 +399,12 @@ Database* Database::openDatabaseFile(QString fileName, CompositeKey key)
Database* Database::unlockFromStdin(QString databaseFilename)
{
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
QTextStream outputTextStream(stdout);
outputTextStream << QString("Insert password to unlock " + databaseFilename + "\n> ");
outputTextStream.flush();
QString line = inputTextStream.readLine();
QString line = PasswordInput::getPassword();
CompositeKey key = CompositeKey::readFromLine(line);
return Database::openDatabaseFile(databaseFilename, key);
}