Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
Conflicts:
	mainwindow.cpp
	pass.h
	qtpass.pro
  • Loading branch information
Janosch Knack committed Nov 29, 2016
2 parents 8f7561b + 58f6d72 commit 1bd2ef4
Show file tree
Hide file tree
Showing 39 changed files with 1,469 additions and 1,391 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- Copy after timeout [\#189](https://github.com/IJHack/QtPass/issues/189)
- Feature Request: Copy template fields with button [\#133](https://github.com/IJHack/QtPass/issues/133)
- Cannot create top level folder [\#127](https://github.com/IJHack/QtPass/issues/127)
- Feature: moving items \(reordering folders\) [\#116](https://github.com/IJHack/QtPass/issues/116)
- Refactoring of qpushbuttonwithclipboard and timers [\#241](https://github.com/IJHack/QtPass/pull/241) ([tezeb](https://github.com/tezeb))
- added a copy button for each line to paste the content into the clipboard, "pass init -- path=" command with right path-parameter, lupdate qtpass.pro [\#218](https://github.com/IJHack/QtPass/pull/218) ([YoshiMan](https://github.com/YoshiMan))

**Fixed bugs:**
Expand All @@ -33,6 +35,7 @@

**Merged pull requests:**

- Password dialog decoupling from MW [\#242](https://github.com/IJHack/QtPass/pull/242) ([tezeb](https://github.com/tezeb))
- refactoring - pass ifce, process mgmt [\#234](https://github.com/IJHack/QtPass/pull/234) ([tezeb](https://github.com/tezeb))
- Solve Doubleclick issue [\#230](https://github.com/IJHack/QtPass/pull/230) ([jounathaen](https://github.com/jounathaen))
- refactoring, new QtPassSettings class, all settings should be read and written here [\#224](https://github.com/IJHack/QtPass/pull/224) ([YoshiMan](https://github.com/YoshiMan))
Expand Down
96 changes: 96 additions & 0 deletions datahelpers.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#ifndef DATAHELPERS_H
#define DATAHELPERS_H

#include <QDateTime>
#include <QString>

/*!
\struct passwordConfiguration
\brief holds the Password configuration settings
*/
struct passwordConfiguration {
/**
* @brief passwordConfiguration::selected character set.
*/
enum characterSet {
ALLCHARS = 0,
ALPHABETICAL,
ALPHANUMERIC,
CUSTOM,
CHARSETS_COUNT // have to be last, for easier initialization of arrays
} selected;
/**
* @brief passwordConfiguration::length of password.
*/
int length;
/**
* @brief passwordConfiguration::Characters the different character sets.
*/
QString Characters[CHARSETS_COUNT];
passwordConfiguration() : selected(ALLCHARS), length(16) {
Characters[ALLCHARS] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&"
"*()_-+={}[]|:;<>,.?"; /*AllChars*/
Characters[ALPHABETICAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
"vwxyz"; /*Only Alphabetical*/
Characters[ALPHANUMERIC] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
"vwxyz1234567890"; /*Alphabetical and Numerical*/
Characters[CUSTOM] = Characters[ALLCHARS]; // this may be redefined by user
}
};

/*!
\struct UserInfo
\brief Stores key info lines including validity, creation date and more.
*/
struct UserInfo {
UserInfo() : validity('-'), have_secret(false), enabled(false) {}

/**
* @brief UserInfo::fullyValid when validity is f or u.
* http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
*/
bool fullyValid() { return validity == 'f' || validity == 'u'; }
/**
* @brief UserInfo::marginallyValid when validity is m.
* http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
*/
bool marginallyValid() { return validity == 'm'; }
/**
* @brief UserInfo::isValid when fullyValid or marginallyValid.
*/
bool isValid() { return fullyValid() || marginallyValid(); }

/**
* @brief UserInfo::name full name
*/
QString name;
/**
* @brief UserInfo::key_id hexadecimal representation
*/
QString key_id;
/**
* @brief UserInfo::validity GnuPG representation of validity
* http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
*/
char validity;
/**
* @brief UserInfo::have_secret secret key is available
* (can decrypt with this key)
*/
bool have_secret;
/**
* @brief UserInfo::enabled
*/
bool enabled;
/**
* @brief UserInfo::expiry date/time key expires
*/
QDateTime expiry;
/**
* @brief UserInfo::created date/time key was created
*/
QDateTime created;
};

#endif // DATAHELPERS_H
13 changes: 0 additions & 13 deletions enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ class Enums {
CLIPBOARD_ALWAYS = 1,
CLIPBOARD_ON_DEMAND = 2
};
/**
* @brief Enums::characterSet enum
* 0 All character
* 1 Alphabetical
* 2 Alphanumeric
* 3 Custon (from config)
*/
enum characterSet {
ALLCHARS = 0,
ALPHABETICAL = 1,
ALPHANUMERIC = 2,
CUSTOM = 3
};
};

#endif // ENUMS_H
Loading

0 comments on commit 1bd2ef4

Please sign in to comment.