Commit 85b34d6c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_EMIT

parent d5069a33
......@@ -838,7 +838,7 @@ void ActionManager::writeSettings()
/*
void ActionManager::file_new()
{
emit actionNewMainWindow();
Q_EMIT actionNewMainWindow();
}
*/
......
......@@ -233,7 +233,7 @@ Q_SIGNALS:
void toggleMenuBar();
/**
When change is made to options dialog, the topwidget will catch this
and emit this signal which notifies all widgets which have registered
and Q_EMIT this signal which notifies all widgets which have registered
for notification to update their settings.
*/
void configChanged();
......
......@@ -363,7 +363,7 @@ void AkonadiCollectionView::setDefaultCalendar()
updateMenu();
updateView();
emit defaultResourceChanged(collection);
Q_EMIT defaultResourceChanged(collection);
}
void AkonadiCollectionView::assignColor()
......@@ -379,7 +379,7 @@ void AkonadiCollectionView::assignColor()
myColor = QColorDialog::getColor(defaultColor);
if (myColor.isValid() && myColor != defaultColor) {
KOPrefs::instance()->setResourceColor(identifier, myColor);
emit colorsChanged();
Q_EMIT colorsChanged();
updateMenu();
updateView();
}
......@@ -395,7 +395,7 @@ void AkonadiCollectionView::disableColor()
KOPrefs::instance()->setResourceColor(identifier, QColor());
updateMenu();
updateView();
emit colorsChanged();
Q_EMIT colorsChanged();
}
void AkonadiCollectionView::setCollectionSelectionProxyModel(KCheckableProxyModel *m)
......@@ -424,7 +424,7 @@ Akonadi::EntityTreeView *AkonadiCollectionView::view() const
void AkonadiCollectionView::updateView()
{
emit resourcesChanged(mSelectionProxyModel ?
Q_EMIT resourcesChanged(mSelectionProxyModel ?
mSelectionProxyModel->selectionModel()->hasSelection() :
false);
}
......@@ -562,7 +562,7 @@ void AkonadiCollectionView::deleteCalendarDone(KJob *job)
void AkonadiCollectionView::rowsInserted(const QModelIndex &, int, int)
{
if (!mNotSendAddRemoveSignal) {
emit resourcesAddedRemoved();
Q_EMIT resourcesAddedRemoved();
}
restoreTreeState();
}
......
......@@ -624,7 +624,7 @@ void CalendarView::updateConfig(const QByteArray &receiver)
// if there weren't changed they are ignored
updateHighlightModes();
emit configChanged();
Q_EMIT configChanged();
//switch beetween merged, side by side and tabbed agenda if needed
mViewManager->updateMultiCalendarDisplay();
......@@ -1766,7 +1766,7 @@ void CalendarView::setReadOnly(bool readOnly)
{
if (mReadOnly != readOnly) {
mReadOnly = readOnly;
emit readOnlyChanged(mReadOnly);
Q_EMIT readOnlyChanged(mReadOnly);
}
}
......@@ -1926,11 +1926,11 @@ void CalendarView::adaptNavigationUnits()
if (mViewManager->currentView()->isEventView()) {
int days = mViewManager->currentView()->currentDateCount();
if (days == 1) {
emit changeNavStringPrev(i18n("&Previous Day"));
emit changeNavStringNext(i18n("&Next Day"));
Q_EMIT changeNavStringPrev(i18n("&Previous Day"));
Q_EMIT changeNavStringNext(i18n("&Next Day"));
} else {
emit changeNavStringPrev(i18n("&Previous Week"));
emit changeNavStringNext(i18n("&Next Week"));
Q_EMIT changeNavStringPrev(i18n("&Previous Week"));
Q_EMIT changeNavStringNext(i18n("&Next Week"));
}
}
}
......@@ -1956,7 +1956,7 @@ void CalendarView::processIncidenceSelection(const Akonadi::Item &item, const QD
KCalCore::Incidence::Ptr incidence = CalendarSupport::incidence(item);
if (item != mSelectedIncidence) {
// This signal also must be emitted if incidence is 0
emit incidenceSelected(item, date);
Q_EMIT incidenceSelected(item, date);
}
if (!incidence) {
......@@ -1983,15 +1983,15 @@ void CalendarView::processIncidenceSelection(const Akonadi::Item &item, const QD
todo = true;
subtodo = (incidence->relatedTo() != QString());
}
emit todoSelected(todo);
emit subtodoSelected(subtodo);
emit organizerEventsSelected(organizerEvents);
emit groupEventsSelected(groupEvents);
Q_EMIT todoSelected(todo);
Q_EMIT subtodoSelected(subtodo);
Q_EMIT organizerEventsSelected(organizerEvents);
Q_EMIT groupEventsSelected(groupEvents);
}
void CalendarView::checkClipboard()
{
emit pasteEnabled(mCalendarClipboard->pasteAvailable());
Q_EMIT pasteEnabled(mCalendarClipboard->pasteAvailable());
}
void CalendarView::showDates(const KCalCore::DateList &selectedDates, const QDate &preferredMonth)
......@@ -2029,7 +2029,7 @@ void CalendarView::updateFilter()
// account for the additional "No filter" at the beginning! if the
// filter is not in the list, pos == -1...
emit filtersUpdated(filters, pos + 1);
Q_EMIT filtersUpdated(filters, pos + 1);
mCalendar->setFilter(mCurrentFilter);
}
......@@ -2046,7 +2046,7 @@ void CalendarView::filterActivated(int filterNo)
mViewManager->addChange(EventViews::EventView::FilterChanged);
updateView();
}
emit filterChanged();
Q_EMIT filterChanged();
}
bool CalendarView::isFiltered() const
......@@ -2142,7 +2142,7 @@ void CalendarView::showLeftFrame(bool show)
if (show) {
mMainSplitterSizes.clear();
mLeftFrame->show();
emit calendarViewExpanded(false);
Q_EMIT calendarViewExpanded(false);
} else {
// mPanner splitter sizes are useless if mLeftFrame is hidden, so remember them beforehand.
if (mMainSplitterSizes.isEmpty()) {
......@@ -2150,7 +2150,7 @@ void CalendarView::showLeftFrame(bool show)
}
mLeftFrame->hide();
emit calendarViewExpanded(true);
Q_EMIT calendarViewExpanded(true);
}
}
......
......@@ -211,7 +211,7 @@ public:
Q_SIGNALS:
/** when change is made to options dialog, the topwidget will catch this
* and emit this signal which notifies all widgets which have registered
* and Q_EMIT this signal which notifies all widgets which have registered
* for notification to update their settings. */
void configChanged();
......@@ -593,7 +593,7 @@ public Q_SLOTS:
void slotAutoArchivingSettingsModified()
{
emit autoArchivingSettingsModified();
Q_EMIT autoArchivingSettingsModified();
}
void showErrorMessage(const QString &);
......
......@@ -65,10 +65,10 @@ void DateChecker::passedMidnight()
if (today.month() != mLastDayChecked.month()) {
if (mUpdateRollover == FollowMonth) {
emit monthPassed(today);
Q_EMIT monthPassed(today);
}
}
emit dayPassed(today);
Q_EMIT dayPassed(today);
}
void DateChecker::possiblyPastMidnight()
......
......@@ -311,6 +311,6 @@ void DateNavigator::selectYear(int year)
void DateNavigator::emitSelected(const QDate &preferredMonth)
{
emit datesSelected(mSelectedDates, preferredMonth);
Q_EMIT datesSelected(mSelectedDates, preferredMonth);
}
......@@ -335,7 +335,7 @@ void DateNavigatorContainer::goNextMonth()
{
const QPair<QDate, QDate> p = dateLimits(1);
emit nextMonthClicked(mNavigatorView->month(),
Q_EMIT nextMonthClicked(mNavigatorView->month(),
p.first,
p.second);
}
......@@ -344,7 +344,7 @@ void DateNavigatorContainer::goPrevMonth()
{
const QPair<QDate, QDate> p = dateLimits(-1);
emit prevMonthClicked(mNavigatorView->month(),
Q_EMIT prevMonthClicked(mNavigatorView->month(),
p.first,
p.second);
}
......@@ -392,7 +392,7 @@ void DateNavigatorContainer::handleDatesSelectedSignal(const KCalCore::DateList
KDateNavigator *navigator = firstNavigatorForDate(firstDate);
navigator = navigator ? navigator : qobject_cast<KDateNavigator *>(sender());
emit datesSelected(dateList, navigator->month());
Q_EMIT datesSelected(dateList, navigator->month());
}
void DateNavigatorContainer::handleWeekClickedSignal(const QDate &week, const QDate &)
......@@ -401,7 +401,7 @@ void DateNavigatorContainer::handleWeekClickedSignal(const QDate &week, const QD
KDateNavigator *navigator = firstNavigatorForDate(week);
navigator = navigator ? navigator : qobject_cast<KDateNavigator *>(sender());
emit weekClicked(week, navigator->month());
Q_EMIT weekClicked(week, navigator->month());
}
KDateNavigator *DateNavigatorContainer::firstNavigatorForDate(const QDate &date) const
......
......@@ -96,13 +96,13 @@ void ExportWebDialog::writeConfig()
void ExportWebDialog::slotApply()
{
writeConfig();
emit configChanged();
Q_EMIT configChanged();
}
void ExportWebDialog::slotOk()
{
slotApply();
emit exportHTML(mSettings);
Q_EMIT exportHTML(mSettings);
accept();
}
......
......@@ -185,7 +185,7 @@ void FilterEdit::saveChanges()
}
}
mCurrent->setCategoryList(categoryList);
emit filterChanged();
Q_EMIT filterChanged();
}
void FilterEdit::filterSelected()
......@@ -248,7 +248,7 @@ void FilterEdit::bNewPressed()
mFilters->append(newFilter);
updateFilterList();
mRulesList->setCurrentRow(mRulesList->count() - 1);
emit filterChanged();
Q_EMIT filterChanged();
}
void FilterEdit::bDeletePressed()
......@@ -276,7 +276,7 @@ void FilterEdit::bDeletePressed()
mCurrent = Q_NULLPTR;
updateFilterList();
mRulesList->setCurrentRow(qMin(mRulesList->count() - 1, selected));
emit filterChanged();
Q_EMIT filterChanged();
}
void FilterEdit::updateSelectedName(const QString &newText)
......@@ -288,7 +288,7 @@ void FilterEdit::updateSelectedName(const QString &newText)
}
mRulesList->blockSignals(false);
if (correctName(newText)) {
emit dataConsistent(false);
Q_EMIT dataConsistent(false);
return;
}
bool allOk = true;
......@@ -299,7 +299,7 @@ void FilterEdit::updateSelectedName(const QString &newText)
}
}
emit dataConsistent(allOk);
Q_EMIT dataConsistent(allOk);
}
bool FilterEdit::correctName(const QString &newText)
......
......@@ -435,7 +435,7 @@ void KCMDesignerFields::itemClicked(QTreeWidgetItem *item)
PageItem *pageItem = static_cast<PageItem *>(item);
if (pageItem->isOn() != pageItem->isActive()) {
emit changed(true);
Q_EMIT changed(true);
pageItem->setIsActive(pageItem->isOn());
}
}
......
......@@ -34,13 +34,13 @@ bool KOCheckableProxyModel::setData(const QModelIndex &index,
{
Qt::CheckState newState = static_cast<Qt::CheckState>(value.toInt());
if (role == Qt::CheckStateRole && index.column() == 0) {
emit aboutToToggle(newState);
Q_EMIT aboutToToggle(newState);
}
const bool result = KCheckableProxyModel::setData(index, value, role);
if (result) {
emit toggled(newState);
Q_EMIT toggled(newState);
}
return result;
}
......
......@@ -527,11 +527,11 @@ void KODayMatrix::popupMenu(const QDate &date)
QIcon::fromTheme(QStringLiteral("journal-new")), i18n("New &Journal..."));
QAction *ret = popup.exec(QCursor::pos());
if (ret == newEventAction) {
emit newEventSignal(date);
Q_EMIT newEventSignal(date);
} else if (ret == newTodoAction) {
emit newTodoSignal(date);
Q_EMIT newTodoSignal(date);
} else if (ret == newJournalAction) {
emit newJournalSignal(date);
Q_EMIT newJournalSignal(date);
}
}
......@@ -569,7 +569,7 @@ void KODayMatrix::mouseReleaseEvent(QMouseEvent *e)
for (int i = mSelStart; i <= mSelEnd; ++i) {
daylist.append(mDays[i]);
}
emit selected(static_cast<const KCalCore::DateList>(daylist));
Q_EMIT selected(static_cast<const KCalCore::DateList>(daylist));
}
void KODayMatrix::mouseMoveEvent(QMouseEvent *e)
......@@ -702,9 +702,9 @@ void KODayMatrix::dropEvent(QDropEvent *e)
int idx = getDayIndexFrom(e->pos().x(), e->pos().y());
if (action == DRAG_COPY) {
emit incidenceDropped(items.at(0), mDays[idx]);
Q_EMIT incidenceDropped(items.at(0), mDays[idx]);
} else if (action == DRAG_MOVE) {
emit incidenceDroppedMove(items.at(0), mDays[idx]);
Q_EMIT incidenceDroppedMove(items.at(0), mDays[idx]);
}
}
}
......
......@@ -147,14 +147,14 @@ void KOEventPopupMenu::showIncidencePopup(const Akonadi::Item &item, const QDate
void KOEventPopupMenu::popupShow()
{
if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
emit showIncidenceSignal(mCurrentIncidence);
Q_EMIT showIncidenceSignal(mCurrentIncidence);
}
}
void KOEventPopupMenu::popupEdit()
{
if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
emit editIncidenceSignal(mCurrentIncidence);
Q_EMIT editIncidenceSignal(mCurrentIncidence);
}
}
......@@ -186,40 +186,40 @@ void KOEventPopupMenu::printPreview()
void KOEventPopupMenu::popupDelete()
{
if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
emit deleteIncidenceSignal(mCurrentIncidence);
Q_EMIT deleteIncidenceSignal(mCurrentIncidence);
}
}
void KOEventPopupMenu::popupCut()
{
if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
emit cutIncidenceSignal(mCurrentIncidence);
Q_EMIT cutIncidenceSignal(mCurrentIncidence);
}
}
void KOEventPopupMenu::popupCopy()
{
if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
emit copyIncidenceSignal(mCurrentIncidence);
Q_EMIT copyIncidenceSignal(mCurrentIncidence);
}
}
void KOEventPopupMenu::popupPaste()
{
emit pasteIncidenceSignal();
Q_EMIT pasteIncidenceSignal();
}
void KOEventPopupMenu::toggleAlarm()
{
if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
emit toggleAlarmSignal(mCurrentIncidence);
Q_EMIT toggleAlarmSignal(mCurrentIncidence);
}
}
void KOEventPopupMenu::dissociateOccurrences()
{
if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
emit dissociateOccurrencesSignal(mCurrentIncidence, mCurrentDate);
Q_EMIT dissociateOccurrencesSignal(mCurrentIncidence, mCurrentDate);
}
}
......@@ -242,7 +242,7 @@ void KOEventPopupMenu::forward()
void KOEventPopupMenu::toggleTodoCompleted()
{
if (CalendarSupport::hasTodo(mCurrentIncidence)) {
emit toggleTodoCompletedSignal(mCurrentIncidence);
Q_EMIT toggleTodoCompletedSignal(mCurrentIncidence);
}
}
......
......@@ -104,35 +104,35 @@ QMenu *KOEventView::newEventPopup()
void KOEventView::popupShow()
{
emit showIncidenceSignal(mCurrentIncidence);
Q_EMIT showIncidenceSignal(mCurrentIncidence);
}
//---------------------------------------------------------------------------
void KOEventView::popupEdit()
{
emit editIncidenceSignal(mCurrentIncidence);
Q_EMIT editIncidenceSignal(mCurrentIncidence);
}
//---------------------------------------------------------------------------
void KOEventView::popupDelete()
{
emit deleteIncidenceSignal(mCurrentIncidence);
Q_EMIT deleteIncidenceSignal(mCurrentIncidence);
}
//---------------------------------------------------------------------------
void KOEventView::popupCut()
{
emit cutIncidenceSignal(mCurrentIncidence);
Q_EMIT cutIncidenceSignal(mCurrentIncidence);
}
//---------------------------------------------------------------------------
void KOEventView::popupCopy()
{
emit copyIncidenceSignal(mCurrentIncidence);
Q_EMIT copyIncidenceSignal(mCurrentIncidence);
}
//---------------------------------------------------------------------------
......@@ -160,9 +160,9 @@ void KOEventView::defaultAction(const Akonadi::Item &aitem)
}
if (!calendar()->hasRight(aitem, Akonadi::Collection::CanChangeItem)) {
emit showIncidenceSignal(aitem);
Q_EMIT showIncidenceSignal(aitem);
} else {
emit editIncidenceSignal(aitem);
Q_EMIT editIncidenceSignal(aitem);
}
}
......
......@@ -272,10 +272,10 @@ bool ApptSummaryWidget::eventFilter(QObject *obj, QEvent *e)
if (obj->inherits("KUrlLabel")) {
KUrlLabel *label = static_cast<KUrlLabel *>(obj);
if (e->type() == QEvent::Enter) {
emit message(i18n("Edit Event: \"%1\"", label->text()));
Q_EMIT message(i18n("Edit Event: \"%1\"", label->text()));
}
if (e->type() == QEvent::Leave) {
emit message(QString());
Q_EMIT message(QString());
}
}
......
......@@ -71,7 +71,7 @@ KCMApptSummary::KCMApptSummary(QWidget *parent)
void KCMApptSummary::modified()
{
emit changed(true);
Q_EMIT changed(true);
}
void KCMApptSummary::buttonClicked(int id)
......@@ -108,7 +108,7 @@ void KCMApptSummary::load()
group = config.group("Groupware");
mShowMineOnly->setChecked(group.readEntry("ShowMineOnly", false));
emit changed(false);
Q_EMIT changed(false);
}
void KCMApptSummary::save()
......@@ -140,7 +140,7 @@ void KCMApptSummary::save()
group.writeEntry("ShowMineOnly", mShowMineOnly->isChecked());
config.sync();
emit changed(false);
Q_EMIT changed(false);
}
void KCMApptSummary::defaults()
......@@ -154,7 +154,7 @@ void KCMApptSummary::defaults()
mShowMineOnly->setChecked(false);
emit changed(true);
Q_EMIT changed(true);
}
const KAboutData *KCMApptSummary::aboutData() const
......
......@@ -69,7 +69,7 @@ KCMTodoSummary::~KCMTodoSummary()
void KCMTodoSummary::modified()
{
emit changed(true);
Q_EMIT changed(true);
}
void KCMTodoSummary::customDaysChanged(int value)
......@@ -103,7 +103,7 @@ void KCMTodoSummary::load()
group = config.group("Groupware");
mShowMineOnly->setChecked(group.readEntry("ShowMineOnly", false));
emit changed(false);
Q_EMIT changed(false);
}
void KCMTodoSummary::save()
......@@ -132,7 +132,7 @@ void KCMTodoSummary::save()
group.writeEntry("ShowMineOnly", mShowMineOnly->isChecked());
config.sync();
emit changed(false);
Q_EMIT changed(false);
}
void KCMTodoSummary::defaults()
......@@ -149,7 +149,7 @@ void KCMTodoSummary::defaults()
mShowMineOnly->setChecked(false);
emit changed(true);
Q_EMIT changed(true);
}
const KAboutData *KCMTodoSummary::aboutData() const
......
......@@ -379,10 +379,10 @@ bool TodoSummaryWidget::eventFilter(QObject *obj, QEvent *e)
if (obj->inherits("KUrlLabel")) {
KUrlLabel *label = static_cast<KUrlLabel *>(obj);
if (e->type() == QEvent::Enter) {
emit message(i18n("Edit To-do: \"%1\"", label->text()));
Q_EMIT message(i18n("Edit To-do: \"%1\"", label->text()));
}
if (e->type() == QEvent::Leave) {
emit message(QString());
Q_EMIT message(QString());
}
}
return KontactInterface::Summary::eventFilter(obj, e);
......
......@@ -70,7 +70,7 @@ KCMSDSummary::KCMSDSummary(QWidget *parent)
void KCMSDSummary::modified()
{
emit changed(true);
Q_EMIT changed(true);
}
void KCMSDSummary::buttonClicked(int id)
......@@ -114,7 +114,7 @@ void KCMSDSummary::load()
group = config.group("Groupware");
mShowMineOnly->setChecked(group.readEntry("ShowMineOnly", false));
emit changed(false);
Q_EMIT changed(false);
}
void KCMSDSummary::save()
......@@ -149,7 +149,7 @@ void KCMSDSummary::save()
group.writeEntry("ShowMineOnly", mShowMineOnly->isChecked());
group.sync();
emit changed(false);
Q_EMIT changed(false);
}
void KCMSDSummary::defaults()
......@@ -167,7 +167,7 @@ void KCMSDSummary::defaults()
mShowMineOnly->setChecked(false);
emit changed(true);
Q_EMIT changed(true);
}
const KAboutData *KCMSDSummary::aboutData() const
......
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