Skip to content

Commit

Permalink
Port deprecated parts to Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
pvuorela committed Dec 12, 2017
1 parent 79a186a commit e9c1cf3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/src.pro
Expand Up @@ -12,7 +12,6 @@ TARGET = lipstick-qt5
# Override the version from the spec file, we need .so version 1.0
VERSION = 1.0

DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000
DEFINES += LIPSTICK_BUILD_LIBRARY
DEFINES += VERSION=\\\"$${VERSION}\\\"
DEFINES += MESA_EGL_NO_X11_HEADERS
Expand Down
6 changes: 5 additions & 1 deletion src/utilities/qobjectlistmodel.cpp
Expand Up @@ -22,10 +22,14 @@
QObjectListModel::QObjectListModel(QObject *parent, QList<QObject*> *list)
: QAbstractListModel(parent),
_list(list)
{
}

QHash<int, QByteArray> QObjectListModel::roleNames() const
{
QHash<int, QByteArray> roles;
roles[Qt::UserRole + 1] = "object";
setRoleNames(roles);
return roles;
}

int QObjectListModel::indexOf(QObject *obj) const
Expand Down
2 changes: 2 additions & 0 deletions src/utilities/qobjectlistmodel.h
Expand Up @@ -32,6 +32,8 @@ class LIPSTICK_EXPORT QObjectListModel : public QAbstractListModel

public:
explicit QObjectListModel(QObject *parent = 0, QList<QObject*> *list = new QList<QObject*>());

QHash<int, QByteArray> roleNames() const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int itemCount() const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
Expand Down
2 changes: 1 addition & 1 deletion src/volume/pulseaudiocontrol.cpp
Expand Up @@ -97,7 +97,7 @@ void PulseAudioControl::openConnection()
message.setArguments(QVariantList() << "org.PulseAudio.ServerLookup1" << "Address");
QDBusMessage reply = QDBusConnection::sessionBus().call(message);
if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() > 0) {
addressArray = reply.arguments().first().value<QDBusVariant>().variant().toString().toAscii();
addressArray = reply.arguments().first().value<QDBusVariant>().variant().toString().toLatin1();
pa_bus_address = addressArray.data();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/common.pri
Expand Up @@ -16,7 +16,7 @@ DEPENDPATH = $$INCLUDEPATH
QT += testlib
TEMPLATE = app
DEFINES += UNIT_TEST
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000

CONFIG -= link_prl
CONFIG += link_pkgconfig
PKGCONFIG += mlite5
Expand Down

0 comments on commit e9c1cf3

Please sign in to comment.