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

Make it compile against qt5.15

parent 08423b65
...@@ -91,13 +91,21 @@ ImageScalingWidget::ImageScalingWidget(QWidget *parent) ...@@ -91,13 +91,21 @@ ImageScalingWidget::ImageScalingWidget(QWidget *parent)
d->ui->pattern->setEnabled(false); d->ui->pattern->setEnabled(false);
d->mSourceFilenameFilterGroup = new QButtonGroup(d->ui->filterSourceGroupBox); d->mSourceFilenameFilterGroup = new QButtonGroup(d->ui->filterSourceGroupBox);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->mSourceFilenameFilterGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImageScalingWidget::slotSourceFilterClicked); connect(d->mSourceFilenameFilterGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImageScalingWidget::slotSourceFilterClicked);
#else
connect(d->mSourceFilenameFilterGroup, &QButtonGroup::buttonClicked, this, &ImageScalingWidget::slotSourceFilterAbstractButtonClicked);
#endif
d->mSourceFilenameFilterGroup->addButton(d->ui->notFilterFilename, MessageComposer::MessageComposerSettings::EnumFilterSourceType::NoFilter); d->mSourceFilenameFilterGroup->addButton(d->ui->notFilterFilename, MessageComposer::MessageComposerSettings::EnumFilterSourceType::NoFilter);
d->mSourceFilenameFilterGroup->addButton(d->ui->includeFilesWithPattern, MessageComposer::MessageComposerSettings::EnumFilterSourceType::IncludeFilesWithPattern); d->mSourceFilenameFilterGroup->addButton(d->ui->includeFilesWithPattern, MessageComposer::MessageComposerSettings::EnumFilterSourceType::IncludeFilesWithPattern);
d->mSourceFilenameFilterGroup->addButton(d->ui->excludeFilesWithPattern, MessageComposer::MessageComposerSettings::EnumFilterSourceType::ExcludeFilesWithPattern); d->mSourceFilenameFilterGroup->addButton(d->ui->excludeFilesWithPattern, MessageComposer::MessageComposerSettings::EnumFilterSourceType::ExcludeFilesWithPattern);
d->mRecipientFilterGroup = new QButtonGroup(d->ui->tab_4); d->mRecipientFilterGroup = new QButtonGroup(d->ui->tab_4);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->mRecipientFilterGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImageScalingWidget::slotRecipientFilterClicked); connect(d->mRecipientFilterGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImageScalingWidget::slotRecipientFilterClicked);
#else
connect(d->mRecipientFilterGroup, &QButtonGroup::buttonClicked, this, &ImageScalingWidget::slotRecipientFilterAbstractClicked);
#endif
d->ui->doNotResizePattern->setEnabled(false); d->ui->doNotResizePattern->setEnabled(false);
d->ui->resizeEmailsPattern->setEnabled(false); d->ui->resizeEmailsPattern->setEnabled(false);
d->mRecipientFilterGroup->addButton(d->ui->doNotFilterRecipients, MessageComposer::MessageComposerSettings::EnumFilterRecipientType::NoFilter); d->mRecipientFilterGroup->addButton(d->ui->doNotFilterRecipients, MessageComposer::MessageComposerSettings::EnumFilterRecipientType::NoFilter);
...@@ -134,6 +142,14 @@ void ImageScalingWidget::slotHelpLinkClicked(const QString &) ...@@ -134,6 +142,14 @@ void ImageScalingWidget::slotHelpLinkClicked(const QString &)
QWhatsThis::showText(QCursor::pos(), help); QWhatsThis::showText(QCursor::pos(), help);
} }
void ImageScalingWidget::slotSourceFilterAbstractButtonClicked(QAbstractButton *button)
{
if (button) {
const int buttonId = d->mRecipientFilterGroup->id(button);
slotSourceFilterClicked(buttonId);
}
}
void ImageScalingWidget::slotSourceFilterClicked(int button) void ImageScalingWidget::slotSourceFilterClicked(int button)
{ {
d->ui->pattern->setEnabled(button != 0); d->ui->pattern->setEnabled(button != 0);
...@@ -149,6 +165,14 @@ void ImageScalingWidget::slotRecipientFilterClicked(int button) ...@@ -149,6 +165,14 @@ void ImageScalingWidget::slotRecipientFilterClicked(int button)
Q_EMIT changed(); Q_EMIT changed();
} }
void ImageScalingWidget::slotRecipientFilterAbstractClicked(QAbstractButton *button)
{
if (button) {
const int buttonId = d->mRecipientFilterGroup->id(button);
slotRecipientFilterClicked(buttonId);
}
}
void ImageScalingWidget::slotComboboxChanged(int index) void ImageScalingWidget::slotComboboxChanged(int index)
{ {
QComboBox *combo = qobject_cast< QComboBox * >(sender()); QComboBox *combo = qobject_cast< QComboBox * >(sender());
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "messagecomposer_export.h" #include "messagecomposer_export.h"
class QComboBox; class QComboBox;
class QAbstractButton;
namespace Ui { namespace Ui {
class ImageScalingWidget; class ImageScalingWidget;
} }
...@@ -54,6 +55,8 @@ private Q_SLOTS: ...@@ -54,6 +55,8 @@ private Q_SLOTS:
void slotHelpLinkClicked(const QString &); void slotHelpLinkClicked(const QString &);
private: private:
void slotRecipientFilterAbstractClicked(QAbstractButton *button);
void slotSourceFilterAbstractButtonClicked(QAbstractButton *button);
void updateFilterSourceTypeSettings(); void updateFilterSourceTypeSettings();
void initComboBox(QComboBox *combo); void initComboBox(QComboBox *combo);
void initWriteImageFormat(); void initWriteImageFormat();
......
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