Skip to content

Commit

Permalink
Merge branch 'release/2.6.2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Oct 15, 2020
2 parents fd3cc7e + b10a55a commit 0c5dd15
Show file tree
Hide file tree
Showing 43 changed files with 291 additions and 469 deletions.
4 changes: 3 additions & 1 deletion COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ Files: share/icons/badges/2_Expired.svg
Copyright: 2020 KeePassXC Team <team@keepassxc.org>
License: MIT

Files: share/icons/application/scalable/actions/document-close.svg
Files: share/icons/application/scalable/actions/chevron-double-down.svg
share/icons/application/scalable/actions/chevron-double-right.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
share/icons/application/scalable/actions/document-import.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.
2 changes: 2 additions & 0 deletions share/icons/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<file>application/scalable/actions/application-exit.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/clipboard-text.svg</file>
<file>application/scalable/actions/configure.svg</file>
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ set(keepassx_SOURCES
gui/IconModels.cpp
gui/KeePass1OpenWidget.cpp
gui/KMessageWidget.cpp
gui/LineEdit.cpp
gui/MainWindow.cpp
gui/MessageBox.cpp
gui/MessageWidget.cpp
Expand Down
1 change: 1 addition & 0 deletions src/core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::GUI_MinimizeOnStartup, {QS("GUI/MinimizeOnStartup"), Roaming, false}},
{Config::GUI_MinimizeOnClose, {QS("GUI/MinimizeOnClose"), Roaming, false}},
{Config::GUI_HideUsernames, {QS("GUI/HideUsernames"), Roaming, false}},
{Config::GUI_HidePasswords, {QS("GUI/HidePasswords"), Roaming, true}},
{Config::GUI_AdvancedSettings, {QS("GUI/AdvancedSettings"), Roaming, false}},
{Config::GUI_MonospaceNotes, {QS("GUI/MonospaceNotes"), Roaming, false}},
{Config::GUI_ApplicationTheme, {QS("GUI/ApplicationTheme"), Roaming, QS("auto")}},
Expand Down
1 change: 1 addition & 0 deletions src/core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Config : public QObject
GUI_MinimizeOnStartup,
GUI_MinimizeOnClose,
GUI_HideUsernames,
GUI_HidePasswords,
GUI_AdvancedSettings,
GUI_MonospaceNotes,
GUI_ApplicationTheme,
Expand Down
2 changes: 2 additions & 0 deletions src/core/Entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const int Entry::ResolveMaximumDepth = 10;
const QString Entry::AutoTypeSequenceUsername = "{USERNAME}{ENTER}";
const QString Entry::AutoTypeSequencePassword = "{PASSWORD}{ENTER}";

Entry::CloneFlags Entry::DefaultCloneFlags = Entry::CloneNewUuid | Entry::CloneResetTimeInfo;

Entry::Entry()
: m_attributes(new EntryAttributes(this))
, m_attachments(new EntryAttachments(this))
Expand Down
13 changes: 7 additions & 6 deletions src/core/Entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ class Entry : public QObject
CustomData* customData();
const CustomData* customData() const;

static const int DefaultIconNumber;
static const int ResolveMaximumDepth;
static const QString AutoTypeSequenceUsername;
static const QString AutoTypeSequencePassword;

void setUuid(const QUuid& uuid);
void setIcon(int iconNumber);
void setIcon(const QUuid& uuid);
Expand Down Expand Up @@ -210,13 +205,19 @@ class Entry : public QObject
DbDir
};

static const int DefaultIconNumber;
static const int ResolveMaximumDepth;
static const QString AutoTypeSequenceUsername;
static const QString AutoTypeSequencePassword;
static CloneFlags DefaultCloneFlags;

/**
* Creates a duplicate of this entry except that the returned entry isn't
* part of any group.
* Note that you need to copy the custom icons manually when inserting the
* new entry into another database.
*/
Entry* clone(CloneFlags flags) const;
Entry* clone(CloneFlags flags = DefaultCloneFlags) const;
void copyDataFrom(const Entry* other);
QString maskPasswordPlaceholders(const QString& str) const;
Entry* resolveReference(const QString& str) const;
Expand Down
4 changes: 1 addition & 3 deletions src/core/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ const int Group::RecycleBinIconNumber = 43;
const QString Group::RootAutoTypeSequence = "{USERNAME}{TAB}{PASSWORD}{ENTER}";

Group::CloneFlags Group::DefaultCloneFlags =
static_cast<Group::CloneFlags>(Group::CloneNewUuid | Group::CloneResetTimeInfo | Group::CloneIncludeEntries);
Entry::CloneFlags Group::DefaultEntryCloneFlags =
static_cast<Entry::CloneFlags>(Entry::CloneNewUuid | Entry::CloneResetTimeInfo);
Group::CloneNewUuid | Group::CloneResetTimeInfo | Group::CloneIncludeEntries;

Group::Group()
: m_customData(new CustomData(this))
Expand Down
3 changes: 1 addition & 2 deletions src/core/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class Group : public QObject
static const int DefaultIconNumber;
static const int RecycleBinIconNumber;
static CloneFlags DefaultCloneFlags;
static Entry::CloneFlags DefaultEntryCloneFlags;
static const QString RootAutoTypeSequence;

Group* findChildByName(const QString& name);
Expand Down Expand Up @@ -158,7 +157,7 @@ class Group : public QObject
QSet<QUuid> customIconsRecursive() const;
QList<QString> usernamesRecursive(int topN = -1) const;

Group* clone(Entry::CloneFlags entryFlags = DefaultEntryCloneFlags,
Group* clone(Entry::CloneFlags entryFlags = Entry::DefaultCloneFlags,
CloneFlags groupFlags = DefaultCloneFlags) const;

void copyDataFrom(const Group* other);
Expand Down
13 changes: 0 additions & 13 deletions src/gui/DatabaseOpenWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
m_ui->keyFileLabelHelp->setIcon(icons()->icon("system-help").pixmap(QSize(12, 12)));
connect(m_ui->keyFileLabelHelp, SIGNAL(clicked(bool)), SLOT(openKeyFileHelp()));

connect(m_ui->keyFileLineEdit, SIGNAL(textChanged(QString)), SLOT(keyFileTextChanged()));
m_ui->keyFileLineEdit->addAction(m_ui->keyFileClearIcon, QLineEdit::TrailingPosition);
m_ui->keyFileClearIcon->setIcon(icons()->icon("edit-clear-locationbar-rtl"));
m_ui->keyFileClearIcon->setVisible(false);
connect(m_ui->keyFileClearIcon, SIGNAL(triggered(bool)), SLOT(clearKeyFileText()));

#ifdef WITH_XC_YUBIKEY
m_ui->hardwareKeyProgress->setVisible(false);
QSizePolicy sp = m_ui->hardwareKeyProgress->sizePolicy();
Expand Down Expand Up @@ -145,8 +139,6 @@ void DatabaseOpenWidget::load(const QString& filename)
m_filename = filename;
m_ui->fileNameLabel->setRawText(m_filename);

m_ui->keyFileClearIcon->setVisible(false);

if (config()->get(Config::RememberLastKeyFiles).toBool()) {
auto lastKeyFiles = config()->get(Config::LastKeyFiles).toHash();
if (lastKeyFiles.contains(m_filename)) {
Expand Down Expand Up @@ -388,11 +380,6 @@ void DatabaseOpenWidget::clearKeyFileText()
m_ui->keyFileLineEdit->clear();
}

void DatabaseOpenWidget::keyFileTextChanged()
{
m_ui->keyFileClearIcon->setVisible(!m_ui->keyFileLineEdit->text().isEmpty());
}

void DatabaseOpenWidget::pollHardwareKey()
{
if (m_pollingHardwareKey) {
Expand Down
1 change: 0 additions & 1 deletion src/gui/DatabaseOpenWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ protected slots:
private slots:
void browseKeyFile();
void clearKeyFileText();
void keyFileTextChanged();
void pollHardwareKey();
void hardwareKeyResponse(bool found);
void openHardwareKeyHelp();
Expand Down
22 changes: 9 additions & 13 deletions src/gui/DatabaseOpenWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@
<property name="accessibleName">
<string>Key file to unlock the database</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -575,16 +578,14 @@
</spacer>
</item>
</layout>
<action name="keyFileClearIcon">
<property name="text">
<string>Clear</string>
</property>
<property name="toolTip">
<string>Clear Key File</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>PasswordEdit</class>
<extends>QLineEdit</extends>
<header>gui/PasswordEdit.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MessageWidget</class>
<extends>QWidget</extends>
Expand All @@ -596,11 +597,6 @@
<extends>QLabel</extends>
<header>gui/widgets/ElidedLabel.h</header>
</customwidget>
<customwidget>
<class>PasswordEdit</class>
<extends>QLineEdit</extends>
<header>gui/PasswordEdit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>editPassword</tabstop>
Expand Down
35 changes: 2 additions & 33 deletions src/gui/DatabaseWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,38 +329,6 @@ void DatabaseWidget::setPreviewSplitterSizes(const QList<int>& sizes)
m_previewSplitter->setSizes(sizes);
}

/**
* Get current state of entry view 'Hide Usernames' setting
*/
bool DatabaseWidget::isUsernamesHidden() const
{
return m_entryView->isUsernamesHidden();
}

/**
* Set state of entry view 'Hide Usernames' setting
*/
void DatabaseWidget::setUsernamesHidden(bool hide)
{
m_entryView->setUsernamesHidden(hide);
}

/**
* Get current state of entry view 'Hide Passwords' setting
*/
bool DatabaseWidget::isPasswordsHidden() const
{
return m_entryView->isPasswordsHidden();
}

/**
* Set state of entry view 'Hide Passwords' setting
*/
void DatabaseWidget::setPasswordsHidden(bool hide)
{
m_entryView->setPasswordsHidden(hide);
}

/**
* Get current view state of entry view
*/
Expand Down Expand Up @@ -890,7 +858,8 @@ void DatabaseWidget::openUrlForEntry(Entry* entry)

// otherwise ask user
if (!launch && cmdString.length() > 6) {
QString cmdTruncated = cmdString.mid(6);
QString cmdTruncated = entry->resolveMultiplePlaceholders(entry->maskPasswordPlaceholders(entry->url()));
cmdTruncated = cmdTruncated.mid(6);
if (cmdTruncated.length() > 400) {
cmdTruncated = cmdTruncated.left(400) + " […]";
}
Expand Down
4 changes: 0 additions & 4 deletions src/gui/DatabaseWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ class DatabaseWidget : public QStackedWidget

QStringList customEntryAttributes() const;
bool isEditWidgetModified() const;
bool isUsernamesHidden() const;
void setUsernamesHidden(bool hide);
bool isPasswordsHidden() const;
void setPasswordsHidden(bool hide);
void clearAllWidgets();
bool currentEntryHasTitle();
bool currentEntryHasUsername();
Expand Down
12 changes: 0 additions & 12 deletions src/gui/DatabaseWidgetStateSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ DatabaseWidgetStateSync::DatabaseWidgetStateSync(QObject* parent)
{
m_mainSplitterSizes = variantToIntList(config()->get(Config::GUI_SplitterState));
m_previewSplitterSizes = variantToIntList(config()->get(Config::GUI_PreviewSplitterState));
m_hideUsernames = config()->get(Config::GUI_HideUsernames).toBool();
m_hidePasswords = true;
m_listViewState = config()->get(Config::GUI_ListViewState).toByteArray();
m_searchViewState = config()->get(Config::GUI_SearchViewState).toByteArray();

Expand All @@ -48,7 +46,6 @@ void DatabaseWidgetStateSync::sync()
{
config()->set(Config::GUI_SplitterState, intListToVariant(m_mainSplitterSizes));
config()->set(Config::GUI_PreviewSplitterState, intListToVariant(m_previewSplitterSizes));
config()->set(Config::GUI_HideUsernames, m_hideUsernames);
config()->set(Config::GUI_ListViewState, m_listViewState);
config()->set(Config::GUI_SearchViewState, m_searchViewState);
config()->sync();
Expand Down Expand Up @@ -104,9 +101,6 @@ void DatabaseWidgetStateSync::setActive(DatabaseWidget* dbWidget)
*/
void DatabaseWidgetStateSync::restoreListView()
{
m_activeDbWidget->setUsernamesHidden(m_hideUsernames);
m_activeDbWidget->setPasswordsHidden(m_hidePasswords);

if (!m_listViewState.isEmpty()) {
m_activeDbWidget->setEntryViewState(m_listViewState);
}
Expand All @@ -129,9 +123,6 @@ void DatabaseWidgetStateSync::restoreListView()
*/
void DatabaseWidgetStateSync::restoreSearchView()
{
m_activeDbWidget->setUsernamesHidden(m_hideUsernames);
m_activeDbWidget->setPasswordsHidden(m_hidePasswords);

if (!m_searchViewState.isEmpty()) {
m_activeDbWidget->setEntryViewState(m_searchViewState);
} else {
Expand Down Expand Up @@ -169,9 +160,6 @@ void DatabaseWidgetStateSync::updateViewState()
return;
}

m_hideUsernames = m_activeDbWidget->isUsernamesHidden();
m_hidePasswords = m_activeDbWidget->isPasswordsHidden();

if (m_activeDbWidget->isSearchActive()) {
m_searchViewState = m_activeDbWidget->entryViewState();
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/gui/DatabaseWidgetStateSync.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ private slots:
QList<int> m_mainSplitterSizes;
QList<int> m_previewSplitterSizes;

bool m_hideUsernames;
bool m_hidePasswords;

QByteArray m_listViewState;
QByteArray m_searchViewState;
};
Expand Down
70 changes: 0 additions & 70 deletions src/gui/LineEdit.cpp

This file was deleted.

Loading

0 comments on commit 0c5dd15

Please sign in to comment.