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