Commit e9ed624b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15

parent 78d3ec48
......@@ -86,22 +86,26 @@ MessageComposer::ComposerAttachmentInterface ComposerViewInterface::attachments(
QString ComposerViewInterface::shortDate() const
{
return QDate::currentDate().toString(Qt::SystemLocaleShortDate);
QLocale locale;
return locale.toString(QDate::currentDate(), QLocale::ShortFormat);
}
QString ComposerViewInterface::longDate() const
{
return QDate::currentDate().toString(Qt::SystemLocaleLongDate);
QLocale locale;
return locale.toString(QDate::currentDate(), QLocale::LongFormat);
}
QString ComposerViewInterface::shortTime() const
{
return QTime::currentTime().toString(Qt::SystemLocaleShortDate);
QLocale locale;
return locale.toString(QTime::currentTime(), QLocale::ShortFormat);
}
QString ComposerViewInterface::longTime() const
{
return QTime::currentTime().toString(Qt::SystemLocaleLongDate);
QLocale locale;
return locale.toString(QTime::currentTime(), QLocale::LongFormat);
}
QString ComposerViewInterface::insertDayOfWeek() const
......
......@@ -89,7 +89,11 @@ FollowUpReminderSelectDateDialog::FollowUpReminderSelectDateDialog(QWidget *pare
formLayout->addRow(i18n("Store ToDo in:"), d->mCollectionCombobox);
connect(d->mDateComboBox->lineEdit(), &QLineEdit::textChanged, this, &FollowUpReminderSelectDateDialog::slotDateChanged);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &FollowUpReminderSelectDateDialog::updateOkButton);
#else
connect(d->mCollectionCombobox, qOverload<int, const QString &>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &FollowUpReminderSelectDateDialog::updateOkButton);
#endif
updateOkButton();
}
......
......@@ -73,10 +73,26 @@ ImageScalingWidget::ImageScalingWidget(QWidget *parent)
connect(d->ui->skipImageSizeLower, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
connect(d->ui->imageSize, qOverload<int>(&QSpinBox::valueChanged), this, &ImageScalingWidget::changed);
connect(d->ui->pattern, &KLineEdit::textChanged, this, &ImageScalingWidget::changed);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->ui->CBMaximumWidth, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#else
connect(d->ui->CBMaximumWidth, qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->ui->CBMaximumHeight, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#else
connect(d->ui->CBMaximumHeight, qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->ui->CBMinimumWidth, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#else
connect(d->ui->CBMinimumWidth, qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->ui->CBMinimumHeight, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#else
connect(d->ui->CBMinimumHeight, qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this, &ImageScalingWidget::slotComboboxChanged);
#endif
connect(d->ui->WriteToImageFormat, qOverload<int>(&QComboBox::activated), this, &ImageScalingWidget::changed);
connect(d->ui->renameResizedImage, &QCheckBox::clicked, this, &ImageScalingWidget::changed);
connect(d->ui->renameResizedImage, &QCheckBox::clicked, d->ui->renameResizedImagePattern, &KLineEdit::setEnabled);
......
......@@ -107,16 +107,17 @@ void ConvertSnippetVariableMenu::initializeMenu(bool onlyMenuForCustomizeAttachm
dateTimeMenuVariable->addAction(i18n("Day Of Week"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::Dow);
});
dateTimeMenuVariable->addAction(i18n("Date (%1)", QDate::currentDate().toString(Qt::SystemLocaleShortDate)), this, [this]() {
QLocale locale;
dateTimeMenuVariable->addAction(i18n("Date (%1)", locale.toString(QDate::currentDate(), QLocale::ShortFormat)), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::ShortDate);
});
dateTimeMenuVariable->addAction(i18n("Date (%1)", QDate::currentDate().toString(Qt::SystemLocaleLongDate)), this, [this]() {
dateTimeMenuVariable->addAction(i18n("Date (%1)", locale.toString(QDate::currentDate(), QLocale::LongFormat)), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::Date);
});
dateTimeMenuVariable->addAction(i18n("Time (%1)", QTime::currentTime().toString(Qt::SystemLocaleShortDate)), this, [this]() {
dateTimeMenuVariable->addAction(i18n("Time (%1)", locale.toString(QTime::currentTime(), QLocale::ShortFormat)), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::Time);
});
dateTimeMenuVariable->addAction(i18n("Time (%1)", QTime::currentTime().toString(Qt::SystemLocaleLongDate)), this, [this]() {
dateTimeMenuVariable->addAction(i18n("Time (%1)", locale.toString(QTime::currentTime(), QLocale::LongFormat)), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::TimeLong);
});
dateTimeMenuVariable->addAction(i18n("Year"), this, [this]() {
......
......@@ -208,7 +208,11 @@ void Widget::populateStatusFilterCombo()
d->mStatusFilterComboPopulationInProgress = true;
QComboBox *tagFilterComboBox = d->quickSearchLine->tagFilterComboBox();
d->mCurrentStatusFilterIndex = (tagFilterComboBox->currentIndex() != -1) ? tagFilterComboBox->currentIndex() : 0;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
disconnect(tagFilterComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &Widget::statusSelected);
#else
disconnect(tagFilterComboBox, qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this, &Widget::statusSelected);
#endif
tagFilterComboBox->clear();
......@@ -223,8 +227,11 @@ void Widget::addMessageTagItem(const QPixmap &icon, const QString &text, const Q
void Widget::setCurrentStatusFilterItem()
{
d->quickSearchLine->updateComboboxVisibility();
connect(d->quickSearchLine->tagFilterComboBox(), qOverload<int>(&QComboBox::currentIndexChanged),
this, &Widget::statusSelected);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->quickSearchLine->tagFilterComboBox(), qOverload<int>(&QComboBox::currentIndexChanged), this, &Widget::statusSelected);
#else
connect(d->quickSearchLine->tagFilterComboBox(), qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this, &Widget::statusSelected);
#endif
d->quickSearchLine->tagFilterComboBox()->setCurrentIndex(d->mCurrentStatusFilterIndex >= d->quickSearchLine->tagFilterComboBox()->count() ? 0 : d->mCurrentStatusFilterIndex);
d->mStatusFilterComboPopulationInProgress = false;
}
......
......@@ -65,9 +65,13 @@ ConfigureWidget::ConfigureWidget(QWidget *parent)
MessageViewer::MessageViewerSettings::self()->shrinkQuotesItem()->whatsThis());
d->mSettingsUi->kcfg_ShowExpandQuotesMark->setWhatsThis(
MessageViewer::MessageViewerSettings::self()->showExpandQuotesMarkItem()->whatsThis());
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->mSettingsUi->overrideCharacterEncoding, qOverload<int>(&QComboBox::currentIndexChanged), this,
&ConfigureWidget::settingsChanged);
#else
connect(d->mSettingsUi->overrideCharacterEncoding, qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this,
&ConfigureWidget::settingsChanged);
#endif
}
ConfigureWidget::~ConfigureWidget()
......
......@@ -129,7 +129,12 @@ TestScriptWidget::TestScriptWidget(QWidget *parent)
mScriptCombo = new QComboBox;
vScriptLayout->addWidget(mScriptCombo);
fillScriptCombo(mScriptCombo);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(mScriptCombo, qOverload<int>(&QComboBox::currentIndexChanged), this, &TestScriptWidget::slotCurrentIndexChanged);
#else
connect(mScriptCombo, qOverload<int, const QString &>(&QComboBox::currentIndexChanged), this, &TestScriptWidget::slotCurrentIndexChanged);
#endif
mScriptEdit = new QTextEdit;
mScriptEdit->setAcceptRichText(false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment