Merge branch 'develop' into 8020-age

This commit is contained in:
mattesony 2023-01-30 14:20:09 -08:00
commit 1153b10bb0
162 changed files with 644 additions and 970 deletions

View File

@ -897,7 +897,7 @@
- Compare window title to entry URLs #556
- Implemented inline error messages #162
- Ignore group expansion and other minor changes when making database "dirty" #464
- Updated license and copyright information on souce files #632
- Updated license and copyright information on source files #632
- Added contributors list to about dialog #629
## 2.1.4 (2017-04-09)

View File

@ -1,4 +1,5 @@
# <img src="https://keepassxc.org/images/keepassxc-logo.svg" width="40" height="40"/> KeePassXC
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6326/badge)](https://bestpractices.coreinfrastructure.org/projects/6326)
[![TeamCity Build Status](https://ci.keepassxc.org/app/rest/builds/buildType:\(project:KeepassXC\)/statusIcon)](https://ci.keepassxc.org/?guest=1)
[![codecov](https://codecov.io/gh/keepassxreboot/keepassxc/branch/develop/graph/badge.svg)](https://codecov.io/gh/keepassxreboot/keepassxc)
[![GitHub release](https://img.shields.io/github/release/keepassxreboot/keepassxc)](https://github.com/keepassxreboot/keepassxc/releases/)

View File

@ -1,5 +1,5 @@
# Running macdeployqt on a POST_BUILD copied binaries is pointless when using CPack because
# the copied binaries will be overriden by the corresponding install(TARGETS) commands.
# the copied binaries will be overridden by the corresponding install(TARGETS) commands.
# That's why we run macdeployqt using install(CODE) on the already installed binaries.
# The precondition is that all install(TARGETS) calls have to be called before this function is
# called.

View File

@ -1,4 +1,4 @@
= KeePassXC - Auto-Type
= KeePassXC Auto-Type
:imagesdir: ../images
// tag::content[]

View File

@ -1,4 +1,4 @@
= KeePassXC - Browser Plugin
= KeePassXC Browser Plugin
include::.sharedheader[]
:imagesdir: ../images

View File

@ -1,4 +1,4 @@
= KeePassXC - Database Operations
= KeePassXC Database Operations
include::.sharedheader[]
:imagesdir: ../images
@ -11,22 +11,22 @@ To create a database, perform the following steps:
1. Open your KeePassXC application. Click the create new database button *(A)*:
+
.Create database - Welcome screen
.Create database Welcome screen
image::welcome_screen.png[]
2. The database creation wizard appears. Enter the desired database name and a short description (optional):
+
.Create database - General information
.Create database General information
image::new_db_wizard_1.png[,80%]
3. Click Continue. The Encryption Settings screen appears, we don't recommend making any changes besides increasing or decreasing the decryption time using the slider. Setting the Decryption Time slider at higher values means that the database will have higher level of protection but the time taken by the database to open will increase.
+
.Create database - Encryption settings
.Create database Encryption settings
image::new_db_wizard_2.png[,80%]
4. Click the Continue button. The Database Credentials screen appears, enter your desired database password. We recommend using a long, randomized password.
+
.Create database - Database credentials
.Create database Database credentials
image::new_db_wizard_3.png[,80%]
+
*(A)* Open the password generator +
@ -362,7 +362,7 @@ The following key derivation functions are supported:
* AES-KDF (KDBX 4 and KDBX 3.1): This key derivation function is based on iterating AES. Users can change the number of iterations. The more iterations, the harder are dictionary and guessing attacks, but also database loading/saving takes more time (linearly). KDBX 3.1 only supports AES-KDF; any other key derivation function, like for instance Argon2, requires KDBX 4.
* Argon2 (KDBX 4 - recommended): KDBX 4, the Argon2 key derivation function can be used for transforming the composite master key (as protection against dictionary attacks). The main advantage of Argon2 over AES-KDF is that it provides a better resistance against GPU/ASIC attacks (due to being a memory-hard function). The number of iterations scales linearly with the required time. By increasing the memory parameter, GPU/ASIC attacks become harder and the required time increases. The parallelism parameter can be used to specify how many threads should be used. We recommend using Argon2id to prevent against timing-based attacks. Argon2d offers maximum compatibility with other KeePass-based apps, the default settings provide sufficient protection against any known attacks.
* Argon2 (KDBX 4 recommended): KDBX 4, the Argon2 key derivation function can be used for transforming the composite master key (as protection against dictionary attacks). The main advantage of Argon2 over AES-KDF is that it provides a better resistance against GPU/ASIC attacks (due to being a memory-hard function). The number of iterations scales linearly with the required time. By increasing the memory parameter, GPU/ASIC attacks become harder and the required time increases. The parallelism parameter can be used to specify how many threads should be used. We recommend using Argon2id to prevent against timing-based attacks. Argon2d offers maximum compatibility with other KeePass-based apps, the default settings provide sufficient protection against any known attacks.
== Database Maintenance
KeePassXC offers some maintenance features that can be applied to clean up your database. Navigate to _Database_ -> _Database settings_ then click on _Maintenance_ on the left hand panel. The following screen appears. On this screen you can delete multiple icons at once and purge any unused icons in your database.
@ -395,9 +395,9 @@ The database file that you create might contain highly sensitive data and must b
Make sure that you or someone else does not accidentally delete the database file. Deletion of the database file will result in the total loss of all your information (including all your passwords!) and a lot of inconvenience to manually retrieve your logins for various web applications. Do not share the credentials to access your database file with anyone unless you absolutely trust them (spouse, child, etc.).
TIP: You can safely store your database file in the cloud (e.g., OneDrive, Dropbox, Google Drive, Nextcloud, Syncthing, etc). The database file is always fully encrypted; unencrypted data is never written to disk and is never accessible to your cloud storage provider. We recommend using a storage service that keeps automatic backups (version history) of your database file in the event of corruption or accidental deletion.
TIP: You can safely store your database file in the cloud (OneDrive, Dropbox, Google Drive, Nextcloud, Syncthing, etc.). The database file is always fully encrypted; unencrypted data is never written to disk and is never accessible to your cloud storage provider. We recommend using a storage service that keeps automatic backups (version history) of your database file in the event of corruption or accidental deletion.
== Backing up a Database File
== Backing up a Database File
It is a good practice to create copies of your database file and store the copies of your database on a different computer, smart phone, or cloud storage space such a Google Drive or Microsoft OneDrive. Backups can be created automatically by selecting the _Backup database file before saving_ option in the application settings. Additionally, you can create a backup on-demand using the _Database_ -> _Save Database Backup..._ menu feature.
.Saving a database backup

View File

@ -1,4 +1,4 @@
= KeePassXC - Download and Install
= KeePassXC Download and Install
include::.sharedheader[]
:imagesdir: ../images
@ -8,9 +8,9 @@ KeePassXC is available for download for the following operating systems and plat
* Microsoft Windows
** Portable and MSI Installer (64-bit and 32-bit)
* Linux - Official Cross-Distribution Packages
* Linux Official Cross-Distribution Packages
** AppImage and Snap Package
* Linux - Distribution-Specific Packages
* Linux Distribution-Specific Packages
** Ubuntu, Debian, Arch Linux, Gentoo, Fedora, CentOS, and OpenSUSE
* macOS
** DMG Installer, Homebrew Cask
@ -45,9 +45,9 @@ image::install_wizard_2.png[,80%]
The following options can be set when running the MSI in an unattended installation:
* *LAUNCHAPPONEXIT* - Launch KeePassXC after install (default ON)
* *AUTOSTARTPROGRAM* - KeePassXC will auto-start on login (default ON)
* *INSTALLDESKTOPSHORTCUT* - A desktop icon will be installed (default OFF)
* *LAUNCHAPPONEXIT* Launch KeePassXC after install (default ON)
* *AUTOSTARTPROGRAM* KeePassXC will auto-start on login (default ON)
* *INSTALLDESKTOPSHORTCUT* A desktop icon will be installed (default OFF)
Example: `msiexec.exe /q /i KeePassXC-Y.Y.Y-WinZZ.msi AUTOSTARTPROGRAM=0`
@ -69,4 +69,4 @@ image::macos_install.png[,80%]
// end::content[]
// tag::advanced[]
// end::advanced[]
// end::advanced[]

View File

@ -1,4 +1,4 @@
= KeePassXC - Import/Export Operations
= KeePassXC Import/Export Operations
include::.sharedheader[]
:imagesdir: ../images

View File

@ -1,4 +1,4 @@
= KeePassXC - KeeShare
= KeePassXC KeeShare
include::.sharedheader[]
:imagesdir: ../images
@ -24,10 +24,10 @@ NOTE: KeeShare does not synchronize group structure after the initial share is c
1. Open the edit sheet on a group you want to share.
2. Select the KeeShare category on the left toolbar.
3. Choose a sharing type:
a. *Inactive* - Disable sharing this group
b. *Import* - Read-only import of entries, merge changes
c. *Export* - Write-only export of entries, no merge
d. *Synchronize* - Read/Write entries from the share, merge changes
a. *Inactive* Disable sharing this group
b. *Import* Read-only import of entries, merge changes
c. *Export* Write-only export of entries, no merge
d. *Synchronize* Read/Write entries from the share, merge changes
4. Choose a path to store the shared credentials to.
5. The password to use for this share container.

View File

@ -1,4 +1,4 @@
= KeePassXC - Keyboard Shortcuts
= KeePassXC Keyboard Shortcuts
include::.sharedheader[]
:imagesdir: ../images
@ -9,12 +9,15 @@ NOTE: On macOS please substitute `Ctrl` with `Cmd` (aka `⌘`).
|===
|Action | Keyboard Shortcut
|Settings | Ctrl + ,
|Open Database | Ctrl + O
|Save Database | Ctrl + S
|Save Database As | Ctrl + Shift + S
|New Database | Ctrl + Shift + N
|Close Database | Ctrl + W ; Ctrl + F4
|Lock All Databases | Ctrl + L
|Database Settings | Ctrl + Shift + ,
|Database Reports | Ctrl + Shift + R
|Quit | Ctrl + Q
|New Entry | Ctrl + N
|Edit Entry | Enter ; Ctrl + E

View File

@ -1,4 +1,4 @@
= KeePassXC - Password Generator
= KeePassXC Password Generator
include::.sharedheader[]
:imagesdir: ../images

View File

@ -1,4 +1,4 @@
= KeePassXC - Reference
= KeePassXC Reference
include::.sharedheader[]
:imagesdir: ../images
@ -53,13 +53,13 @@ A reference to another entry's field is possible using the shorthand syntax:
`&lt;FIELD&gt;` and `&lt;SEARCH_IN&gt;` can be one of following:
* T - Title
* U - Username
* P - Password
* A - URL
* N - Notes
* I - UUID (found on entry properties page)
* O - Custom Attribute _(SEARCH_IN only)_
* T Title
* U Username
* P Password
* A URL
* N Notes
* I UUID (found on entry properties page)
* O Custom Attribute _(SEARCH_IN only)_
Examples: +
`{REF:U@I:033054D445C648C59092CC1D661B1B71}` +

View File

@ -1,4 +1,4 @@
= KeePassXC - SSH Agent integration
= KeePassXC SSH Agent integration
include::.sharedheader[]
:imagesdir: ../images

View File

@ -1,22 +1,22 @@
= KeePassXC - Database Operations
= KeePassXC Database Operations
include::.sharedheader[]
:imagesdir: ../images
// tag::content[]
== Interface Overview
=== Application Layout
The KeePassXC interface is designed for simplicity and easy access to your information. The main database view is split into three main partitions detailed below. You can open multiple databases at the same time, they will appear in tabs.
The KeePassXC interface is designed for simplicity and easy access to your information. The main database view is split into four main partitions detailed below. You can open multiple databases at the same time, they will appear in tabs.
.Main database interface
image::main_interface.png[]
*(A) Groups* - Organize your entries into discrete groups to bring order to all of your sensitive information. Groups can be nested under each other to create a hierarchy. Settings from parent groups get applied to their children. You can hide this panel on the View menu.
*(A) Groups* Organize your entries into discrete groups to bring order to all of your sensitive information. Groups can be nested under each other to create a hierarchy. Settings from parent groups get applied to their children. You can hide this panel on the View menu.
*(B) Tags* - Dynamic groups of entries that can be quickly displayed with one click. Any number of custom tags can be added when editing an entry. This panel also includes useful pre-defined searches, such as finding expired and weak passwords.
*(B) Tags* Dynamic groups of entries that can be quickly displayed with one click. Any number of custom tags can be added when editing an entry. This panel also includes useful pre-defined searches, such as finding expired and weak passwords.
*\(C) Entries* - Entries contain all the information you want to store for a website or application you are storing in KeePassXC. This view shows all the entries in the selected group. Each column can be resized, reordered, and shown or hidden based on your preference. Right-click the header row to see all available options.
*\(C) Entries* Entries contain all the information you want to store for a website or application you are storing in KeePassXC. This view shows all the entries in the selected group. Each column can be resized, reordered, and shown or hidden based on your preference. Right-click the header row to see all available options.
*(D) Preview* - Shows a preview of the selected group or entry. You can temporarily hide this preview using the close button on the right hand side or completely disabled in the application settings.
*(D) Preview* Shows a preview of the selected group or entry. You can temporarily hide this preview using the close button on the right hand side or completely disabled in the application settings.
TIP: You can enable double-click copying of entry username and password in the Application Security Settings. This is turned off by default starting with version 2.7.0.
@ -26,10 +26,10 @@ The toolbar provides a quick way to perform common tasks with your database. Som
.Toolbar overview
image::toolbar.png[]
*(A) Database* - Open Database, Save Database, Lock Database +
*(B) Entries* - Create Entry, Edit Entry, Delete Selected Entries +
*\(C) Entry Data* - Copy Username, Copy Password, Copy URL, Perform Auto-Type +
*(D) Tools* - Password Generator, Application Settings +
*(A) Database* Open Database, Save Database, Lock Database +
*(B) Entries* Create Entry, Edit Entry, Delete Selected Entries +
*\(C) Entry Data* Copy Username, Copy Password, Copy URL, Perform Auto-Type +
*(D) Tools* Password Generator, Application Settings +
*(E) Search*
=== Application Settings
@ -59,7 +59,7 @@ You can use the following command line options to tailor the application to your
----
Usage: keepassxc.exe [options] [filename(s)]
KeePassXC - cross-platform password manager
KeePassXC cross-platform password manager
Options:
-?, -h, --help Displays help on commandline options.

View File

@ -1,4 +1,4 @@
= KeePassXC - Welcome
= KeePassXC Welcome
include::.sharedheader[]
:imagesdir: ../images
@ -9,7 +9,7 @@ KeePassXC is a modern, secure, and open-source password manager that stores and
KeePassXC is for people with extremely high demands of secure personal data management. It saves many different types of information, such as usernames, passwords, URLs, attachments, and notes in an offline, encrypted file that can be stored in any location, including private and public cloud solutions. For easy identification and management, user-defined titles and icons can be specified for entries. In addition, entries are sorted in customizable groups. An integrated search function allows you to use advanced patterns to easily find any entry in your database. A customizable, fast, and easy-to-use password generator utility allows you to create passwords with any combination of characters or easy to remember passphrases.
=== Overview
You can store an unlimited number of passwords and information in a KeePassXC database. Every piece of information you store in your database is encrypted at all times within the `kdbx` file. When you are accessing your database from within KeePassXC, your information in decrypted and stored in your computer's memory. KeePassXC places controls over the access to this data so other applications cannot read it (unless they have administrative rights). The interface is designed to let you quickly access your passwords, search for the right entry, perform Auto-Type or copy/paste operations, make and save changes, and then get out of your way.
You can store an unlimited number of passwords and information in a KeePassXC database. Every piece of information you store in your database is encrypted at all times within the `kdbx` file. When you are accessing your database from within KeePassXC, your information is decrypted and stored in your computer's memory. KeePassXC places controls over the access to this data so other applications cannot read it (unless they have administrative rights). The interface is designed to let you quickly access your passwords, search for the right entry, perform Auto-Type or copy/paste operations, make and save changes, and then get out of your way.
KeePassXC ships with light and dark themes specifically designed to meet accessibility standards. In most cases, the appropriate theme for your system will be determined automatically, but you can always set a specific theme in the application settings.
@ -45,4 +45,4 @@ KeePassXC has numerous features for novice and power users alike. This guide wil
** Additional encryption choices: Twofish and ChaCha20
// end::content[]
// tag::advanced[]
// end::advanced[]
// end::advanced[]

View File

@ -1411,8 +1411,8 @@ i18n() {
if ! command -v $LUPDATE > /dev/null; then
LUPDATE=lupdate
fi
$LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -no-obsolete src \
-ts share/translations/keepassxc_en.ts $@
$LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -extensions c,cpp,h,js,mm,qrc,ui \
-no-obsolete src -ts share/translations/keepassxc_en.ts $@
return 0
fi

View File

@ -284,7 +284,7 @@ if ($Merge) {
# Update translation files
Write-Host "Updating source translation file..."
Invoke-Cmd "lupdate" "-no-ui-lines -disable-heuristic similartext -locations none", `
"-no-obsolete ./src -ts share/translations/keepassxc_en.ts"
"-extensions c,cpp,h,js,mm,qrc,ui -no-obsolete ./src -ts share/translations/keepassxc_en.ts"
Write-Host "Pulling updated translations from Transifex..."
Invoke-Cmd "tx" "pull -af --minimum-perc=60 --parallel -r keepassxc.share-translations-keepassxc-en-ts--develop"

View File

@ -941,7 +941,7 @@
<li>Compare window title to entry URLs [#556]</li>
<li>Implemented inline error messages [#162]</li>
<li>Ignore group expansion and other minor changes when making database "dirty" [#464]</li>
<li>Updated license and copyright information on souce files [#632]</li>
<li>Updated license and copyright information on source files [#632]</li>
<li>Added contributors list to about dialog [#629]</li>
</ul>
</description>

View File

@ -42,6 +42,8 @@ StartupWMClass=keepassxc
StartupNotify=true
Terminal=false
Type=Application
Version=1.0
Version=1.5
Categories=Utility;Security;Qt;
MimeType=application/x-keepass2;
SingleMainWindow=true
X-GNOME-SingleWindow=true

View File

@ -892,52 +892,6 @@ Do you want to delete the entry?
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Converting attributes to custom data</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Abort</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Converted KeePassHTTP attributes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Successfully converted attributes from %1 entry(s).
Moved %2 keys to custom data.</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<source>Successfully moved %n keys to custom data.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>KeePassXC: No entry with KeePassHTTP attributes found!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The active database does not contain an entry with KeePassHTTP attributes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Don&apos;t show this warning again</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Legacy browser integration settings detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Your KeePassXC-Browser settings need to be moved into the database settings.
This is necessary to maintain your current browser connections.
Would you like to migrate your existing settings now?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BrowserSettingsWidget</name>
@ -1597,6 +1551,10 @@ If you do not have a key file, please leave the field empty.</source>
&lt;p&gt;Click for more information&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>authenticate to access the database</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DatabaseSettingWidgetMetaData</name>
@ -1642,14 +1600,6 @@ If you do not have a key file, please leave the field empty.</source>
<source>KeePassXC-Browser settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Convert KeePassHTTP data</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Convert legacy KeePassHTTP attributes to KeePassXC-Browser compatible custom data</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Refresh database root group ID</source>
<translation type="unfinished"></translation>
@ -1759,15 +1709,6 @@ Permissions to access entries will be revoked.</source>
<source>The active database does not contain an entry with permissions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Move KeePassHTTP attributes to custom data</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want to convert all legacy browser integration data to the latest standard?
This is necessary to maintain compatibility with the browser plugin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Refresh database ID</source>
<translation type="unfinished"></translation>
@ -3084,10 +3025,6 @@ Would you like to correct it?</source>
</context>
<context>
<name>EditGroupWidgetBrowser</name>
<message>
<source>Edit Group</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>These settings affect to the group&apos;s behaviour with the browser extension.</source>
<translation type="unfinished"></translation>
@ -5200,10 +5137,6 @@ Are you sure you want to continue with this file?</source>
<source>Copy title to clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;URL</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy URL to clipboard</source>
<translation type="unfinished"></translation>
@ -5458,6 +5391,10 @@ We recommend you use the AppImage available on our downloads page.</source>
<source>XML File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy &amp;URL</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ManageDatabase</name>
@ -5827,6 +5764,10 @@ We recommend you use the AppImage available on our downloads page.</source>
<source>Unexpected EOF when writing private key</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AES-256/GCM is currently not supported</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PasswordEditWidget</name>
@ -7924,6 +7865,10 @@ Kernel: %3 %4</source>
This options is deprecated, use --set-key-file instead.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC is not running. No open database to lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password is %1 old</source>
<translation type="unfinished"></translation>

View File

@ -532,5 +532,5 @@ if(WIN32)
endif()
# The install commands in this subdirectory will be executed after all the install commands in the
# current scope are ran. It is required for correct functtioning of macdeployqt.
# current scope are ran. It is required for correct functioning of macdeployqt.
add_subdirectory(post_install)

View File

@ -225,7 +225,7 @@ void AutoType::createTestInstance()
QStringList AutoType::windowTitles()
{
if (!m_plugin) {
return QStringList();
return {};
}
return m_plugin->windowTitles();
@ -356,7 +356,7 @@ void AutoType::executeAutoTypeActions(const Entry* entry,
/**
* Single Autotype entry-point function
* Look up the Auto-Type sequence for the given entry then perfom Auto-Type in the active window
* Look up the Auto-Type sequence for the given entry then perform Auto-Type in the active window
*/
void AutoType::performAutoType(const Entry* entry)
{
@ -372,7 +372,7 @@ void AutoType::performAutoType(const Entry* entry)
/**
* Extra Autotype entry-point function
* Perfom Auto-Type of the directly specified sequence in the active window
* Perform Auto-Type of the directly specified sequence in the active window
*/
void AutoType::performAutoTypeWithSequence(const Entry* entry, const QString& sequence)
{

View File

@ -38,17 +38,17 @@ public:
static Result Ok()
{
return Result(true, false, QString());
return {true, false, QString()};
}
static Result Retry(const QString& error)
{
return Result(false, true, error);
return {false, true, error};
}
static Result Failed(const QString& error)
{
return Result(false, false, error);
return {false, false, error};
}
bool isOk() const

View File

@ -25,9 +25,7 @@
class AutoTypePlatformInterface
{
public:
virtual ~AutoTypePlatformInterface()
{
}
virtual ~AutoTypePlatformInterface() = default;
virtual bool isAvailable() = 0;
virtual QStringList windowTitles() = 0;
virtual WId activeWindow() = 0;

View File

@ -92,9 +92,7 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
}
// Required for QScopedPointer
AutoTypeSelectDialog::~AutoTypeSelectDialog()
{
}
AutoTypeSelectDialog::~AutoTypeSelectDialog() = default;
void AutoTypeSelectDialog::setMatches(const QList<AutoTypeMatch>& matches,
const QList<QSharedPointer<Database>>& dbs,
@ -326,7 +324,7 @@ void AutoTypeSelectDialog::buildActionMenu()
submitAutoTypeMatch(match);
});
#ifdef Q_OS_WIN
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
auto typeVirtualAction = new QAction(icons()->icon("auto-type"), tr("Use Virtual Keyboard"));
m_actionMenu->insertAction(copyUsernameAction, typeVirtualAction);
typeVirtualAction->setShortcut(Qt::CTRL + Qt::Key_4);
@ -342,7 +340,7 @@ void AutoTypeSelectDialog::buildActionMenu()
typeUsernameAction->setShortcutVisibleInContextMenu(true);
typePasswordAction->setShortcutVisibleInContextMenu(true);
typeTotpAction->setShortcutVisibleInContextMenu(true);
#ifdef Q_OS_WIN
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
typeVirtualAction->setShortcutVisibleInContextMenu(true);
#endif
#endif

View File

@ -250,6 +250,10 @@ AutoTypeAction::Result AutoTypeExecutorMac::execType(const AutoTypeKey* action)
int ch = action->character.toUpper().toLatin1();
m_platform->sendKey(static_cast<Qt::Key>(ch), true, action->modifiers);
m_platform->sendKey(static_cast<Qt::Key>(ch), false, action->modifiers);
} else if (mode == Mode::VIRTUAL) {
int ch = action->character.toLatin1();
m_platform->sendKey(static_cast<Qt::Key>(ch), true, action->modifiers);
m_platform->sendKey(static_cast<Qt::Key>(ch), false, action->modifiers);
} else {
m_platform->sendChar(action->character, true);
m_platform->sendChar(action->character, false);

View File

@ -29,7 +29,7 @@ QString AutoTypePlatformTest::keyToString(Qt::Key key)
QStringList AutoTypePlatformTest::windowTitles()
{
return QStringList();
return {};
}
WId AutoTypePlatformTest::activeWindow()

View File

@ -23,9 +23,7 @@
class AutoTypeTestInterface
{
public:
virtual ~AutoTypeTestInterface()
{
}
virtual ~AutoTypeTestInterface() = default;
virtual void setActiveWindowTitle(const QString& title) = 0;
virtual QString actionChars() = 0;

View File

@ -184,17 +184,17 @@ QString AutoTypePlatformX11::windowTitle(Window window, bool useBlacklist)
if (useBlacklist && !title.isEmpty()) {
if (window == m_rootWindow) {
return QString();
return {};
}
QString className = windowClassName(window);
if (m_classBlacklist.contains(className)) {
return QString();
return {};
}
QList<Window> keepassxWindows = widgetsToX11Windows(QApplication::topLevelWidgets());
if (keepassxWindows.contains(window)) {
return QString();
return {};
}
}

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) 2013 Francois Ferrand
* Copyright (C) 2022 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2017 Sami Vänttinen <sami.vanttinen@protonmail.com>
* Copyright (C) 2013 Francois Ferrand
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -781,79 +782,6 @@ BrowserService::searchEntries(const QString& siteUrl, const QString& formUrl, co
return entries;
}
void BrowserService::convertAttributesToCustomData(QSharedPointer<Database> db)
{
if (!db) {
return;
}
QList<Entry*> entries = db->rootGroup()->entriesRecursive();
QProgressDialog progress(tr("Converting attributes to custom data…"), tr("Abort"), 0, entries.count());
progress.setWindowModality(Qt::WindowModal);
int counter = 0;
int keyCounter = 0;
for (auto* entry : entries) {
if (progress.wasCanceled()) {
return;
}
if (moveSettingsToCustomData(entry, KEEPASSHTTP_NAME)) {
++counter;
}
if (moveSettingsToCustomData(entry, KEEPASSXCBROWSER_OLD_NAME)) {
++counter;
}
if (moveSettingsToCustomData(entry, KEEPASSXCBROWSER_NAME)) {
++counter;
}
if (entry->title() == KEEPASSHTTP_NAME || entry->title().contains(KEEPASSXCBROWSER_NAME, Qt::CaseInsensitive)) {
keyCounter += moveKeysToCustomData(entry, db);
db->recycleEntry(entry);
}
progress.setValue(progress.value() + 1);
}
progress.reset();
if (counter > 0) {
MessageBox::information(nullptr,
tr("KeePassXC: Converted KeePassHTTP attributes"),
tr("Successfully converted attributes from %1 entry(s).\n"
"Moved %2 keys to custom data.",
"")
.arg(counter)
.arg(keyCounter),
MessageBox::Ok);
} else if (counter == 0 && keyCounter > 0) {
MessageBox::information(nullptr,
tr("KeePassXC: Converted KeePassHTTP attributes"),
tr("Successfully moved %n keys to custom data.", "", keyCounter),
MessageBox::Ok);
} else {
MessageBox::information(nullptr,
tr("KeePassXC: No entry with KeePassHTTP attributes found!"),
tr("The active database does not contain an entry with KeePassHTTP attributes."),
MessageBox::Ok);
}
// Rename password groupName
Group* rootGroup = db->rootGroup();
if (!rootGroup) {
return;
}
for (auto* g : rootGroup->groupsRecursive(true)) {
if (g->name() == KEEPASSHTTP_GROUP_NAME) {
g->setName(KEEPASSXCBROWSER_GROUP_NAME);
break;
}
}
}
void BrowserService::requestGlobalAutoType(const QString& search)
{
emit osUtils->globalShortcutTriggered("autotype", search);
@ -1264,84 +1192,6 @@ QSharedPointer<Database> BrowserService::selectedDatabase()
return getDatabase();
}
bool BrowserService::moveSettingsToCustomData(Entry* entry, const QString& name)
{
if (entry->attributes()->contains(name)) {
QString attr = entry->attributes()->value(name);
entry->beginUpdate();
if (!attr.isEmpty()) {
entry->customData()->set(KEEPASSXCBROWSER_NAME, attr);
}
entry->attributes()->remove(name);
entry->endUpdate();
return true;
}
return false;
}
int BrowserService::moveKeysToCustomData(Entry* entry, QSharedPointer<Database> db)
{
int keyCounter = 0;
for (const auto& key : entry->attributes()->keys()) {
if (key.contains(CustomData::BrowserLegacyKeyPrefix)) {
QString publicKey = key;
publicKey.remove(CustomData::BrowserLegacyKeyPrefix);
// Add key to database custom data
if (db && !db->metadata()->customData()->contains(CustomData::BrowserKeyPrefix + publicKey)) {
db->metadata()->customData()->set(CustomData::BrowserKeyPrefix + publicKey,
entry->attributes()->value(key));
++keyCounter;
}
}
}
return keyCounter;
}
bool BrowserService::checkLegacySettings(QSharedPointer<Database> db)
{
if (!db || !browserSettings()->isEnabled() || browserSettings()->noMigrationPrompt()) {
return false;
}
bool legacySettingsFound = false;
QList<Entry*> entries = db->rootGroup()->entriesRecursive();
for (const auto& e : entries) {
if (e->isRecycled()) {
continue;
}
if ((e->attributes()->contains(KEEPASSHTTP_NAME) || e->attributes()->contains(KEEPASSXCBROWSER_NAME))
|| (e->title() == KEEPASSHTTP_NAME || e->title().contains(KEEPASSXCBROWSER_NAME, Qt::CaseInsensitive))) {
legacySettingsFound = true;
break;
}
}
if (!legacySettingsFound) {
return false;
}
auto* checkbox = new QCheckBox(tr("Don't show this warning again"));
QObject::connect(checkbox, &QCheckBox::stateChanged, [&](int state) {
browserSettings()->setNoMigrationPrompt(static_cast<Qt::CheckState>(state) == Qt::CheckState::Checked);
});
auto dialogResult =
MessageBox::warning(nullptr,
tr("KeePassXC: Legacy browser integration settings detected"),
tr("Your KeePassXC-Browser settings need to be moved into the database settings.\n"
"This is necessary to maintain your current browser connections.\n"
"Would you like to migrate your existing settings now?"),
MessageBox::Yes | MessageBox::No,
MessageBox::NoButton,
MessageBox::Raise,
checkbox);
return dialogResult == MessageBox::Yes;
}
QStringList BrowserService::getEntryURLs(const Entry* entry)
{
QStringList urlList;
@ -1440,11 +1290,6 @@ void BrowserService::databaseUnlocked(DatabaseWidget* dbWidget)
QJsonObject msg;
msg["action"] = QString("database-unlocked");
m_browserHost->broadcastClientMessage(msg);
auto db = dbWidget->database();
if (checkLegacySettings(db)) {
convertAttributesToCustomData(db);
}
}
}

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) 2013 Francois Ferrand
* Copyright (C) 2022 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2017 Sami Vänttinen <sami.vanttinen@protonmail.com>
* Copyright (C) 2013 Francois Ferrand
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -88,7 +89,6 @@ public:
const StringPairList& keyList,
const bool httpAuth = false);
void requestGlobalAutoType(const QString& search);
static void convertAttributesToCustomData(QSharedPointer<Database> db);
static const QString KEEPASSXCBROWSER_NAME;
static const QString KEEPASSXCBROWSER_OLD_NAME;
@ -157,16 +157,11 @@ private:
QSharedPointer<Database> selectedDatabase();
QString getDatabaseRootUuid();
QString getDatabaseRecycleBinUuid();
bool checkLegacySettings(QSharedPointer<Database> db);
QStringList getEntryURLs(const Entry* entry);
void hideWindow() const;
void raiseWindow(const bool force = false);
void updateWindowState();
static bool moveSettingsToCustomData(Entry* entry, const QString& name);
static int moveKeysToCustomData(Entry* entry, QSharedPointer<Database> db);
QPointer<BrowserHost> m_browserHost;
QHash<QString, QSharedPointer<BrowserAction>> m_browserClients;

View File

@ -225,7 +225,7 @@ QString NativeMessageInstaller::getNativeMessagePath(SupportedBrowsers browser)
} else {
basePath = QDir::homePath() + "/.config";
}
#elif defined(Q_OS_LINUX)
#elif defined(Q_OS_LINUX) || (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
if (browser == SupportedBrowsers::TOR_BROWSER) {
basePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
} else if (browser == SupportedBrowsers::FIREFOX) {

View File

@ -29,9 +29,7 @@ AddGroup::AddGroup()
positionalArguments.append({QString("group"), QObject::tr("Path of the group to add."), QString("")});
}
AddGroup::~AddGroup()
{
}
AddGroup::~AddGroup() = default;
int AddGroup::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<QCommandLineParser> parser)
{

View File

@ -103,9 +103,7 @@ Command::Command()
options.append(Command::QuietOption);
}
Command::~Command()
{
}
Command::~Command() = default;
QString Command::getDescriptionLine()
{

View File

@ -149,7 +149,7 @@ QSharedPointer<Database> DatabaseCreate::initializeDatabaseFromOptions(const QSh
* If a key file is specified but it can't be loaded, the function will
* fail.
*
* If the database is being saved in a non existant directory, the
* If the database is being saved in a non existent directory, the
* function will fail.
*
* @return EXIT_SUCCESS on success, or EXIT_FAILURE on failure

View File

@ -93,7 +93,7 @@ QSharedPointer<PasswordGenerator> Generate::createGenerator(QSharedPointer<QComm
passwordGenerator->setLength(PasswordGenerator::DefaultLength);
} else if (passwordLength.toInt() <= 0) {
err << QObject::tr("Invalid password length %1").arg(passwordLength) << endl;
return QSharedPointer<PasswordGenerator>(nullptr);
return {};
} else {
passwordGenerator->setLength(passwordLength.toInt());
}
@ -139,7 +139,7 @@ QSharedPointer<PasswordGenerator> Generate::createGenerator(QSharedPointer<QComm
if (!passwordGenerator->isValid()) {
err << QObject::tr("Invalid password generator after applying all options") << endl;
return QSharedPointer<PasswordGenerator>(nullptr);
return {};
}
return passwordGenerator;

View File

@ -28,7 +28,7 @@
* A password can be specified to encrypt the database.
* If none is specified the function will fail.
*
* If the database is being saved in a non existant directory, the
* If the database is being saved in a non existent directory, the
* function will fail.
*
* @return EXIT_SUCCESS on success, or EXIT_FAILURE on failure

View File

@ -30,9 +30,7 @@ Move::Move()
positionalArguments.append({QString("group"), QObject::tr("Path of the destination group."), QString("")});
}
Move::~Move()
{
}
Move::~Move() = default;
int Move::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<QCommandLineParser> parser)
{

View File

@ -30,9 +30,7 @@ RemoveGroup::RemoveGroup()
positionalArguments.append({QString("group"), QObject::tr("Path of the group to remove."), QString("")});
}
RemoveGroup::~RemoveGroup()
{
}
RemoveGroup::~RemoveGroup() = default;
int RemoveGroup::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<QCommandLineParser> parser)
{

View File

@ -384,7 +384,7 @@ namespace Utils
if (fieldName == TagsFieldName) {
return entry->tags();
}
return QString("");
return "";
}
QStringList findAttributes(const EntryAttributes& attributes, const QString& name)
@ -413,7 +413,7 @@ namespace Utils
*
* @param path Path to the key file to be loaded
* @param fileKey Resulting fileKey
* @return true if the key file was loaded succesfully
* @return true if the key file was loaded successfully
*/
bool loadFileKey(const QString& path, QSharedPointer<FileKey>& fileKey)
{

View File

@ -64,7 +64,7 @@ namespace AsyncTask
*
* @param task std::function object to run
* @param context QObject responsible for calling this function
* @param callback std::function object to run after the task completess
* @param callback std::function object to run after the task completes
*/
template <typename FunctionObject, typename FunctionObject2>
void runThenCallback(FunctionObject task, QObject* context, FunctionObject2 callback)

View File

@ -50,7 +50,7 @@ QVariant Base32::decode(const QByteArray& encodedData)
}
if (encodedData.size() % 8 != 0) {
return QVariant();
return {};
}
int nPads = 0;
@ -119,7 +119,7 @@ QVariant Base32::decode(const QByteArray& encodedData)
continue;
} else {
// illegal character
return QVariant();
return {};
}
}
}
@ -145,7 +145,7 @@ QVariant Base32::decode(const QByteArray& encodedData)
QByteArray Base32::encode(const QByteArray& data)
{
if (data.size() < 1) {
return QByteArray();
return {};
}
const int nBits = data.size() * 8;

View File

@ -50,12 +50,12 @@ QDateTime Clock::serialized(const QDateTime& dateTime)
QDateTime Clock::datetimeUtc(int year, int month, int day, int hour, int min, int second)
{
return QDateTime(QDate(year, month, day), QTime(hour, min, second), Qt::UTC);
return {QDate(year, month, day), QTime(hour, min, second), Qt::UTC};
}
QDateTime Clock::datetime(int year, int month, int day, int hour, int min, int second)
{
return QDateTime(QDate(year, month, day), QTime(hour, min, second), Qt::LocalTime);
return {QDate(year, month, day), QTime(hour, min, second), Qt::LocalTime};
}
QDateTime Clock::datetimeUtc(qint64 msecSinceEpoch)
@ -78,13 +78,9 @@ QDateTime Clock::parse(const QString& text, const QString& format)
return QDateTime::fromString(text, format);
}
Clock::~Clock()
{
}
Clock::~Clock() = default;
Clock::Clock()
{
}
Clock::Clock() = default;
QDateTime Clock::currentDateTimeUtcImpl() const
{

View File

@ -454,9 +454,7 @@ Config::Config(QObject* parent)
init(configFiles.first, configFiles.second);
}
Config::~Config()
{
}
Config::~Config() = default;
void Config::init(const QString& configFileName, const QString& localConfigFileName)
{

View File

@ -275,8 +275,8 @@ bool Database::saveAs(const QString& filePath, SaveAction action, const QString&
bool isNewFile = !QFile::exists(realFilePath);
bool ok = AsyncTask::runAndWaitForFuture([&] { return performSave(realFilePath, action, backupFilePath, error); });
if (ok) {
markAsClean();
setFilePath(filePath);
markAsClean();
if (isNewFile) {
QFile::setPermissions(realFilePath, QFile::ReadUser | QFile::WriteUser);
}
@ -346,7 +346,7 @@ bool Database::performSave(const QString& filePath, SaveAction action, const QSt
tempFile.setAutoRemove(false);
QFile::setPermissions(filePath, perms);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
// Retain orginal creation time
// Retain original creation time
tempFile.setFileTime(createTime, QFile::FileBirthTime);
#endif
return true;

View File

@ -1236,7 +1236,7 @@ QString Entry::referenceFieldValue(EntryReferenceType referenceType) const
default:
break;
}
return QString();
return {};
}
void Entry::moveUp()
@ -1353,7 +1353,7 @@ QString Entry::resolvePlaceholder(const QString& placeholder) const
QString Entry::resolveUrlPlaceholder(const QString& str, Entry::PlaceholderType placeholderType) const
{
if (str.isEmpty()) {
return QString();
return {};
}
const QUrl qurl(str);
@ -1384,7 +1384,7 @@ QString Entry::resolveUrlPlaceholder(const QString& str, Entry::PlaceholderType
}
}
return QString();
return {};
}
Entry::PlaceholderType Entry::placeholderType(const QString& placeholder) const
@ -1456,7 +1456,7 @@ QString Entry::resolveUrl(const QString& url) const
}
// No URL in this command
return QString("");
return {};
}
if (!newUrl.isEmpty() && !newUrl.contains("://")) {

View File

@ -166,7 +166,7 @@ QString Group::effectiveAutoTypeSequence() const
const Group* group = this;
do {
if (group->autoTypeEnabled() == Group::Disable) {
return QString();
return {};
}
sequence = group->defaultAutoTypeSequence();

View File

@ -43,7 +43,7 @@ public:
KeepLocal, // merge history forcing local as top regardless of age
KeepRemote, // merge history forcing remote as top regardless of age
KeepNewer, // merge history
Synchronize, // merge history keeping most recent as top entry and appling deletions
Synchronize, // merge history keeping most recent as top entry and applying deletions
};
enum CloneFlag

View File

@ -116,7 +116,7 @@ QString PassphraseGenerator::generatePassphrase() const
// In case there was an error loading the wordlist
if (m_wordlist.length() == 0) {
return QString();
return {};
}
QStringList words;

View File

@ -19,9 +19,7 @@
#include "core/Global.h"
SignalMultiplexer::SignalMultiplexer()
{
}
SignalMultiplexer::SignalMultiplexer() = default;
SignalMultiplexer::~SignalMultiplexer()
{

View File

@ -29,22 +29,22 @@ QDateTime operator+(const QDateTime& dateTime, const TimeDelta& delta)
TimeDelta TimeDelta::fromHours(int hours)
{
return TimeDelta(hours, 0, 0, 0);
return {hours, 0, 0, 0};
}
TimeDelta TimeDelta::fromDays(int days)
{
return TimeDelta(0, days, 0, 0);
return {0, days, 0, 0};
}
TimeDelta TimeDelta::fromMonths(int months)
{
return TimeDelta(0, 0, months, 0);
return {0, 0, months, 0};
}
TimeDelta TimeDelta::fromYears(int years)
{
return TimeDelta(0, 0, 0, years);
return {0, 0, 0, years};
}
TimeDelta::TimeDelta()

View File

@ -106,7 +106,7 @@ QByteArray CryptoHash::result() const
} else if (d->hashFunction) {
result = d->hashFunction->final();
}
return QByteArray(reinterpret_cast<const char*>(result.data()), result.size());
return {reinterpret_cast<const char*>(result.data()), int(result.size())};
}
QByteArray CryptoHash::hash(const QByteArray& data, Algorithm algo)

View File

@ -267,3 +267,22 @@ int SymmetricCipher::blockSize(Mode mode)
return 0;
}
}
int SymmetricCipher::ivSize(Mode mode)
{
switch (mode) {
case Aes128_CBC:
case Aes256_CBC:
case Aes128_CTR:
case Aes256_CTR:
case Twofish_CBC:
return 16;
case Aes256_GCM:
return 12;
case Salsa20:
case ChaCha20:
return 8;
default:
return 0;
}
}

View File

@ -70,6 +70,7 @@ public:
static int defaultIvSize(Mode mode);
static int keySize(Mode mode);
static int blockSize(Mode mode);
static int ivSize(Mode mode);
private:
static QString modeToString(const Mode mode);

View File

@ -183,7 +183,7 @@ QString KdbxXmlReader::errorString() const
.arg(m_xml.lineNumber())
.arg(m_xml.columnNumber());
}
return QString();
return {};
}
bool KdbxXmlReader::isTrueValue(const QStringRef& value)
@ -1117,13 +1117,13 @@ QUuid KdbxXmlReader::readUuid()
{
QByteArray uuidBin = readBinary();
if (uuidBin.isEmpty()) {
return QUuid();
return {};
}
if (uuidBin.length() != UUID_LENGTH) {
if (m_strictMode) {
raiseError(tr("Invalid uuid value"));
}
return QUuid();
return {};
}
return QUuid::fromRfc4122(uuidBin);
}

View File

@ -391,7 +391,7 @@ QByteArray KeePass1Reader::key(const QByteArray& password, const QByteArray& key
if (!result) {
raiseError(tr("Key transformation failed"));
return QByteArray();
return {};
}
CryptoHash hash(CryptoHash::Sha256);
@ -927,7 +927,7 @@ QDateTime KeePass1Reader::dateFromPackedStruct(const QByteArray& data)
// check for the special "never" datetime
if (dateTime == QDateTime(QDate(2999, 12, 28), QTime(23, 59, 59), Qt::UTC)) {
return QDateTime();
return {};
} else {
return dateTime;
}
@ -943,13 +943,13 @@ bool KeePass1Reader::isMetaStream(const Entry* entry)
QByteArray KeePass1Reader::readKeyfile(QIODevice* device)
{
if (device->size() == 0) {
return QByteArray();
return {};
}
if (device->size() == 32) {
QByteArray data = device->read(32);
if (data.size() != 32) {
return QByteArray();
return {};
}
return data;
@ -959,7 +959,7 @@ QByteArray KeePass1Reader::readKeyfile(QIODevice* device)
QByteArray data = device->read(64);
if (data.size() != 64) {
return QByteArray();
return {};
}
if (Tools::isHex(data)) {
@ -974,7 +974,7 @@ QByteArray KeePass1Reader::readKeyfile(QIODevice* device)
do {
if (!Tools::readFromDevice(device, buffer)) {
return QByteArray();
return {};
}
cryptoHash.addData(buffer);
} while (!buffer.isEmpty());

View File

@ -50,7 +50,7 @@ QByteArray KeePass2RandomStream::randomBytes(int size, bool* ok)
if (m_buffer.size() == m_offset) {
if (!loadBlock()) {
*ok = false;
return QByteArray();
return {};
}
}
@ -71,7 +71,7 @@ QByteArray KeePass2RandomStream::process(const QByteArray& data, bool* ok)
QByteArray randomData = randomBytes(data.size(), &randomBytesOk);
if (!randomBytesOk) {
*ok = false;
return QByteArray();
return {};
}
QByteArray result;

View File

@ -184,7 +184,7 @@ void KeePass2Writer::raiseError(const QString& errorMessage)
*/
QSharedPointer<KdbxWriter> KeePass2Writer::writer() const
{
return QSharedPointer<KdbxWriter>();
return {};
}
/**

View File

@ -27,9 +27,7 @@ OpData01::OpData01(QObject* parent)
{
}
OpData01::~OpData01()
{
}
OpData01::~OpData01() = default;
bool OpData01::decodeBase64(QString const& b64String, const QByteArray& key, const QByteArray& hmacKey)
{

View File

@ -35,9 +35,7 @@ OpVaultReader::OpVaultReader(QObject* parent)
{
}
OpVaultReader::~OpVaultReader()
{
}
OpVaultReader::~OpVaultReader() = default;
Database* OpVaultReader::readDatabase(QDir& opdataDir, const QString& password)
{
@ -301,11 +299,11 @@ QJsonObject OpVaultReader::readAndAssertJsonFile(QFile& file, const QString& str
auto absFilePath = fileInfo.absoluteFilePath();
if (!fileInfo.exists()) {
qCritical() << QString("File \"%1\" must exist").arg(absFilePath);
return QJsonObject();
return {};
}
if (!fileInfo.isReadable()) {
qCritical() << QString("File \"%1\" must be readable").arg(absFilePath);
return QJsonObject();
return {};
}
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@ -331,7 +329,7 @@ QJsonObject OpVaultReader::readAndAssertJsonFile(QFile& file, const QString& str
QJsonDocument jDoc = QJsonDocument::fromJson(filePayload, error);
if (!jDoc.isObject()) {
qCritical() << "Expected " << filePayload << "to be a JSON Object";
return QJsonObject();
return {};
}
return jDoc.object();
}

View File

@ -327,9 +327,7 @@ AboutDialog::AboutDialog(QWidget* parent)
m_ui->buttonBox->button(QDialogButtonBox::Close)->setDefault(true);
}
AboutDialog::~AboutDialog()
{
}
AboutDialog::~AboutDialog() = default;
void AboutDialog::copyToClipboard()
{

View File

@ -175,9 +175,7 @@ ApplicationSettingsWidget::ApplicationSettingsWidget(QWidget* parent)
m_secUi->quickUnlockCheckBox->setVisible(showQuickUnlock);
}
ApplicationSettingsWidget::~ApplicationSettingsWidget()
{
}
ApplicationSettingsWidget::~ApplicationSettingsWidget() = default;
void ApplicationSettingsWidget::addSettingsPage(ISettingsPage* page)
{

View File

@ -30,9 +30,7 @@ namespace Ui
class ISettingsPage
{
public:
virtual ~ISettingsPage()
{
}
virtual ~ISettingsPage() = default;
virtual QString name() = 0;
virtual QIcon icon() = 0;
virtual QWidget* createWidget() = 0;

View File

@ -43,9 +43,7 @@ CategoryListWidget::CategoryListWidget(QWidget* parent)
// clang-format on
}
CategoryListWidget::~CategoryListWidget()
{
}
CategoryListWidget::~CategoryListWidget() = default;
QSize CategoryListWidget::sizeHint() const
{
@ -64,8 +62,8 @@ QSize CategoryListWidget::sizeHint() const
QSize CategoryListWidget::minimumSizeHint() const
{
return QSize(m_itemDelegate->minWidth() + m_ui->categoryList->frameWidth() * 2,
m_ui->categoryList->sizeHintForRow(0) * 2);
return {m_itemDelegate->minWidth() + m_ui->categoryList->frameWidth() * 2,
m_ui->categoryList->sizeHintForRow(0) * 2};
}
int CategoryListWidget::addCategory(const QString& labelText, const QIcon& icon)

View File

@ -52,24 +52,19 @@ void Clipboard::setText(const QString& text, bool clear)
}
auto* mime = new QMimeData;
#ifdef Q_OS_MACOS
mime->setText(text);
#if defined(Q_OS_MACOS)
mime->setData("application/x-nspasteboard-concealed-type", text.toUtf8());
clipboard->setMimeData(mime, QClipboard::Clipboard);
#else
mime->setText(text);
#ifdef Q_OS_LINUX
#elif defined(Q_OS_UNIX)
mime->setData("x-kde-passwordManagerHint", QByteArrayLiteral("secret"));
#endif
#ifdef Q_OS_WIN
#elif defined(Q_OS_WIN)
mime->setData("ExcludeClipboardContentFromMonitorProcessing", QByteArrayLiteral("1"));
#endif
clipboard->setMimeData(mime, QClipboard::Clipboard);
if (clipboard->supportsSelection()) {
clipboard->setMimeData(mime, QClipboard::Selection);
}
#endif
clipboard->setMimeData(mime, QClipboard::Clipboard);
if (clear) {
m_lastCopied = text;

View File

@ -61,6 +61,4 @@ void CloneDialog::cloneEntry()
close();
}
CloneDialog::~CloneDialog()
{
}
CloneDialog::~CloneDialog() = default;

View File

@ -68,13 +68,13 @@ DatabaseOpenDialog::DatabaseOpenDialog(QWidget* parent)
auto* shortcut = new QShortcut(Qt::CTRL + Qt::Key_PageUp, this);
shortcut->setContext(Qt::WidgetWithChildrenShortcut);
connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(-1); });
shortcut = new QShortcut(dbTabModifier + Qt::Key_Tab, this);
shortcut = new QShortcut(dbTabModifier + Qt::SHIFT + Qt::Key_Tab, this);
shortcut->setContext(Qt::WidgetWithChildrenShortcut);
connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(-1); });
shortcut = new QShortcut(Qt::CTRL + Qt::Key_PageDown, this);
shortcut->setContext(Qt::WidgetWithChildrenShortcut);
connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(1); });
shortcut = new QShortcut(dbTabModifier + Qt::SHIFT + Qt::Key_Tab, this);
shortcut = new QShortcut(dbTabModifier + Qt::Key_Tab, this);
shortcut->setContext(Qt::WidgetWithChildrenShortcut);
connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(1); });
}

View File

@ -141,9 +141,7 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
connect(m_ui->resetQuickUnlockButton, &QPushButton::pressed, this, [this] { resetQuickUnlock(); });
}
DatabaseOpenWidget::~DatabaseOpenWidget()
{
}
DatabaseOpenWidget::~DatabaseOpenWidget() = default;
void DatabaseOpenWidget::showEvent(QShowEvent* event)
{
@ -538,9 +536,6 @@ bool DatabaseOpenWidget::isOnQuickUnlockScreen()
*/
void DatabaseOpenWidget::resetQuickUnlock()
{
if (!isQuickUnlockAvailable()) {
return;
}
#if defined(Q_CC_MSVC)
getWindowsHello()->reset(m_filename);
#elif defined(Q_OS_MACOS)

View File

@ -68,9 +68,7 @@ DatabaseTabWidget::DatabaseTabWidget(QWidget* parent)
connect(&m_lockDelayTimer, &QTimer::timeout, this, [this] { lockDatabases(); });
}
DatabaseTabWidget::~DatabaseTabWidget()
{
}
DatabaseTabWidget::~DatabaseTabWidget() = default;
void DatabaseTabWidget::toggleTabbar()
{
@ -244,6 +242,7 @@ void DatabaseTabWidget::addDatabaseTab(DatabaseWidget* dbWidget, bool inBackgrou
SLOT(updateTabName()));
connect(dbWidget, SIGNAL(databaseModified()), SLOT(updateTabName()));
connect(dbWidget, SIGNAL(databaseSaved()), SLOT(updateTabName()));
connect(dbWidget, SIGNAL(databaseSaved()), SLOT(updateLastDatabases()));
connect(dbWidget, SIGNAL(databaseUnlocked()), SLOT(updateTabName()));
connect(dbWidget, SIGNAL(databaseUnlocked()), SLOT(emitDatabaseLockChanged()));
connect(dbWidget, SIGNAL(databaseLocked()), SLOT(updateTabName()));
@ -331,7 +330,7 @@ void DatabaseTabWidget::importOpVaultDatabase()
* Attempt to close the current database and remove its tab afterwards.
*
* @param index index of the database tab to close
* @return true if database was closed successully
* @return true if database was closed successfully
*/
bool DatabaseTabWidget::closeCurrentDatabaseTab()
{
@ -342,7 +341,7 @@ bool DatabaseTabWidget::closeCurrentDatabaseTab()
* Attempt to close the database tab that sent the close request.
*
* @param index index of the database tab to close
* @return true if database was closed successully
* @return true if database was closed successfully
*/
bool DatabaseTabWidget::closeDatabaseTabFromSender()
{
@ -353,7 +352,7 @@ bool DatabaseTabWidget::closeDatabaseTabFromSender()
* Attempt to close a database and remove its tab afterwards.
*
* @param index index of the database tab to close
* @return true if database was closed successully
* @return true if database was closed successfully
*/
bool DatabaseTabWidget::closeDatabaseTab(int index)
{
@ -364,7 +363,7 @@ bool DatabaseTabWidget::closeDatabaseTab(int index)
* Attempt to close a database and remove its tab afterwards.
*
* @param dbWidget \link DatabaseWidget to close
* @return true if database was closed successully
* @return true if database was closed successfully
*/
bool DatabaseTabWidget::closeDatabaseTab(DatabaseWidget* dbWidget)
{
@ -829,6 +828,18 @@ void DatabaseTabWidget::updateLastDatabases(const QString& filename)
}
}
void DatabaseTabWidget::updateLastDatabases()
{
auto dbWidget = currentDatabaseWidget();
if (dbWidget) {
auto filePath = dbWidget->database()->filePath();
if (!filePath.isEmpty()) {
updateLastDatabases(filePath);
}
}
}
void DatabaseTabWidget::emitActiveDatabaseChanged()
{
emit activeDatabaseChanged(currentDatabaseWidget());

View File

@ -105,6 +105,7 @@ private slots:
void emitDatabaseLockChanged();
void handleDatabaseUnlockDialogFinished(bool accepted, DatabaseWidget* dbWidget);
void handleExportError(const QString& reason);
void updateLastDatabases();
private:
QSharedPointer<Database> execNewDatabaseWizard();

View File

@ -1837,7 +1837,7 @@ QStringList DatabaseWidget::customEntryAttributes() const
{
Entry* entry = m_entryView->currentEntry();
if (!entry) {
return QStringList();
return {};
}
return entry->attributes()->customKeys();

View File

@ -36,9 +36,7 @@ DatabaseWidgetStateSync::DatabaseWidgetStateSync(QObject* parent)
connect(qApp, &QCoreApplication::aboutToQuit, this, &DatabaseWidgetStateSync::sync);
}
DatabaseWidgetStateSync::~DatabaseWidgetStateSync()
{
}
DatabaseWidgetStateSync::~DatabaseWidgetStateSync() = default;
/**
* Sync state with persistent storage.

View File

@ -45,9 +45,7 @@ EditWidget::EditWidget(QWidget* parent)
connect(m_ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(buttonClicked(QAbstractButton*)));
}
EditWidget::~EditWidget()
{
}
EditWidget::~EditWidget() = default;
void EditWidget::addPage(const QString& labelText, const QIcon& icon, QWidget* widget)
{

View File

@ -86,9 +86,7 @@ EditWidgetIcons::EditWidgetIcons(QWidget* parent)
#endif
}
EditWidgetIcons::~EditWidgetIcons()
{
}
EditWidgetIcons::~EditWidgetIcons() = default;
IconStruct EditWidgetIcons::state()
{

View File

@ -41,9 +41,7 @@ EditWidgetProperties::EditWidgetProperties(QWidget* parent)
connect(m_ui->removeCustomDataButton, SIGNAL(clicked()), SLOT(removeSelectedPluginData()));
}
EditWidgetProperties::~EditWidgetProperties()
{
}
EditWidgetProperties::~EditWidgetProperties() = default;
void EditWidgetProperties::setFields(const TimeInfo& timeInfo, const QUuid& uuid)
{

View File

@ -107,9 +107,7 @@ EntryPreviewWidget::EntryPreviewWidget(QWidget* parent)
#endif
}
EntryPreviewWidget::~EntryPreviewWidget()
{
}
EntryPreviewWidget::~EntryPreviewWidget() = default;
void EntryPreviewWidget::clear()
{

View File

@ -21,9 +21,7 @@
FileDialog* FileDialog::m_instance(nullptr);
FileDialog::FileDialog()
{
}
FileDialog::FileDialog() = default;
QString FileDialog::getOpenFileName(QWidget* parent,
const QString& caption,

View File

@ -27,9 +27,7 @@ public:
static QFont fixedFont();
private:
Font()
{
}
Font() = default;
};
#endif // KEEPASSX_FONT_H

View File

@ -85,15 +85,6 @@ namespace
item.append("</a></td></tr>");
}
const auto& n = entry.notes();
if (!n.isEmpty()) {
item.append("<tr><th>");
item.append(QObject::tr("Notes"));
item.append("</th><td class=\"notes\">");
item.append(entry.notes().toHtmlEscaped().replace("\n", "<br>"));
item.append("</td></tr>");
}
// Now add the attributes (if there are any)
const auto* const attr = entry.attributes();
if (attr && !attr->customKeys().isEmpty()) {
@ -105,6 +96,15 @@ namespace
item.append("</td></tr>");
}
}
const auto& n = entry.notes();
if (!n.isEmpty()) {
item.append("<tr><th>");
item.append(QObject::tr("Notes"));
item.append("</th><td class=\"notes\">");
item.append(entry.notes().toHtmlEscaped().replace("\n", "<br>"));
item.append("</td></tr>");
}
return item;
}
} // namespace
@ -150,15 +150,18 @@ bool HtmlExporter::exportDatabase(QIODevice* device,
"h3 "
"{ margin-left: 2em; }"
"table "
"{ margin-left: 4em; } "
"{ margin-left: 1em; } "
"caption "
"{ text-align: left; font-weight: bold; font-size: 150%; border-bottom: .15em solid "
"#4ca; margin-bottom: .5em;} "
"th, td "
"{ text-align: left; vertical-align: top; padding: 1px; }"
"th "
"{ min-width: 5em; width: 20%; } "
"{ min-width: 7em; width: 15%; } "
".username, .password, .url, .attr "
"{ font-size: larger; font-family: monospace; } "
".notes "
"{ font-size: medium; } "
"{ font-size: small; } "
"</style>"
"</head>\n"
"<body>"
@ -231,7 +234,7 @@ bool HtmlExporter::writeGroup(QIODevice& device, const Group& group, QString pat
}
// Begin the table for the entries in this group
auto table = QString("<table width=\"100%\">");
auto table = QString("<table width=\"95%\">");
auto entries = group.entries();
if (sorted) {
@ -252,10 +255,11 @@ bool HtmlExporter::writeGroup(QIODevice& device, const Group& group, QString pat
// icon and entry title ...
table += "<tr>";
table += "<td width=\"1%\">" + PixmapToHTML(Icons::entryIconPixmap(entry, IconSize::Medium)) + "</td>";
table += "<td width=\"19%\" valign=\"top\"><h3>" + entry->title().toHtmlEscaped() + "</h3></td>";
auto caption = "<caption>" + entry->title().toHtmlEscaped() + "</caption>";
// ... then the right side with the data fields
table += "<td style=\"padding-bottom: 0.5em;\"><table width=\"100%\">" + formatted_entry + "</table></td>";
table +=
"<td style=\"padding-bottom: 0.5em;\"><table width=\"100%\">" + caption + formatted_entry + "</table></td>";
table += "</tr>";
}

View File

@ -38,7 +38,7 @@ int DefaultIconModel::rowCount(const QModelIndex& parent) const
QVariant DefaultIconModel::data(const QModelIndex& index, int role) const
{
if (!index.isValid()) {
return QVariant();
return {};
}
Q_ASSERT(index.row() < databaseIcons()->count());
@ -47,7 +47,7 @@ QVariant DefaultIconModel::data(const QModelIndex& index, int role) const
return databaseIcons()->icon(index.row(), IconSize::Medium);
}
return QVariant();
return {};
}
CustomIconModel::CustomIconModel(QObject* parent)
@ -78,7 +78,7 @@ int CustomIconModel::rowCount(const QModelIndex& parent) const
QVariant CustomIconModel::data(const QModelIndex& index, int role) const
{
if (!index.isValid()) {
return QVariant();
return {};
}
if (role == Qt::DecorationRole) {
@ -86,7 +86,7 @@ QVariant CustomIconModel::data(const QModelIndex& index, int role) const
return m_icons.value(uuid);
}
return QVariant();
return {};
}
QUuid CustomIconModel::uuidFromIndex(const QModelIndex& index) const

View File

@ -48,16 +48,14 @@ private:
Icons* Icons::m_instance(nullptr);
Icons::Icons()
{
}
Icons::Icons() = default;
QString Icons::applicationIconName()
{
#ifdef KEEPASSXC_DIST_FLATPAK
return QString("org.keepassxc.KeePassXC");
return "org.keepassxc.KeePassXC";
#else
return QString("keepassxc");
return "keepassxc";
#endif
}

View File

@ -128,6 +128,7 @@ MainWindow::MainWindow()
m_entryContextMenu->setSeparatorsCollapsible(true);
m_entryContextMenu->addAction(m_ui->actionEntryCopyUsername);
m_entryContextMenu->addAction(m_ui->actionEntryCopyPassword);
m_entryContextMenu->addAction(m_ui->actionEntryCopyURL);
m_entryContextMenu->addAction(m_ui->menuEntryCopyAttribute->menuAction());
m_entryContextMenu->addAction(m_ui->menuEntryTotp->menuAction());
m_entryContextMenu->addAction(m_ui->menuTags->menuAction());
@ -268,6 +269,9 @@ MainWindow::MainWindow()
setShortcut(m_ui->actionDatabaseSave, QKeySequence::Save, Qt::CTRL + Qt::Key_S);
setShortcut(m_ui->actionDatabaseSaveAs, QKeySequence::SaveAs, Qt::CTRL + Qt::SHIFT + Qt::Key_S);
setShortcut(m_ui->actionDatabaseClose, QKeySequence::Close, Qt::CTRL + Qt::Key_W);
m_ui->actionDatabaseSettings->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Comma);
m_ui->actionReports->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_R);
setShortcut(m_ui->actionSettings, QKeySequence::Preferences, Qt::CTRL + Qt::Key_Comma);
m_ui->actionLockDatabase->setShortcut(Qt::CTRL + Qt::Key_L);
m_ui->actionLockAllDatabases->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_L);
setShortcut(m_ui->actionQuit, QKeySequence::Quit, Qt::CTRL + Qt::Key_Q);
@ -745,7 +749,7 @@ void MainWindow::appExit()
/**
* Returns if application was built with hardware key support.
* Intented to be used by 3rd-party applications using DBus.
* Intended to be used by 3rd-party applications using DBus.
*
* @return True if built with hardware key support, false otherwise
*/
@ -761,7 +765,7 @@ bool MainWindow::isHardwareKeySupported()
/**
* Refreshes list of hardware keys known.
* Triggers the DatabaseOpenWidget to automatically select the key last used for a database if found.
* Intented to be used by 3rd-party applications using DBus.
* Intended to be used by 3rd-party applications using DBus.
*
* @return True if any key was found, false otherwise or if application lacks hardware key support
*/

View File

@ -216,7 +216,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>25</height>
<height>22</height>
</rect>
</property>
<property name="contextMenuPolicy">
@ -247,11 +247,6 @@
<addaction name="actionExportHtml"/>
<addaction name="actionExportXML"/>
</widget>
<widget class="QMenu" name="menu_Quit">
<property name="title">
<string>&amp;Quit</string>
</property>
</widget>
<addaction name="actionDatabaseNew"/>
<addaction name="actionDatabaseOpen"/>
<addaction name="menuRecentDatabases"/>
@ -306,7 +301,6 @@
<string>Copy Att&amp;ribute</string>
</property>
<addaction name="actionEntryCopyTitle"/>
<addaction name="actionEntryCopyURL"/>
<addaction name="actionEntryCopyNotes"/>
<addaction name="separator"/>
</widget>
@ -338,6 +332,7 @@
<addaction name="separator"/>
<addaction name="actionEntryCopyUsername"/>
<addaction name="actionEntryCopyPassword"/>
<addaction name="actionEntryCopyURL"/>
<addaction name="menuEntryCopyAttribute"/>
<addaction name="menuEntryTotp"/>
<addaction name="menuTags"/>
@ -818,7 +813,7 @@
<bool>false</bool>
</property>
<property name="text">
<string>&amp;URL</string>
<string>Copy &amp;URL</string>
</property>
<property name="toolTip">
<string>Copy URL to clipboard</string>
@ -895,7 +890,7 @@
<string>Copy &amp;TOTP</string>
</property>
</action>
<action name="actionEntryCopyPasswordTotp">
<action name="actionEntryCopyPasswordTotp">
<property name="text">
<string>Copy Password and TOTP</string>
</property>

View File

@ -54,7 +54,7 @@ PasswordWidget::PasswordWidget(QWidget* parent)
// use a monospace font for the password field
QFont passwordFont = Font::fixedFont();
passwordFont.setLetterSpacing(QFont::PercentageSpacing, 110);
setFont(passwordFont);
m_ui->passwordEdit->setFont(passwordFont);
// Prevent conflicts with global Mac shortcuts (force Control on all platforms)
#ifdef Q_OS_MAC
@ -143,19 +143,19 @@ void PasswordWidget::setReadOnly(bool state)
m_ui->passwordEdit->setReadOnly(state);
}
void PasswordWidget::setRepeatPartner(PasswordWidget* repeatEdit)
void PasswordWidget::setRepeatPartner(PasswordWidget* repeatPartner)
{
m_repeatPasswordEdit = repeatEdit;
m_repeatPasswordEdit->setParentPasswordEdit(this);
m_repeatPasswordWidget = repeatPartner;
m_repeatPasswordWidget->setParentPasswordEdit(this);
connect(
m_ui->passwordEdit, SIGNAL(textChanged(QString)), m_repeatPasswordEdit, SLOT(autocompletePassword(QString)));
connect(m_ui->passwordEdit, SIGNAL(textChanged(QString)), m_repeatPasswordEdit, SLOT(updateRepeatStatus()));
m_ui->passwordEdit, SIGNAL(textChanged(QString)), m_repeatPasswordWidget, SLOT(autocompletePassword(QString)));
connect(m_ui->passwordEdit, SIGNAL(textChanged(QString)), m_repeatPasswordWidget, SLOT(updateRepeatStatus()));
}
void PasswordWidget::setParentPasswordEdit(PasswordWidget* parent)
{
m_parentPasswordEdit = parent;
m_parentPasswordWidget = parent;
// Hide actions
m_toggleVisibleAction->setVisible(false);
m_passwordGeneratorAction->setVisible(false);
@ -176,13 +176,13 @@ void PasswordWidget::setShowPassword(bool show)
m_toggleVisibleAction->setIcon(icons()->onOffIcon("password-show", show));
m_toggleVisibleAction->setChecked(show);
if (m_repeatPasswordEdit) {
m_repeatPasswordEdit->setEchoMode(show ? QLineEdit::Normal : QLineEdit::Password);
if (m_repeatPasswordWidget) {
m_repeatPasswordWidget->setEchoMode(show ? QLineEdit::Normal : QLineEdit::Password);
if (!config()->get(Config::Security_PasswordsRepeatVisible).toBool()) {
m_repeatPasswordEdit->setEnabled(!show);
m_repeatPasswordEdit->setText(text());
m_repeatPasswordWidget->setEnabled(!show);
m_repeatPasswordWidget->setText(text());
} else {
m_repeatPasswordEdit->setEnabled(true);
m_repeatPasswordWidget->setEnabled(true);
}
}
}
@ -199,19 +199,19 @@ void PasswordWidget::popupPasswordGenerator()
generator->setPasswordLength(text().length());
connect(generator, SIGNAL(appliedPassword(QString)), SLOT(setText(QString)));
if (m_repeatPasswordEdit) {
connect(generator, SIGNAL(appliedPassword(QString)), m_repeatPasswordEdit, SLOT(setText(QString)));
if (m_repeatPasswordWidget) {
connect(generator, SIGNAL(appliedPassword(QString)), m_repeatPasswordWidget, SLOT(setText(QString)));
}
}
void PasswordWidget::updateRepeatStatus()
{
static const auto stylesheetTemplate = QStringLiteral("QLineEdit { background: %1; }");
if (!m_parentPasswordEdit) {
if (!m_parentPasswordWidget) {
return;
}
const auto otherPassword = m_parentPasswordEdit->text();
const auto otherPassword = m_parentPasswordWidget->text();
const auto password = text();
if (otherPassword != password) {
bool isCorrect = false;
@ -251,7 +251,7 @@ bool PasswordWidget::event(QEvent* event)
void PasswordWidget::checkCapslockState()
{
if (m_parentPasswordEdit) {
if (m_parentPasswordWidget) {
return;
}

View File

@ -37,7 +37,7 @@ public:
explicit PasswordWidget(QWidget* parent = nullptr);
~PasswordWidget() override;
void enablePasswordGenerator();
void setRepeatPartner(PasswordWidget* repeatEdit);
void setRepeatPartner(PasswordWidget* repeatPartner);
void setQualityVisible(bool state);
bool isPasswordVisible() const;
@ -76,8 +76,8 @@ private:
QPointer<QAction> m_toggleVisibleAction;
QPointer<QAction> m_passwordGeneratorAction;
QPointer<QAction> m_capslockAction;
QPointer<PasswordWidget> m_repeatPasswordEdit;
QPointer<PasswordWidget> m_parentPasswordEdit;
QPointer<PasswordWidget> m_repeatPasswordWidget;
QPointer<PasswordWidget> m_parentPasswordWidget;
bool m_capslockState = false;
};

View File

@ -81,9 +81,7 @@ SearchWidget::SearchWidget(QWidget* parent)
}
}
SearchWidget::~SearchWidget()
{
}
SearchWidget::~SearchWidget() = default;
bool SearchWidget::eventFilter(QObject* obj, QEvent* event)
{

View File

@ -53,9 +53,7 @@ TotpDialog::TotpDialog(QWidget* parent, Entry* entry)
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(copyToClipboard()));
}
TotpDialog::~TotpDialog()
{
}
TotpDialog::~TotpDialog() = default;
void TotpDialog::copyToClipboard()
{

View File

@ -38,9 +38,7 @@ TotpSetupDialog::TotpSetupDialog(QWidget* parent, Entry* entry)
init();
}
TotpSetupDialog::~TotpSetupDialog()
{
}
TotpSetupDialog::~TotpSetupDialog() = default;
void TotpSetupDialog::saveSettings()
{

View File

@ -51,9 +51,7 @@ WelcomeWidget::WelcomeWidget(QWidget* parent)
SLOT(openDatabaseFromFile(QListWidgetItem*)));
}
WelcomeWidget::~WelcomeWidget()
{
}
WelcomeWidget::~WelcomeWidget() = default;
void WelcomeWidget::openDatabaseFromFile(QListWidgetItem* item)
{

View File

@ -88,9 +88,7 @@ void CsvImportWidget::skippedChanged(int rows)
updateTableview();
}
CsvImportWidget::~CsvImportWidget()
{
}
CsvImportWidget::~CsvImportWidget() = default;
void CsvImportWidget::configParser()
{

View File

@ -29,9 +29,7 @@ CsvImportWizard::CsvImportWizard(QWidget* parent)
connect(m_parse, SIGNAL(editFinished(bool)), this, SLOT(parseFinished(bool)));
}
CsvImportWizard::~CsvImportWizard()
{
}
CsvImportWizard::~CsvImportWizard() = default;
void CsvImportWizard::load(const QString& filename, Database* database)
{

View File

@ -26,9 +26,7 @@ CsvParserModel::CsvParserModel(QObject* parent)
{
}
CsvParserModel::~CsvParserModel()
{
}
CsvParserModel::~CsvParserModel() = default;
void CsvParserModel::setFilename(const QString& filename)
{
@ -119,12 +117,12 @@ int CsvParserModel::columnCount(const QModelIndex& parent) const
QVariant CsvParserModel::data(const QModelIndex& index, int role) const
{
if ((index.column() >= m_columnHeader.size()) || (index.row() + m_skipped >= rowCount()) || !index.isValid()) {
return QVariant();
return {};
}
if (role == Qt::DisplayRole) {
return m_table.at(index.row() + m_skipped).at(m_columnMap[index.column()]);
}
return QVariant();
return {};
}
QVariant CsvParserModel::headerData(int section, Qt::Orientation orientation, int role) const
@ -132,15 +130,15 @@ QVariant CsvParserModel::headerData(int section, Qt::Orientation orientation, in
if (role == Qt::DisplayRole) {
if (orientation == Qt::Horizontal) {
if ((section < 0) || (section >= m_columnHeader.size())) {
return QVariant();
return {};
}
return m_columnHeader.at(section);
} else if (orientation == Qt::Vertical) {
if (section + m_skipped >= rowCount()) {
return QVariant();
return {};
}
return QString::number(section + 1);
}
}
return QVariant();
return {};
}

View File

@ -43,9 +43,7 @@ KeyComponentWidget::KeyComponentWidget(QWidget* parent)
m_ui->stackedWidget->blockSignals(prev);
}
KeyComponentWidget::~KeyComponentWidget()
{
}
KeyComponentWidget::~KeyComponentWidget() = default;
void KeyComponentWidget::setComponentAdded(bool added)
{

View File

@ -33,9 +33,7 @@ KeyFileEditWidget::KeyFileEditWidget(DatabaseSettingsWidget* parent)
initComponent();
}
KeyFileEditWidget::~KeyFileEditWidget()
{
}
KeyFileEditWidget::~KeyFileEditWidget() = default;
bool KeyFileEditWidget::addToCompositeKey(QSharedPointer<CompositeKey> key)
{

View File

@ -29,9 +29,7 @@ PasswordEditWidget::PasswordEditWidget(QWidget* parent)
initComponent();
}
PasswordEditWidget::~PasswordEditWidget()
{
}
PasswordEditWidget::~PasswordEditWidget() = default;
bool PasswordEditWidget::addToCompositeKey(QSharedPointer<CompositeKey> key)
{

View File

@ -33,9 +33,7 @@ YubiKeyEditWidget::YubiKeyEditWidget(QWidget* parent)
connect(YubiKey::instance(), SIGNAL(detectComplete(bool)), SLOT(hardwareKeyResponse(bool)), Qt::QueuedConnection);
}
YubiKeyEditWidget::~YubiKeyEditWidget()
{
}
YubiKeyEditWidget::~YubiKeyEditWidget() = default;
bool YubiKeyEditWidget::addToCompositeKey(QSharedPointer<CompositeKey> key)
{

View File

@ -122,9 +122,7 @@ DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent)
pageChanged();
}
DatabaseSettingsDialog::~DatabaseSettingsDialog()
{
}
DatabaseSettingsDialog::~DatabaseSettingsDialog() = default;
void DatabaseSettingsDialog::load(const QSharedPointer<Database>& db)
{

View File

@ -41,9 +41,7 @@ namespace Ui
class IDatabaseSettingsPage
{
public:
virtual ~IDatabaseSettingsPage()
{
}
virtual ~IDatabaseSettingsPage() = default;
virtual QString name() = 0;
virtual QIcon icon() = 0;
virtual QWidget* createWidget() = 0;

View File

@ -23,9 +23,7 @@ DatabaseSettingsWidget::DatabaseSettingsWidget(QWidget* parent)
{
}
DatabaseSettingsWidget::~DatabaseSettingsWidget()
{
}
DatabaseSettingsWidget::~DatabaseSettingsWidget() = default;
/**
* Load the database to be configured by this page and initialize the page.

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2022 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2018 Sami Vänttinen <sami.vanttinen@protonmail.com>
*
* This program is free software: you can redistribute it and/or modify
@ -48,8 +48,6 @@ DatabaseSettingsWidgetBrowser::DatabaseSettingsWidgetBrowser(QWidget* parent)
// clang-format on
connect(m_ui->removeCustomDataButton, SIGNAL(clicked()), SLOT(removeSelectedKey()));
connect(m_ui->convertToCustomData, SIGNAL(clicked()), this, SLOT(convertAttributesToCustomData()));
connect(m_ui->convertToCustomData, SIGNAL(clicked()), this, SLOT(updateSharedKeyList()));
connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SLOT(removeSharedEncryptionKeys()));
connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SLOT(updateSharedKeyList()));
connect(m_ui->removeStoredPermissions, SIGNAL(clicked()), this, SLOT(removeStoredPermissions()));
@ -141,7 +139,6 @@ void DatabaseSettingsWidgetBrowser::updateModel()
void DatabaseSettingsWidgetBrowser::settingsWarning()
{
if (!browserSettings()->isEnabled()) {
m_ui->convertToCustomData->setEnabled(false);
m_ui->removeSharedEncryptionKeys->setEnabled(false);
m_ui->removeStoredPermissions->setEnabled(false);
m_ui->customDataTable->setEnabled(false);
@ -150,7 +147,6 @@ void DatabaseSettingsWidgetBrowser::settingsWarning()
m_ui->warningWidget->setCloseButtonVisible(false);
m_ui->warningWidget->setAutoHideTimeout(-1);
} else {
m_ui->convertToCustomData->setEnabled(true);
m_ui->removeSharedEncryptionKeys->setEnabled(true);
m_ui->removeStoredPermissions->setEnabled(true);
m_ui->customDataTable->setEnabled(true);
@ -242,22 +238,6 @@ void DatabaseSettingsWidgetBrowser::removeStoredPermissions()
}
}
void DatabaseSettingsWidgetBrowser::convertAttributesToCustomData()
{
if (MessageBox::Yes
!= MessageBox::question(
this,
tr("Move KeePassHTTP attributes to custom data"),
tr("Do you really want to convert all legacy browser integration data to the latest standard?\n"
"This is necessary to maintain compatibility with the browser plugin."),
MessageBox::Yes | MessageBox::Cancel,
MessageBox::Cancel)) {
return;
}
BrowserService::convertAttributesToCustomData(m_db);
}
void DatabaseSettingsWidgetBrowser::refreshDatabaseID()
{
if (MessageBox::Yes

Some files were not shown because too many files have changed in this diff Show More