Commit 79233335 authored by Christian Ehrlicher's avatar Christian Ehrlicher

KF5 port: remove deprecated KStringHandler and KTabWidget usage

Summary:
KStringHandler::naturalCompare() was replaced with QCollator (according to deprecating comment, other commits did it the same way)
KTabWidget was replaced with QTabWidget - there were no special KTabWidget functions at all.

Test Plan: TriggerConfig works as before

Reviewers: #kde_games, ltoscano

Reviewed By: ltoscano

Subscribers: ltoscano, #kde_games

Differential Revision: https://phabricator.kde.org/D7417
parent eb0585e8
......@@ -24,7 +24,7 @@
#include <KLocalizedString>
Palapeli::TriggerConfigWidget::TriggerConfigWidget(QWidget* parent)
: KTabWidget(parent)
: QTabWidget(parent)
, m_interactors(Palapeli::TriggerMapper::createInteractors(0)) //these interactors are just for reading metadata
, m_mouseView(new Palapeli::TriggerListView(m_interactors, Palapeli::MouseInteractor, this))
, m_wheelView(new Palapeli::TriggerListView(m_interactors, Palapeli::WheelInteractor, this))
......
......@@ -20,14 +20,14 @@
#define PALAPELI_TRIGGERCONFIGWIDGET_H
#include <QMap>
#include <KTabWidget>
#include <QTabWidget>
namespace Palapeli
{
class Interactor;
class TriggerListView;
class TriggerConfigWidget : public KTabWidget
class TriggerConfigWidget : public QTabWidget
{
Q_OBJECT
public:
......
......@@ -22,8 +22,8 @@
#include "triggerlistview.h"
#include "elidinglabel.h"
#include "mouseinputbutton.h"
#include <kstringhandler_deprecated.h>
#include <QApplication>
#include <QCollator>
#include <QHBoxLayout>
#include <QLabel>
#include <QStandardItemModel>
......@@ -41,6 +41,7 @@ namespace Palapeli
: KCategorizedSortFilterProxyModel(parent)
{
setCategorizedModel(true);
m_collator.setCaseSensitivity(Qt::CaseSensitive);
}
protected:
int compareCategories(const QModelIndex& left, const QModelIndex& right) const Q_DECL_OVERRIDE
......@@ -53,8 +54,10 @@ namespace Palapeli
{
const QString textLeft = left.data(Qt::DisplayRole).toString();
const QString textRight = right.data(Qt::DisplayRole).toString();
return KStringHandler::naturalCompare(textLeft, textRight) < 0;
return m_collator.compare(textLeft, textRight) < 0;
}
private:
QCollator m_collator;
};
class TriggerListDelegateWidget : public QWidget
......
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