mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 23:39:45 -05:00
Connect ShareObserver to group signals (#3441)
Connected ShareObserver to allow to import from a share before an export happens.
This commit is contained in:
parent
41131ae48d
commit
0a75b47509
@ -41,6 +41,10 @@ ShareObserver::ShareObserver(QSharedPointer<Database> db, QObject* parent)
|
||||
{
|
||||
connect(KeeShare::instance(), SIGNAL(activeChanged()), SLOT(handleDatabaseChanged()));
|
||||
|
||||
connect(m_db.data(), SIGNAL(groupDataChanged(Group*)), SLOT(handleDatabaseChanged()));
|
||||
connect(m_db.data(), SIGNAL(groupAdded()), SLOT(handleDatabaseChanged()));
|
||||
connect(m_db.data(), SIGNAL(groupRemoved()), SLOT(handleDatabaseChanged()));
|
||||
|
||||
connect(m_db.data(), SIGNAL(databaseModified()), SLOT(handleDatabaseChanged()));
|
||||
connect(m_db.data(), SIGNAL(databaseSaved()), SLOT(handleDatabaseSaved()));
|
||||
|
||||
@ -109,10 +113,12 @@ void ShareObserver::reinitialize()
|
||||
}
|
||||
if (update.newReference.isExporting()) {
|
||||
exported[update.newReference.path] << update.group->name();
|
||||
// export is only on save
|
||||
}
|
||||
|
||||
if (update.newReference.isImporting()) {
|
||||
imported[update.newReference.path] << update.group->name();
|
||||
// import has to occur immediately
|
||||
const auto result = this->importShare(update.newReference.path);
|
||||
if (!result.isValid()) {
|
||||
// tolerable result - blocked import or missing source
|
||||
|
Loading…
Reference in New Issue
Block a user