QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
tst_settings.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
3#include <QtTest>
4
5#include <QDir>
6#include <QFile>
7#include <QSettings>
8
9#include <utility>
10
13
14class tst_settings : public QObject {
15 Q_OBJECT
16
17private Q_SLOTS:
18 void initTestCase();
19 void cleanupTestCase();
20 void getPasswordConfigurationDefault();
21 void setAndGetPasswordConfiguration();
22 void getProfilesEmpty();
23 void setAndGetProfiles();
24 void setAndGetVersion();
25 void setAndGetGeometry();
26 void getPassStore();
27 void setAndGetPassStore();
28 void boolRoundTrip_data();
29 void boolRoundTrip();
30 void intRoundTrip_data();
31 void intRoundTrip();
32 void stringRoundTrip_data();
33 void stringRoundTrip();
34 void setAndGetClipBoardType();
35 void setAndGetPasswordLength();
36 void autoDetectGit();
37 void setAndGetSavestate();
38 void setAndGetPos();
39 void setAndGetSize();
40 void setAndGetDialogGeometry();
41 void setAndGetDialogPos();
42 void setAndGetDialogSize();
43 void setAndGetDialogMaximized();
44 void setAndGetPasswordCharsSelection();
45 void setAndGetPasswordChars();
46 void setAndGetMultipleProfiles();
47 void setAndGetProfileDefault();
48
49private:
50 QString m_settingsBackupPath;
51 bool m_isPortableMode = false;
52};
53
54void tst_settings::initTestCase() {
55 // Check for portable mode (qtpass.ini in app directory)
56 // Only backup/restore settings file in portable mode
57 // On non-portable (registry on Windows), we cannot safely backup
58 QString portable_ini =
59 QCoreApplication::applicationDirPath() + QDir::separator() + "qtpass.ini";
60 m_isPortableMode = QFile::exists(portable_ini);
61
62 if (m_isPortableMode) {
64 QString settingsFile = QtPassSettings::getInstance()->fileName();
65 m_settingsBackupPath = settingsFile + ".bak";
66 QFile::remove(m_settingsBackupPath);
67 QFile::copy(settingsFile, m_settingsBackupPath);
68 } else {
69 m_settingsBackupPath.clear();
70 // On non-portable mode, warn but continue (tests may modify registry)
71 qWarning()
72 << "Non-portable mode detected. Tests may modify registry settings.";
73 }
74}
75
76void tst_settings::cleanupTestCase() {
77 // Restore original settings after all tests
78 // This ensures make check doesn't change user's live config
79 if (m_isPortableMode && !m_settingsBackupPath.isEmpty()) {
80 QString settingsFile = QtPassSettings::getInstance()->fileName();
81 QFile::remove(settingsFile);
82 QFile::copy(m_settingsBackupPath, settingsFile);
83 QFile::remove(m_settingsBackupPath);
84 }
85}
86
87void tst_settings::getPasswordConfigurationDefault() {
88 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
89 QVERIFY(config.length >= 0);
90 QVERIFY(config.selected >= 0);
91}
92
93void tst_settings::setAndGetPasswordConfiguration() {
94 PasswordConfiguration config;
95 config.length = 20;
98
100
101 PasswordConfiguration readConfig = QtPassSettings::getPasswordConfiguration();
102 QCOMPARE(readConfig.length, 20);
103 QVERIFY2(readConfig.selected == PasswordConfiguration::ALPHABETICAL,
104 "Password config should be ALPHABETICAL");
105}
106
107void tst_settings::getProfilesEmpty() {
108 QHash<QString, QHash<QString, QString>> emptyProfiles;
109 QtPassSettings::setProfiles(emptyProfiles);
110
111 QHash<QString, QHash<QString, QString>> profiles =
113 QVERIFY(profiles.isEmpty());
114}
115
116void tst_settings::setAndGetProfiles() {
117 QHash<QString, QHash<QString, QString>> profiles;
118 QHash<QString, QString> profile1;
119 profile1.insert("path", "/test/path");
120 profile1.insert("signingKey", "ABC123");
121 profiles.insert("profile1", profile1);
122
124
125 QHash<QString, QHash<QString, QString>> readProfiles =
127 QVERIFY(!readProfiles.isEmpty());
128 QVERIFY(readProfiles.contains("profile1"));
129 QCOMPARE(readProfiles["profile1"]["path"], QString("/test/path"));
130}
131
132void tst_settings::setAndGetVersion() {
134 QString version = QtPassSettings::getVersion();
135 QVERIFY2(version == "1.5.1", "Version should be 1.5.1");
136}
137
138void tst_settings::setAndGetGeometry() {
139 QByteArray geometry("test_geometry_data");
141 QByteArray read = QtPassSettings::getGeometry(QByteArray());
142 QVERIFY2(read == geometry, "Geometry should match");
143}
144
145void tst_settings::getPassStore() {
146 QString store = QtPassSettings::getPassStore();
147 QVERIFY2(store.isEmpty() || store.startsWith("/") || store.contains("/"),
148 "Pass store should be empty or a plausible path");
149}
150
151void tst_settings::setAndGetPassStore() {
152 QtPassSettings::setPassStore("/tmp/test-store");
153 QString store = QtPassSettings::getPassStore();
154 QVERIFY(store.contains("test-store"));
155}
156
157namespace {
158struct BoolSetting {
159 const char *name;
160 void (*setter)(const bool &);
161 bool (*getter)(const bool &);
162};
163
164const BoolSetting boolSettings[] = {
168 {"useTrayIcon", QtPassSettings::setUseTrayIcon,
171 {"hidePassword", QtPassSettings::setHidePassword,
173 {"hideContent", QtPassSettings::setHideContent,
175 {"useSelection", QtPassSettings::setUseSelection,
177 {"useAutoclear", QtPassSettings::setUseAutoclear,
179 {"useMonospace", QtPassSettings::setUseMonospace,
181 {"noLineWrapping", QtPassSettings::setNoLineWrapping,
184 {"avoidCapitals", QtPassSettings::setAvoidCapitals,
186 {"avoidNumbers", QtPassSettings::setAvoidNumbers,
190 {"displayAsIs", QtPassSettings::setDisplayAsIs,
192 {"hideOnClose", QtPassSettings::setHideOnClose,
194 {"startMinimized", QtPassSettings::setStartMinimized,
196 {"alwaysOnTop", QtPassSettings::setAlwaysOnTop,
200 {"useTemplate", QtPassSettings::setUseTemplate,
202 {"templateAllFields", QtPassSettings::setTemplateAllFields,
205 {"useQrencode", QtPassSettings::setUseQrencode,
207 {"useAutoclearPanel", QtPassSettings::setUseAutoclearPanel,
210};
211} // namespace
212
213void tst_settings::boolRoundTrip_data() {
214 QTest::addColumn<QString>("setting");
215 QTest::addColumn<bool>("testValue");
216
217 for (const auto &s : boolSettings) {
218 QByteArray name(s.name);
219 QTest::newRow(name + "_true") << s.name << true;
220 QTest::newRow(name + "_false") << s.name << false;
221 }
222}
223
224void tst_settings::boolRoundTrip() {
225 QFETCH(QString, setting);
226 QFETCH(bool, testValue);
227
228 for (const auto &s : boolSettings) {
229 if (setting == s.name) {
230 s.setter(testValue);
231 QVERIFY2(s.getter(!testValue) == testValue,
232 qPrintable(QString("%1 should be %2, got %3")
233 .arg(setting)
234 .arg(testValue ? "true" : "false")
235 .arg(s.getter(!testValue) ? "true" : "false")));
236 return;
237 }
238 }
239 QFAIL(qPrintable(QString("Unknown setting: %1").arg(setting)));
240}
241
242void tst_settings::setAndGetClipBoardType() {
245}
246
247void tst_settings::setAndGetPasswordLength() {
249 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
250 QCOMPARE(config.length, 24);
251}
252
253namespace {
254struct IntSetting {
255 const char *name;
256 void (*setter)(const int &);
257 int (*getter)(const int &);
258};
259
260const IntSetting intSettings[] = {
261 {"autoclearSeconds", QtPassSettings::setAutoclearSeconds,
263 {"autoclearPanelSeconds", QtPassSettings::setAutoclearPanelSeconds,
265};
266
267struct StringSetting {
268 const char *name;
269 void (*setter)(const QString &);
270 QString (*getter)(const QString &);
271};
272
273const StringSetting stringSettings[] = {
274 {"passSigningKey", QtPassSettings::setPassSigningKey,
276 {"passExecutable", QtPassSettings::setPassExecutable,
278 {"gitExecutable", QtPassSettings::setGitExecutable,
280 {"gpgExecutable", QtPassSettings::setGpgExecutable,
282 {"pwgenExecutable", QtPassSettings::setPwgenExecutable,
284 {"qrencodeExecutable", QtPassSettings::setQrencodeExecutable,
287 {"webDavUser", QtPassSettings::setWebDavUser,
289 {"webDavPassword", QtPassSettings::setWebDavPassword,
292 {"passTemplate", QtPassSettings::setPassTemplate,
294};
295} // namespace
296
297void tst_settings::intRoundTrip_data() {
298 QTest::addColumn<QString>("setting");
299 QTest::addColumn<int>("testValue");
300
301 for (const auto &s : intSettings) {
302 QByteArray name(s.name);
303 QTest::newRow(name + "_30") << s.name << 30;
304 QTest::newRow(name + "_60") << s.name << 60;
305 }
306}
307
308void tst_settings::intRoundTrip() {
309 QFETCH(QString, setting);
310 QFETCH(int, testValue);
311
312 for (const auto &s : intSettings) {
313 if (setting == s.name) {
314 s.setter(testValue);
315 QCOMPARE(s.getter(-1), testValue);
316 return;
317 }
318 }
319 QFAIL(qPrintable(QString("Unknown setting: %1").arg(setting)));
320}
321
322void tst_settings::stringRoundTrip_data() {
323 QTest::addColumn<QString>("setting");
324 QTest::addColumn<QString>("testValue");
325
326 auto addString = [](const char *name, const QString &value) {
327 QTest::newRow((QByteArray(name) + "_" + value.toUtf8()).constData())
328 << name << value;
329 };
330
331 addString("passSigningKey", "testkey123");
332 addString("passSigningKey", "anotherkey456");
333 addString("passExecutable", "/usr/bin/pass");
334 addString("passExecutable", "/usr/local/bin/pass");
335 addString("gitExecutable", "/usr/bin/git");
336 addString("gitExecutable", "/usr/local/bin/git");
337 addString("gpgExecutable", "/usr/bin/gpg");
338 addString("gpgExecutable", "/usr/local/bin/gpg");
339 addString("pwgenExecutable", "/usr/bin/pwgen");
340 addString("pwgenExecutable", "/usr/local/bin/pwgen");
341 addString("qrencodeExecutable", "/usr/bin/qrencode");
342 addString("qrencodeExecutable", "/usr/local/bin/qrencode");
343 addString("webDavUrl", "https://dav.example.com/pass");
344 addString("webDavUrl", "https://dav2.example.com/pass");
345 addString("webDavUser", "testuser");
346 addString("webDavUser", "admin");
347 addString("webDavPassword", "secretpassword");
348 addString("webDavPassword", "anothersecret");
349 addString("profile", "work");
350 addString("profile", "personal");
351 addString("passTemplate", "username: {username}\npassword: {password}");
352 addString("passTemplate", "user: {username}\npass: {password}");
353}
354
355void tst_settings::stringRoundTrip() {
356 QFETCH(QString, setting);
357 QFETCH(QString, testValue);
358
359 for (const auto &s : stringSettings) {
360 if (setting == s.name) {
361 s.setter(testValue);
362 QCOMPARE(s.getter(QString()), testValue);
363 return;
364 }
365 }
366 QFAIL(qPrintable(QString("Unknown setting: %1").arg(setting)));
367}
368
369void tst_settings::autoDetectGit() {
370 QTemporaryDir tempDir;
371 QtPassSettings::setPassStore(tempDir.path());
372
373 QDir gitDir(tempDir.path());
374 QVERIFY(gitDir.mkdir(".git"));
376
377 QtPassSettings::getInstance()->remove("useGit");
379 QVERIFY2(QtPassSettings::isUseGit(true),
380 "Should auto-detect .git and return true when default is true");
381
382 QtPassSettings::getInstance()->remove("useGit");
384 QVERIFY2(!QtPassSettings::isUseGit(false),
385 "Should return false when default is false, even if .git exists");
386
387 QVERIFY(gitDir.rmdir(".git"));
389
390 QtPassSettings::getInstance()->remove("useGit");
392 QVERIFY2(QtPassSettings::isUseGit(true),
393 "Should return true default when .git not present");
394
395 QtPassSettings::getInstance()->remove("useGit");
397 QVERIFY2(!QtPassSettings::isUseGit(false),
398 "Should return false default when .git not present");
399}
400
401void tst_settings::setAndGetSavestate() {
402 QByteArray state("test_state_data");
404 QByteArray read = QtPassSettings::getSavestate(QByteArray());
405 QVERIFY2(read == state, "Savestate should match");
406}
407
408void tst_settings::setAndGetPos() {
409 QPoint pos(100, 200);
411 QPoint read = QtPassSettings::getPos(QPoint());
412 QVERIFY2(read == pos, "Pos should match");
413}
414
415void tst_settings::setAndGetSize() {
416 QSize size(800, 600);
418 QSize read = QtPassSettings::getSize(QSize());
419 QVERIFY2(read == size, "Size should match");
420}
421
422void tst_settings::setAndGetDialogGeometry() {
423 const QString key = "testDialog";
424 QByteArray geometry("test_dialog_geometry");
426 QByteArray read = QtPassSettings::getDialogGeometry(key, QByteArray());
427 QVERIFY2(read == geometry, "Dialog geometry should match");
428}
429
430void tst_settings::setAndGetDialogPos() {
431 const QString key = "testDialog";
432 QPoint pos(100, 200);
434 QPoint read = QtPassSettings::getDialogPos(key, QPoint());
435 QVERIFY2(read == pos, "Dialog pos should match");
436}
437
438void tst_settings::setAndGetDialogSize() {
439 const QString key = "testDialog";
440 QSize size(640, 480);
442 QSize read = QtPassSettings::getDialogSize(key, QSize());
443 QVERIFY2(read == size, "Dialog size should match");
444}
445
446void tst_settings::setAndGetDialogMaximized() {
447 const QString key = "testDialog";
449 bool read = QtPassSettings::isDialogMaximized(key, false);
450 QVERIFY2(read == true, "Dialog maximized should be true");
452 read = QtPassSettings::isDialogMaximized(key, true);
453 QVERIFY2(read == false, "Dialog maximized should be false");
454}
455
456void tst_settings::setAndGetPasswordCharsSelection() {
459 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
461}
462
463void tst_settings::setAndGetPasswordChars() {
465 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
466 QVERIFY2(config.Characters[PasswordConfiguration::CUSTOM].contains("abc"),
467 "PasswordChars should contain 'abc'");
468 // Reset to avoid affecting subsequent tests and live QtPass
470}
471
472void tst_settings::setAndGetMultipleProfiles() {
473 QHash<QString, QHash<QString, QString>> profiles;
474 QHash<QString, QString> profile1;
475 profile1["path"] = "/path/to/store1";
476 profiles["profile1"] = std::move(profile1);
477
478 QHash<QString, QString> profile2;
479 profile2["path"] = "/path/to/store2";
480 profiles["profile2"] = std::move(profile2);
481
483 QHash<QString, QHash<QString, QString>> readProfiles =
485 QVERIFY(readProfiles.size() >= 1);
486 QVERIFY(readProfiles.contains("profile1"));
487 QVERIFY(readProfiles.contains("profile2"));
488 QVERIFY(readProfiles["profile1"].contains("path"));
489 QVERIFY(readProfiles["profile2"].contains("path"));
490}
491
492void tst_settings::setAndGetProfileDefault() {
493 const QString expectedProfile = QStringLiteral("defaultProfile");
494 QtPassSettings::setProfile(expectedProfile);
495 QCOMPARE(QtPassSettings::getProfile(), expectedProfile);
496}
497
498QTEST_MAIN(tst_settings)
499#include "tst_settings.moc"
static auto isUseSelection(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to use selection (X11) for clipboard.
static void setMaximized(const bool &maximized)
Save maximized state.
static void setStartMinimized(const bool &startMinimized)
Save start-minimized flag.
static void setUseWebDav(const bool &useWebDav)
Save WebDAV integration flag.
static auto isUseAutoclear(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to use autoclear for clipboard.
static void setAutoclearPanelSeconds(const int &autoClearPanelSeconds)
Save panel autoclear seconds.
static void setPassExecutable(const QString &passExecutable)
Save pass executable path.
static auto getWebDavPassword(const QString &defaultValue=QVariant().toString()) -> QString
Get WebDAV password.
static auto isStartMinimized(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether application should start minimized.
static void setHidePassword(const bool &hidePassword)
Save hide password setting.
static auto isUseOtp(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether OTP support is enabled.
static void setPwgenExecutable(const QString &pwgenExecutable)
Save pwgen executable path.
static auto getPwgenExecutable(const QString &defaultValue=QVariant().toString()) -> QString
Get pwgen executable path.
static void setProfile(const QString &profile)
Save active profile name.
static void setUseTrayIcon(const bool &useTrayIcon)
Save tray icon support flag.
static void setWebDavPassword(const QString &webDavPassword)
Save WebDAV password.
static auto getInstance() -> QtPassSettings *
Get the singleton instance.
static auto isNoLineWrapping(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to disable line wrapping.
static auto getWebDavUser(const QString &defaultValue=QVariant().toString()) -> QString
Get WebDAV username.
static void setPassStore(const QString &passStore)
Save password store path.
static auto getDialogPos(const QString &key, const QPoint &defaultValue=QVariant().toPoint()) -> QPoint
Get saved dialog position.
static auto isHideContent(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to hide content (password + username).
static void setPasswordConfiguration(const PasswordConfiguration &config)
Save complete password generation configuration.
static auto getSize(const QSize &defaultValue=QVariant().toSize()) -> QSize
Get saved window size.
static void setHideOnClose(const bool &hideOnClose)
Save hide-on-close flag.
static auto getPasswordConfiguration() -> PasswordConfiguration
Get complete password generation configuration.
static auto isUseQrencode(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether qrencode support is enabled.
static void setPasswordLength(const int &passwordLength)
Save password length setting.
static auto isUseAutoclearPanel(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to use panel autoclear.
static auto isAutoPull(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether automatic pull is enabled.
static void setGitExecutable(const QString &gitExecutable)
Save git executable path.
static void setPasswordChars(const QString &passwordChars)
Save custom password characters.
static auto isUseGit(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether Git integration is enabled.
static void setUseOtp(const bool &useOtp)
Save OTP support flag.
static void setProfiles(const QHash< QString, QHash< QString, QString > > &profiles)
Save all configured profiles.
static auto getClipBoardType(const Enums::clipBoardType &defaultValue=Enums::CLIPBOARD_NEVER) -> Enums::clipBoardType
Get clipboard type as enum.
static void setUsePwgen(const bool &usePwgen)
Save pwgen support flag.
static auto isTemplateAllFields(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether template applies to all fields.
static void setPassSigningKey(const QString &passSigningKey)
Save GPG signing key.
static auto isUsePass(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to use pass (true) or GPG (false).
static auto getPassStore(const QString &defaultValue=QVariant().toString()) -> QString
Get password store directory path.
static auto getVersion(const QString &defaultValue=QVariant().toString()) -> QString
Get saved application version.
static auto isUseTemplate(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether template usage is enabled.
static auto isUseTrayIcon(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether tray icon support is enabled.
static void setUseTemplate(const bool &useTemplate)
Save template usage flag.
static void setDialogPos(const QString &key, const QPoint &pos)
Save dialog position.
static auto isAvoidCapitals(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether uppercase characters should be avoided.
static auto isAddGPGId(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to auto-add GPG ID when receiving files.
static void setPasswordCharsselection(const int &passwordCharsSelection)
Save password character selection mode.
static auto getGpgExecutable(const QString &defaultValue=QVariant().toString()) -> QString
Get GPG executable path.
static void setAutoPull(const bool &autoPull)
Save automatic pull flag.
static auto getPassSigningKey(const QString &defaultValue=QVariant().toString()) -> QString
Get GPG signing key for pass.
static void setPassTemplate(const QString &passTemplate)
Save pass entry template.
static auto isUseSymbols(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether symbol characters are enabled.
static auto getQrencodeExecutable(const QString &defaultValue=QVariant().toString()) -> QString
Get qrencode executable path.
static auto getDialogSize(const QString &key, const QSize &defaultValue=QVariant().toSize()) -> QSize
Get saved dialog size.
static void setGpgExecutable(const QString &gpgExecutable)
Save GPG executable path.
static void setPos(const QPoint &pos)
Save window position.
static void setVersion(const QString &version)
Save application version.
static void setUseAutoclear(const bool &useAutoclear)
Save use autoclear setting.
static auto isLessRandom(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether less random password generation is enabled.
static void setAlwaysOnTop(const bool &alwaysOnTop)
Save always-on-top flag.
static auto getPassTemplate(const QString &defaultValue=QVariant().toString()) -> QString
Get pass entry template.
static void setWebDavUser(const QString &webDavUser)
Save WebDAV username.
static void setDisplayAsIs(const bool &displayAsIs)
Save display as-is setting.
static auto isMaximized(const bool &defaultValue=QVariant().toBool()) -> bool
Get maximized state.
static void setUseMonospace(const bool &useMonospace)
Save use monospace setting.
static void setDialogSize(const QString &key, const QSize &size)
Save dialog size.
static void setAvoidCapitals(const bool &avoidCapitals)
Save uppercase avoidance flag.
static void setDialogMaximized(const QString &key, const bool &maximized)
Save dialog maximized state.
static void setQrencodeExecutable(const QString &qrencodeExecutable)
Save qrencode executable path.
static void setWebDavUrl(const QString &webDavUrl)
Save WebDAV URL.
static auto getProfile(const QString &defaultValue=QVariant().toString()) -> QString
Get active profile name.
static auto getWebDavUrl(const QString &defaultValue=QVariant().toString()) -> QString
Get WebDAV URL.
static auto isUseMonospace(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to use monospace font.
static void setAddGPGId(const bool &addGPGId)
Save add GPG ID setting.
static void setUsePass(const bool &usePass)
Save use pass setting.
static auto isUseWebDav(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether WebDAV integration is enabled.
static auto isDialogMaximized(const QString &key, const bool &defaultValue=QVariant().toBool()) -> bool
Get dialog maximized state.
static auto getAutoclearPanelSeconds(const int &defaultValue=QVariant().toInt()) -> int
Get panel autoclear delay in seconds.
static auto isUsePwgen(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether pwgen support is enabled.
static void setSavestate(const QByteArray &saveState)
Save window state.
static auto isAlwaysOnTop(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether main window should stay always on top.
static auto isAvoidNumbers(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether numeric characters should be avoided.
static auto isHidePassword(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to hide password in UI.
static void setDialogGeometry(const QString &key, const QByteArray &geometry)
Save dialog geometry.
static auto getPassExecutable(const QString &defaultValue=QVariant().toString()) -> QString
Get pass executable path.
static void setUseAutoclearPanel(const bool &useAutoclearPanel)
Save use autoclear panel setting.
static void setAutoclearSeconds(const int &autoClearSeconds)
Save autoclear seconds.
static void setNoLineWrapping(const bool &noLineWrapping)
Save no line wrapping setting.
static void setUseQrencode(const bool &useQrencode)
Save qrencode support flag.
static auto getPos(const QPoint &defaultValue=QVariant().toPoint()) -> QPoint
Get saved window position.
static void setAvoidNumbers(const bool &avoidNumbers)
Save numeric avoidance flag.
static auto getDialogGeometry(const QString &key, const QByteArray &defaultValue=QVariant().toByteArray()) -> QByteArray
Get saved dialog geometry.
static auto isHideOnClose(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether closing the window hides the application.
static void setAutoPush(const bool &autoPush)
Save automatic push flag.
static void setClipBoardType(const int &clipBoardType)
Save clipboard type.
static auto getProfiles() -> QHash< QString, QHash< QString, QString > >
Get all configured profiles.
static void setSize(const QSize &size)
Save window size.
static void setLessRandom(const bool &lessRandom)
Save less-random generation flag.
static auto getAutoclearSeconds(const int &defaultValue=QVariant().toInt()) -> int
Get autoclear delay in seconds.
static void setHideContent(const bool &hideContent)
Save hide content setting.
static auto isAutoPush(const bool &defaultValue=QVariant().toBool()) -> bool
Check whether automatic push is enabled.
static void setGeometry(const QByteArray &geometry)
Save window geometry.
static void setUseSelection(const bool &useSelection)
Save use selection setting.
static auto getGitExecutable(const QString &defaultValue=QVariant().toString()) -> QString
Get git executable path.
static void setTemplateAllFields(const bool &templateAllFields)
Save template-all-fields flag.
static auto getGeometry(const QByteArray &defaultValue=QVariant().toByteArray()) -> QByteArray
Get saved window geometry.
static void setUseSymbols(const bool &useSymbols)
Save symbol usage flag.
static auto isDisplayAsIs(const bool &defaultValue=QVariant().toBool()) -> bool
Get whether to display password as-is (no modification).
static void setUseGit(const bool &useGit)
Save Git integration flag.
static auto getSavestate(const QByteArray &defaultValue=QVariant().toByteArray()) -> QByteArray
Get saved window state.
int length
Length of the password.
enum PasswordConfiguration::characterSet selected
QString Characters[CHARSETS_COUNT]
The different character sets.