Mailcommon
collectionexpirywidget.cpp
36 KLocalization::setupSpinBoxFormatString(this, ki18ncp("Expire messages after %1", "%v day", "%v days"));
68 , mExpireMailWithInvalidDateCB(new QCheckBox(i18nc("@option:check", "Expire messages with invalid date"), this))
76 connect(mExpireUnreadMailSB, &QSpinBox::valueChanged, this, &CollectionExpiryWidget::slotChanged);
79 connect(mExpireMailWithInvalidDateCB, &QCheckBox::toggled, this, &CollectionExpiryWidget::slotChanged);
99 connect(mFolderSelector, &FolderRequester::folderChanged, this, &CollectionExpiryWidget::slotChanged);
103 connect(mDeletePermanentlyRB, &QRadioButton::toggled, this, &CollectionExpiryWidget::slotChanged);
107 connect(mExpireNowPB, &QPushButton::clicked, this, &CollectionExpiryWidget::saveAndExpireRequested);
123 const bool showExpiryActions = mExpireReadMailSB->value() != 0 || mExpireUnreadMailSB->value() != 0;
136 if (expiryGloballyOn && settings.mReadExpireUnits != ExpireCollectionAttribute::ExpireNever && settings.daysToExpireRead >= 0) {
141 if (expiryGloballyOn && settings.mUnreadExpireUnits != ExpireCollectionAttribute::ExpireNever && settings.daysToExpireUnread >= 0) {
169 const bool enableGlobally = mExpireReadMailSB->value() != 0 || mExpireUnreadMailSB->value() != 0;
173 i18n("Please select a folder to expire messages into.\nIf this is not done, expired messages will be permanently deleted."),
181MailCommon::ExpireCollectionAttribute *CollectionExpiryWidget::assignFolderAttribute(Akonadi::Collection &collection, bool &expireNow)
188 i18n("Please select a different folder than the current folder to expire messages into.\nIf this is not done, expired messages "
194 attribute = collection.attribute<MailCommon::ExpireCollectionAttribute>(Akonadi::Collection::AddIfMissing);
199 attribute = collection.attribute<MailCommon::ExpireCollectionAttribute>(Akonadi::Collection::AddIfMissing);
207 settings.expiryGloballyOn = mExpireReadMailSB->value() != 0 || mExpireUnreadMailSB->value() != 0;
213 mExpireReadMailSB->value() != 0 ? MailCommon::ExpireCollectionAttribute::ExpireDays : MailCommon::ExpireCollectionAttribute::ExpireNever;
215 mExpireUnreadMailSB->value() != 0 ? MailCommon::ExpireCollectionAttribute::ExpireDays : MailCommon::ExpireCollectionAttribute::ExpireNever;
225void CollectionExpiryWidget::save(const CollectionExpirySettings &collectionExpirySettings, Akonadi::Collection &collection, bool saveSettings, bool expireNow)
228 MailCommon::ExpireCollectionAttribute *attribute = assignFolderAttribute(collection, expireNow);
250void CollectionExpiryWidget::save(Akonadi::Collection &collection, bool saveSettings, bool expireNow)
259 return fd->canDeleteMessages() && !fd->isStructural() && !MailCommon::Util::isVirtualCollection(col);
264 const bool valid = daysToExpireRead != -1 || daysToExpireUnread != -1 || mUnreadExpireUnits != ExpireCollectionAttribute::ExpireNever
265 || mReadExpireUnits != ExpireCollectionAttribute::ExpireNever || mExpireAction != ExpireCollectionAttribute::ExpireDelete || mExpireToFolderId != -1;
qint64 Id
bool isValid() const
const T * attribute() const
AddIfMissing
Id id() const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
QString i18n(const char *text, const TYPE &arg...)
void setupSpinBoxFormatString(T *spinBox, const KLocalizedString &formatString)
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QDebug operator<<(QDebug dbg, const PerceptualColor::MultiSpinBoxSection &value)
bool isChecked() const const
void clicked(bool checked)
void toggled(bool checked)
void setSpecialValueText(const QString &txt)
Q_EMITQ_EMIT
QObject * parent() const const
void setMaximum(int max)
virtual QString textFromValue(int value) const const
virtual QValidator::State validate(QString &text, int &pos) const const override
value
void valueChanged(int i)
virtual int valueFromText(const QString &text) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
State
void setEnabled(bool)
pos
virtual void setVisible(bool visible)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:02:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:02:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.