mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-09 23:12:23 -04:00
Avoid copying QSharedPointers when not needed
This commit is contained in:
parent
6df9c6f9b2
commit
39b96c13e8
18 changed files with 31 additions and 29 deletions
|
@ -77,7 +77,7 @@ int Clip::execute(const QStringList& arguments)
|
|||
return clipEntry(db, args.at(1), args.value(2), parser.isSet(totp), parser.isSet(Command::QuietOption));
|
||||
}
|
||||
|
||||
int Clip::clipEntry(QSharedPointer<Database> database,
|
||||
int Clip::clipEntry(const QSharedPointer<Database>& database,
|
||||
const QString& entryPath,
|
||||
const QString& timeout,
|
||||
bool clipTotp,
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
Clip();
|
||||
~Clip();
|
||||
int execute(const QStringList& arguments) override;
|
||||
int clipEntry(QSharedPointer<Database> database,
|
||||
int clipEntry(const QSharedPointer<Database>& database,
|
||||
const QString& entryPath,
|
||||
const QString& timeout,
|
||||
bool clipTotp,
|
||||
|
|
|
@ -74,7 +74,7 @@ int Create::execute(const QStringList& arguments)
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
QString databaseFilename = args.at(0);
|
||||
const QString& databaseFilename = args.at(0);
|
||||
if (QFileInfo::exists(databaseFilename)) {
|
||||
err << QObject::tr("File %1 already exists.").arg(databaseFilename) << endl;
|
||||
return EXIT_FAILURE;
|
||||
|
@ -150,7 +150,7 @@ QSharedPointer<PasswordKey> Create::getPasswordFromStdin()
|
|||
* @param fileKey Resulting fileKey
|
||||
* @return true if the key file was loaded succesfully
|
||||
*/
|
||||
bool Create::loadFileKey(QString path, QSharedPointer<FileKey>& fileKey)
|
||||
bool Create::loadFileKey(const QString& path, QSharedPointer<FileKey>& fileKey)
|
||||
{
|
||||
QTextStream err(Utils::STDERR, QIODevice::WriteOnly);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
private:
|
||||
QSharedPointer<PasswordKey> getPasswordFromStdin();
|
||||
QSharedPointer<FileKey> getFileKeyFromStdin();
|
||||
bool loadFileKey(QString path, QSharedPointer<FileKey>& fileKey);
|
||||
bool loadFileKey(const QString& path, QSharedPointer<FileKey>& fileKey);
|
||||
};
|
||||
|
||||
#endif // KEEPASSXC_CREATE_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue