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

Port to new connect api

parent f1e5dd5f
......@@ -92,8 +92,7 @@ void AkonadiResourceCreator::getAgentType()
return;
}
AgentInstanceCreateJob* job = new AgentInstanceCreateJob(mAgentType, mParent);
connect(job, &AgentInstanceCreateJob::result,
this, &AkonadiResourceCreator::agentInstanceCreated);
connect(job, &AgentInstanceCreateJob::result, this, &AkonadiResourceCreator::agentInstanceCreated);
job->start();
}
......@@ -133,10 +132,8 @@ void AkonadiResourceCreator::agentInstanceCreated(KJob* j)
}
else
{
connect(agentControlIface, &org::freedesktop::Akonadi::Agent::Control::configurationDialogAccepted,
this, &AkonadiResourceCreator::configurationDialogAccepted);
connect(agentControlIface, &org::freedesktop::Akonadi::Agent::Control::configurationDialogRejected,
this, &AkonadiResourceCreator::exitWithError);
connect(agentControlIface, &org::freedesktop::Akonadi::Agent::Control::configurationDialogAccepted, this, &AkonadiResourceCreator::configurationDialogAccepted);
connect(agentControlIface, &org::freedesktop::Akonadi::Agent::Control::configurationDialogRejected, this, &AkonadiResourceCreator::exitWithError);
}
mAgentInstance.configure(mParent);
......
......@@ -172,8 +172,8 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
item->setEnabled(false);
}
}
connect(mTypeCombo, SIGNAL(currentIndexChanged(int)), SLOT(slotAlarmTypeChanged(int)));
connect(mTypeCombo, SIGNAL(currentIndexChanged(int)), SLOT(contentsChanged()));
connect(mTypeCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &EditDisplayAlarmDlg::slotAlarmTypeChanged);
connect(mTypeCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &EditDisplayAlarmDlg::contentsChanged);
label->setBuddy(mTypeCombo);
box->setWhatsThis(xi18nc("@info:whatsthis", "<para>Select what the alarm should display:"
"<list><item><interface>%1</interface>: the alarm will display the text message you type in.</item>"
......@@ -187,7 +187,7 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mTextMessageEdit = new TextEdit(parent);
mTextMessageEdit->setLineWrapMode(KTextEdit::NoWrap);
mTextMessageEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the text of the alarm message. It may be multi-line."));
connect(mTextMessageEdit, SIGNAL(textChanged()), SLOT(contentsChanged()));
connect(mTextMessageEdit, &TextEdit::textChanged, this, &EditDisplayAlarmDlg::contentsChanged);
frameLayout->addWidget(mTextMessageEdit);
// File name edit box
......@@ -200,7 +200,7 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
fileBoxHLayout->addWidget(mFileMessageEdit);
mFileMessageEdit->setAcceptDrops(true);
mFileMessageEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or URL of a text or image file to display."));
connect(mFileMessageEdit, SIGNAL(textChanged(QString)), SLOT(contentsChanged()));
connect(mFileMessageEdit, &LineEdit::textChanged, this, &EditDisplayAlarmDlg::contentsChanged);
// File browse button
mFileBrowseButton = new QPushButton(mFileBox);
......@@ -210,12 +210,12 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mFileBrowseButton->setFixedSize(size, size);
mFileBrowseButton->setToolTip(i18nc("@info:tooltip", "Choose a file"));
mFileBrowseButton->setWhatsThis(i18nc("@info:whatsthis", "Select a text or image file to display."));
connect(mFileBrowseButton, SIGNAL(clicked()), SLOT(slotPickFile()));
connect(mFileBrowseButton, &QPushButton::clicked, this, &EditDisplayAlarmDlg::slotPickFile);
// Command type checkbox and edit box
mCmdEdit = new CommandEdit(parent);
connect(mCmdEdit, SIGNAL(scriptToggled(bool)), SLOT(slotCmdScriptToggled(bool)));
connect(mCmdEdit, SIGNAL(changed()), SLOT(contentsChanged()));
connect(mCmdEdit, &CommandEdit::scriptToggled, this, &EditDisplayAlarmDlg::slotCmdScriptToggled);
connect(mCmdEdit, &CommandEdit::changed, this, &EditDisplayAlarmDlg::contentsChanged);
frameLayout->addWidget(mCmdEdit);
// Sound checkbox and file selector
......@@ -224,7 +224,7 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
frameLayout->addLayout(hlayout);
mSoundPicker = new SoundPicker(parent);
mSoundPicker->setFixedSize(mSoundPicker->sizeHint());
connect(mSoundPicker, SIGNAL(changed()), SLOT(contentsChanged()));
connect(mSoundPicker, &SoundPicker::changed, this, &EditDisplayAlarmDlg::contentsChanged);
hlayout->addWidget(mSoundPicker);
hlayout->addSpacing(2*spacingHint());
hlayout->addStretch();
......@@ -233,15 +233,15 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mFontColourButton = new FontColourButton(parent);
mFontColourButton->setMaximumHeight(mFontColourButton->sizeHint().height() * 3/2);
hlayout->addWidget(mFontColourButton);
connect(mFontColourButton, SIGNAL(selected(QColor,QColor)), SLOT(setColours(QColor,QColor)));
connect(mFontColourButton, SIGNAL(selected(QColor,QColor)), SLOT(contentsChanged()));
connect(mFontColourButton, &FontColourButton::selected, this, &EditDisplayAlarmDlg::setColours);
connect(mFontColourButton, &FontColourButton::selected, this, &EditDisplayAlarmDlg::contentsChanged);
if (ShellProcess::authorised()) // don't display if shell commands not allowed (e.g. kiosk mode)
{
// Special actions button
mSpecialActionsButton = new SpecialActionsButton(false, parent);
mSpecialActionsButton->setFixedSize(mSpecialActionsButton->sizeHint());
connect(mSpecialActionsButton, SIGNAL(selected()), SLOT(contentsChanged()));
connect(mSpecialActionsButton, &SpecialActionsButton::selected, this, &EditDisplayAlarmDlg::contentsChanged);
frameLayout->addWidget(mSpecialActionsButton, 0, Qt::AlignRight);
}
......@@ -768,8 +768,8 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
setButtonWhatsThis(Try, i18nc("@info:whatsthis", "Execute the specified command now"));
mCmdEdit = new CommandEdit(parent);
connect(mCmdEdit, SIGNAL(scriptToggled(bool)), SLOT(slotCmdScriptToggled(bool)));
connect(mCmdEdit, SIGNAL(changed()), SLOT(contentsChanged()));
connect(mCmdEdit, &CommandEdit::scriptToggled, this, &EditCommandAlarmDlg::slotCmdScriptToggled);
connect(mCmdEdit, &CommandEdit::changed, this, &EditCommandAlarmDlg::contentsChanged);
frameLayout->addWidget(mCmdEdit);
// What to do with command output
......@@ -780,7 +780,7 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
vlayout->setMargin(marginHint());
vlayout->setSpacing(spacingHint());
mCmdOutputGroup = new ButtonGroup(mCmdOutputBox);
connect(mCmdOutputGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(contentsChanged()));
connect(mCmdOutputGroup, &ButtonGroup::buttonSet, this, &EditCommandAlarmDlg::contentsChanged);
// Execute in terminal window
mCmdExecInTerm = new RadioButton(i18n_radio_ExecInTermWindow(), mCmdOutputBox);
......@@ -799,7 +799,7 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
boxHLayout->addWidget(mCmdLogFileEdit);
mCmdLogFileEdit->setAcceptDrops(true);
mCmdLogFileEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or path of the log file."));
connect(mCmdLogFileEdit, SIGNAL(textChanged(QString)), SLOT(contentsChanged()));
connect(mCmdLogFileEdit, &LineEdit::textChanged, this, &EditCommandAlarmDlg::contentsChanged);
// Log file browse button.
// The file browser dialog is activated by the PickLogFileRadio class.
......@@ -815,7 +815,7 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mCmdLogToFile = new PickLogFileRadio(browseButton, mCmdLogFileEdit, i18nc("@option:radio", "Log to file"), mCmdOutputGroup, mCmdOutputBox);
mCmdLogToFile->setFixedSize(mCmdLogToFile->sizeHint());
mCmdLogToFile->setWhatsThis(i18nc("@info:whatsthis", "Check to log the command output to a local file. The output will be appended to any existing contents of the file."));
connect(mCmdLogToFile, SIGNAL(fileChanged()), SLOT(contentsChanged()));
connect(mCmdLogToFile, &PickLogFileRadio::fileChanged, this, &EditCommandAlarmDlg::contentsChanged);
mCmdOutputGroup->addButton(mCmdLogToFile, Preferences::Log_File);
vlayout->addWidget(mCmdLogToFile, 0, Qt::AlignLeft);
vlayout->addWidget(box);
......@@ -1093,7 +1093,7 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mEmailFromList->setMinimumSize(mEmailFromList->sizeHint());
label->setBuddy(mEmailFromList);
mEmailFromList->setWhatsThis(i18nc("@info:whatsthis", "Your email identity, used to identify you as the sender when sending email alarms."));
connect(mEmailFromList, SIGNAL(identityChanged(uint)), SLOT(contentsChanged()));
connect(mEmailFromList, &EmailIdCombo::identityChanged, this, &EditEmailAlarmDlg::contentsChanged);
grid->addWidget(mEmailFromList, 0, 1, 1, 2);
}
......@@ -1106,14 +1106,14 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mEmailToEdit->setMinimumSize(mEmailToEdit->sizeHint());
mEmailToEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the addresses of the email recipients. Separate multiple addresses by "
"commas or semicolons."));
connect(mEmailToEdit, SIGNAL(textChanged(QString)), SLOT(contentsChanged()));
connect(mEmailToEdit, &LineEdit::textChanged, this, &EditEmailAlarmDlg::contentsChanged);
grid->addWidget(mEmailToEdit, 1, 1);
mEmailAddressButton = new QPushButton(parent);
mEmailAddressButton->setIcon(SmallIcon(QLatin1String("help-contents")));
int size = mEmailAddressButton->sizeHint().height();
mEmailAddressButton->setFixedSize(size, size);
connect(mEmailAddressButton, SIGNAL(clicked()), SLOT(openAddressBook()));
connect(mEmailAddressButton, &QPushButton::clicked, this, &EditEmailAlarmDlg::openAddressBook);
mEmailAddressButton->setToolTip(i18nc("@info:tooltip", "Open address book"));
mEmailAddressButton->setWhatsThis(i18nc("@info:whatsthis", "Select email addresses from your address book."));
grid->addWidget(mEmailAddressButton, 1, 2);
......@@ -1127,13 +1127,13 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mEmailSubjectEdit->setMinimumSize(mEmailSubjectEdit->sizeHint());
label->setBuddy(mEmailSubjectEdit);
mEmailSubjectEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the email subject."));
connect(mEmailSubjectEdit, SIGNAL(textChanged(QString)), SLOT(contentsChanged()));
connect(mEmailSubjectEdit, &LineEdit::textChanged, this, &EditEmailAlarmDlg::contentsChanged);
grid->addWidget(mEmailSubjectEdit, 2, 1, 1, 2);
// Email body
mEmailMessageEdit = new TextEdit(parent);
mEmailMessageEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the email message."));
connect(mEmailMessageEdit, SIGNAL(textChanged()), SLOT(contentsChanged()));
connect(mEmailMessageEdit, &TextEdit::textChanged, this, &EditEmailAlarmDlg::contentsChanged);
frameLayout->addWidget(mEmailMessageEdit);
// Email attachments
......@@ -1155,12 +1155,12 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
grid->setColumnStretch(1, 1);
mEmailAddAttachButton = new QPushButton(i18nc("@action:button", "Add..."), parent);
connect(mEmailAddAttachButton, SIGNAL(clicked()), SLOT(slotAddAttachment()));
connect(mEmailAddAttachButton, &QPushButton::clicked, this, &EditEmailAlarmDlg::slotAddAttachment);
mEmailAddAttachButton->setWhatsThis(i18nc("@info:whatsthis", "Add an attachment to the email."));
grid->addWidget(mEmailAddAttachButton, 0, 2);
mEmailRemoveButton = new QPushButton(i18nc("@action:button", "Remove"), parent);
connect(mEmailRemoveButton, SIGNAL(clicked()), SLOT(slotRemoveAttachment()));
connect(mEmailRemoveButton, &QPushButton::clicked, this, &EditEmailAlarmDlg::slotRemoveAttachment);
mEmailRemoveButton->setWhatsThis(i18nc("@info:whatsthis", "Remove the highlighted attachment from the email."));
grid->addWidget(mEmailRemoveButton, 1, 2);
......@@ -1168,7 +1168,7 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mEmailBcc = new CheckBox(i18n_chk_CopyEmailToSelf(), parent);
mEmailBcc->setFixedSize(mEmailBcc->sizeHint());
mEmailBcc->setWhatsThis(i18nc("@info:whatsthis", "If checked, the email will be blind copied to you."));
connect(mEmailBcc, SIGNAL(toggled(bool)), SLOT(contentsChanged()));
connect(mEmailBcc, &CheckBox::toggled, this, &EditEmailAlarmDlg::contentsChanged);
grid->addWidget(mEmailBcc, 1, 0, 1, 2, Qt::AlignLeft);
}
......@@ -1526,7 +1526,7 @@ void EditAudioAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mSoundConfig = new SoundWidget(false, true, parent);
if (isTemplate())
mSoundConfig->setAllowEmptyFile();
connect(mSoundConfig, SIGNAL(changed()), SLOT(contentsChanged()));
connect(mSoundConfig, &SoundWidget::changed, this, &EditAudioAlarmDlg::contentsChanged);
frameLayout->addWidget(mSoundConfig);
// Top-adjust the controls
......@@ -1686,7 +1686,7 @@ void EditAudioAlarmDlg::type_executedTry(const QString&, void* result)
if (mMessageWin)
{
slotAudioPlaying(true);
connect(mMessageWin, SIGNAL(destroyed(QObject*)), SLOT(audioWinDestroyed()));
connect(mMessageWin, &MessageWin::destroyed, this, &EditAudioAlarmDlg::audioWinDestroyed);
}
}
......@@ -1735,18 +1735,18 @@ CommandEdit::CommandEdit(QWidget* parent)
mTypeScript = new CheckBox(EditCommandAlarmDlg::i18n_chk_EnterScript(), this);
mTypeScript->setFixedSize(mTypeScript->sizeHint());
mTypeScript->setWhatsThis(i18nc("@info:whatsthis", "Check to enter the contents of a script instead of a shell command line"));
connect(mTypeScript, SIGNAL(toggled(bool)), SLOT(slotCmdScriptToggled(bool)));
connect(mTypeScript, SIGNAL(toggled(bool)), SIGNAL(changed()));
connect(mTypeScript, &CheckBox::toggled, this, &CommandEdit::slotCmdScriptToggled);
connect(mTypeScript, &CheckBox::toggled, this, &CommandEdit::changed);
vlayout->addWidget(mTypeScript, 0, Qt::AlignLeft);
mCommandEdit = new LineEdit(LineEdit::Url, this);
mCommandEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter a shell command to execute."));
connect(mCommandEdit, SIGNAL(textChanged(QString)), SIGNAL(changed()));
connect(mCommandEdit, &LineEdit::textChanged, this, &CommandEdit::changed);
vlayout->addWidget(mCommandEdit);
mScriptEdit = new TextEdit(this);
mScriptEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the contents of a script to execute"));
connect(mScriptEdit, SIGNAL(textChanged()), SIGNAL(changed()));
connect(mScriptEdit, &TextEdit::textChanged, this, &CommandEdit::changed);
vlayout->addWidget(mScriptEdit);
slotCmdScriptToggled(mTypeScript->isChecked());
......
......@@ -174,10 +174,10 @@ MainWindow::MainWindow(bool restored)
mListView->sortByColumn(mShowTime ? AlarmListModel::TimeColumn : AlarmListModel::TimeToColumn, Qt::AscendingOrder);
mListView->setItemDelegate(new AlarmListDelegate(mListView));
connect(mListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(slotSelection()));
connect(mListView, SIGNAL(contextMenuRequested(QPoint)), SLOT(slotContextMenuRequested(QPoint)));
connect(mListView, &AlarmListView::contextMenuRequested, this, &MainWindow::slotContextMenuRequested);
connect(AkonadiModel::instance(), SIGNAL(collectionStatusChanged(Akonadi::Collection,AkonadiModel::Change,QVariant,bool)),
SLOT(slotCalendarStatusChanged()));
connect(mResourceSelector, SIGNAL(resized(QSize,QSize)), SLOT(resourcesResized()));
connect(mResourceSelector, &ResourceSelector::resized, this, &MainWindow::resourcesResized);
mListView->installEventFilter(this);
initActions();
......@@ -422,7 +422,7 @@ void MainWindow::initActions()
mActionTemplates = new QAction(i18nc("@action", "&Templates..."), this);
actions->addAction(QLatin1String("templates"), mActionTemplates);
connect(mActionTemplates, SIGNAL(triggered(bool)), SLOT(slotTemplates()));
connect(mActionTemplates, &QAction::triggered, this, &MainWindow::slotTemplates);
mActionNew = new NewAlarmAction(false, i18nc("@action", "&New"), this);
actions->addAction(QLatin1String("new"), mActionNew);
......@@ -430,65 +430,65 @@ void MainWindow::initActions()
QAction* action = mActionNew->displayAlarmAction();
actions->addAction(QLatin1String("newDisplay"), action);
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, SIGNAL(triggered(bool)), SLOT(slotNewDisplay()));
connect(action, &QAction::triggered, this, &MainWindow::slotNewDisplay);
action = mActionNew->commandAlarmAction();
actions->addAction(QLatin1String("newCommand"), action);
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, SIGNAL(triggered(bool)), SLOT(slotNewCommand()));
connect(action, &QAction::triggered, this, &MainWindow::slotNewCommand);
action = mActionNew->emailAlarmAction();
actions->addAction(QLatin1String("newEmail"), action);
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, SIGNAL(triggered(bool)), SLOT(slotNewEmail()));
connect(action, &QAction::triggered, this, &MainWindow::slotNewEmail);
action = mActionNew->audioAlarmAction();
actions->addAction(QLatin1String("newAudio"), action);
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, SIGNAL(triggered(bool)), SLOT(slotNewAudio()));
connect(action, &QAction::triggered, this, &MainWindow::slotNewAudio);
action = mActionNew->fromTemplateAlarmAction();
actions->addAction(QLatin1String("newFromTemplate"), action);
connect(action, SIGNAL(selected(const KAEvent*)), SLOT(slotNewFromTemplate(const KAEvent*)));
TemplateMenuAction *templateMenuAction = mActionNew->fromTemplateAlarmAction();
actions->addAction(QLatin1String("newFromTemplate"), templateMenuAction);
connect(templateMenuAction, &TemplateMenuAction::selected, this, &MainWindow::slotNewFromTemplate);
mActionCreateTemplate = new QAction(i18nc("@action", "Create Tem&plate..."), this);
actions->addAction(QLatin1String("createTemplate"), mActionCreateTemplate);
connect(mActionCreateTemplate, SIGNAL(triggered(bool)), SLOT(slotNewTemplate()));
connect(mActionCreateTemplate, &QAction::triggered, this, &MainWindow::slotNewTemplate);
mActionCopy = new QAction(QIcon::fromTheme(QLatin1String("edit-copy")), i18nc("@action", "&Copy..."), this);
actions->addAction(QLatin1String("copy"), mActionCopy);
actions->setDefaultShortcut(mActionCopy, QKeySequence(Qt::SHIFT + Qt::Key_Insert));
connect(mActionCopy, SIGNAL(triggered(bool)), SLOT(slotCopy()));
connect(mActionCopy, &QAction::triggered, this, &MainWindow::slotCopy);
mActionModify = new QAction(QIcon::fromTheme(QLatin1String("document-properties")), i18nc("@action", "&Edit..."), this);
actions->addAction(QLatin1String("modify"), mActionModify);
actions->setDefaultShortcut(mActionModify, QKeySequence(Qt::CTRL + Qt::Key_E));
connect(mActionModify, SIGNAL(triggered(bool)), SLOT(slotModify()));
connect(mActionModify, &QAction::triggered, this, &MainWindow::slotModify);
mActionDelete = new QAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18nc("@action", "&Delete"), this);
actions->addAction(QLatin1String("delete"), mActionDelete);
actions->setDefaultShortcut(mActionDelete, QKeySequence::Delete);
connect(mActionDelete, SIGNAL(triggered(bool)), SLOT(slotDeleteIf()));
connect(mActionDelete, &QAction::triggered, this, &MainWindow::slotDeleteIf);
// Set up Shift-Delete as a shortcut to delete without confirmation
mActionDeleteForce = new QAction(i18nc("@action", "Delete Without Confirmation"), this);
actions->addAction(QLatin1String("delete-force"), mActionDeleteForce);
actions->setDefaultShortcut(mActionDeleteForce, QKeySequence::Delete + Qt::SHIFT);
connect(mActionDeleteForce, SIGNAL(triggered(bool)), SLOT(slotDeleteForce()));
connect(mActionDeleteForce, &QAction::triggered, this, &MainWindow::slotDeleteForce);
mActionReactivate = new QAction(i18nc("@action", "Reac&tivate"), this);
actions->addAction(QLatin1String("undelete"), mActionReactivate);
actions->setDefaultShortcut(mActionReactivate, QKeySequence(Qt::CTRL + Qt::Key_R));
connect(mActionReactivate, SIGNAL(triggered(bool)), SLOT(slotReactivate()));
connect(mActionReactivate, &QAction::triggered, this, &MainWindow::slotReactivate);
mActionEnable = new QAction(this);
actions->addAction(QLatin1String("disable"), mActionEnable);
actions->setDefaultShortcut(mActionEnable, QKeySequence(Qt::CTRL + Qt::Key_B));
connect(mActionEnable, SIGNAL(triggered(bool)), SLOT(slotEnable()));
connect(mActionEnable, &QAction::triggered, this, &MainWindow::slotEnable);
action = new QAction(i18nc("@action", "Wake From Suspend..."), this);
actions->addAction(QLatin1String("wakeSuspend"), action);
connect(action, SIGNAL(triggered(bool)), SLOT(slotWakeFromSuspend()));
connect(action, &QAction::triggered, this, &MainWindow::slotWakeFromSuspend);
action = KAlarm::createStopPlayAction(this);
actions->addAction(QLatin1String("stopAudio"), action);
......@@ -496,25 +496,25 @@ void MainWindow::initActions()
mActionShowTime = new KToggleAction(i18n_a_ShowAlarmTimes(), this);
actions->addAction(QLatin1String("showAlarmTimes"), mActionShowTime);
connect(mActionShowTime, SIGNAL(triggered(bool)), SLOT(slotShowTime()));
connect(mActionShowTime, &KToggleAction::triggered, this, &MainWindow::slotShowTime);
mActionShowTimeTo = new KToggleAction(i18n_o_ShowTimeToAlarms(), this);
actions->addAction(QLatin1String("showTimeToAlarms"), mActionShowTimeTo);
actions->setDefaultShortcut(mActionShowTimeTo, QKeySequence(Qt::CTRL + Qt::Key_I));
connect(mActionShowTimeTo, SIGNAL(triggered(bool)), SLOT(slotShowTimeTo()));
connect(mActionShowTimeTo, &KToggleAction::triggered, this, &MainWindow::slotShowTimeTo);
mActionShowArchived = new KToggleAction(i18nc("@action", "Show Archi&ved Alarms"), this);
actions->addAction(QLatin1String("showArchivedAlarms"), mActionShowArchived);
actions->setDefaultShortcut(mActionShowArchived, QKeySequence(Qt::CTRL + Qt::Key_P));
connect(mActionShowArchived, SIGNAL(triggered(bool)), SLOT(slotShowArchived()));
connect(mActionShowArchived, &KToggleAction::triggered, this, &MainWindow::slotShowArchived);
mActionToggleTrayIcon = new KToggleAction(i18nc("@action", "Show in System &Tray"), this);
actions->addAction(QLatin1String("showInSystemTray"), mActionToggleTrayIcon);
connect(mActionToggleTrayIcon, SIGNAL(triggered(bool)), SLOT(slotToggleTrayIcon()));
connect(mActionToggleTrayIcon, &KToggleAction::triggered, this, &MainWindow::slotToggleTrayIcon);
mActionToggleResourceSel = new KToggleAction(QIcon::fromTheme(QLatin1String("view-choose")), i18nc("@action", "Show &Calendars"), this);
actions->addAction(QLatin1String("showResources"), mActionToggleResourceSel);
connect(mActionToggleResourceSel, SIGNAL(triggered(bool)), SLOT(slotToggleResourceSelector()));
connect(mActionToggleResourceSel, &KToggleAction::triggered, this, &MainWindow::slotToggleResourceSelector);
mActionSpreadWindows = KAlarm::createSpreadWindowsAction(this);
actions->addAction(QLatin1String("spread"), mActionSpreadWindows);
......@@ -522,23 +522,23 @@ void MainWindow::initActions()
mActionImportAlarms = new QAction(i18nc("@action", "Import &Alarms..."), this);
actions->addAction(QLatin1String("importAlarms"), mActionImportAlarms);
connect(mActionImportAlarms, SIGNAL(triggered(bool)), SLOT(slotImportAlarms()));
connect(mActionImportAlarms, &QAction::triggered, this, &MainWindow::slotImportAlarms);
mActionImportBirthdays = new QAction(i18nc("@action", "Import &Birthdays..."), this);
actions->addAction(QLatin1String("importBirthdays"), mActionImportBirthdays);
connect(mActionImportBirthdays, SIGNAL(triggered(bool)), SLOT(slotBirthdays()));
connect(mActionImportBirthdays, &QAction::triggered, this, &MainWindow::slotBirthdays);
mActionExportAlarms = new QAction(i18nc("@action", "E&xport Selected Alarms..."), this);
actions->addAction(QLatin1String("exportAlarms"), mActionExportAlarms);
connect(mActionExportAlarms, SIGNAL(triggered(bool)), SLOT(slotExportAlarms()));
connect(mActionExportAlarms, &QAction::triggered, this, &MainWindow::slotExportAlarms);
mActionExport = new QAction(i18nc("@action", "E&xport..."), this);
actions->addAction(QLatin1String("export"), mActionExport);
connect(mActionExport, SIGNAL(triggered(bool)), SLOT(slotExportAlarms()));
connect(mActionExport, &QAction::triggered, this, &MainWindow::slotExportAlarms);
action = new QAction(QIcon::fromTheme(QLatin1String("view-refresh")), i18nc("@action", "&Refresh Alarms"), this);
actions->addAction(QLatin1String("refreshAlarms"), action);
connect(action, SIGNAL(triggered(bool)), SLOT(slotRefreshAlarms()));
connect(action, &QAction::triggered, this, &MainWindow::slotRefreshAlarms);
KToggleAction* toggleAction = KAlarm::createAlarmEnableAction(this);
actions->addAction(QLatin1String("alarmsEnable"), toggleAction);
......@@ -559,12 +559,12 @@ void MainWindow::initActions()
mActionUndo = new KToolBarPopupAction(QIcon::fromTheme(QLatin1String("edit-undo")), undoText, this);
actions->addAction(QLatin1String("edit_undo"), mActionUndo);
mActionUndo->setShortcuts(undoShortcut);
connect(mActionUndo, SIGNAL(triggered(bool)), SLOT(slotUndo()));
connect(mActionUndo, &KToolBarPopupAction::triggered, this, &MainWindow::slotUndo);
mActionRedo = new KToolBarPopupAction(QIcon::fromTheme(QLatin1String("edit-redo")), redoText, this);
actions->addAction(QLatin1String("edit_redo"), mActionRedo);
mActionRedo->setShortcuts(redoShortcut);
connect(mActionRedo, SIGNAL(triggered(bool)), SLOT(slotRedo()));
connect(mActionRedo, &KToolBarPopupAction::triggered, this, &MainWindow::slotRedo);
KStandardAction::find(mListView, SLOT(slotFind()), actions);
mActionFindNext = KStandardAction::findNext(mListView, SLOT(slotFindNext()), actions);
......@@ -574,7 +574,7 @@ void MainWindow::initActions()
// Quit only once the event loop is called; otherwise, the parent window will
// be deleted while still processing the action, resulting in a crash.
QAction* act = KStandardAction::quit(0, 0, actions);
connect(act, SIGNAL(triggered(bool)), SLOT(slotQuit()), Qt::QueuedConnection);
connect(act, &QAction::triggered, this, &MainWindow::slotQuit, Qt::QueuedConnection);
KStandardAction::keyBindings(this, SLOT(slotConfigureKeys()), actions);
KStandardAction::configureToolbars(this, SLOT(slotConfigureToolbar()), actions);
KStandardAction::preferences(this, SLOT(slotPreferences()), actions);
......@@ -594,7 +594,7 @@ void MainWindow::initActions()
connect(mActionRedo->menu(), SIGNAL(aboutToShow()), SLOT(slotInitRedoMenu()));
connect(mActionRedo->menu(), SIGNAL(triggered(QAction*)), SLOT(slotRedoItem(QAction*)));
connect(Undo::instance(), SIGNAL(changed(QString,QString)), SLOT(slotUndoStatus(QString,QString)));
connect(mListView, SIGNAL(findActive(bool)), SLOT(slotFindActive(bool)));
connect(mListView, &AlarmListView::findActive, this, &MainWindow::slotFindActive);
Preferences::connect(SIGNAL(archivedKeepDaysChanged(int)), this, SLOT(updateKeepArchived(int)));
Preferences::connect(SIGNAL(showInSystemTrayChanged(bool)), this, SLOT(updateTrayIconAction()));
connect(theApp(), SIGNAL(trayIconToggled()), SLOT(updateTrayIconAction()));
......@@ -1173,7 +1173,7 @@ void MainWindow::slotConfigureToolbar()
KConfigGroup grp(KSharedConfig::openConfig()->group(WINDOW_NAME));
saveMainWindowSettings(grp);
KEditToolBar dlg(factory());
connect(&dlg, SIGNAL(newToolBarConfig()), this, SLOT(slotNewToolbarConfig()));
connect(&dlg, &KEditToolBar::newToolBarConfig, this, &MainWindow::slotNewToolbarConfig);
dlg.exec();
}
......@@ -1556,8 +1556,8 @@ MainWindow* MainWindow::toggleWindow(MainWindow* win)
void MainWindow::editAlarm(EditAlarmDlg* dlg, const KAEvent& event)
{
mEditAlarmMap[dlg] = event;
connect(dlg, SIGNAL(accepted()), SLOT(editAlarmOk()));
connect(dlg, SIGNAL(destroyed(QObject*)), SLOT(editAlarmDeleted(QObject*)));
connect(dlg, &KEditToolBar::accepted, this, &MainWindow::editAlarmOk);
connect(dlg, &KEditToolBar::destroyed, this, &MainWindow::editAlarmDeleted);
dlg->setAttribute(Qt::WA_DeleteOnClose, true); // ensure no memory leaks
dlg->show();
}
......
......@@ -66,8 +66,7 @@ Reminder::Reminder(const QString& reminderWhatsThis, const QString& valueWhatsTh
mTime->setFixedSize(mTime->sizeHint());
connect(mTime, &TimeSelector::toggled, this, &Reminder::slotReminderToggled);
connect(mTime, &TimeSelector::valueChanged, this, &Reminder::changed);
connect(mTimeSignCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged),
this, &Reminder::changed);
connect(mTimeSignCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &Reminder::changed);
topLayout->addWidget(mTime, 0, Qt::AlignLeft);
if (showOnceOnly)
......
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