summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilian Wolff <mail@milianw.de>2016-08-21 22:32:53 (GMT)
committerMilian Wolff <mail@milianw.de>2016-08-21 22:32:58 (GMT)
commit01b61c2fb7b6538b0a9c3cb256cf23a451afde43 (patch)
tree5f228251d4144d38edb274c5feb62524d5ae6d9e
parentf06ee7b7fc30a3ceb0564a4f7a8d12258e1610fe (diff)
Fix compile when deprecated Qt features are disabled
-rw-r--r--src/filter/autotests/filteractionpipethroughtest.cpp2
-rw-r--r--src/filter/kmfilteraccountlist.cpp2
-rw-r--r--src/folder/foldertreeview.cpp4
-rw-r--r--src/snippets/snippetsmodel.cpp15
-rw-r--r--src/snippets/snippetsmodel.h1
5 files changed, 14 insertions, 10 deletions
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..43523bb 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<int, QByteArray> names = roleNames();
-
- names.insert(IsGroupRole, "isSnippetGroup");
-
- setRoleNames(names);
}
SnippetsModel::~SnippetsModel()
@@ -443,3 +437,12 @@ Qt::DropActions SnippetsModel::supportedDropActions() const
return Qt::CopyAction | Qt::MoveAction;
}
+QHash<int, QByteArray> SnippetsModel::roleNames() const
+{
+ static QHash<int, QByteArray> 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<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
protected:
bool insertRows(int row, int count,