From 219bf482937b6099deabfa375ade8e01a686c735 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 24 Aug 2016 07:17:06 +0200 Subject: [PATCH] Make it compiles against master (I need it) --- CMakeLists.txt | 1 + autotests/foldertreewidgettest.cpp | 4 +--- .../autotests/filteractionpipethroughtest.cpp | 2 +- src/filter/kmfilteraccountlist.cpp | 2 +- src/folder/foldertreeview.cpp | 4 ++-- src/snippets/snippetsmodel.cpp | 16 ++++++++++------ src/snippets/snippetsmodel.h | 1 + 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a774dd..127458c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED) find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED) find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED) find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED) +find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED) find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED) diff --git a/autotests/foldertreewidgettest.cpp b/autotests/foldertreewidgettest.cpp index 9ba423f..0f3709e 100644 --- a/autotests/foldertreewidgettest.cpp +++ b/autotests/foldertreewidgettest.cpp @@ -58,9 +58,7 @@ using namespace Akonadi; class FolderTreeWidgetTest : public QObject { Q_OBJECT -public: - -private slots: +private Q_SLOTS: void initTestCase() { AkonadiTest::checkTestIsIsolated(); diff --git a/src/filter/autotests/filteractionpipethroughtest.cpp b/src/filter/autotests/filteractionpipethroughtest.cpp index 1d92562..14876c1 100644 --- a/src/filter/autotests/filteractionpipethroughtest.cpp +++ b/src/filter/autotests/filteractionpipethroughtest.cpp @@ -209,7 +209,7 @@ void FilterActionPipeThroughTest::testXUidUnchange() filter.argsFromString(QStringLiteral("cat ")); QCOMPARE(filter.process(context, false), FilterAction::GoOn); QCOMPARE(context.needsPayloadStore(), true); - QCOMPARE(QString::fromAscii(msgPtr->encodedContent()), QString::fromAscii(data)); + QCOMPARE(QString::fromLatin1(msgPtr->encodedContent()), QString::fromLatin1(data)); } void FilterActionPipeThroughTest::testXUidRemoved() diff --git a/src/filter/kmfilteraccountlist.cpp b/src/filter/kmfilteraccountlist.cpp index dd6a3ec..3e9f1c3 100644 --- a/src/filter/kmfilteraccountlist.cpp +++ b/src/filter/kmfilteraccountlist.cpp @@ -41,7 +41,7 @@ KMFilterAccountList::KMFilterAccountList(QWidget *parent) setRootIsDecorated(false); setSortingEnabled(true); sortByColumn(0, Qt::AscendingOrder); - header()->setMovable(false); + header()->setSectionsMovable(false); } KMFilterAccountList::~KMFilterAccountList() diff --git a/src/folder/foldertreeview.cpp b/src/folder/foldertreeview.cpp index a120ff9..3ae561a 100644 --- a/src/folder/foldertreeview.cpp +++ b/src/folder/foldertreeview.cpp @@ -238,14 +238,14 @@ void FolderTreeView::setSortingPolicy(FolderTreeWidget::SortingPolicy policy, bo mSortingPolicy = policy; switch (mSortingPolicy) { case FolderTreeWidget::SortByCurrentColumn: - header()->setClickable(true); + header()->setSectionsClickable(true); header()->setSortIndicatorShown(true); setSortingEnabled(true); Q_EMIT manualSortingChanged(false); break; case FolderTreeWidget::SortByDragAndDropKey: - header()->setClickable(false); + header()->setSectionsClickable(false); header()->setSortIndicatorShown(false); setSortingEnabled(false); // hack for qutie bug: this call shouldn't be here at all diff --git a/src/snippets/snippetsmodel.cpp b/src/snippets/snippetsmodel.cpp index 859f7b6..9a3bc9c 100644 --- a/src/snippets/snippetsmodel.cpp +++ b/src/snippets/snippetsmodel.cpp @@ -148,12 +148,6 @@ SnippetsModel::SnippetsModel(QObject *parent) : QAbstractItemModel(parent) { mRootItem = new SnippetItem(true); - - QHash names = roleNames(); - - names.insert(IsGroupRole, "isSnippetGroup"); - - setRoleNames(names); } SnippetsModel::~SnippetsModel() @@ -443,3 +437,13 @@ Qt::DropActions SnippetsModel::supportedDropActions() const return Qt::CopyAction | Qt::MoveAction; } +QHash SnippetsModel::roleNames() const +{ + static QHash names; + if (names.isEmpty()) { + names.insert(IsGroupRole, QByteArrayLiteral("isSnippetGroup")); + } + + return names; +} + diff --git a/src/snippets/snippetsmodel.h b/src/snippets/snippetsmodel.h index 5a771be..abbec94 100644 --- a/src/snippets/snippetsmodel.h +++ b/src/snippets/snippetsmodel.h @@ -66,6 +66,7 @@ public: int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE; Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE; + QHash roleNames() const Q_DECL_OVERRIDE; protected: bool insertRows(int row, int count,