QtPass  1.2.1
Multi-platform GUI for pass, the standard unix password manager.
qtpasssettings.cpp
Go to the documentation of this file.
1 #include "qtpasssettings.h"
2 #include "pass.h"
3 #include "settingsconstants.h"
4 #include "util.h"
5 
6 #include <QCoreApplication>
7 
8 QtPassSettings::QtPassSettings() {}
9 
10 bool QtPassSettings::initialized = false;
11 
12 QScopedPointer<QSettings> QtPassSettings::settings;
13 QHash<QString, QString> QtPassSettings::stringSettings;
14 QHash<QString, QByteArray> QtPassSettings::byteArraySettings;
15 QHash<QString, QPoint> QtPassSettings::pointSettings;
16 QHash<QString, QSize> QtPassSettings::sizeSettings;
17 QHash<QString, int> QtPassSettings::intSettings;
18 QHash<QString, bool> QtPassSettings::boolSettings;
19 
20 Pass *QtPassSettings::pass;
21 RealPass QtPassSettings::realPass;
22 ImitatePass QtPassSettings::imitatePass;
23 
24 QString QtPassSettings::getVersion(const QString &defaultValue) {
25  return getStringValue(SettingsConstants::version, defaultValue);
26 }
27 
28 void QtPassSettings::setVersion(const QString &version) {
29  setStringValue(SettingsConstants::version, version);
30 }
31 
32 QByteArray QtPassSettings::getGeometry(const QByteArray &defaultValue) {
33  beginMainwindowGroup();
34  QByteArray returnValue =
35  getByteArrayValue(SettingsConstants::geometry, defaultValue);
36  endSettingsGroup();
37  return returnValue;
38 }
39 
40 void QtPassSettings::setGeometry(const QByteArray &geometry) {
41  beginMainwindowGroup();
42  setByteArrayValue(SettingsConstants::geometry, geometry);
43  endSettingsGroup();
44 }
45 
46 QByteArray QtPassSettings::getSavestate(const QByteArray &defaultValue) {
47  beginMainwindowGroup();
48  QByteArray returnValue =
49  getByteArrayValue(SettingsConstants::savestate, defaultValue);
50  endSettingsGroup();
51  return returnValue;
52 }
53 
54 void QtPassSettings::setSavestate(const QByteArray &saveState) {
55  beginMainwindowGroup();
56  setByteArrayValue(SettingsConstants::savestate, saveState);
57  endSettingsGroup();
58 }
59 
60 QPoint QtPassSettings::getPos(const QPoint &defaultValue) {
61  beginMainwindowGroup();
62  QPoint returnValue = getPointValue(SettingsConstants::pos, defaultValue);
63  endSettingsGroup();
64  return returnValue;
65 }
66 
67 void QtPassSettings::setPos(const QPoint &pos) {
68  beginMainwindowGroup();
69  setPointValue(SettingsConstants::pos, pos);
70  endSettingsGroup();
71 }
72 
73 QSize QtPassSettings::getSize(const QSize &defaultValue) {
74  beginMainwindowGroup();
75  QSize returnValue = getSizeValue(SettingsConstants::size, defaultValue);
76  endSettingsGroup();
77  return returnValue;
78 }
79 
80 void QtPassSettings::setSize(const QSize &size) {
81  beginMainwindowGroup();
82  setSizeValue(SettingsConstants::size, size);
83  endSettingsGroup();
84 }
85 
86 int QtPassSettings::getSplitterLeft(const int &defaultValue) {
87  beginMainwindowGroup();
88  int returnValue = getIntValue(SettingsConstants::splitterLeft, defaultValue);
89  endSettingsGroup();
90  return returnValue;
91 }
92 
93 void QtPassSettings::setSplitterLeft(const int &splitterLeft) {
94  beginMainwindowGroup();
95  setIntValue(SettingsConstants::splitterLeft, splitterLeft);
96  endSettingsGroup();
97 }
98 
99 int QtPassSettings::getSplitterRight(const int &defaultValue) {
100  beginMainwindowGroup();
101  int returnValue = getIntValue(SettingsConstants::splitterRight, defaultValue);
102  endSettingsGroup();
103  return returnValue;
104 }
105 
106 void QtPassSettings::setSplitterRight(const int &splitterRight) {
107  beginMainwindowGroup();
108  setIntValue(SettingsConstants::splitterRight, splitterRight);
109  endSettingsGroup();
110 }
111 
112 bool QtPassSettings::isMaximized(const bool &defaultValue) {
113  beginMainwindowGroup();
114  bool returnValue = getBoolValue(SettingsConstants::maximized, defaultValue);
115  endSettingsGroup();
116  return returnValue;
117 }
118 
119 void QtPassSettings::setMaximized(const bool &maximized) {
120  beginMainwindowGroup();
121  setBoolValue(SettingsConstants::maximized, maximized);
122  endSettingsGroup();
123 }
124 
125 bool QtPassSettings::isUsePass(const bool &defaultValue) {
126  return getBoolValue(SettingsConstants::usePass, defaultValue);
127 }
128 
129 void QtPassSettings::setUsePass(const bool &usePass) {
130  if (usePass) {
131  QtPassSettings::pass = &QtPassSettings::realPass;
132  } else {
133  QtPassSettings::pass = &QtPassSettings::imitatePass;
134  }
135  setBoolValue(SettingsConstants::usePass, usePass);
136 }
137 
140  return static_cast<Enums::clipBoardType>(getIntValue(
141  SettingsConstants::clipBoardType, static_cast<int>(defaultvalue)));
142 }
143 
147  static_cast<int>(clipBoardType));
148 }
149 
150 bool QtPassSettings::isUseSelection(const bool &defaultValue) {
151  return getBoolValue(SettingsConstants::useSelection, defaultValue);
152 }
153 
154 void QtPassSettings::setUseSelection(const bool &useSelection) {
155  setBoolValue(SettingsConstants::useSelection, useSelection);
156 }
157 
158 bool QtPassSettings::isUseAutoclear(const bool &defaultValue) {
159  return getBoolValue(SettingsConstants::useAutoclear, defaultValue);
160 }
161 
162 void QtPassSettings::setUseAutoclear(const bool &useAutoclear) {
163  setBoolValue(SettingsConstants::useAutoclear, useAutoclear);
164 }
165 
166 int QtPassSettings::getAutoclearSeconds(const int &defaultValue) {
167  return getIntValue(SettingsConstants::autoclearSeconds, defaultValue);
168 }
169 
170 void QtPassSettings::setAutoclearSeconds(const int &autoClearSeconds) {
171  setIntValue(SettingsConstants::autoclearSeconds, autoClearSeconds);
172 }
173 
174 bool QtPassSettings::isUseAutoclearPanel(const bool &defaultValue) {
175  return getBoolValue(SettingsConstants::useAutoclearPanel, defaultValue);
176 }
177 
178 void QtPassSettings::setUseAutoclearPanel(const bool &useAutoclearPanel) {
179  setBoolValue(SettingsConstants::useAutoclearPanel, useAutoclearPanel);
180 }
181 
182 int QtPassSettings::getAutoclearPanelSeconds(const int &defaultValue) {
183  return getIntValue(SettingsConstants::autoclearPanelSeconds, defaultValue);
184 }
185 
187  const int &autoClearPanelSeconds) {
188  setIntValue(SettingsConstants::autoclearPanelSeconds, autoClearPanelSeconds);
189 }
190 
191 bool QtPassSettings::isHidePassword(const bool &defaultValue) {
192  return getBoolValue(SettingsConstants::hidePassword, defaultValue);
193 }
194 
195 void QtPassSettings::setHidePassword(const bool &hidePassword) {
196  setBoolValue(SettingsConstants::hidePassword, hidePassword);
197 }
198 
199 bool QtPassSettings::isHideContent(const bool &defaultValue) {
200  return getBoolValue(SettingsConstants::hideContent, defaultValue);
201 }
202 
203 void QtPassSettings::setHideContent(const bool &hideContent) {
204  setBoolValue(SettingsConstants::hideContent, hideContent);
205 }
206 
207 bool QtPassSettings::isAddGPGId(const bool &defaultValue) {
208  return getBoolValue(SettingsConstants::addGPGId, defaultValue);
209 }
210 
211 void QtPassSettings::setAddGPGId(const bool &addGPGId) {
212  setBoolValue(SettingsConstants::addGPGId, addGPGId);
213 }
214 
215 QString QtPassSettings::getPassStore(const QString &defaultValue) {
216  QString returnValue =
217  getStringValue(SettingsConstants::passStore, defaultValue);
218  // ensure directory exists if never used pass or misconfigured.
219  // otherwise process->setWorkingDirectory(passStore); will fail on execution.
220  if (!QDir(returnValue).exists()) {
221  QDir().mkdir(returnValue);
222  }
223  // ensure path ends in /
224  if (!returnValue.endsWith("/")) {
225  returnValue += "/";
226  }
227  return returnValue;
228 }
229 
230 void QtPassSettings::setPassStore(const QString &passStore) {
231  setStringValue(SettingsConstants::passStore, passStore);
232 }
233 
235  QString passExecutable =
237  QtPassSettings::setPassExecutable(passExecutable);
238 
239  QString gitExecutable =
241  QtPassSettings::setGitExecutable(gitExecutable);
242 
243  QString gpgExecutable =
245  QtPassSettings::setGpgExecutable(gpgExecutable);
246 
247  QString pwgenExecutable =
249  QtPassSettings::setPwgenExecutable(pwgenExecutable);
250 }
251 
252 QString QtPassSettings::getPassExecutable(const QString &defaultValue) {
253  return getStringValue(SettingsConstants::passExecutable, defaultValue);
254 }
255 
256 void QtPassSettings::setPassExecutable(const QString &passExecutable) {
257  setStringValue(SettingsConstants::passExecutable, passExecutable);
258 }
259 
260 QString QtPassSettings::getGitExecutable(const QString &defaultValue) {
261  return getStringValue(SettingsConstants::gitExecutable, defaultValue);
262 }
263 
264 void QtPassSettings::setGitExecutable(const QString &gitExecutable) {
265  setStringValue(SettingsConstants::gitExecutable, gitExecutable);
266 }
267 
268 QString QtPassSettings::getGpgExecutable(const QString &defaultValue) {
269  return getStringValue(SettingsConstants::gpgExecutable, defaultValue);
270 }
271 
272 void QtPassSettings::setGpgExecutable(const QString &gpgExecutable) {
273  setStringValue(SettingsConstants::gpgExecutable, gpgExecutable);
274 }
275 
276 QString QtPassSettings::getPwgenExecutable(const QString &defaultValue) {
277  return getStringValue(SettingsConstants::pwgenExecutable, defaultValue);
278 }
279 
280 void QtPassSettings::setPwgenExecutable(const QString &pwgenExecutable) {
281  setStringValue(SettingsConstants::pwgenExecutable, pwgenExecutable);
282 }
283 
284 QString QtPassSettings::getGpgHome(const QString &defaultValue) {
285  return getStringValue(SettingsConstants::gpgHome, defaultValue);
286 }
287 
288 bool QtPassSettings::isUseWebDav(const bool &defaultValue) {
289  return getBoolValue(SettingsConstants::useWebDav, defaultValue);
290 }
291 
292 void QtPassSettings::setUseWebDav(const bool &useWebDav) {
293  setBoolValue(SettingsConstants::useWebDav, useWebDav);
294 }
295 
296 QString QtPassSettings::getWebDavUrl(const QString &defaultValue) {
297  return getStringValue(SettingsConstants::webDavUrl, defaultValue);
298 }
299 
300 void QtPassSettings::setWebDavUrl(const QString &webDavUrl) {
301  setStringValue(SettingsConstants::webDavUrl, webDavUrl);
302 }
303 
304 QString QtPassSettings::getWebDavUser(const QString &defaultValue) {
305  return getStringValue(SettingsConstants::webDavUser, defaultValue);
306 }
307 
308 void QtPassSettings::setWebDavUser(const QString &webDavUser) {
309  setStringValue(SettingsConstants::webDavUser, webDavUser);
310 }
311 
312 QString QtPassSettings::getWebDavPassword(const QString &defaultValue) {
313  return getStringValue(SettingsConstants::webDavPassword, defaultValue);
314 }
315 
316 void QtPassSettings::setWebDavPassword(const QString &webDavPassword) {
317  setStringValue(SettingsConstants::webDavPassword, webDavPassword);
318 }
319 
320 QString QtPassSettings::getProfile(const QString &defaultValue) {
321  return getStringValue(SettingsConstants::profile, defaultValue);
322 }
323 
324 void QtPassSettings::setProfile(const QString &profile) {
325  setStringValue(SettingsConstants::profile, profile);
326 }
327 
328 bool QtPassSettings::isUseGit(const bool &defaultValue) {
329  return getBoolValue(SettingsConstants::useGit, defaultValue);
330 }
331 
332 void QtPassSettings::setUseGit(const bool &useGit) {
333  setBoolValue(SettingsConstants::useGit, useGit);
334 }
335 
336 bool QtPassSettings::isUsePwgen(const bool &defaultValue) {
337  return getBoolValue(SettingsConstants::usePwgen, defaultValue);
338 }
339 
340 void QtPassSettings::setUsePwgen(const bool &usePwgen) {
341  setBoolValue(SettingsConstants::usePwgen, usePwgen);
342 }
343 
344 bool QtPassSettings::isAvoidCapitals(const bool &defaultValue) {
345  return getBoolValue(SettingsConstants::avoidCapitals, defaultValue);
346 }
347 
348 void QtPassSettings::setAvoidCapitals(const bool &avoidCapitals) {
349  setBoolValue(SettingsConstants::avoidCapitals, avoidCapitals);
350 }
351 
352 bool QtPassSettings::isAvoidNumbers(const bool &defaultValue) {
353  return getBoolValue(SettingsConstants::avoidNumbers, defaultValue);
354 }
355 
356 void QtPassSettings::setAvoidNumbers(const bool &avoidNumbers) {
357  setBoolValue(SettingsConstants::avoidNumbers, avoidNumbers);
358 }
359 
360 bool QtPassSettings::isLessRandom(const bool &defaultValue) {
361  return getBoolValue(SettingsConstants::lessRandom, defaultValue);
362 }
363 
364 void QtPassSettings::setLessRandom(const bool &lessRandom) {
365  setBoolValue(SettingsConstants::lessRandom, lessRandom);
366 }
367 
368 bool QtPassSettings::isUseSymbols(const bool &defaultValue) {
369  return getBoolValue(SettingsConstants::useSymbols, defaultValue);
370 }
371 
372 void QtPassSettings::setUseSymbols(const bool &useSymbols) {
373  setBoolValue(SettingsConstants::useSymbols, useSymbols);
374 }
375 
377  PasswordConfiguration config;
378  config.length = getIntValue(SettingsConstants::passwordLength, 0);
379  config.selected = static_cast<PasswordConfiguration::characterSet>(
382  getStringValue(SettingsConstants::passwordChars, QString());
383  return config;
384 }
385 
387  const PasswordConfiguration &config) {
388  setIntValue(SettingsConstants::passwordLength, config.length);
390  setStringValue(SettingsConstants::passwordChars,
392 }
393 
394 void QtPassSettings::setPasswordLength(const int &passwordLength) {
395  setIntValue(SettingsConstants::passwordLength, passwordLength);
396 }
397 
399  const int &passwordCharsselection) {
401  passwordCharsselection);
402 }
403 
404 void QtPassSettings::setPasswordChars(const QString &passwordChars) {
405  setStringValue(SettingsConstants::passwordChars, passwordChars);
406 }
407 
408 bool QtPassSettings::isUseTrayIcon(const bool &defaultValue) {
409  return getBoolValue(SettingsConstants::useTrayIcon, defaultValue);
410 }
411 
412 void QtPassSettings::setUseTrayIcon(const bool &useTrayIcon) {
413  setBoolValue(SettingsConstants::useTrayIcon, useTrayIcon);
414 }
415 
416 bool QtPassSettings::isHideOnClose(const bool &defaultValue) {
417  return getBoolValue(SettingsConstants::hideOnClose, defaultValue);
418 }
419 
420 void QtPassSettings::setHideOnClose(const bool &hideOnClose) {
421  setBoolValue(SettingsConstants::hideOnClose, hideOnClose);
422 }
423 
424 bool QtPassSettings::isStartMinimized(const bool &defaultValue) {
425  return getBoolValue(SettingsConstants::startMinimized, defaultValue);
426 }
427 
428 void QtPassSettings::setStartMinimized(const bool &startMinimized) {
429  setBoolValue(SettingsConstants::startMinimized, startMinimized);
430 }
431 
432 bool QtPassSettings::isAlwaysOnTop(const bool &defaultValue) {
433  return getBoolValue(SettingsConstants::alwaysOnTop, defaultValue);
434 }
435 
436 void QtPassSettings::setAlwaysOnTop(const bool &alwaysOnTop) {
437  setBoolValue(SettingsConstants::alwaysOnTop, alwaysOnTop);
438 }
439 
440 bool QtPassSettings::isAutoPull(const bool &defaultValue) {
441  return getBoolValue(SettingsConstants::autoPull, defaultValue);
442 }
443 
444 void QtPassSettings::setAutoPull(const bool &autoPull) {
445  setBoolValue(SettingsConstants::autoPull, autoPull);
446 }
447 
448 bool QtPassSettings::isAutoPush(const bool &defaultValue) {
449  return getBoolValue(SettingsConstants::autoPush, defaultValue);
450 }
451 
452 void QtPassSettings::setAutoPush(const bool &autoPush) {
453  setBoolValue(SettingsConstants::autoPush, autoPush);
454 }
455 
456 QString QtPassSettings::getPassTemplate(const QString &defaultValue) {
457  return getStringValue(SettingsConstants::passTemplate, defaultValue);
458 }
459 
460 void QtPassSettings::setPassTemplate(const QString &passTemplate) {
461  setStringValue(SettingsConstants::passTemplate, passTemplate);
462 }
463 
464 bool QtPassSettings::isUseTemplate(const bool &defaultValue) {
465  return getBoolValue(SettingsConstants::useTemplate, defaultValue);
466 }
467 
468 void QtPassSettings::setUseTemplate(const bool &useTemplate) {
469  setBoolValue(SettingsConstants::useTemplate, useTemplate);
470 }
471 
472 bool QtPassSettings::isTemplateAllFields(const bool &defaultValue) {
473  return getBoolValue(SettingsConstants::templateAllFields, defaultValue);
474 }
475 
476 void QtPassSettings::setTemplateAllFields(const bool &templateAllFields) {
477  setBoolValue(SettingsConstants::templateAllFields, templateAllFields);
478 }
479 
480 QStringList QtPassSettings::getChildKeysFromCurrentGroup() {
481  return getSettings().childKeys();
482 }
483 
484 QHash<QString, QString> QtPassSettings::getProfiles() {
485  beginProfilesGroup();
486  QStringList childrenKeys = getChildKeysFromCurrentGroup();
487  QHash<QString, QString> profiles;
488  foreach (QString key, childrenKeys) {
489  profiles.insert(key, getSetting(key).toString());
490  }
491  endSettingsGroup();
492  return profiles;
493 }
494 
495 void QtPassSettings::setProfiles(const QHash<QString, QString> &profiles) {
496  getSettings().remove(SettingsConstants::groupProfiles);
497  beginProfilesGroup();
498  QHash<QString, QString>::const_iterator i = profiles.begin();
499  for (; i != profiles.end(); ++i) {
500  setSetting(i.key(), i.value());
501  }
502  endSettingsGroup();
503 }
504 
505 QSettings &QtPassSettings::getSettings() {
506  if (!QtPassSettings::initialized) {
507  QString portable_ini = QCoreApplication::applicationDirPath() +
508  QDir::separator() + "qtpass.ini";
509  if (QFile(portable_ini).exists()) {
510  settings.reset(new QSettings(portable_ini, QSettings::IniFormat));
511  } else {
512  settings.reset(new QSettings("IJHack", "QtPass"));
513  }
514  }
515  initialized = true;
516  return *settings;
517 }
518 
519 QString QtPassSettings::getStringValue(const QString &key,
520  const QString &defaultValue) {
521  QString stringValue;
522  if (stringSettings.contains(key)) {
523  stringValue = stringSettings.take(key);
524  } else {
525  stringValue = getSettings().value(key, defaultValue).toString();
526  stringSettings.insert(key, stringValue);
527  }
528  return stringValue;
529 }
530 
531 int QtPassSettings::getIntValue(const QString &key, const int &defaultValue) {
532  int intValue;
533  if (intSettings.contains(key)) {
534  intValue = intSettings.take(key);
535  } else {
536  intValue = getSettings().value(key, defaultValue).toInt();
537  intSettings.insert(key, intValue);
538  }
539  return intValue;
540 }
541 
542 bool QtPassSettings::getBoolValue(const QString &key,
543  const bool &defaultValue) {
544  bool boolValue;
545  if (boolSettings.contains(key)) {
546  boolValue = boolSettings.take(key);
547  } else {
548  boolValue = getSettings().value(key, defaultValue).toBool();
549  boolSettings.insert(key, boolValue);
550  }
551  return boolValue;
552 }
553 
554 QByteArray QtPassSettings::getByteArrayValue(const QString &key,
555  const QByteArray &defaultValue) {
556  QByteArray byteArrayValue;
557  if (byteArraySettings.contains(key)) {
558  byteArrayValue = byteArraySettings.take(key);
559  } else {
560  byteArrayValue = getSettings().value(key, defaultValue).toByteArray();
561  byteArraySettings.insert(key, byteArrayValue);
562  }
563  return byteArrayValue;
564 }
565 
566 QPoint QtPassSettings::getPointValue(const QString &key,
567  const QPoint &defaultValue) {
568  QPoint pointValue;
569  if (pointSettings.contains(key)) {
570  pointValue = pointSettings.take(key);
571  } else {
572  pointValue = getSettings().value(key, defaultValue).toPoint();
573  pointSettings.insert(key, pointValue);
574  }
575  return pointValue;
576 }
577 
578 QSize QtPassSettings::getSizeValue(const QString &key,
579  const QSize &defaultValue) {
580  QSize sizeValue;
581  if (sizeSettings.contains(key)) {
582  sizeValue = sizeSettings.take(key);
583  } else {
584  sizeValue = getSettings().value(key, defaultValue).toSize();
585  sizeSettings.insert(key, sizeValue);
586  }
587  return sizeValue;
588 }
589 
590 void QtPassSettings::setStringValue(const QString &key,
591  const QString &stringValue) {
592  stringSettings.insert(key, stringValue);
593  getSettings().setValue(key, stringValue);
594 }
595 
596 void QtPassSettings::setIntValue(const QString &key, const int &intValue) {
597  intSettings.insert(key, intValue);
598  getSettings().setValue(key, intValue);
599 }
600 
601 void QtPassSettings::setBoolValue(const QString &key, const bool &boolValue) {
602  boolSettings.insert(key, boolValue);
603  getSettings().setValue(key, boolValue);
604 }
605 
606 void QtPassSettings::setByteArrayValue(const QString &key,
607  const QByteArray &byteArrayValue) {
608  byteArraySettings.insert(key, byteArrayValue);
609  getSettings().setValue(key, byteArrayValue);
610 }
611 
612 void QtPassSettings::setPointValue(const QString &key,
613  const QPoint &pointValue) {
614  pointSettings.insert(key, pointValue);
615  getSettings().setValue(key, pointValue);
616 }
617 
618 void QtPassSettings::setSizeValue(const QString &key, const QSize &sizeValue) {
619  sizeSettings.insert(key, sizeValue);
620  getSettings().setValue(key, sizeValue);
621 }
622 
623 void QtPassSettings::beginSettingsGroup(const QString &groupName) {
624  getSettings().beginGroup(groupName);
625 }
626 
627 void QtPassSettings::endSettingsGroup() { getSettings().endGroup(); }
628 
629 void QtPassSettings::beginMainwindowGroup() {
630  getSettings().beginGroup(SettingsConstants::groupMainwindow);
631 }
632 
633 void QtPassSettings::beginProfilesGroup() {
634  getSettings().beginGroup(SettingsConstants::groupProfiles);
635 }
636 
637 QVariant QtPassSettings::getSetting(const QString &key,
638  const QVariant &defaultValue) {
639  return getSettings().value(key, defaultValue);
640 }
641 
642 void QtPassSettings::setSetting(const QString &key, const QVariant &value) {
643  getSettings().setValue(key, value);
644 }
645 
647  if (!pass) {
648  if (isUsePass()) {
649  QtPassSettings::pass = &QtPassSettings::realPass;
650  } else {
651  QtPassSettings::pass = &QtPassSettings::imitatePass;
652  }
653  pass->init();
654  }
655  return pass;
656 }
657 
658 ImitatePass *QtPassSettings::getImitatePass() { return &imitatePass; }
659 
660 RealPass *QtPassSettings::getRealPass() { return &realPass; }
static void setPwgenExecutable(const QString &pwgenExecutable)
static const QString usePass
static void setAutoclearSeconds(const int &autoClearSeconds)
static const QString useAutoclear
static int getAutoclearSeconds(const int &defaultValue=QVariant().toInt())
static void setUsePwgen(const bool &usePwgen)
static const QString useTemplate
static bool isStartMinimized(const bool &defaultValue=QVariant().toBool())
static const QString useWebDav
static bool isMaximized(const bool &defaultValue=QVariant().toBool())
static void setUsePass(const bool &usePass)
static const QString savestate
static bool isLessRandom(const bool &defaultValue=QVariant().toBool())
static const QString hideOnClose
static void setPassExecutable(const QString &passExecutable)
static const QString hideContent
int length
Length of the password.
static const QString pwgenExecutable
static const QString profile
static void setSplitterLeft(const int &splitterLeft)
static QString getGpgHome(const QString &defaultValue=QVariant().toString())
static bool isAlwaysOnTop(const bool &defaultValue=QVariant().toBool())
static QPoint getPos(const QPoint &defaultValue=QVariant().toPoint())
static void setWebDavPassword(const QString &webDavPassword)
Holds the Password configuration settings.
static void setPasswordChars(const QString &passwordChars)
static QString findBinaryInPath(QString binary)
Util::findBinaryInPath search for executables.
Definition: util.cpp:75
static void setAutoPush(const bool &autoPush)
static void setGitExecutable(const QString &gitExecutable)
static void setAlwaysOnTop(const bool &alwaysOnTop)
static bool isUseSelection(const bool &defaultValue=QVariant().toBool())
static const QString avoidCapitals
static const QString version
static void setPassTemplate(const QString &passTemplate)
static const QString hidePassword
static void setUseGit(const bool &useGit)
static void setClipBoardType(const Enums::clipBoardType &clipBoardType)
static void setPos(const QPoint &pos)
static bool isAvoidNumbers(const bool &defaultValue=QVariant().toBool())
static ImitatePass * getImitatePass()
static void setPasswordConfiguration(const PasswordConfiguration &config)
static void setHideContent(const bool &hideContent)
static bool isUseAutoclearPanel(const bool &defaultValue=QVariant().toBool())
static void setUseWebDav(const bool &useWebDav)
static bool isUseWebDav(const bool &defaultValue=QVariant().toBool())
static void setSize(const QSize &size)
static const QString useSelection
static const QString passwordLength
static void setLessRandom(const bool &lessRandom)
static void setAutoPull(const bool &autoPull)
static void setSplitterRight(const int &splitterRight)
static bool isAddGPGId(const bool &defaultValue=QVariant().toBool())
static bool isUseAutoclear(const bool &defaultValue=QVariant().toBool())
Wrapper for executing pass to handle the password-store.
Definition: realpass.h:10
static bool isHideOnClose(const bool &defaultValue=QVariant().toBool())
static void setProfiles(const QHash< QString, QString > &profiles)
static const QString autoclearSeconds
static bool isUseGit(const bool &defaultValue=QVariant().toBool())
static const QString addGPGId
static const QString avoidNumbers
Acts as an abstraction for pass or pass imitation.
Definition: pass.h:25
static const QString passStore
static const QString gpgHome
static QString getPassStore(const QString &defaultValue=QVariant().toString())
static void setProfile(const QString &profile)
static void setMaximized(const bool &maximized)
static QString getGitExecutable(const QString &defaultValue=QVariant().toString())
enum PasswordConfiguration::characterSet selected
static void setAutoclearPanelSeconds(const int &autoClearPanelSeconds)
static const QString passwordChars
static const QString groupMainwindow
static void setUseAutoclearPanel(const bool &useAutoclearPanel)
static const QString size
clipBoardType
Definition: enums.h:10
static const QString groupProfiles
static bool isUseTrayIcon(const bool &defaultValue=QVariant().toBool())
static const QString webDavUser
static void setAvoidNumbers(const bool &avoidNumbers)
static QString getPassExecutable(const QString &defaultValue=QVariant().toString())
static const QString webDavUrl
void init()
Definition: pass.cpp:39
static QString getVersion(const QString &defaultValue=QVariant().toString())
static const QString gitExecutable
static void setHideOnClose(const bool &hideOnClose)
static bool isAvoidCapitals(const bool &defaultValue=QVariant().toBool())
static const QString pos
static QByteArray getSavestate(const QByteArray &defaultValue=QVariant().toByteArray())
static QSize getSize(const QSize &defaultValue=QVariant().toSize())
static Pass * getPass()
static const QString splitterRight
static const QString useAutoclearPanel
static const QString passwordCharsselection
static void setGpgExecutable(const QString &gpgExecutable)
static QString getWebDavUser(const QString &defaultValue=QVariant().toString())
Imitates pass features when pass is not enabled or available.
Definition: imitatepass.h:11
static void setStartMinimized(const bool &startMinimized)
static const QString autoPush
static const QString lessRandom
static bool isUsePwgen(const bool &defaultValue=QVariant().toBool())
static const QString passTemplate
static const QString geometry
static void setSavestate(const QByteArray &saveState)
static void setUseAutoclear(const bool &useAutoclear)
static QString getPassTemplate(const QString &defaultValue=QVariant().toString())
static Enums::clipBoardType getClipBoardType(const Enums::clipBoardType &defaultvalue=Enums::CLIPBOARD_NEVER)
static QString getWebDavUrl(const QString &defaultValue=QVariant().toString())
static const QString maximized
static QString getPwgenExecutable(const QString &defaultValue=QVariant().toString())
static bool isUseSymbols(const bool &defaultValue=QVariant().toBool())
static const QString autoclearPanelSeconds
static const QString templateAllFields
static const QString alwaysOnTop
static void setUseTemplate(const bool &useTemplate)
static QByteArray getGeometry(const QByteArray &defaultValue=QVariant().toByteArray())
static void setPasswordCharsselection(const int &passwordCharsselection)
static const QString gpgExecutable
static int getSplitterRight(const int &defaultValue=QVariant().toInt())
static int getAutoclearPanelSeconds(const int &defaultValue=QVariant().toInt())
static void setAddGPGId(const bool &addGPGId)
static QString getGpgExecutable(const QString &defaultValue=QVariant().toString())
static void setWebDavUrl(const QString &webDavUrl)
static bool isUseTemplate(const bool &defaultValue=QVariant().toBool())
static QString getWebDavPassword(const QString &defaultValue=QVariant().toString())
static bool isTemplateAllFields(const bool &defaultValue=QVariant().toBool())
static const QString useTrayIcon
static void setUseSymbols(const bool &useSymbols)
static void initExecutables()
static const QString passExecutable
QString Characters[CHARSETS_COUNT]
The different character sets.
static void setTemplateAllFields(const bool &templateAllFields)
static QHash< QString, QString > getProfiles()
static void setUseTrayIcon(const bool &useTrayIcon)
static PasswordConfiguration getPasswordConfiguration()
static void setGeometry(const QByteArray &geometry)
static int getSplitterLeft(const int &defaultValue=QVariant().toInt())
static const QString useSymbols
static RealPass * getRealPass()
static bool isHidePassword(const bool &defaultValue=QVariant().toBool())
static bool isHideContent(const bool &defaultValue=QVariant().toBool())
static const QString startMinimized
static const QString useGit
static const QString clipBoardType
static QString getProfile(const QString &defaultValue=QVariant().toString())
static const QString splitterLeft
static const QString usePwgen
static void setWebDavUser(const QString &webDavUser)
static void setVersion(const QString &version)
static void setHidePassword(const bool &hidePassword)
static void setPassStore(const QString &passStore)
static void setUseSelection(const bool &useSelection)
static void setPasswordLength(const int &passwordLength)
static bool isAutoPull(const bool &defaultValue=QVariant().toBool())
static bool isUsePass(const bool &defaultValue=QVariant().toBool())
characterSet
The selected character set.
static const QString webDavPassword
static bool isAutoPush(const bool &defaultValue=QVariant().toBool())
static const QString autoPull
static void setAvoidCapitals(const bool &avoidCapitals)