Skip to content

Commit

Permalink
Merge branch 'develop' into feature/copy-password-and-otp
Browse files Browse the repository at this point in the history
  • Loading branch information
jimheden authored Sep 9, 2022
2 parents 392ee40 + 612c109 commit 03e18c2
Show file tree
Hide file tree
Showing 47 changed files with 701 additions and 159 deletions.
31 changes: 29 additions & 2 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,24 @@ Files: share/icons/badges/2_Expired.svg
Copyright: 2022 KeePassXC Team <[email protected]>
License: MIT

Files: share/icons/application/scalable/actions/chevron-double-down.svg
Files: share/icons/application/scalable/actions/application-exit.svg
share/icons/application/scalable/actions/attributes-copy.svg
share/icons/application/scalable/actions/auto-type.svg
share/icons/application/scalable/actions/bugreport.svg
share/icons/application/scalable/actions/chevron-double-down.svg
share/icons/application/scalable/actions/chevron-double-right.svg
share/icons/application/scalable/actions/totp.svg
share/icons/application/scalable/actions/totp-copy.svg
share/icons/application/scalable/actions/totp-edit.svg
share/icons/application/scalable/actions/clipboard-text.svg
share/icons/application/scalable/actions/configure.svg
share/icons/application/scalable/actions/database-change-key.svg
share/icons/application/scalable/actions/database-lock.svg
share/icons/application/scalable/actions/database-lock-all.svg
share/icons/application/scalable/actions/database-merge.svg
share/icons/application/scalable/actions/database-search.svg
share/icons/application/scalable/actions/dialog-close.svg
share/icons/application/scalable/actions/dialog-ok.svg
share/icons/application/scalable/actions/document-close.svg
share/icons/application/scalable/actions/document-edit.svg
share/icons/application/scalable/actions/document-export.svg
Expand All @@ -159,43 +173,56 @@ Files: share/icons/application/scalable/actions/chevron-double-down.svg
share/icons/application/scalable/actions/document-save.svg
share/icons/application/scalable/actions/document-save-as.svg
share/icons/application/scalable/actions/document-save-copy.svg
share/icons/application/scalable/actions/donate.svg
share/icons/application/scalable/actions/edit-clear-locationbar-ltr.svg
share/icons/application/scalable/actions/edit-clear-locationbar-rtl.svg
share/icons/application/scalable/actions/entry-clone.svg
share/icons/application/scalable/actions/entry-delete.svg
share/icons/application/scalable/actions/entry-restore.svg
share/icons/application/scalable/actions/entry-edit.svg
share/icons/application/scalable/actions/entry-new.svg
share/icons/application/scalable/actions/favicon-download.svg
share/icons/application/scalable/actions/fingerprint.svg
share/icons/application/scalable/actions/group-clone.svg
share/icons/application/scalable/actions/getting-started.svg
share/icons/application/scalable/actions/group-delete.svg
share/icons/application/scalable/actions/group-edit.svg
share/icons/application/scalable/actions/group-clone.svg
share/icons/application/scalable/actions/group-empty-trash.svg
share/icons/application/scalable/actions/group-new.svg
share/icons/application/scalable/actions/hammer-wrench.svg
share/icons/application/scalable/actions/health.svg
share/icons/application/scalable/actions/help-about.svg
share/icons/application/scalable/actions/lock-question.svg
share/icons/application/scalable/actions/keyboard-shortcuts.svg
share/icons/application/scalable/actions/message-close.svg
share/icons/application/scalable/actions/move-down.svg
share/icons/application/scalable/actions/move-up.svg
share/icons/application/scalable/actions/object-locked.svg
share/icons/application/scalable/actions/object-unlocked.svg
share/icons/application/scalable/actions/paperclip.svg
share/icons/application/scalable/actions/password-copy.svg
share/icons/application/scalable/actions/password-generator.svg
share/icons/application/scalable/actions/password-show-off.svg
share/icons/application/scalable/actions/password-show-on.svg
share/icons/application/scalable/actions/qrcode.svg
share/icons/application/scalable/actions/refresh.svg
share/icons/application/scalable/actions/reports.svg
share/icons/application/scalable/actions/reports-exclude.svg
share/icons/application/scalable/actions/sort-alphabetical-ascending.svg
share/icons/application/scalable/actions/sort-alphabetical-descending.svg
share/icons/application/scalable/actions/statistics.svg
share/icons/application/scalable/actions/system-help.svg
share/icons/application/scalable/actions/system-search.svg
share/icons/application/scalable/actions/system-software-update.svg
share/icons/application/scalable/actions/tag.svg
share/icons/application/scalable/actions/tag-multiple.svg
share/icons/application/scalable/actions/tag-search.svg
share/icons/application/scalable/actions/trash.svg
share/icons/application/scalable/actions/url-copy.svg
share/icons/application/scalable/actions/user-guide.svg
share/icons/application/scalable/actions/username-copy.svg
share/icons/application/scalable/actions/view-history.svg
share/icons/application/scalable/actions/web.svg
share/icons/application/scalable/apps/internet-web-browser.svg
share/icons/application/scalable/apps/keepassxc.svg
share/icons/application/scalable/apps/keepassxc-dark.svg
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions share/icons/application/scalable/actions/qrcode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions share/icons/application/scalable/actions/tag-multiple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions share/icons/application/scalable/actions/totp-copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions share/icons/application/scalable/actions/totp-edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion share/icons/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
<file>application/256x256/apps/keepassxc.png</file>

<file>application/scalable/actions/application-exit.svg</file>
<file>application/scalable/actions/attributes-copy.svg</file>
<file>application/scalable/actions/auto-type.svg</file>
<file>application/scalable/actions/bugreport.svg</file>
<file>application/scalable/actions/chevron-double-down.svg</file>
<file>application/scalable/actions/chevron-double-right.svg</file>
<file>application/scalable/actions/chronometer.svg</file>
<file>application/scalable/actions/totp.svg</file>
<file>application/scalable/actions/totp-copy.svg</file>
<file>application/scalable/actions/totp-edit.svg</file>
<file>application/scalable/actions/clipboard-text.svg</file>
<file>application/scalable/actions/configure.svg</file>
<file>application/scalable/actions/database-change-key.svg</file>
<file>application/scalable/actions/database-lock.svg</file>
<file>application/scalable/actions/database-lock-all.svg</file>
<file>application/scalable/actions/database-merge.svg</file>
<file>application/scalable/actions/database-search.svg</file>
<file>application/scalable/actions/dialog-close.svg</file>
<file>application/scalable/actions/dialog-ok.svg</file>
<file>application/scalable/actions/document-close.svg</file>
Expand Down Expand Up @@ -62,6 +66,7 @@
<file>application/scalable/actions/password-generator.svg</file>
<file>application/scalable/actions/password-show-off.svg</file>
<file>application/scalable/actions/password-show-on.svg</file>
<file>application/scalable/actions/qrcode.svg</file>
<file>application/scalable/actions/refresh.svg</file>
<file>application/scalable/actions/reports.svg</file>
<file>application/scalable/actions/reports-exclude.svg</file>
Expand All @@ -72,6 +77,7 @@
<file>application/scalable/actions/system-search.svg</file>
<file>application/scalable/actions/system-software-update.svg</file>
<file>application/scalable/actions/tag.svg</file>
<file>application/scalable/actions/tag-multiple.svg</file>
<file>application/scalable/actions/tag-search.svg</file>
<file>application/scalable/actions/trash.svg</file>
<file>application/scalable/actions/url-copy.svg</file>
Expand Down
68 changes: 61 additions & 7 deletions share/translations/keepassxc_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2249,10 +2249,6 @@ This is definitely a bug, please report it to the developers.</source>
</context>
<context>
<name>DatabaseWidget</name>
<message>
<source>Database Tags</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Searching…</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -2417,6 +2413,22 @@ Disable safe saves and try again?</source>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>Searches and Tags</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter a unique name or overwrite an existing search from the list:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save Search</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditEntryWidget</name>
Expand Down Expand Up @@ -5407,6 +5419,21 @@ We recommend you use the AppImage available on our downloads page.</source>
<source>Copy Password and TOTP</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tags</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Tags</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<source>%1 Entry(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
</context>
<context>
<name>ManageDatabase</name>
Expand Down Expand Up @@ -8376,6 +8403,10 @@ Kernel: %3 %4</source>
<source>Limit search to selected group</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save Search</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsClientModel</name>
Expand Down Expand Up @@ -8589,15 +8620,38 @@ Kernel: %3 %4</source>
<context>
<name>TagModel</name>
<message>
<source>All</source>
<source>Expired</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expired</source>
<source>Weak Passwords</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Weak Passwords</source>
<source>All Entries</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Clear Search</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TagView</name>
<message>
<source>Remove Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove Tag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Confirm Remove Tag</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove tag &quot;%1&quot; from all entries in this database?</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ set(keepassx_SOURCES
gui/group/GroupModel.cpp
gui/group/GroupView.cpp
gui/tag/TagModel.cpp
gui/tag/TagView.cpp
gui/tag/TagsEdit.cpp
gui/databasekey/KeyComponentWidget.cpp
gui/databasekey/PasswordEditWidget.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/autotype/AutoTypeSelectDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void AutoTypeSelectDialog::buildActionMenu()
auto typeTotpAction = new QAction(icons()->icon("auto-type"), tr("Type {TOTP}"), this);
auto copyUsernameAction = new QAction(icons()->icon("username-copy"), tr("Copy Username"), this);
auto copyPasswordAction = new QAction(icons()->icon("password-copy"), tr("Copy Password"), this);
auto copyTotpAction = new QAction(icons()->icon("chronometer"), tr("Copy TOTP"), this);
auto copyTotpAction = new QAction(icons()->icon("totp"), tr("Copy TOTP"), this);
m_actionMenu->addAction(typeUsernameAction);
m_actionMenu->addAction(typePasswordAction);
m_actionMenu->addAction(typeTotpAction);
Expand Down
2 changes: 1 addition & 1 deletion src/browser/BrowserService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ BrowserService::Access
BrowserService::checkAccess(const Entry* entry, const QString& siteHost, const QString& formHost, const QString& realm)
{
if (entry->isExpired()) {
return browserSettings()->allowExpiredCredentials() ? Allowed : Denied;
return browserSettings()->allowExpiredCredentials() ? Unknown : Denied;
}

BrowserEntryConfig config;
Expand Down
1 change: 1 addition & 0 deletions src/cli/Clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ int Clip::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<
return EXIT_FAILURE;
}

selectedAttribute = "totp";
found = true;
value = entry->totp();
} else if (Utils::EntryFieldNames.contains(selectedAttribute)) {
Expand Down
15 changes: 13 additions & 2 deletions src/core/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,8 @@ void Database::updateTagList()
// Search groups recursively looking for tags
// Use a set to prevent adding duplicates
QSet<QString> tagSet;
for (const auto group : m_rootGroup->groupsRecursive(true)) {
for (const auto entry : group->entries()) {
for (auto entry : m_rootGroup->entriesRecursive()) {
if (!entry->isRecycled()) {
for (auto tag : entry->tagList()) {
tagSet.insert(tag);
}
Expand All @@ -714,6 +714,17 @@ void Database::updateTagList()
emit tagListUpdated();
}

void Database::removeTag(const QString& tag)
{
if (!m_rootGroup) {
return;
}

for (auto entry : m_rootGroup->entriesRecursive()) {
entry->removeTag(tag);
}
}

const QUuid& Database::cipher() const
{
return m_data.cipher;
Expand Down
1 change: 1 addition & 0 deletions src/core/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class Database : public ModifiableObject

const QStringList& commonUsernames() const;
const QStringList& tagList() const;
void removeTag(const QString& tag);

QSharedPointer<const CompositeKey> key() const;
bool setKey(const QSharedPointer<const CompositeKey>& key,
Expand Down
44 changes: 38 additions & 6 deletions src/core/Entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,12 @@ QString Entry::overrideUrl() const

QString Entry::tags() const
{
return m_data.tags;
return m_data.tags.join(",");
}

QStringList Entry::tagList() const
{
static QRegExp rx("(\\,|\\t|\\;)");
auto taglist = tags().split(rx, QString::SkipEmptyParts);
std::sort(taglist.begin(), taglist.end());
return taglist;
return m_data.tags;
}

const TimeInfo& Entry::timeInfo() const
Expand Down Expand Up @@ -654,7 +651,42 @@ void Entry::setOverrideUrl(const QString& url)

void Entry::setTags(const QString& tags)
{
set(m_data.tags, tags);
static QRegExp rx("(\\,|\\t|\\;)");
auto taglist = tags.split(rx, QString::SkipEmptyParts);
// Trim whitespace before/after tag text
for (auto itr = taglist.begin(); itr != taglist.end(); ++itr) {
*itr = itr->trimmed();
}
// Remove duplicates
auto tagSet = QSet<QString>::fromList(taglist);
taglist = tagSet.toList();
// Sort alphabetically
taglist.sort();
set(m_data.tags, taglist);
}

void Entry::addTag(const QString& tag)
{
auto cleanTag = tag.trimmed();
cleanTag.remove(QRegExp("(\\,|\\t|\\;)"));

auto taglist = m_data.tags;
if (!taglist.contains(cleanTag)) {
taglist.append(cleanTag);
taglist.sort();
set(m_data.tags, taglist);
}
}

void Entry::removeTag(const QString& tag)
{
auto cleanTag = tag.trimmed();
cleanTag.remove(QRegExp("(\\,|\\t|\\;)"));

auto taglist = m_data.tags;
if (taglist.removeAll(tag) > 0) {
set(m_data.tags, taglist);
}
}

void Entry::setTimeInfo(const TimeInfo& timeInfo)
Expand Down
Loading

0 comments on commit 03e18c2

Please sign in to comment.