Sharedialog: Allow setting and retrieving of experiation data for public urls

This commit is contained in:
Roeland Jago Douma 2015-01-12 10:14:45 +01:00
parent 811cbc27c0
commit b680788f48
2 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ ShareDialog::ShareDialog(QWidget *parent) :
_ui->lineEdit_password->setPlaceholderText(tr("Choose a password for the public link"));
}
void ShareDialog::setExpireDate(QString date)
void ShareDialog::setExpireDate(const QString &date)
{
_ui->labelCalendarSpinner->show();
QUrl url = Account::concatUrlPath(AccountManager::instance()->account()->url(), QString("ocs/v1.php/apps/files_sharing/api/v1/shares/").append(QString::number(_public_share_id)));
@ -72,7 +72,7 @@ void ShareDialog::slotExpireSet(const QString &reply)
void ShareDialog::slotCalendarClicked(const QDate &date)
{
ShareDialog::setExpireDate(date.toString("dd-MM-yyyy"));
ShareDialog::setExpireDate(date.toString("yyyy-MM-dd"));
}
QString ShareDialog::getPath()
@ -159,9 +159,9 @@ void ShareDialog::slotSharesFetched(const QString &reply)
_ui->lineEdit_password->show();
}
if (data.value("expire_date").isValid())
if (data.value("expiration").isValid())
{
_ui->calendar->setSelectedDate(QDate::fromString(data.value("expire_date").toString(), "dd-MM-yyyy"));
_ui->calendar->setSelectedDate(QDate::fromString(data.value("expiration").toString(), "yyyy-MM-dd 00:00:00"));
_ui->calendar->show();
_ui->checkBox_expire->setChecked(true);
}

View file

@ -58,7 +58,7 @@ private:
QList<QVariant> _shares;
qulonglong _public_share_id;
void setPassword(QString password);
void setExpireDate(QString date);
void setExpireDate(const QString &date);
};
}