Resolves#1313
What this commit does:
* Whenever the Apply button is pressed, and if the save was successful, then the Apply button is disabled.
* Each subwidget used by EditEntryWidget has now a signal called `widgetUpdated` that is emitted when the widgets' internal content changes. The EditEntryWidget subscribes to that signal to know when to enable the Apply button (by calling `entryUpdated()`).
* There are some views that are not isolated in their own widgets (`m_advancedUi`, for example) so in those cases I invoked `entryUpdated()` directly whenever I detected an update:
* some updates occur directly in a Qt widget like when editing the text of a QLineItem, so in that case I connected the widget's signals directly to the `entryUpdated()` slot.
* some updates occur in EditEntryWidget, so in those cases the invocation to `entryUpdated()` is made as soon as the change is detected (for example when the user has confirmed an action in a dialog).
A known problem: there are some situations when the Apply button will get enabled even if there are no changes, this is because the app changes the value of a field by itself so it's considered an update (for example, clicking on the "Reveal" button changes the text shown in a text field).
The solution to this can be a bit complicated: disabling temporarily the `entryUpdated()` whenever the app is going to do an action with such side-effects.
So I preferred to let the Apply button get enabled in those cases.
Fix/work around KeePassXC flickering and not restoring from tray on some Linux systems, which happens if the window is hidden and minimized by code at the same time (see issue #1595).
The 'text' property of the QAction gets mangled by KDE when it adds its
own accelerator shortcuts. But the data property is ours. Use that for
keying instead.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Similar to KeePass2 most elements are checked for a
Protected="True"
attribute. Previously, files KDBX 3.1 files with protected Binary
entries, as seen in the wild, could not be read (mangled passwords and
file attachments).
When a field value is of the form ...{REF:...}...
Then:
* Auto-type does not work with that field
* References to this field are not properly resolved
This commit fixes both issues.
Building with -flto caught the fact that we were ignoring the return
value of readMagicNumbers(), which potentially left the value of 'sig2'
uninitialized.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Databases are re-opened by traversing LastOpenedDatabases from front to
back, i.e. the last element in the list will be the active tab. However,
the most-recently used database is currently stored at the beginning of
the list. This leads to the least-recently used database to be the
ative tab on next startup.
Previously, this has been fixed in 4c76c97 by opening the databases in
reversed order. This change was accidentally reverted in 165d664.
Instead, change the order of LastOpenedDatabases itself, so no reversal
on opening the databases is necessary.
Resolves#1572