mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-13 16:30:29 -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(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(databaseModified()), SLOT(handleDatabaseChanged()));
|
||||||
connect(m_db.data(), SIGNAL(databaseSaved()), SLOT(handleDatabaseSaved()));
|
connect(m_db.data(), SIGNAL(databaseSaved()), SLOT(handleDatabaseSaved()));
|
||||||
|
|
||||||
@ -109,10 +113,12 @@ void ShareObserver::reinitialize()
|
|||||||
}
|
}
|
||||||
if (update.newReference.isExporting()) {
|
if (update.newReference.isExporting()) {
|
||||||
exported[update.newReference.path] << update.group->name();
|
exported[update.newReference.path] << update.group->name();
|
||||||
|
// export is only on save
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update.newReference.isImporting()) {
|
if (update.newReference.isImporting()) {
|
||||||
imported[update.newReference.path] << update.group->name();
|
imported[update.newReference.path] << update.group->name();
|
||||||
|
// import has to occur immediately
|
||||||
const auto result = this->importShare(update.newReference.path);
|
const auto result = this->importShare(update.newReference.path);
|
||||||
if (!result.isValid()) {
|
if (!result.isValid()) {
|
||||||
// tolerable result - blocked import or missing source
|
// tolerable result - blocked import or missing source
|
||||||
|
Loading…
Reference in New Issue
Block a user