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

Port to new connect api

parent af6c74b9
......@@ -142,8 +142,7 @@ AkonadiModel::AkonadiModel(ChangeRecorder* monitor, QObject* parent)
connect(this, &AkonadiModel::rowsAboutToBeRemoved, this, &AkonadiModel::slotRowsAboutToBeRemoved);
connect(monitor, SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)), SLOT(slotMonitoredItemChanged(Akonadi::Item,QSet<QByteArray>)));
connect(ServerManager::self(), SIGNAL(stateChanged(Akonadi::ServerManager::State)),
SLOT(checkResources(Akonadi::ServerManager::State)));
connect(ServerManager::self(), &ServerManager::stateChanged, this, &AkonadiModel::checkResources);
checkResources(ServerManager::state());
}
......
......@@ -128,8 +128,7 @@ AlarmCalendar::AlarmCalendar()
connect(model, &AkonadiModel::eventsAdded, this, &AlarmCalendar::slotEventsAdded);
connect(model, &AkonadiModel::eventsToBeRemoved, this, &AlarmCalendar::slotEventsToBeRemoved);
connect(model, &AkonadiModel::eventChanged, this, &AlarmCalendar::slotEventChanged);
connect(model, SIGNAL(collectionStatusChanged(Akonadi::Collection,AkonadiModel::Change,QVariant,bool)),
SLOT(slotCollectionStatusChanged(Akonadi::Collection,AkonadiModel::Change,QVariant,bool)));
connect(model, &AkonadiModel::collectionStatusChanged, this, &AlarmCalendar::slotCollectionStatusChanged);
Preferences::connect(SIGNAL(askResourceChanged(bool)), this, SLOT(setAskResource(bool)));
}
......
......@@ -217,9 +217,9 @@ void EditAlarmDlg::init(const KAEvent* event)
setButtonText(Help, i18nc("@action:button", "Load Template..."));
setButtonIcon(Help, KIcon());
setButtonIcon(Default, KIcon());
connect(this, SIGNAL(tryClicked()), SLOT(slotTry()));
connect(this, SIGNAL(defaultClicked()), SLOT(slotDefault())); // More/Less Options button
connect(this, SIGNAL(helpClicked()), SLOT(slotHelp())); // Load Template button
connect(this, &EditAlarmDlg::tryClicked, this, &EditAlarmDlg::slotTry);
connect(this, &EditAlarmDlg::defaultClicked, this, &EditAlarmDlg::slotDefault); // More/Less Options button
connect(this, &EditAlarmDlg::helpClicked, this, &EditAlarmDlg::slotHelp); // Load Template button
KVBox* mainWidget = new KVBox(this);
mainWidget->setMargin(0);
setMainWidget(mainWidget);
......@@ -232,7 +232,7 @@ void EditAlarmDlg::init(const KAEvent* event)
label->setFixedSize(label->sizeHint());
mTemplateName = new QLineEdit(box);
mTemplateName->setReadOnly(mReadOnly);
connect(mTemplateName, SIGNAL(textEdited(QString)), SLOT(contentsChanged()));
connect(mTemplateName, &QLineEdit::textEdited, this, &EditAlarmDlg::contentsChanged);
label->setBuddy(mTemplateName);
box->setWhatsThis(i18nc("@info:whatsthis", "Enter the name of the alarm template"));
box->setFixedHeight(box->sizeHint().height());
......@@ -245,7 +245,7 @@ void EditAlarmDlg::init(const KAEvent* event)
mMainPageIndex = 0;
PageFrame* mainPage = new PageFrame(mainScroll);
mainScroll->setWidget(mainPage); // mainPage becomes the child of mainScroll
connect(mainPage, SIGNAL(shown()), SLOT(slotShowMainPage()));
connect(mainPage, &PageFrame::shown, this, &EditAlarmDlg::slotShowMainPage);
QVBoxLayout* topLayout = new QVBoxLayout(mainPage);
topLayout->setMargin(marginHint());
topLayout->setSpacing(spacingHint());
......@@ -258,11 +258,11 @@ void EditAlarmDlg::init(const KAEvent* event)
recurTab->setMargin(marginHint());
recurScroll->setWidget(recurTab); // recurTab becomes the child of recurScroll
mRecurrenceEdit = new RecurrenceEdit(mReadOnly, recurTab);
connect(mRecurrenceEdit, SIGNAL(shown()), SLOT(slotShowRecurrenceEdit()));
connect(mRecurrenceEdit, SIGNAL(typeChanged(int)), SLOT(slotRecurTypeChange(int)));
connect(mRecurrenceEdit, SIGNAL(frequencyChanged()), SLOT(slotRecurFrequencyChange()));
connect(mRecurrenceEdit, SIGNAL(repeatNeedsInitialisation()), SLOT(slotSetSubRepetition()));
connect(mRecurrenceEdit, SIGNAL(contentsChanged()), SLOT(contentsChanged()));
connect(mRecurrenceEdit, &RecurrenceEdit::shown, this, &EditAlarmDlg::slotShowRecurrenceEdit);
connect(mRecurrenceEdit, &RecurrenceEdit::typeChanged, this, &EditAlarmDlg::slotRecurTypeChange);
connect(mRecurrenceEdit, &RecurrenceEdit::frequencyChanged, this, &EditAlarmDlg::slotRecurFrequencyChange);
connect(mRecurrenceEdit, &RecurrenceEdit::repeatNeedsInitialisation, this, &EditAlarmDlg::slotSetSubRepetition);
connect(mRecurrenceEdit, &RecurrenceEdit::contentsChanged, this, &EditAlarmDlg::contentsChanged);
// Controls specific to the alarm type
QGroupBox* actionBox = new QGroupBox(i18nc("@title:group", "Action"), mainPage);
......@@ -289,7 +289,7 @@ void EditAlarmDlg::init(const KAEvent* event)
mDeferChangeButton = new QPushButton(i18nc("@action:button", "Change..."), mDeferGroup);
mDeferChangeButton->setFixedSize(mDeferChangeButton->sizeHint());
connect(mDeferChangeButton, SIGNAL(clicked()), SLOT(slotEditDeferral()));
connect(mDeferChangeButton, &QPushButton::clicked, this, &EditAlarmDlg::slotEditDeferral);
mDeferChangeButton->setWhatsThis(i18nc("@info:whatsthis", "Change the alarm's deferred time, or cancel the deferral"));
hlayout->addWidget(mDeferChangeButton);
//?? mDeferGroup->addSpace(0);
......@@ -308,8 +308,8 @@ void EditAlarmDlg::init(const KAEvent* event)
grid->setMargin(marginHint());
grid->setSpacing(spacingHint());
mTemplateTimeGroup = new ButtonGroup(templateTimeBox);
connect(mTemplateTimeGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(slotTemplateTimeType(QAbstractButton*)));
connect(mTemplateTimeGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(contentsChanged()));
connect(mTemplateTimeGroup, &ButtonGroup::buttonSet, this, &EditAlarmDlg::slotTemplateTimeType);
connect(mTemplateTimeGroup, &ButtonGroup::buttonSet, this, &EditAlarmDlg::contentsChanged);
mTemplateDefaultTime = new RadioButton(i18nc("@option:radio", "Default time"), templateTimeBox);
mTemplateDefaultTime->setFixedSize(mTemplateDefaultTime->sizeHint());
......@@ -333,7 +333,7 @@ void EditAlarmDlg::init(const KAEvent* event)
mTemplateTime->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the start time for alarms based on this template.</para><para>%1</para>",
TimeSpinBox::shiftWhatsThis()));
connect(mTemplateTime, SIGNAL(valueChanged(int)), SLOT(contentsChanged()));
connect(mTemplateTime, &TimeEdit::valueChanged, this, &EditAlarmDlg::contentsChanged);
box->setStretchFactor(new QWidget(box), 1); // left adjust the controls
box->setFixedHeight(box->sizeHint().height());
grid->addWidget(box, 0, 1, Qt::AlignLeft);
......@@ -359,7 +359,7 @@ void EditAlarmDlg::init(const KAEvent* event)
mTemplateTimeAfter->setValue(1439);
mTemplateTimeAfter->setFixedSize(mTemplateTimeAfter->sizeHint());
mTemplateTimeAfter->setReadOnly(mReadOnly);
connect(mTemplateTimeAfter, SIGNAL(valueChanged(int)), SLOT(contentsChanged()));
connect(mTemplateTimeAfter, static_cast<void (TimeSpinBox::*)(int)>(&TimeSpinBox::valueChanged), this, &EditAlarmDlg::contentsChanged);
mTemplateTimeAfter->setWhatsThis(xi18nc("@info:whatsthis", "<para>%1</para><para>%2</para>",
AlarmTimeWidget::i18n_TimeAfterPeriod(), TimeSpinBox::shiftWhatsThis()));
box->setFixedHeight(box->sizeHint().height());
......@@ -370,8 +370,8 @@ void EditAlarmDlg::init(const KAEvent* event)
else
{
mTimeWidget = new AlarmTimeWidget(i18nc("@title:group", "Time"), AlarmTimeWidget::AT_TIME, mainPage);
connect(mTimeWidget, SIGNAL(dateOnlyToggled(bool)), SLOT(slotAnyTimeToggled(bool)));
connect(mTimeWidget, SIGNAL(changed(KDateTime)), SLOT(contentsChanged()));
connect(mTimeWidget, &AlarmTimeWidget::dateOnlyToggled, this, &EditAlarmDlg::slotAnyTimeToggled);
connect(mTimeWidget, &AlarmTimeWidget::changed, this, &EditAlarmDlg::contentsChanged);
topLayout->addWidget(mTimeWidget);
}
......@@ -388,15 +388,15 @@ void EditAlarmDlg::init(const KAEvent* event)
if (mReminder)
{
mReminder->setFixedSize(mReminder->sizeHint());
connect(mReminder, SIGNAL(changed()), SLOT(contentsChanged()));
connect(mReminder, &Reminder::changed, this, &EditAlarmDlg::contentsChanged);
moreLayout->addWidget(mReminder, 0, Qt::AlignLeft);
if (mTimeWidget)
connect(mTimeWidget, SIGNAL(changed(KDateTime)), mReminder, SLOT(setDefaultUnits(KDateTime)));
connect(mTimeWidget, &AlarmTimeWidget::changed, mReminder, &Reminder::setDefaultUnits);
}
// Late cancel selector - default = allow late display
mLateCancel = new LateCancelSelector(true, mMoreOptions);
connect(mLateCancel, SIGNAL(changed()), SLOT(contentsChanged()));
connect(mLateCancel, &LateCancelSelector::changed, this, &EditAlarmDlg::contentsChanged);
moreLayout->addWidget(mLateCancel, 0, Qt::AlignLeft);
PackedLayout* playout = new PackedLayout(Qt::AlignJustify);
......@@ -408,7 +408,7 @@ void EditAlarmDlg::init(const KAEvent* event)
if (confirmAck)
{
confirmAck->setFixedSize(confirmAck->sizeHint());
connect(confirmAck, SIGNAL(toggled(bool)), SLOT(contentsChanged()));
connect(confirmAck, &CheckBox::toggled, this, &EditAlarmDlg::contentsChanged);
playout->addWidget(confirmAck);
}
......@@ -417,7 +417,7 @@ void EditAlarmDlg::init(const KAEvent* event)
// Show in KOrganizer checkbox
mShowInKorganizer = new CheckBox(i18n_chk_ShowInKOrganizer(), mMoreOptions);
mShowInKorganizer->setFixedSize(mShowInKorganizer->sizeHint());
connect(mShowInKorganizer, SIGNAL(toggled(bool)), SLOT(contentsChanged()));
connect(mShowInKorganizer, &CheckBox::toggled, this, &EditAlarmDlg::contentsChanged);
mShowInKorganizer->setWhatsThis(i18nc("@info:whatsthis", "Check to copy the alarm into KOrganizer's calendar"));
playout->addWidget(mShowInKorganizer);
}
......
......@@ -69,7 +69,7 @@ void SpinBox::init()
// Detect when the text field is edited
connect(lineEdit(), SIGNAL(textChanged(QString)), SLOT(textEdited()));
connect(this, SIGNAL(valueChanged(int)), SLOT(valueChange()));
connect(this, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &SpinBox::valueChange);
}
void SpinBox::setReadOnly(bool ro)
......
......@@ -44,14 +44,14 @@ TimeEdit::TimeEdit(QWidget* parent)
bool use12hour = KLocale::global()->use12Clock();
mSpinBox = new TimeSpinBox(!use12hour, this);
mSpinBox->setFixedSize(mSpinBox->sizeHint());
connect(mSpinBox, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
connect(mSpinBox, static_cast<void (TimeSpinBox::*)(int)>(&TimeSpinBox::valueChanged), this, &TimeEdit::slotValueChanged);
layout->addWidget(mSpinBox);
if (use12hour)
{
mAmPm = new ComboBox(this);
setAmPmCombo(1, 1); // add "am" and "pm" options to the combo box
mAmPm->setFixedSize(mAmPm->sizeHint());
connect(mAmPm, SIGNAL(highlighted(int)), SLOT(slotAmPmChanged(int)));
connect(mAmPm, static_cast<void (ComboBox::*)(int)>(&ComboBox::highlighted), this, &TimeEdit::slotAmPmChanged);
layout->addWidget(mAmPm);
}
}
......
......@@ -61,12 +61,12 @@ TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent)
mSpinBox->setSingleStep(1);
mSpinBox->setSingleShiftStep(10);
mSpinBox->setRange(1, mMaxDays);
connect(mSpinBox, SIGNAL(valueChanged(int)), SLOT(slotDaysChanged(int)));
connect(mSpinBox, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &TimePeriod::slotDaysChanged);
mSpinStack->addWidget(mSpinBox);
mTimeSpinBox = new TimeSpinBox(0, 99999, mSpinStack);
mTimeSpinBox->setRange(1, maxMinutes); // max 999H59M
connect(mTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(slotTimeChanged(int)));
connect(mTimeSpinBox, static_cast<void (TimeSpinBox::*)(int)>(&TimeSpinBox::valueChanged), this, &TimePeriod::slotTimeChanged);
mSpinStack->addWidget(mTimeSpinBox);
mSpinStack->setFixedSize(mSpinBox->sizeHint().expandedTo(mTimeSpinBox->sizeHint()));
......@@ -88,7 +88,7 @@ TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent)
mUnitsCombo->addItem(i18n_weeks());
mMaxUnitShown = Weeks;
mUnitsCombo->setFixedSize(mUnitsCombo->sizeHint());
connect(mUnitsCombo, SIGNAL(activated(int)), SLOT(slotUnitsSelected(int)));
connect(mUnitsCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::activated), this, &TimePeriod::slotUnitsSelected);
layout->addWidget(mUnitsCombo);
setFocusProxy(mUnitsCombo);
......
......@@ -52,7 +52,7 @@ TimeSpinBox::TimeSpinBox(bool use24hour, QWidget* parent)
setShiftSteps(5, 360); // shift-left button increments 5 min / 6 hours
setSelectOnStep(false);
setAlignment(Qt::AlignHCenter);
connect(this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
connect(this, static_cast<void (TimeSpinBox::*)(int)>(&TimeSpinBox::valueChanged), this, &TimeSpinBox::slotValueChanged);
}
/******************************************************************************
......
......@@ -256,10 +256,8 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mRepeatCountEntry->setSelectOnStep(false);
mRepeatCountEntry->setReadOnly(mReadOnly);
mRepeatCountEntry->setWhatsThis(i18nc("@info:whatsthis", "Enter the total number of times to trigger the alarm"));
connect(mRepeatCountEntry, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged),
this, &RecurrenceEdit::repeatCountChanged);
connect(mRepeatCountEntry, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged),
this, &RecurrenceEdit::contentsChanged);
connect(mRepeatCountEntry, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &RecurrenceEdit::repeatCountChanged);
connect(mRepeatCountEntry, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &RecurrenceEdit::contentsChanged);
mRepeatCountButton->setFocusWidget(mRepeatCountEntry);
mRepeatCountLabel = new QLabel(i18nc("@label", "occurrence(s)"), mRangeButtonBox);
mRepeatCountLabel->setFixedSize(mRepeatCountLabel->sizeHint());
......
......@@ -126,8 +126,7 @@ ResourceSelector::ResourceSelector(QWidget* parent)
connect(AkonadiModel::instance(), SIGNAL(collectionAdded(Akonadi::Collection)),
SLOT(slotCollectionAdded(Akonadi::Collection)));
connect(mAlarmType, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated),
this, &ResourceSelector::alarmTypeSelected);
connect(mAlarmType, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &ResourceSelector::alarmTypeSelected);
QTimer::singleShot(0, this, SLOT(alarmTypeSelected()));
Preferences::connect(SIGNAL(archivedKeepDaysChanged(int)), this, SLOT(archiveDaysChanged(int)));
......@@ -194,8 +193,7 @@ void ResourceSelector::reinstateAlarmTypeScrollBars()
void ResourceSelector::addResource()
{
AkonadiResourceCreator* creator = new AkonadiResourceCreator(mCurrentAlarmType, this);
connect(creator, SIGNAL(finished(AkonadiResourceCreator*,bool)),
SLOT(resourceAdded(AkonadiResourceCreator*,bool)));
connect(creator, &AkonadiResourceCreator::finished, this, &ResourceSelector::resourceAdded);
creator->createResource();
}
......
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