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 QVERIFY(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();
82 QVERIFY2(QFile::remove(settingsFile) || !QFile::exists(settingsFile),
83 "Failed to remove current settings file before restore");
84 QVERIFY2(QFile::copy(m_settingsBackupPath, settingsFile),
85 "Failed to restore settings file from backup");
86 QVERIFY2(QFile::remove(m_settingsBackupPath),
87 "Failed to remove temporary settings backup file");
88 }
89}
90
91void tst_settings::getPasswordConfigurationDefault() {
92 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
93 QVERIFY(config.length >= 0);
94 QVERIFY(config.selected >= 0);
95}
96
97void tst_settings::setAndGetPasswordConfiguration() {
98 PasswordConfiguration config;
99 config.length = 20;
102
104
105 PasswordConfiguration readConfig = QtPassSettings::getPasswordConfiguration();
106 QCOMPARE(readConfig.length, 20);
107 QVERIFY2(readConfig.selected == PasswordConfiguration::ALPHABETICAL,
108 "Password config should be ALPHABETICAL");
109}
110
111void tst_settings::getProfilesEmpty() {
112 QHash<QString, QHash<QString, QString>> emptyProfiles;
113 QtPassSettings::setProfiles(emptyProfiles);
114
115 QHash<QString, QHash<QString, QString>> profiles =
117 QVERIFY(profiles.isEmpty());
118}
119
120void tst_settings::setAndGetProfiles() {
121 QHash<QString, QHash<QString, QString>> profiles;
122 QHash<QString, QString> profile1;
123 profile1.insert("path", "/test/path");
124 profile1.insert("signingKey", "ABC123");
125 profiles.insert("profile1", profile1);
126
128
129 QHash<QString, QHash<QString, QString>> readProfiles =
131 QVERIFY(!readProfiles.isEmpty());
132 QVERIFY(readProfiles.contains("profile1"));
133 QCOMPARE(readProfiles["profile1"]["path"], QString("/test/path"));
134}
135
136void tst_settings::setAndGetVersion() {
138 QString version = QtPassSettings::getVersion();
139 QVERIFY2(version == "1.5.1", "Version should be 1.5.1");
140}
141
142void tst_settings::setAndGetGeometry() {
143 QByteArray geometry("test_geometry_data");
145 QByteArray read = QtPassSettings::getGeometry(QByteArray());
146 QVERIFY2(read == geometry, "Geometry should match");
147}
148
149void tst_settings::getPassStore() {
150 QString store = QtPassSettings::getPassStore();
151 QVERIFY2(store.isEmpty() || store.startsWith("/") || store.contains("/"),
152 "Pass store should be empty or a plausible path");
153}
154
155void tst_settings::setAndGetPassStore() {
156 QtPassSettings::setPassStore("/tmp/test-store");
157 QString store = QtPassSettings::getPassStore();
158 QVERIFY(store.contains("test-store"));
159}
160
161namespace {
162struct BoolSetting {
163 const char *name;
164 void (*setter)(const bool &);
165 bool (*getter)(const bool &);
166};
167
168const BoolSetting boolSettings[] = {
172 {"useTrayIcon", QtPassSettings::setUseTrayIcon,
175 {"hidePassword", QtPassSettings::setHidePassword,
177 {"hideContent", QtPassSettings::setHideContent,
179 {"useSelection", QtPassSettings::setUseSelection,
181 {"useAutoclear", QtPassSettings::setUseAutoclear,
183 {"useMonospace", QtPassSettings::setUseMonospace,
185 {"noLineWrapping", QtPassSettings::setNoLineWrapping,
188 {"avoidCapitals", QtPassSettings::setAvoidCapitals,
190 {"avoidNumbers", QtPassSettings::setAvoidNumbers,
194 {"displayAsIs", QtPassSettings::setDisplayAsIs,
196 {"hideOnClose", QtPassSettings::setHideOnClose,
198 {"startMinimized", QtPassSettings::setStartMinimized,
200 {"alwaysOnTop", QtPassSettings::setAlwaysOnTop,
204 {"useTemplate", QtPassSettings::setUseTemplate,
206 {"templateAllFields", QtPassSettings::setTemplateAllFields,
209 {"useQrencode", QtPassSettings::setUseQrencode,
211 {"useAutoclearPanel", QtPassSettings::setUseAutoclearPanel,
214};
215} // namespace
216
217void tst_settings::boolRoundTrip_data() {
218 QTest::addColumn<QString>("setting");
219 QTest::addColumn<bool>("testValue");
220
221 for (const auto &s : boolSettings) {
222 QByteArray name(s.name);
223 QTest::newRow(name + "_true") << s.name << true;
224 QTest::newRow(name + "_false") << s.name << false;
225 }
226}
227
228void tst_settings::boolRoundTrip() {
229 QFETCH(QString, setting);
230 QFETCH(bool, testValue);
231
232 for (const auto &s : boolSettings) {
233 if (setting == s.name) {
234 s.setter(testValue);
235 QVERIFY2(s.getter(!testValue) == testValue,
236 qPrintable(QString("%1 should be %2, got %3")
237 .arg(setting)
238 .arg(testValue ? "true" : "false")
239 .arg(s.getter(!testValue) ? "true" : "false")));
240 return;
241 }
242 }
243 QFAIL(qPrintable(QString("Unknown setting: %1").arg(setting)));
244}
245
246void tst_settings::setAndGetClipBoardType() {
249}
250
251void tst_settings::setAndGetPasswordLength() {
253 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
254 QCOMPARE(config.length, 24);
255}
256
257namespace {
258struct IntSetting {
259 const char *name;
260 void (*setter)(const int &);
261 int (*getter)(const int &);
262};
263
264const IntSetting intSettings[] = {
265 {"autoclearSeconds", QtPassSettings::setAutoclearSeconds,
267 {"autoclearPanelSeconds", QtPassSettings::setAutoclearPanelSeconds,
269};
270
271struct StringSetting {
272 const char *name;
273 void (*setter)(const QString &);
274 QString (*getter)(const QString &);
275};
276
277const StringSetting stringSettings[] = {
278 {"passSigningKey", QtPassSettings::setPassSigningKey,
280 {"passExecutable", QtPassSettings::setPassExecutable,
282 {"gitExecutable", QtPassSettings::setGitExecutable,
284 {"gpgExecutable", QtPassSettings::setGpgExecutable,
286 {"pwgenExecutable", QtPassSettings::setPwgenExecutable,
288 {"qrencodeExecutable", QtPassSettings::setQrencodeExecutable,
291 {"webDavUser", QtPassSettings::setWebDavUser,
293 {"webDavPassword", QtPassSettings::setWebDavPassword,
296 {"passTemplate", QtPassSettings::setPassTemplate,
298};
299} // namespace
300
301void tst_settings::intRoundTrip_data() {
302 QTest::addColumn<QString>("setting");
303 QTest::addColumn<int>("testValue");
304
305 for (const auto &s : intSettings) {
306 QByteArray name(s.name);
307 QTest::newRow(name + "_30") << s.name << 30;
308 QTest::newRow(name + "_60") << s.name << 60;
309 }
310}
311
312void tst_settings::intRoundTrip() {
313 QFETCH(QString, setting);
314 QFETCH(int, testValue);
315
316 for (const auto &s : intSettings) {
317 if (setting == s.name) {
318 s.setter(testValue);
319 QCOMPARE(s.getter(-1), testValue);
320 return;
321 }
322 }
323 QFAIL(qPrintable(QString("Unknown setting: %1").arg(setting)));
324}
325
326void tst_settings::stringRoundTrip_data() {
327 QTest::addColumn<QString>("setting");
328 QTest::addColumn<QString>("testValue");
329
330 auto addString = [](const char *name, const QString &value) {
331 QTest::newRow((QByteArray(name) + "_" + value.toUtf8()).constData())
332 << name << value;
333 };
334
335 addString("passSigningKey", "testkey123");
336 addString("passSigningKey", "anotherkey456");
337 addString("passExecutable", "/usr/bin/pass");
338 addString("passExecutable", "/usr/local/bin/pass");
339 addString("gitExecutable", "/usr/bin/git");
340 addString("gitExecutable", "/usr/local/bin/git");
341 addString("gpgExecutable", "/usr/bin/gpg");
342 addString("gpgExecutable", "/usr/local/bin/gpg");
343 addString("pwgenExecutable", "/usr/bin/pwgen");
344 addString("pwgenExecutable", "/usr/local/bin/pwgen");
345 addString("qrencodeExecutable", "/usr/bin/qrencode");
346 addString("qrencodeExecutable", "/usr/local/bin/qrencode");
347 addString("webDavUrl", "https://dav.example.com/pass");
348 addString("webDavUrl", "https://dav2.example.com/pass");
349 addString("webDavUser", "testuser");
350 addString("webDavUser", "admin");
351 addString("webDavPassword", "secretpassword");
352 addString("webDavPassword", "anothersecret");
353 addString("profile", "work");
354 addString("profile", "personal");
355 addString("passTemplate", "username: {username}\npassword: {password}");
356 addString("passTemplate", "user: {username}\npass: {password}");
357}
358
359void tst_settings::stringRoundTrip() {
360 QFETCH(QString, setting);
361 QFETCH(QString, testValue);
362
363 for (const auto &s : stringSettings) {
364 if (setting == s.name) {
365 s.setter(testValue);
366 QCOMPARE(s.getter(QString()), testValue);
367 return;
368 }
369 }
370 QFAIL(qPrintable(QString("Unknown setting: %1").arg(setting)));
371}
372
373void tst_settings::autoDetectGit() {
374 QTemporaryDir tempDir;
375 QtPassSettings::setPassStore(tempDir.path());
376
377 QDir gitDir(tempDir.path());
378 QVERIFY(gitDir.mkdir(".git"));
380
381 QtPassSettings::getInstance()->remove("useGit");
383 QVERIFY2(QtPassSettings::isUseGit(true),
384 "Should auto-detect .git and return true when default is true");
385
386 QtPassSettings::getInstance()->remove("useGit");
388 QVERIFY2(!QtPassSettings::isUseGit(false),
389 "Should return false when default is false, even if .git exists");
390
391 QVERIFY(gitDir.rmdir(".git"));
393
394 QtPassSettings::getInstance()->remove("useGit");
396 QVERIFY2(QtPassSettings::isUseGit(true),
397 "Should return true default when .git not present");
398
399 QtPassSettings::getInstance()->remove("useGit");
401 QVERIFY2(!QtPassSettings::isUseGit(false),
402 "Should return false default when .git not present");
403}
404
405void tst_settings::setAndGetSavestate() {
406 QByteArray state("test_state_data");
408 QByteArray read = QtPassSettings::getSavestate(QByteArray());
409 QVERIFY2(read == state, "Savestate should match");
410}
411
412void tst_settings::setAndGetPos() {
413 QPoint pos(100, 200);
415 QPoint read = QtPassSettings::getPos(QPoint());
416 QVERIFY2(read == pos, "Pos should match");
417}
418
419void tst_settings::setAndGetSize() {
420 QSize size(800, 600);
422 QSize read = QtPassSettings::getSize(QSize());
423 QVERIFY2(read == size, "Size should match");
424}
425
426void tst_settings::setAndGetDialogGeometry() {
427 const QString key = "testDialog";
428 QByteArray geometry("test_dialog_geometry");
430 QByteArray read = QtPassSettings::getDialogGeometry(key, QByteArray());
431 QVERIFY2(read == geometry, "Dialog geometry should match");
432}
433
434void tst_settings::setAndGetDialogPos() {
435 const QString key = "testDialog";
436 QPoint pos(100, 200);
438 QPoint read = QtPassSettings::getDialogPos(key, QPoint());
439 QVERIFY2(read == pos, "Dialog pos should match");
440}
441
442void tst_settings::setAndGetDialogSize() {
443 const QString key = "testDialog";
444 QSize size(640, 480);
446 QSize read = QtPassSettings::getDialogSize(key, QSize());
447 QVERIFY2(read == size, "Dialog size should match");
448}
449
450void tst_settings::setAndGetDialogMaximized() {
451 const QString key = "testDialog";
453 bool read = QtPassSettings::isDialogMaximized(key, false);
454 QVERIFY2(read == true, "Dialog maximized should be true");
456 read = QtPassSettings::isDialogMaximized(key, true);
457 QVERIFY2(read == false, "Dialog maximized should be false");
458}
459
460void tst_settings::setAndGetPasswordCharsSelection() {
463 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
465}
466
467void tst_settings::setAndGetPasswordChars() {
469 PasswordConfiguration config = QtPassSettings::getPasswordConfiguration();
470 QVERIFY2(config.Characters[PasswordConfiguration::CUSTOM].contains("abc"),
471 "PasswordChars should contain 'abc'");
472 // Reset to avoid affecting subsequent tests and live QtPass
474}
475
476void tst_settings::setAndGetMultipleProfiles() {
477 QHash<QString, QHash<QString, QString>> profiles;
478 QHash<QString, QString> profile1;
479 profile1["path"] = "/path/to/store1";
480 profiles["profile1"] = std::move(profile1);
481
482 QHash<QString, QString> profile2;
483 profile2["path"] = "/path/to/store2";
484 profiles["profile2"] = std::move(profile2);
485
487 QHash<QString, QHash<QString, QString>> readProfiles =
489 QVERIFY(!readProfiles.isEmpty());
490 QVERIFY2(readProfiles.size() == 2, "Should have exactly 2 profiles");
491 QVERIFY(readProfiles.contains("profile1"));
492 QVERIFY(readProfiles.contains("profile2"));
493 QVERIFY(readProfiles["profile1"].contains("path"));
494 QVERIFY(readProfiles["profile2"].contains("path"));
495}
496
497void tst_settings::setAndGetProfileDefault() {
498 const QString expectedProfile = QStringLiteral("defaultProfile");
499 QtPassSettings::setProfile(expectedProfile);
500 QCOMPARE(QtPassSettings::getProfile(), expectedProfile);
501}
502
503QTEST_MAIN(tst_settings)
504#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 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 setPasswordCharsSelection(const int &passwordCharsSelection)
Save password character selection mode.
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.