Skip to content

Commit

Permalink
Fixup build on qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Dec 12, 2022
1 parent 52b2f6b commit c0b1f64
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/qusbmoded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ void QUsbModed::onGetHiddenFinished(QDBusPendingCallWatcher* aCall)

void QUsbModed::updateHiddenModes(QString aModes)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const QStringList result = aModes.split(',', QString::SkipEmptyParts);
#else
const QStringList result = aModes.split(',', Qt::SkipEmptyParts);
#endif
const int n = result.count();
QStringList modes;
for (int i=0; i<n; i++) {
Expand All @@ -384,7 +388,11 @@ void QUsbModed::updateHiddenModes(QString aModes)

void QUsbModed::updateSupportedModes(QString aModes)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const QStringList result = aModes.split(',', QString::SkipEmptyParts);
#else
const QStringList result = aModes.split(',', Qt::SkipEmptyParts);
#endif
const int n = result.count();
QStringList modes;
for (int i=0; i<n; i++) {
Expand All @@ -399,7 +407,11 @@ void QUsbModed::updateSupportedModes(QString aModes)

void QUsbModed::updateAvailableModes(const QString &aModes)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const QStringList result = aModes.split(',', QString::SkipEmptyParts);
#else
const QStringList result = aModes.split(',', Qt::SkipEmptyParts);
#endif
const int n = result.count();
QStringList modes;
for (int i=0; i<n; i++) {
Expand Down
6 changes: 3 additions & 3 deletions src/src.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TEMPLATE = lib
TARGET = usb-moded-qt5
TARGET = usb-moded-qt$${QT_MAJOR_VERSION}
CONFIG += link_pkgconfig
PKGCONFIG += usb_moded

Expand Down Expand Up @@ -32,15 +32,15 @@ com_meego_usb_moded.files = $$USB_MODED_INCLUDE_PATH/com.meego.usb_moded.xml
com_meego_usb_moded.header_flags = -N -c QUsbModedInterface
com_meego_usb_moded.source_flags = -N -c QUsbModedInterface

headers.path = $$INSTALL_ROOT$$PREFIX/include/usb-moded-qt5
headers.path = $$INSTALL_ROOT$$PREFIX/include/usb-moded-qt$${QT_MAJOR_VERSION}
headers.files = $$PUBLIC_HEADERS
INSTALLS += headers

target.path = $$[QT_INSTALL_LIBS]
INSTALLS += target

pkgconfig.files = $$TARGET.pc
pkgconfig.path = $$target.path/pkgconfig-qt5
pkgconfig.path = $$target.path/pkgconfig-qt$${QT_MAJOR_VERSION}
QMAKE_PKGCONFIG_NAME = lib$$TARGET
QMAKE_PKGCONFIG_VERSION = $$VERSION
QMAKE_PKGCONFIG_DESCRIPTION = Qt bindings for usb_moded
Expand Down

0 comments on commit c0b1f64

Please sign in to comment.