mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-29 05:13:06 -08:00
Hotfix/2657 prevent share overwrite (#2746)
* Fix problem with export from newly saved database Newly created/saved databases (or used with DatabaseWidget::saveAs) were not exported/imported correctly. Fixed the problem by reinitializing the ShareObserver on DatabaseWidget::saveAs. * Introduce warnings and prevent conflicting shares Introduced several warnings and errors to indicate improper settings. Prevent export when a path is used multiple times (only the file path is checked - may ignore multiple similar ways to reference a share). * Improve KeeShare integration in DatabaseWidget Moved initial KeeShare association to constructor. Introduced Q_UNUSED to indicate need for assignment statement.
This commit is contained in:
1 parent
ebb87e6379
commit
11ecaf4fa4
8 files changed
+109
-19
No files matched your search
@@ -208,6 +208,12 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_XC_KEESHARE
|
||||
// We need to reregister the database to allow exports
|
||||
// from a newly created database
|
||||
KeeShare::instance()->connectDatabase(m_db, {});
|
||||
#endif
|
||||
|
||||
switchToMainView();
|
||||
}
|
||||
|
||||
@@ -391,6 +397,9 @@ void DatabaseWidget::replaceDatabase(QSharedPointer<Database> db)
|
||||
processAutoOpen();
|
||||
#if defined(WITH_XC_KEESHARE)
|
||||
KeeShare::instance()->connectDatabase(m_db, oldDb);
|
||||
#else
|
||||
// Keep the instance active till the end of this function
|
||||
Q_UNUSED(oldDb);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user