mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-01-01 00:30:17 -05:00
Cleanup database save functions
* Make a clear distinction between saving to the existing file path and saving to a new file path * Use proper save function calls in CLI
This commit is contained in:
parent
a876b3b72f
commit
6b746913e4
12 changed files with 33 additions and 57 deletions
|
|
@ -38,8 +38,7 @@ Remove::Remove()
|
|||
int Remove::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<QCommandLineParser> parser)
|
||||
{
|
||||
bool quiet = parser->isSet(Command::QuietOption);
|
||||
QString databasePath = parser->positionalArguments().at(0);
|
||||
QString entryPath = parser->positionalArguments().at(1);
|
||||
auto& entryPath = parser->positionalArguments().at(1);
|
||||
|
||||
TextStream outputTextStream(quiet ? Utils::DEVNULL : Utils::STDOUT, QIODevice::WriteOnly);
|
||||
TextStream errorTextStream(Utils::STDERR, QIODevice::WriteOnly);
|
||||
|
|
@ -61,7 +60,7 @@ int Remove::executeWithDatabase(QSharedPointer<Database> database, QSharedPointe
|
|||
};
|
||||
|
||||
QString errorMessage;
|
||||
if (!database->save(databasePath, &errorMessage, true, false)) {
|
||||
if (!database->save(&errorMessage, true, false)) {
|
||||
errorTextStream << QObject::tr("Unable to save database to file: %1").arg(errorMessage) << endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue