Commit 0ad74eb6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove dead code

parent 1fba5ef5
Pipeline #44385 passed with stage
in 20 minutes and 26 seconds
......@@ -192,7 +192,6 @@ set(korganizerprivate_LIB_SRCS
datenavigatorcontainer.cpp
dialog/filtereditdialog.cpp
widgets/kdatenavigator.cpp
kocheckableproxymodel.cpp
kocorehelper.cpp
kodaymatrix.cpp
kodialogmanager.cpp
......
......@@ -23,7 +23,6 @@
#include "prefs/koprefs.h"
#include "koviewmanager.h"
#include "kowindowlist.h"
#include "kocheckableproxymodel.h"
#include "korgacinterface.h"
#include <KAuthorized>
......@@ -73,6 +72,7 @@
#include <QTimer>
#include <KSharedConfig>
#include <QStandardPaths>
#include <KCheckableProxyModel>
KOWindowList *ActionManager::mWindowList = nullptr;
......
......@@ -20,7 +20,6 @@
#include "datechecker.h"
#include "datenavigator.h"
#include "datenavigatorcontainer.h"
#include "kocheckableproxymodel.h"
#include "kodaymatrix.h"
#include "kodialogmanager.h"
#include "koglobals.h"
......@@ -2677,18 +2676,6 @@ void CalendarView::onCutFinished()
checkClipboard();
}
void CalendarView::setCheckableProxyModel(KOCheckableProxyModel *model)
{
if (mCheckableProxyModel) {
mCheckableProxyModel->disconnect(this);
}
mCheckableProxyModel = model;
connect(model, &KOCheckableProxyModel::aboutToToggle, this,
&CalendarView::onCheckableProxyAboutToToggle);
connect(model, &KOCheckableProxyModel::toggled, this, &CalendarView::onCheckableProxyToggled);
}
void CalendarView::onCheckableProxyAboutToToggle(bool newState)
{
// Someone unchecked a collection, save the view state now.
......
......@@ -31,7 +31,6 @@ class KODialogManager;
class KOTodoView;
class KOViewManager;
class NavigatorBar;
class KOCheckableProxyModel;
class AkonadiCollectionView;
namespace CalendarSupport {
......@@ -117,7 +116,6 @@ public:
void showMessage(const QString &message, KMessageWidget::MessageType);
Akonadi::History *history() const;
void setCheckableProxyModel(KOCheckableProxyModel *);
KOViewManager *viewManager() const
{
......@@ -704,7 +702,6 @@ private:
bool mSplitterSizesValid;
Akonadi::CalendarClipboard *mCalendarClipboard = nullptr;
KOCheckableProxyModel *mCheckableProxyModel = nullptr;
AkonadiCollectionView *mETMCollectionView = nullptr;
SearchCollectionHelper mSearchCollectionHelper;
......
/*
This file is part of KOrganizer.
SPDX-FileCopyrightText: 2012 Sergio Martins <iamsergio@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
*/
#include "kocheckableproxymodel.h"
KOCheckableProxyModel::KOCheckableProxyModel(QObject *parent) : KCheckableProxyModel(parent)
{
}
bool KOCheckableProxyModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
const auto newState = static_cast<Qt::CheckState>(value.toInt());
if (role == Qt::CheckStateRole && index.column() == 0) {
Q_EMIT aboutToToggle(newState);
}
const bool result = KCheckableProxyModel::setData(index, value, role);
if (result) {
Q_EMIT toggled(newState);
}
return result;
}
/*
This file is part of KOrganizer.
SPDX-FileCopyrightText: 2012 Sergio Martins <iamsergio@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
*/
#ifndef KORG_KOCHECKABLE_PROXYMODEL_H
#define KORG_KOCHECKABLE_PROXYMODEL_H
#include <KCheckableProxyModel>
// TODO: This functionality could be ported to the KCheckableProxyModel
/**
* A KCheckableProxyModel that emits a signal before and after toggling.
*
* Listeners, like to-do view, restore tree expand state before unchecking,
* and restore after checking.
*/
class KOCheckableProxyModel : public KCheckableProxyModel
{
Q_OBJECT
public:
explicit KOCheckableProxyModel(QObject *parent);
/**reimp*/
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
Q_SIGNALS:
void aboutToToggle(bool oldState);
void toggled(bool newState);
};
#endif
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