summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2023-01-31 13:00:12 +0100
committerAnne Jan Brouwer <brouwer@annejan.com>2023-01-31 13:00:12 +0100
commit32182959224abd80541f238df2e27119a52810ce (patch)
tree37d4f1ffb1450bb30ed34622d282e3293546832d
parent9ce95b92cdc59f3a3703593dd49ae6b603653c25 (diff)
Some automatic fixes
-rw-r--r--CHANGELOG.md4
-rw-r--r--CODE_OF_CONDUCT.md4
-rw-r--r--CONTRIBUTING.md6
-rw-r--r--FAQ.md15
-rw-r--r--README.md4
-rw-r--r--main/main.cpp14
-rw-r--r--src/imitatepass.cpp13
-rw-r--r--src/keygendialog.cpp17
-rw-r--r--src/mainwindow.cpp15
-rw-r--r--src/pass.cpp6
-rw-r--r--src/qtpass.cpp12
-rw-r--r--src/storemodel.cpp2
-rw-r--r--src/usersdialog.cpp14
13 files changed, 77 insertions, 49 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 510223dd..37c6c6a1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -799,9 +799,7 @@
- Swedish localization [\#5](https://github.com/IJHack/QtPass/pull/5) ([iamtew](https://github.com/iamtew))
- Update localization\_hu\_HU.ts [\#4](https://github.com/IJHack/QtPass/pull/4) ([reesenemesis](https://github.com/reesenemesis))
- Update localization\_hu\_HU.ts [\#3](https://github.com/IJHack/QtPass/pull/3) ([reesenemesis](https://github.com/reesenemesis))
-- \[pass\]\(http://www.passwordstore.org/\) [\#2](https://github.com/IJHack/QtPass/pull/2) ([guaka](https://github.com/guaka))
+- \[pass\]\(<http://www.passwordstore.org/\>) [\#2](https://github.com/IJHack/QtPass/pull/2) ([guaka](https://github.com/guaka))
- Beginning of German translation [\#1](https://github.com/IJHack/QtPass/pull/1) ([mwfc](https://github.com/mwfc))
-
-
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 41dccf64..f6f9d63e 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -67,9 +67,9 @@ members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
-https://www.contributor-covenant.org/faq
+<https://www.contributor-covenant.org/faq>
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c5ae9933..8f8b4372 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -15,7 +15,7 @@ This document is still in a very early stage and needs a lot more work.
3. Make sure you update all of the CI configs if need be. These are ran on every Pull Request.
3. Increase the version numbers in relevant files when applicable.
The versioning scheme we use is [SemVer](http://semver.org/).
-4. You may merge the Pull Request in once you have the sign-off of one other developer, or if you
+4. You may merge the Pull Request in once you have the sign-off of one other developer, or if you
do not have permission to do that, you may request a reviewer to merge it for you.
## Translations
@@ -38,7 +38,7 @@ For questions or brainstorming about features please join #ijhack on freenode.
Or if you prefer to use [gitter](https://gitter.im/IJHack/qtpass)
-## License
+## License
QtPass is released under the GNU GPL v3.0 license.
-http://www.gnu.org/licenses/gpl-3.0.html
+<http://www.gnu.org/licenses/gpl-3.0.html>
diff --git a/FAQ.md b/FAQ.md
index aaaa91fa..0ce309c2 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -45,7 +45,6 @@ fi
eg: `ln -s /usr/bin/pinentry-qt5 /usr/bin/pinentry`
* On MacOs `pinentry-program /usr/local/bin/pinentry-mac` works after installing `pinentry-mac` from homebrew.
-
### I have an other issue with gpg
* Possibly you have you key only in gpg and not in gpg2
@@ -57,7 +56,9 @@ gpg2 --import public.key
gpg2 --import private.key
rm public.key private.key
```
+
Where [ID] is your gpg key-id.
+
* It might be the case where it is the other way around, exchange gpg and gpg2 accordingly . .
### Git doesn't work on Windows
@@ -67,7 +68,7 @@ git for Windows comes with an `ssh-askpass` compatible command, git `gui--askpas
### Git has issues with GPG SSH Authentication
This tutorial might resolve your issues.
-https://github.com/git-for-windows/git/wiki/OpenSSH-Integration-with-Pageant
+<https://github.com/git-for-windows/git/wiki/OpenSSH-Integration-with-Pageant>
### Where is the configuration stored?
@@ -82,7 +83,7 @@ So called "portable config".
There are some things to take care of when trying to sync on some systems (especially OSX, with regards to text and binary .plist files).
-More information: http://doc.qt.io/qt-5/qsettings.html#platform-specific-notes
+More information: <http://doc.qt.io/qt-5/qsettings.html#platform-specific-notes>
### Where can I ask for help?
@@ -102,18 +103,21 @@ Please install using your favorite package manager.
### I get icons that do not fit my (X11) default
* On some WindowManagers, Qt doesn't know what icon set to use. A trick:
+
```
export DESKTOP_SESSION=gnome
```
* Another possible reason is, that the currently installed Qt Version gives problems (e.g. on Linux Mint 17.3)
Then you'll have to install the current version via your package manager or if this is not up-to-date,
-download it from https://www.qt.io/download/ install it and run:
+download it from <https://www.qt.io/download/> install it and run:
+
```
/PATHTOYOURQTINSTALLATION/5.5/gcc_64/bin/qmake
make
(sudo) make install
```
+
where `PATHTOYOURINSTALLATION` is the path you selected in the qt installer (default `/home/YOURUSER/Qt/` )
and 5.5 has to be adapted for the Qt version you downloaded.
@@ -130,11 +134,12 @@ and 5.5 has to be adapted for the Qt version you downloaded.
### How do I set the language manually?
QtPass uses the system language. Changing it depends on your system:
+
* on Linux: ```LANGUAGE=fr qtpass``` will run QtPass in French.
## How can I help improve QtPass?
-### I would like to donate!
+### I would like to donate
* Time:
* Read [contributing](CONTRIBUTING.md) documentation.
diff --git a/README.md b/README.md
index de950ea4..49f12171 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,7 @@ Windows
[![Packaging status](https://repology.org/badge/vertical-allrepos/qtpass.svg)](https://repology.org/metapackage/qtpass)
[![Translation status](https://hosted.weblate.org/widgets/qtpass/-/multi-auto.svg)](https://hosted.weblate.org/engage/qtpass/?utm_source=widget)
+
### From Source
**Dependencies**
@@ -76,6 +77,7 @@ Your GPG has to be set-up with a graphical pinentry when applicable, same goes f
On Mac OS X this currently seems to only work best with `pinentry-mac` from homebrew, although gpgtools works too.
On most unix systems all you need is:
+
```
qmake && make && make install
```
@@ -148,8 +150,8 @@ Further reading
[Issue queue](https://github.com/IJHack/qtpass/issues)
[Chat](https://gitter.im/IJHack/qtpass)
-
## License
+
### GNU GPL v3.0
[![GNU GPL v3.0](http://www.gnu.org/graphics/gplv3-127x51.png)](http://www.gnu.org/licenses/gpl.html)
diff --git a/main/main.cpp b/main/main.cpp
index e31c8a00..ad80a24a 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -41,7 +41,8 @@
* @return
*/
int main(int argc, char *argv[]) {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && \
+ QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
@@ -84,7 +85,8 @@ int main(int argc, char *argv[]) {
// locale = "nl_NL";
// locale = "he_IL";
// locale = "ar_MA";
- if (translator.load(QString(":localization/localization_%1.qm").arg(locale))) {
+ if (translator.load(
+ QString(":localization/localization_%1.qm").arg(locale))) {
SingleApplication::installTranslator(&translator);
SingleApplication::setLayoutDirection(
QObject::tr("LTR") == "RTL" ? Qt::RightToLeft : Qt::LeftToRight);
@@ -104,10 +106,12 @@ int main(int argc, char *argv[]) {
QGuiApplication::setDesktopFileName("qtpass.desktop");
#endif
- //Center the MainWindow on the screen the mouse pointer is currently on
+ // Center the MainWindow on the screen the mouse pointer is currently on
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- static int cursorScreen = app.desktop()->screenNumber(app.desktop()->cursor().pos());
- QPoint cursorScreenCenter = app.desktop()->screenGeometry(cursorScreen).center();
+ static int cursorScreen =
+ app.desktop()->screenNumber(app.desktop()->cursor().pos());
+ QPoint cursorScreenCenter =
+ app.desktop()->screenGeometry(cursorScreen).center();
#else
QScreen *screen = QGuiApplication::screenAt(QCursor::pos());
QPoint cursorScreenCenter = screen->geometry().center();
diff --git a/src/imitatepass.cpp b/src/imitatepass.cpp
index 2140505b..1cdb8575 100644
--- a/src/imitatepass.cpp
+++ b/src/imitatepass.cpp
@@ -127,9 +127,9 @@ void ImitatePass::Insert(QString file, QString newValue, bool overwrite) {
*/
void ImitatePass::GitCommit(const QString &file, const QString &msg) {
if (file.isEmpty())
- executeGit(GIT_COMMIT, {"commit", "-m", msg});
+ executeGit(GIT_COMMIT, {"commit", "-m", msg});
else
- executeGit(GIT_COMMIT, {"commit", "-m", msg, "--", pgit(file)});
+ executeGit(GIT_COMMIT, {"commit", "-m", msg, "--", pgit(file)});
}
/**
@@ -268,9 +268,11 @@ void ImitatePass::reencryptPath(const QString &dir) {
QStringList actualKeys;
keys += err;
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- QStringList key = keys.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
+ QStringList key =
+ keys.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
#else
- QStringList key = keys.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
+ QStringList key =
+ keys.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
#endif
QListIterator<QString> itr(key);
while (itr.hasNext()) {
@@ -404,7 +406,8 @@ void ImitatePass::Move(const QString src, const QString dest,
QString relSrc = QDir(QtPassSettings::getPassStore()).relativeFilePath(src);
relSrc.replace(QRegularExpression("\\.gpg$"), "");
- QString relDest = QDir(QtPassSettings::getPassStore()).relativeFilePath(destFile);
+ QString relDest =
+ QDir(QtPassSettings::getPassStore()).relativeFilePath(destFile);
relDest.replace(QRegularExpression("\\.gpg$"), "");
QString message = QString("Moved for %1 to %2 using QtPass.");
message = message.arg(relSrc).arg(relDest);
diff --git a/src/keygendialog.cpp b/src/keygendialog.cpp
index a7661865..f0df77b3 100644
--- a/src/keygendialog.cpp
+++ b/src/keygendialog.cpp
@@ -85,9 +85,11 @@ void KeygenDialog::replace(const QString &key, const QString &value) {
QStringList clear;
QString expert = ui->plainTextEdit->toPlainText();
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- QStringList lines = expert.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
+ QStringList lines =
+ expert.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
#else
- QStringList lines = expert.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
+ QStringList lines =
+ expert.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
#endif
foreach (QString line, lines) {
line.replace(QRegularExpression(key + ":.*"), key + ": " + value);
@@ -107,9 +109,11 @@ void KeygenDialog::no_protection(bool enable) {
QStringList clear;
QString expert = ui->plainTextEdit->toPlainText();
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- QStringList lines = expert.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
+ QStringList lines =
+ expert.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
#else
- QStringList lines = expert.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
+ QStringList lines =
+ expert.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
#endif
foreach (QString line, lines) {
bool remove = false;
@@ -141,7 +145,10 @@ void KeygenDialog::done(int r) {
}
// check email
- QRegularExpression mailre(QRegularExpression::anchoredPattern(R"(\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b)"), QRegularExpression::CaseInsensitiveOption);
+ QRegularExpression mailre(
+ QRegularExpression::anchoredPattern(
+ R"(\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b)"),
+ QRegularExpression::CaseInsensitiveOption);
if (!mailre.match(ui->email->text()).hasMatch()) {
QMessageBox::critical(
this, tr("Invalid email"),
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 6e7dcffb..60b3d0ca 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -404,7 +404,7 @@ void MainWindow::passShowHandler(const QString &p_output) {
// show what is needed:
if (QtPassSettings::isHideContent()) {
output = "***" + tr("Content hidden") + "***";
- } else if (! QtPassSettings::isDisplayAsIs()) {
+ } else if (!QtPassSettings::isDisplayAsIs()) {
if (!password.isEmpty()) {
// set the password, it is hidden if needed in addToGridLayout
addToGridLayout(0, tr("Password"), password);
@@ -1048,7 +1048,7 @@ void MainWindow::renamePassword() {
QString filePath = QFileInfo(file).path();
QString fileName = QFileInfo(file).fileName();
if (fileName.endsWith(".gpg", Qt::CaseInsensitive))
- fileName.chop(4);
+ fileName.chop(4);
QString newName =
QInputDialog::getText(this, tr("Rename file"), tr("Rename File To: "),
@@ -1126,9 +1126,11 @@ void MainWindow::addToGridLayout(int position, const QString &field,
}
// set the echo mode to password, if the field is "password"
- const QString lineStyle = QtPassSettings::isUseMonospace()
- ? "border-style: none; background: transparent; font-family: monospace;"
- : "border-style: none; background: transparent;";
+ const QString lineStyle =
+ QtPassSettings::isUseMonospace()
+ ? "border-style: none; background: transparent; font-family: "
+ "monospace;"
+ : "border-style: none; background: transparent;";
if (QtPassSettings::isHidePassword() && trimmedField == tr("Password")) {
@@ -1156,7 +1158,8 @@ void MainWindow::addToGridLayout(int position, const QString &field,
QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
line->setObjectName(trimmedField);
trimmedValue.replace(
- QRegularExpression("((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
+ QRegularExpression(
+ "((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
R"(<a href="\1">\1</a>)");
line->setText(trimmedValue);
line->setReadOnly(true);
diff --git a/src/pass.cpp b/src/pass.cpp
index d2ca1e85..f52c27a5 100644
--- a/src/pass.cpp
+++ b/src/pass.cpp
@@ -140,9 +140,11 @@ QList<UserInfo> Pass::listKeys(QStringList keystrings, bool secret) {
0)
return users;
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- QStringList keys = p_out.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
+ QStringList keys =
+ p_out.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
#else
- QStringList keys = p_out.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
+ QStringList keys =
+ p_out.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
#endif
UserInfo current_user;
foreach (QString key, keys) {
diff --git a/src/qtpass.cpp b/src/qtpass.cpp
index 7590d711..6583ccab 100644
--- a/src/qtpass.cpp
+++ b/src/qtpass.cpp
@@ -277,9 +277,9 @@ void QtPass::processErrorExit(int exitCode, const QString &p_error) {
output = "<span style=\"color: red;\">" + error + "</span><br />";
}
- output.replace(
- QRegularExpression("((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
- R"(<a href="\1">\1</a>)");
+ output.replace(QRegularExpression(
+ "((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
+ R"(<a href="\1">\1</a>)");
output.replace(QRegularExpression("\n"), "<br />");
m_mainWindow->flashText(output, false, true);
@@ -339,9 +339,9 @@ void QtPass::showInTextBrowser(QString output, QString prefix,
output.replace(QRegularExpression(">"), "&gt;");
output.replace(QRegularExpression(" "), "&nbsp;");
- output.replace(
- QRegularExpression("((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
- R"(<a href="\1">\1</a>)");
+ output.replace(QRegularExpression(
+ "((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
+ R"(<a href="\1">\1</a>)");
output.replace(QRegularExpression("\n"), "<br />");
output = prefix + output + postfix;
diff --git a/src/storemodel.cpp b/src/storemodel.cpp
index a5bfda55..5b37f8e9 100644
--- a/src/storemodel.cpp
+++ b/src/storemodel.cpp
@@ -2,9 +2,9 @@
#include "qtpasssettings.h"
#include <QDebug>
-#include <QRegularExpression>
#include <QMessageBox>
#include <QMimeData>
+#include <QRegularExpression>
#include <utility>
QDataStream &
diff --git a/src/usersdialog.cpp b/src/usersdialog.cpp
index b89da883..517b6dc8 100644
--- a/src/usersdialog.cpp
+++ b/src/usersdialog.cpp
@@ -136,7 +136,9 @@ void UsersDialog::itemChange(QListWidgetItem *item) {
* @param filter
*/
void UsersDialog::populateList(const QString &filter) {
- QRegularExpression nameFilter(QRegularExpression::wildcardToRegularExpression("*" + filter + "*"), QRegularExpression::CaseInsensitiveOption);
+ QRegularExpression nameFilter(
+ QRegularExpression::wildcardToRegularExpression("*" + filter + "*"),
+ QRegularExpression::CaseInsensitiveOption);
ui->listWidget->clear();
if (!m_userList.isEmpty()) {
for (auto &user : m_userList) {
@@ -149,12 +151,14 @@ void UsersDialog::populateList(const QString &filter) {
continue;
QString userText = user.name + "\n" + user.key_id;
if (user.created.toSecsSinceEpoch() > 0) {
- userText += " " + tr("created") + " " +
- QLocale::system().toString(user.created, QLocale::ShortFormat);
+ userText +=
+ " " + tr("created") + " " +
+ QLocale::system().toString(user.created, QLocale::ShortFormat);
}
if (user.expiry.toSecsSinceEpoch() > 0)
- userText += " " + tr("expires") + " " +
- QLocale::system().toString(user.expiry, QLocale::ShortFormat);
+ userText +=
+ " " + tr("expires") + " " +
+ QLocale::system().toString(user.expiry, QLocale::ShortFormat);
auto *item = new QListWidgetItem(userText, ui->listWidget);
item->setCheckState(user.enabled ? Qt::Checked : Qt::Unchecked);
item->setData(Qt::UserRole, QVariant::fromValue(&user));