diff --git a/src/keeshare/KeeShareSettings.h b/src/keeshare/KeeShareSettings.h index b81dc15af..c8ee73d67 100644 --- a/src/keeshare/KeeShareSettings.h +++ b/src/keeshare/KeeShareSettings.h @@ -126,6 +126,7 @@ namespace KeeShareSettings QUuid uuid; QString path; QString password; + bool recurse; Reference(); bool isNull() const; diff --git a/src/keeshare/ShareExport.cpp b/src/keeshare/ShareExport.cpp index 1dff43c85..15dfcd562 100644 --- a/src/keeshare/ShareExport.cpp +++ b/src/keeshare/ShareExport.cpp @@ -110,7 +110,9 @@ namespace targetRoot->setUpdateTimeinfo(updateTimeinfo); cloneIcon(targetMetadata, sourceRoot->database(), targetRoot->iconUuid()); cloneEntries(targetMetadata, sourceRoot, targetRoot); - cloneChildren(targetMetadata, sourceRoot, targetRoot); + if(reference.recurse) { + cloneChildren(targetMetadata, sourceRoot, targetRoot); + } auto key = QSharedPointer::create(); key->addKey(QSharedPointer::create(reference.password)); diff --git a/src/keeshare/group/EditGroupWidgetKeeShare.cpp b/src/keeshare/group/EditGroupWidgetKeeShare.cpp index 82f8dd1c0..39da44e1f 100644 --- a/src/keeshare/group/EditGroupWidgetKeeShare.cpp +++ b/src/keeshare/group/EditGroupWidgetKeeShare.cpp @@ -43,6 +43,7 @@ EditGroupWidgetKeeShare::EditGroupWidgetKeeShare(QWidget* parent) connect(m_ui->pathEdit, SIGNAL(editingFinished()), SLOT(selectPath())); connect(m_ui->pathSelectionButton, SIGNAL(pressed()), SLOT(launchPathSelectionDialog())); connect(m_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(selectType())); + connect(m_ui->recurseIntoGroupsCheckbox, SIGNAL(toggled(bool)), SLOT(recurseIntoGroupsToggled(bool))); connect(m_ui->clearButton, SIGNAL(clicked(bool)), SLOT(clearInputs())); connect(KeeShare::instance(), SIGNAL(activeChanged()), SLOT(updateSharingState())); @@ -97,6 +98,7 @@ void EditGroupWidgetKeeShare::updateSharingState() m_ui->pathEdit->setEnabled(isEnabled); m_ui->pathSelectionButton->setEnabled(isEnabled); m_ui->passwordEdit->setEnabled(isEnabled); + m_ui->recurseIntoGroupsCheckbox->setEnabled(isEnabled); if (!m_temporaryGroup || !isEnabled) { m_ui->messageWidget->hideMessage(); @@ -291,3 +293,13 @@ void EditGroupWidgetKeeShare::selectType() updateSharingState(); } + +void EditGroupWidgetKeeShare::recurseIntoGroupsToggled(bool toggled) +{ + if (!m_temporaryGroup) { + return; + } + auto reference = KeeShare::referenceOf(m_temporaryGroup); + reference.recurse = toggled; + KeeShare::setReferenceTo(m_temporaryGroup, reference); +} diff --git a/src/keeshare/group/EditGroupWidgetKeeShare.h b/src/keeshare/group/EditGroupWidgetKeeShare.h index aaa3ebbd3..3e403b1e3 100644 --- a/src/keeshare/group/EditGroupWidgetKeeShare.h +++ b/src/keeshare/group/EditGroupWidgetKeeShare.h @@ -48,6 +48,7 @@ private slots: void selectPassword(); void launchPathSelectionDialog(); void selectPath(); + void recurseIntoGroupsToggled(bool); private: QScopedPointer m_ui; diff --git a/src/keeshare/group/EditGroupWidgetKeeShare.ui b/src/keeshare/group/EditGroupWidgetKeeShare.ui index 857ba61c8..921b1f002 100644 --- a/src/keeshare/group/EditGroupWidgetKeeShare.ui +++ b/src/keeshare/group/EditGroupWidgetKeeShare.ui @@ -138,7 +138,7 @@ - + @@ -171,7 +171,7 @@ - + Qt::Vertical @@ -184,6 +184,13 @@ + + + + Share recursively + + +