Commit d1f78490 authored by Glen Ditchfield's avatar Glen Ditchfield 🐛
Browse files

Remove some SIGNAL and SLOT macros

parent ef3e58f2
Pipeline #170548 passed with stage
in 1 minute and 40 seconds
......@@ -534,60 +534,34 @@ void TodoModel::setSourceModel(QAbstractItemModel *model)
beginResetModel();
if (sourceModel()) {
disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), d.get(), SLOT(onDataChanged(QModelIndex, QModelIndex)));
disconnect(sourceModel(), SIGNAL(headerDataChanged(Qt::Orientation, int, int)), d.get(), SLOT(onHeaderDataChanged(Qt::Orientation, int, int)));
disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), d.get(), SLOT(onRowsInserted(QModelIndex, int, int)));
disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), d.get(), SLOT(onRowsRemoved(QModelIndex, int, int)));
disconnect(sourceModel(),
SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)),
d.get(),
SLOT(onRowsMoved(QModelIndex, int, int, QModelIndex, int)));
disconnect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)), d.get(), SLOT(onRowsAboutToBeInserted(QModelIndex, int, int)));
disconnect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), d.get(), SLOT(onRowsAboutToBeRemoved(QModelIndex, int, int)));
disconnect(sourceModel(), SIGNAL(modelAboutToBeReset()), d.get(), SLOT(onModelAboutToBeReset()));
disconnect(sourceModel(), SIGNAL(modelReset()), d.get(), SLOT(onModelReset()));
disconnect(sourceModel(), SIGNAL(layoutAboutToBeChanged()), d.get(), SLOT(onLayoutAboutToBeChanged()));
disconnect(sourceModel(), SIGNAL(layoutChanged()), d.get(), SLOT(onLayoutChanged()));
disconnect(sourceModel(), &QAbstractItemModel::dataChanged, d.get(), &TodoModelPrivate::onDataChanged);
disconnect(sourceModel(), &QAbstractItemModel::headerDataChanged, d.get(), &TodoModelPrivate::onHeaderDataChanged);
disconnect(sourceModel(), &QAbstractItemModel::rowsInserted, d.get(), &TodoModelPrivate::onRowsInserted);
disconnect(sourceModel(), &QAbstractItemModel::rowsRemoved, d.get(), &TodoModelPrivate::onRowsRemoved);
disconnect(sourceModel(), &QAbstractItemModel::rowsMoved, d.get(), &TodoModelPrivate::onRowsMoved);
disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted, d.get(), &TodoModelPrivate::onRowsAboutToBeInserted);
disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved, d.get(), &TodoModelPrivate::onRowsAboutToBeRemoved);
disconnect(sourceModel(), &QAbstractItemModel::modelAboutToBeReset, d.get(), &TodoModelPrivate::onModelAboutToBeReset);
disconnect(sourceModel(), &QAbstractItemModel::modelReset, d.get(), &TodoModelPrivate::onModelReset);
disconnect(sourceModel(), &QAbstractItemModel::layoutAboutToBeChanged, d.get(), &TodoModelPrivate::onLayoutAboutToBeChanged);
disconnect(sourceModel(), &QAbstractItemModel::layoutChanged, d.get(), &TodoModelPrivate::onLayoutChanged);
}
QAbstractProxyModel::setSourceModel(model);
if (sourceModel()) {
connect(sourceModel(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), d.get(), SLOT(onDataChanged(QModelIndex, QModelIndex)));
connect(sourceModel(), SIGNAL(headerDataChanged(Qt::Orientation, int, int)), d.get(), SLOT(onHeaderDataChanged(Qt::Orientation, int, int)));
connect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)), d.get(), SLOT(onRowsAboutToBeInserted(QModelIndex, int, int)));
connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), d.get(), SLOT(onRowsInserted(QModelIndex, int, int)));
connect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), d.get(), SLOT(onRowsAboutToBeRemoved(QModelIndex, int, int)));
connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), d.get(), SLOT(onRowsRemoved(QModelIndex, int, int)));
connect(sourceModel(),
SIGNAL(rowsAboutToBeMoved(QModelIndex, int, int, QModelIndex, int)),
d.get(),
SLOT(onRowsAboutToBeMoved(QModelIndex, int, int, QModelIndex, int)));
connect(sourceModel(), SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)), d.get(), SLOT(onRowsMoved(QModelIndex, int, int, QModelIndex, int)));
connect(sourceModel(), SIGNAL(modelAboutToBeReset()), d.get(), SLOT(onModelAboutToBeReset()));
connect(sourceModel(), SIGNAL(modelReset()), d.get(), SLOT(onModelReset()));
connect(sourceModel(), SIGNAL(layoutAboutToBeChanged()), d.get(), SLOT(onLayoutAboutToBeChanged()));
connect(sourceModel(), SIGNAL(layoutChanged()), d.get(), SLOT(onLayoutChanged()));
connect(sourceModel(), &QAbstractItemModel::dataChanged, d.get(), &TodoModelPrivate::onDataChanged);
connect(sourceModel(), &QAbstractItemModel::headerDataChanged, d.get(), &TodoModelPrivate::onHeaderDataChanged);
connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted, d.get(), &TodoModelPrivate::onRowsAboutToBeInserted);
connect(sourceModel(), &QAbstractItemModel::rowsInserted, d.get(), &TodoModelPrivate::onRowsInserted);
connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved, d.get(), &TodoModelPrivate::onRowsAboutToBeRemoved);
connect(sourceModel(), &QAbstractItemModel::rowsRemoved, d.get(), &TodoModelPrivate::onRowsRemoved);
connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeMoved, d.get(), &TodoModelPrivate::onRowsAboutToBeMoved);
connect(sourceModel(), &QAbstractItemModel::rowsMoved, d.get(), &TodoModelPrivate::onRowsMoved);
connect(sourceModel(), &QAbstractItemModel::modelAboutToBeReset, d.get(), &TodoModelPrivate::onModelAboutToBeReset);
connect(sourceModel(), &QAbstractItemModel::modelReset, d.get(), &TodoModelPrivate::onModelReset);
connect(sourceModel(), &QAbstractItemModel::layoutAboutToBeChanged, d.get(), &TodoModelPrivate::onLayoutAboutToBeChanged);
connect(sourceModel(), &QAbstractItemModel::layoutChanged, d.get(), &TodoModelPrivate::onLayoutChanged);
}
endResetModel();
......
......@@ -39,7 +39,7 @@ public:
QList<int> m_columns;
EventViews::PrefsPtr m_preferences;
private Q_SLOTS:
public Q_SLOTS:
void onDataChanged(const QModelIndex &begin, const QModelIndex &end);
void onHeaderDataChanged(Qt::Orientation orientation, int first, int last);
......
......@@ -243,7 +243,7 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs, bool sidebarView, QWidget
mQuickAdd = new TodoViewQuickAddLine(this);
mQuickAdd->setClearButtonEnabled(true);
mQuickAdd->setVisible(preferences()->enableQuickTodo());
connect(mQuickAdd, SIGNAL(returnPressed(Qt::KeyboardModifiers)), this, SLOT(addQuickTodo(Qt::KeyboardModifiers)));
connect(mQuickAdd, &TodoViewQuickAddLine::returnPressed, this, &TodoView::addQuickTodo);
mFullViewButton = nullptr;
if (!mSidebarView) {
......@@ -263,7 +263,7 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs, bool sidebarView, QWidget
"flat list instead of a hierarchical tree; the parental "
"relationships are removed in the display."));
connect(mFlatViewButton, SIGNAL(toggled(bool)), SLOT(setFlatView(bool)));
connect(mFlatViewButton, &QToolButton::toggled, this, [=](bool flatView) {setFlatView(flatView, true);});
if (mFullViewButton) {
connect(mFullViewButton, &QToolButton::toggled, this, &TodoView::setFullView);
}
......@@ -352,7 +352,7 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs, bool sidebarView, QWidget
a = mItemPopupMenu->addAction(QIcon::fromTheme(QStringLiteral("appointment-new")),
i18nc("@action:inmenu", "Create Event from To-do"),
this,
SLOT(createEvent()));
qOverload<>(&TodoView::createEvent));
a->setObjectName(QStringLiteral("createevent"));
mItemPopupMenuReadWriteEntries << a;
mItemPopupMenuItemOnlyEntries << a;
......@@ -360,7 +360,7 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs, bool sidebarView, QWidget
a = mItemPopupMenu->addAction(QIcon::fromTheme(QStringLiteral("view-pim-notes")),
i18nc("@action:inmenu", "Create Note for To-do"),
this,
SLOT(createNote()));
qOverload<>(&TodoView::createNote));
a->setObjectName(QStringLiteral("createnote"));
mItemPopupMenuReadWriteEntries << a;
mItemPopupMenuItemOnlyEntries << a;
......
......@@ -15,7 +15,7 @@
TodoViewQuickAddLine::TodoViewQuickAddLine(QWidget *parent)
: KLineEdit(parent)
{
connect(this, SIGNAL(returnPressed()), this, SLOT(returnPressedSlot()));
connect(this, &TodoViewQuickAddLine::returnPressed, this, &TodoViewQuickAddLine::returnPressedSlot);
mClickMessage = i18n("Enter a summary to create a new to-do");
setToolTip(mClickMessage);
......
Supports Markdown
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