summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <[email protected]>2017-09-13 12:50:12 +0200
committerDaniel Vrátil <[email protected]>2017-09-13 12:50:12 +0200
commitc5b478a84ca0e8301557b78a6a2664a2e092c880 (patch)
tree1687f6b785ca342bd6dbc6232100673ae5e88142
parent943fe63854be3b446b393d36bb5ae494917229ec (diff)
Adapt to KCalCore API changes
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/agentconfigmodel.cpp8
-rw-r--r--src/notificationmodel.cpp3
-rw-r--r--src/notificationmonitor.cpp2
-rw-r--r--src/querydebugger.cpp8
6 files changed, 23 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f13cebc..12d680d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,6 +75,9 @@ find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_VERSION} REQUIRED)
+find_package(KF5Completion ${KF5_VERSION} REQUIRED)
+find_package(KF5ItemViews ${KF5_VERSION} REQUIRED)
+find_package(KF5KIO ${KF5_VERSION} REQUIRED)
# Find KdepimLibs Package
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 77cd61f..7394e35 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -102,6 +102,10 @@ target_link_libraries(libakonadiconsole
KF5::PimTextEdit
Qt5::Sql
KF5::Crash
+ KF5::Completion
+ KF5::ItemViews
+ KF5::TextWidgets
+ KF5::XmlGui
)
set_target_properties(libakonadiconsole
@@ -138,6 +142,10 @@ target_link_libraries(akonadiconsole
KF5::PimTextEdit
Qt5::Sql
KF5::Crash
+ KF5::Completion
+ KF5::ItemViews
+ KF5::TextWidgets
+ KF5::XmlGui
)
install(TARGETS akonadiconsole ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/src/agentconfigmodel.cpp b/src/agentconfigmodel.cpp
index f0b9f69..ac942a2 100644
--- a/src/agentconfigmodel.cpp
+++ b/src/agentconfigmodel.cpp
@@ -35,8 +35,9 @@ AgentConfigModel::~AgentConfigModel()
void AgentConfigModel::setAgentInstance(const Akonadi::AgentInstance &instance)
{
+ beginResetModel();
m_settings.clear();
- reset();
+
m_interface = new QDBusInterface(
QStringLiteral("org.freedesktop.Akonadi.Agent.%1").arg(instance.identifier()),
@@ -46,12 +47,13 @@ void AgentConfigModel::setAgentInstance(const Akonadi::AgentInstance &instance)
delete m_interface;
return;
}
-
+ endResetModel();
reload();
}
void AgentConfigModel::reload()
{
+ beginResetModel();
m_settings.clear();
for (int i = 0; i < m_interface->metaObject()->methodCount(); ++i) {
const QMetaMethod method = m_interface->metaObject()->method(i);
@@ -77,7 +79,7 @@ void AgentConfigModel::reload()
const QString settingName = methodName.at(0).toUpper() + methodName.mid(1);
m_settings.append(qMakePair(settingName, reply.arguments().at(0)));
}
- reset();
+ endResetModel();
}
int AgentConfigModel::columnCount(const QModelIndex &parent) const
diff --git a/src/notificationmodel.cpp b/src/notificationmodel.cpp
index 643eda9..b9432c1 100644
--- a/src/notificationmodel.cpp
+++ b/src/notificationmodel.cpp
@@ -505,9 +505,10 @@ void NotificationModel::slotNotify(const Akonadi::ChangeNotification &ntf)
void NotificationModel::clear()
{
+ beginResetModel();
qDeleteAll(m_data);
m_data.clear();
- reset();
+ endResetModel();
}
Protocol::ChangeNotificationPtr NotificationModel::notification(const QModelIndex &index) const
diff --git a/src/notificationmonitor.cpp b/src/notificationmonitor.cpp
index 5a76be8..2414fcf 100644
--- a/src/notificationmonitor.cpp
+++ b/src/notificationmonitor.cpp
@@ -53,7 +53,7 @@ NotificationMonitor::NotificationMonitor(QWidget *parent) :
tv->expandAll();
tv->setAlternatingRowColors(true);
tv->setContextMenuPolicy(Qt::CustomContextMenu);
- tv->header()->setResizeMode(QHeaderView::ResizeToContents);
+ tv->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
connect(tv, &QTreeView::customContextMenuRequested, this, &NotificationMonitor::contextMenu);
layout->addWidget(tv);
diff --git a/src/querydebugger.cpp b/src/querydebugger.cpp
index 9ba9a7f..6525a08 100644
--- a/src/querydebugger.cpp
+++ b/src/querydebugger.cpp
@@ -740,10 +740,10 @@ QueryDebugger::QueryDebugger(QWidget *parent):
proxy->setSourceModel(mQueryList);
proxy->setDynamicSortFilter(true);
mUi->queryListView->setModel(proxy);
- mUi->queryListView->header()->setResizeMode(QueryDebuggerModel::CallsColumn, QHeaderView::Fixed);
- mUi->queryListView->header()->setResizeMode(QueryDebuggerModel::DurationColumn, QHeaderView::Fixed);
- mUi->queryListView->header()->setResizeMode(QueryDebuggerModel::AvgDurationColumn, QHeaderView::Fixed);
- mUi->queryListView->header()->setResizeMode(QueryDebuggerModel::QueryColumn, QHeaderView::ResizeToContents);
+ mUi->queryListView->header()->setSectionResizeMode(QueryDebuggerModel::CallsColumn, QHeaderView::Fixed);
+ mUi->queryListView->header()->setSectionResizeMode(QueryDebuggerModel::DurationColumn, QHeaderView::Fixed);
+ mUi->queryListView->header()->setSectionResizeMode(QueryDebuggerModel::AvgDurationColumn, QHeaderView::Fixed);
+ mUi->queryListView->header()->setSectionResizeMode(QueryDebuggerModel::QueryColumn, QHeaderView::ResizeToContents);
connect(mUi->queryTreeView, &QTreeView::doubleClicked,
this, &QueryDebugger::queryTreeDoubleClicked);