mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-31 00:01:07 -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
|
|
@ -43,7 +43,6 @@ int AddGroup::executeWithDatabase(QSharedPointer<Database> database, QSharedPoin
|
|||
TextStream errorTextStream(Utils::STDERR, QIODevice::WriteOnly);
|
||||
|
||||
const QStringList args = parser->positionalArguments();
|
||||
const QString& databasePath = args.at(0);
|
||||
const QString& groupPath = args.at(1);
|
||||
|
||||
QStringList pathParts = groupPath.split("/");
|
||||
|
|
@ -68,7 +67,7 @@ int AddGroup::executeWithDatabase(QSharedPointer<Database> database, QSharedPoin
|
|||
newGroup->setParent(parentGroup);
|
||||
|
||||
QString errorMessage;
|
||||
if (!database->save(databasePath, &errorMessage, true, false)) {
|
||||
if (!database->save(&errorMessage, true, false)) {
|
||||
errorTextStream << QObject::tr("Writing the database failed %1.").arg(errorMessage) << endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue