Fixes share link delete action when clicking on tool button menu.

- Shared point was not handled properly.

Signed-off-by: Camila San <hello@camila.codes>
This commit is contained in:
Camila San 2018-08-19 12:43:12 +02:00
parent 8f7bc8cff9
commit cf3ee4b3a4
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4
2 changed files with 8 additions and 11 deletions

View file

@ -75,7 +75,7 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
// _ui->verticalLayout->addWidget(_pi_password, Qt::AlignCenter);
// _ui->verticalLayout->addWidget(_pi_editing, Qt::AlignCenter);
connect(_ui->enableShareLink, &QCheckBox::toggled, this, &ShareLinkWidget::slotCreateorDeleteShareLink);
connect(_ui->enableShareLink, &QCheckBox::toggled, this, &ShareLinkWidget::slotCreateOrDeleteShareLink);
connect(_ui->lineEdit_password, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotCreatePassword);
connect(_ui->confirmPassword, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCreatePassword);
connect(_ui->confirmExpirationDate, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCreatePassword);
@ -354,7 +354,7 @@ void ShareLinkWidget::slotCreatePassword()
}
}
void ShareLinkWidget::slotCreateorDeleteShareLink(bool checked)
void ShareLinkWidget::slotCreateOrDeleteShareLink(bool checked)
{
if (!_manager) {
qCWarning(lcSharing) << "No share manager set.";
@ -371,8 +371,6 @@ void ShareLinkWidget::slotCreateorDeleteShareLink(bool checked)
}
confirmAndDeleteShare();
}
_ui->shareLinkToolButton->setEnabled(checked);
}
void ShareLinkWidget::setPassword(const QString &password)
@ -410,6 +408,9 @@ void ShareLinkWidget::slotPasswordSet()
void ShareLinkWidget::slotDeleteShareFetched()
{
_linkShare.clear();
_ui->enableShareLink->setChecked(false);
_ui->shareLinkToolButton->setEnabled(false);
getShares();
}
@ -469,12 +470,8 @@ void ShareLinkWidget::confirmAndDeleteShare()
connect(messageBox, &QMessageBox::finished, this,
[messageBox, yesButton, this]() {
if (messageBox->clickedButton() == yesButton){
// TODO: dlete is not hapenning correctly
if (messageBox->clickedButton() == yesButton)
this->_linkShare->deleteShare();
this->_ui->enableShareLink->setChecked(false);
this->_ui->shareLinkToolButton->setEnabled(false);
}
});
messageBox->open();
}
@ -525,7 +522,7 @@ void ShareLinkWidget::slotLinkContextMenuActionTriggered(QAction *action)
toggleExpireDateOptions(state);
} else if (action == _unshareLinkAction) {
confirmAndDeleteShare();
slotCreateOrDeleteShareLink(state);
}
}

View file

@ -61,7 +61,7 @@ private slots:
void slotSharesFetched(const QList<QSharedPointer<Share>> &shares);
//void slotShareSelectionChanged();
void slotCreateorDeleteShareLink(bool checked);
void slotCreateOrDeleteShareLink(bool checked);
void slotCreatePassword();
void slotExpireDateChanged(const QDate &date);