centralize every password generator default option. add extended ASCII to XC_HTTP generator
This commit is contained in:
@@ -91,6 +91,11 @@ QString FilePath::pluginPath(const QString& name)
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString FilePath::wordlistPath(const QString& name)
|
||||
{
|
||||
return m_instance->dataPath("wordlists/" + name);
|
||||
}
|
||||
|
||||
QIcon FilePath::applicationIcon()
|
||||
{
|
||||
bool darkIcon = useDarkIcon();
|
||||
|
||||
@@ -27,6 +27,7 @@ class FilePath
|
||||
public:
|
||||
QString dataPath(const QString& name);
|
||||
QString pluginPath(const QString& name);
|
||||
QString wordlistPath(const QString& name);
|
||||
QIcon applicationIcon();
|
||||
QIcon trayIconLocked();
|
||||
QIcon trayIconUnlocked();
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
#include "crypto/Random.h"
|
||||
#include "core/FilePath.h"
|
||||
|
||||
const QString PassphraseGenerator::DefaultSeparator = " ";
|
||||
const QString PassphraseGenerator::DefaultWordList = "eff_large.wordlist";
|
||||
|
||||
PassphraseGenerator::PassphraseGenerator()
|
||||
: m_wordCount(0)
|
||||
, m_separator(' ')
|
||||
, m_separator(PassphraseGenerator::DefaultSeparator)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -76,7 +79,7 @@ void PassphraseGenerator::setWordList(QString path)
|
||||
|
||||
void PassphraseGenerator::setDefaultWordList()
|
||||
{
|
||||
const QString path = filePath()->dataPath("wordlists/eff_large.wordlist");
|
||||
const QString path = filePath()->wordlistPath(PassphraseGenerator::DefaultWordList);
|
||||
setWordList(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
QString generatePassphrase() const;
|
||||
|
||||
static const int DefaultWordCount = 7;
|
||||
static const QString DefaultSeparator;
|
||||
static const QString DefaultWordList;
|
||||
|
||||
private:
|
||||
int m_wordCount;
|
||||
|
||||
@@ -42,7 +42,8 @@ public:
|
||||
enum GeneratorFlag
|
||||
{
|
||||
ExcludeLookAlike = 0x1,
|
||||
CharFromEveryGroup = 0x2
|
||||
CharFromEveryGroup = 0x2,
|
||||
DefaultFlags = ExcludeLookAlike | CharFromEveryGroup
|
||||
};
|
||||
Q_DECLARE_FLAGS(GeneratorFlags, GeneratorFlag)
|
||||
|
||||
@@ -60,6 +61,13 @@ public:
|
||||
int getbits() const;
|
||||
|
||||
static const int DefaultLength = 16;
|
||||
static const bool DefaultLower = (DefaultCharset & LowerLetters) != 0;
|
||||
static const bool DefaultUpper = (DefaultCharset & UpperLetters) != 0;
|
||||
static const bool DefaultNumbers = (DefaultCharset & Numbers) != 0;
|
||||
static const bool DefaultSpecial = (DefaultCharset & SpecialCharacters) != 0;
|
||||
static const bool DefaultEASCII = (DefaultCharset & EASCII) != 0;
|
||||
static const bool DefaultLookAlike = (DefaultFlags & ExcludeLookAlike) != 0;
|
||||
static const bool DefaultFromEveryGroup = (DefaultFlags & CharFromEveryGroup) != 0;
|
||||
|
||||
private:
|
||||
QVector<PasswordGroup> passwordGroups() const;
|
||||
|
||||
Reference in New Issue
Block a user