Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: Fix build with qt6 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mts/common.pri
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIG += link_pkgconfig
PKGCONFIG += systemsettings
PKGCONFIG += systemsettings-qt6
DEFINES += MTP_PLUGINDIR=\\\"$$[QT_INSTALL_LIBS]/mtp\\\"

SOURCES += $$PWD/common/trace.cpp
2 changes: 1 addition & 1 deletion mts/mts.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(common.pri)

QT += xml dbus
QT += xml dbus core5compat
QT -= gui

LIBS += -lssu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void DeviceInfoProvider_Test::initTestCase()
QCOMPARE(QFile::copy("/opt/tests/buteo-mtp/data/deviceinfo.xml", "/tmp/deviceinfo.xml"), true);
m_xmlDoc = new QDomDocument();
m_xmlFile = new QFile("/tmp/deviceinfo.xml");
QCOMPARE(m_xmlDoc->setContent(m_xmlFile), true);
QCOMPARE(m_xmlDoc->setContent(m_xmlFile).errorMessage.isEmpty(), true);

// Original deviceinfo.xml may be changed during the test execution, so
// backup its current state.
Expand Down
2 changes: 1 addition & 1 deletion mts/platform/deviceinfo/unittests/unittests.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(../../../common.pri)

QT += dbus xml testlib
QT += dbus xml testlib core5compat
QT -= gui
CONFIG += debug_and_release

Expand Down
6 changes: 4 additions & 2 deletions mts/platform/storage/fsstorageplugin/fsstorageplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <QDateTime>
#include <QMetaObject>
#include <QLocale>
#include <QRegularExpression>

#ifndef UT_ON
#include <blkid.h>
Expand Down Expand Up @@ -3147,8 +3148,9 @@ bool FSStoragePlugin::isFileNameValid(const QString &fileName, const StorageItem
{
// Check if the file name contains illegal characters, or if the file with
// the same name is already present under the parent
if (fileName.contains(QRegExp(FILENAMES_FILTER_REGEX)) ||
QRegExp("[\\.]+").exactMatch(fileName)) {
QRegularExpression filterRegex(FILENAMES_FILTER_REGEX);
if (filterRegex.match(fileName).hasMatch() ||
QRegularExpression("^[\\.]+$").match(fileName).hasMatch()) {
// Illegal characters, or all .'s
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion mts/platform/storage/fsstorageplugin/fsstorageplugin.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TARGET = fsstorage

CONFIG += plugin debug

QT += dbus xml
QT += dbus xml core5compat
QT -= gui

PKGCONFIG += blkid mount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG += debug_and_release
LIBS += -ldl -lssu
TEMPLATE = app
TARGET = storage-test
QT += dbus xml testlib
QT += dbus xml testlib core5compat
DEFINES += UT_ON
#QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
#QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
Expand Down
2 changes: 1 addition & 1 deletion mts/platform/storage/unittests/unittests.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include(../../../common.pri)

TEMPLATE = app
TARGET = storagefactory-test
QT += testlib xml dbus
QT += testlib xml dbus core5compat
QT -= gui

DEFINES += UT_ON
Expand Down
2 changes: 1 addition & 1 deletion mts/protocol/unittests/unittests.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG += debug_and_release
LIBS += -ldl -lssu
TEMPLATE = app
TARGET = protocol-test
QT += dbus xml testlib
QT += dbus xml testlib core5compat
QT -= gui
DEFINES += UT_ON
#QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
Expand Down
4 changes: 2 additions & 2 deletions mts/transport/usb/threadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ void BulkWriterThread::setData(const quint8 *buffer, quint32 dataLen, bool termi
m_dataLen = dataLen;
m_terminateTransfer = terminateTransfer;
m_result = false;
m_result_ready.store(0);
m_result_ready.storeRelaxed(0);
}

void BulkWriterThread::execute()
Expand Down Expand Up @@ -543,7 +543,7 @@ void BulkWriterThread::execute()

bool BulkWriterThread::resultReady()
{
return m_result_ready.load() != 0;
return m_result_ready.loadRelaxed() != 0;
}

bool BulkWriterThread::getResult()
Expand Down
2 changes: 1 addition & 1 deletion service/service.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LIBS += -L../mts -lmeegomtp

QT -= gui
CONFIG += link_pkgconfig
PKGCONFIG += mlite5
PKGCONFIG += mlite$${QT_MAJOR_VERSION}

SOURCES += service.cpp

Expand Down