Commit 99bd72ba authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some qt6 compile error

parent 05f76f50
Pipeline #183611 passed with stage
in 11 minutes and 52 seconds
......@@ -179,25 +179,25 @@ void ElisaApplication::setupActions(const QString &actionName)
if (actionName == QLatin1String("Seek") && KAuthorized::authorizeAction(actionName)) {
auto seekAction = d->mCollection.addAction(actionName, this, &ElisaApplication::seek);
seekAction->setText(i18n("Seek forward 10 seconds"));
d->mCollection.setDefaultShortcut(seekAction, QKeySequence(Qt::SHIFT + Qt::Key_Right));
d->mCollection.setDefaultShortcut(seekAction, QKeySequence(Qt::SHIFT | Qt::Key_Right));
}
if (actionName == QLatin1String("Scrub") && KAuthorized::authorizeAction(actionName)) {
auto scrubAction = d->mCollection.addAction(actionName, this, &ElisaApplication::scrub);
scrubAction->setText(i18n("Scrub backwards 10 seconds"));
d->mCollection.setDefaultShortcut(scrubAction, QKeySequence(Qt::SHIFT + Qt::Key_Left));
d->mCollection.setDefaultShortcut(scrubAction, QKeySequence(Qt::SHIFT | Qt::Key_Left));
}
if (actionName == QLatin1String("NextTrack") && KAuthorized::authorizeAction(actionName)) {
auto nextTrackAction = d->mCollection.addAction(actionName, this, &ElisaApplication::nextTrack);
nextTrackAction->setText(i18n("Go to next track"));
d->mCollection.setDefaultShortcut(nextTrackAction, QKeySequence(Qt::CTRL + Qt::Key_Right));
d->mCollection.setDefaultShortcut(nextTrackAction, QKeySequence(Qt::CTRL | Qt::Key_Right));
}
if (actionName == QLatin1String("PreviousTrack") && KAuthorized::authorizeAction(actionName)) {
auto previousTrackAction = d->mCollection.addAction(actionName, this, &ElisaApplication::previousTrack);
previousTrackAction->setText(i18n("Go to previous track"));
d->mCollection.setDefaultShortcut(previousTrackAction, QKeySequence(Qt::CTRL + Qt::Key_Left));
d->mCollection.setDefaultShortcut(previousTrackAction, QKeySequence(Qt::CTRL | Qt::Key_Left));
}
if (actionName == QLatin1String("Play-Pause") && KAuthorized::authorizeAction(actionName)) {
......
......@@ -355,7 +355,11 @@ void MusicListenersManager::configChanged()
QFileInfo pathFileInfo(workPath);
auto directoryPath = pathFileInfo.canonicalFilePath();
if (!directoryPath.isEmpty()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (directoryPath.rightRef(1) != QLatin1Char('/'))
#else
if (QStringView(directoryPath).right(1) != QLatin1Char('/'))
#endif
{
directoryPath.append(QLatin1Char('/'));
}
......
......@@ -16,12 +16,12 @@
#include <QObject>
#include <QString>
#include <QUrl>
#include <QAbstractProxyModel>
#include <memory>
class ViewConfigurationDataPrivate;
class QAbstractItemModel;
class QAbstractProxyModel;
class ELISALIB_EXPORT ViewConfigurationData : public QObject
{
......
......@@ -423,7 +423,11 @@ QStringList::iterator ViewManager::findViewPreference(QStringList &list, const Q
{
auto itViewPreference = list.end();
for(itViewPreference = list.begin(); itViewPreference != list.end(); ++itViewPreference) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
auto parts = itViewPreference->splitRef(QStringLiteral("=="));
#else
auto parts = QStringView(*itViewPreference).split(QStringLiteral("=="));
#endif
if (parts.size() != 2) {
continue;
}
......@@ -442,7 +446,11 @@ Qt::SortOrder ViewManager::computePreferredSortOrder(Qt::SortOrder initialValue)
auto itViewPreference = findViewPreference(currentSortOrderPreferences, viewId);
if (itViewPreference != currentSortOrderPreferences.end()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
auto result = itViewPreference->splitRef(QStringLiteral("=="));
#else
auto result = QStringView(*itViewPreference).split(QStringLiteral("=="));
#endif
if (result.size() == 2) {
const auto &sortOrderMetaEnum = QMetaEnum::fromType<Qt::SortOrder>();
bool conversionOk;
......@@ -463,7 +471,11 @@ int ViewManager::computePreferredSortRole(int initialValue) const
auto itViewPreference = findViewPreference(currentSortRolePreferences, viewId);
if (itViewPreference != currentSortRolePreferences.end()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
auto result = itViewPreference->splitRef(QStringLiteral("=="));
#else
auto result = QStringView(*itViewPreference).split(QStringLiteral("=="));
#endif
if (result.size() == 2) {
const auto &sortRoleMetaEnum = QMetaEnum::fromType<DataTypes::ColumnsRoles>();
bool conversionOk;
......
Supports Markdown
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