Commit 0c22a3e6 authored by Matthieu Gallien's avatar Matthieu Gallien

many clazy level 2 fixes

parent e1b17e32
......@@ -41,6 +41,12 @@ class AllTracksProxyModelTests: public QObject, public DatabaseTestData
{
Q_OBJECT
public:
explicit AllTracksProxyModelTests(QObject *aParent = nullptr) : QObject(aParent)
{
}
private Q_SLOTS:
void initTestCase()
......
......@@ -44,7 +44,11 @@ class DatabaseInterfaceTests: public QObject, public DatabaseTestData
{
Q_OBJECT
private:
public:
explicit DatabaseInterfaceTests(QObject *aParent = nullptr) : QObject(aParent)
{
}
private Q_SLOTS:
......
......@@ -41,6 +41,12 @@ class DataModelTests: public QObject, public DatabaseTestData
{
Q_OBJECT
public:
explicit DataModelTests(QObject *aParent = nullptr) : QObject(aParent)
{
}
private Q_SLOTS:
void initTestCase()
......
......@@ -34,7 +34,13 @@ class FileScannerTest: public QObject
public:
QString createTrackUrl(QString subpath) {
explicit FileScannerTest(QObject *aParent = nullptr) : QObject(aParent)
{
}
public:
QString createTrackUrl(const QString &subpath) {
return QStringLiteral(LOCAL_FILE_TESTS_SAMPLE_FILES_PATH) + QStringLiteral("/cover_art") + subpath;
}
......
......@@ -28,6 +28,12 @@ class TrackMetadataModelTests: public QObject, public DatabaseTestData
{
Q_OBJECT
public:
explicit TrackMetadataModelTests(QObject *aParent = nullptr) : QObject(aParent)
{
}
private Q_SLOTS:
void initTestCase()
......
......@@ -25,7 +25,11 @@ class ViewManagerTests: public QObject
{
Q_OBJECT
private:
public:
explicit ViewManagerTests(QObject *aParent = nullptr) : QObject(aParent)
{
}
private Q_SLOTS:
......
......@@ -96,15 +96,15 @@ public:
QString aAlbumArtist, int aTrackNumber, int aDiscNumber, QTime aDuration, QUrl aResourceURI,
const QDateTime &fileModificationTime, QUrl aAlbumCover, int rating, bool aIsSingleDiscAlbum,
QString aGenre, QString aComposer, QString aLyricist, bool aHasEmbeddedCover)
: DataType({{key_type::TitleRole, aTitle}, {key_type::AlbumRole, aAlbumName},
{key_type::ArtistRole, aArtist}, {key_type::AlbumArtistRole, aAlbumArtist},
{key_type::IdRole, aId}, {key_type::ParentIdRole, aParentId},
: DataType({{key_type::TitleRole, std::move(aTitle)}, {key_type::AlbumRole, std::move(aAlbumName)},
{key_type::ArtistRole, std::move(aArtist)}, {key_type::AlbumArtistRole, std::move(aAlbumArtist)},
{key_type::IdRole, std::move(aId)}, {key_type::ParentIdRole, std::move(aParentId)},
{key_type::TrackNumberRole, aTrackNumber}, {key_type::DiscNumberRole, aDiscNumber},
{key_type::DurationRole, aDuration}, {key_type::ResourceRole, aResourceURI},
{key_type::FileModificationTime, fileModificationTime}, {key_type::ImageUrlRole, aAlbumCover},
{key_type::DurationRole, aDuration}, {key_type::ResourceRole, std::move(aResourceURI)},
{key_type::FileModificationTime, fileModificationTime}, {key_type::ImageUrlRole, std::move(aAlbumCover)},
{key_type::RatingRole, rating}, {key_type::IsSingleDiscAlbumRole, aIsSingleDiscAlbum},
{key_type::GenreRole, aGenre}, {key_type::ComposerRole, aComposer},
{key_type::LyricistRole, aLyricist}, {key_type::HasEmbeddedCover, aHasEmbeddedCover},})
{key_type::GenreRole, std::move(aGenre)}, {key_type::ComposerRole, std::move(aComposer)},
{key_type::LyricistRole, std::move(aLyricist)}, {key_type::HasEmbeddedCover, aHasEmbeddedCover},})
{
Q_UNUSED(aValid)
}
......
......@@ -78,6 +78,11 @@
#include <QQmlEngine>
#include <QQmlContext>
ElisaQmlTestPlugin::ElisaQmlTestPlugin(QObject *aParent)
: QQmlExtensionPlugin(aParent)
{
}
void ElisaQmlTestPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
{
QQmlExtensionPlugin::initializeEngine(engine, uri);
......
......@@ -28,6 +28,8 @@ class ElisaQmlTestPlugin : public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
explicit ElisaQmlTestPlugin(QObject *aParent = nullptr);
void initializeEngine(QQmlEngine *engine, const char *uri) override;
void registerTypes(const char *uri) override;
};
......
......@@ -25,7 +25,7 @@ class AsyncImageResponse : public QQuickImageResponse, public QRunnable
{
public:
AsyncImageResponse(QString id, QSize requestedSize)
: mId(std::move(id)), mRequestedSize(requestedSize)
: QQuickImageResponse(), mId(std::move(id)), mRequestedSize(requestedSize)
{
setAutoDelete(false);
}
......
......@@ -182,13 +182,13 @@ void FileScanner::scanProperties(const QString &localFileName, DataTypes::TrackD
auto key = (*rangeBegin).first;
auto rangeEnd = std::find_if(rangeBegin, d->mAllProperties.constKeyValueEnd(),
[key](const entry& e) { return e.first != key; });
[key](entry e) { return e.first != key; });
auto distance = std::distance(rangeBegin, rangeEnd);
if (distance > 1) {
QStringList list;
list.reserve(static_cast<int>(distance));
std::for_each(rangeBegin, rangeEnd, [&list](const entry& s) { list.append(s.second.toString()); });
std::for_each(rangeBegin, rangeEnd, [&list](entry s) { list.append(s.second.toString()); });
value = QLocale().createSeparatedList(list);
} else {
value = (*rangeBegin).second;
......
......@@ -81,7 +81,7 @@ void KCMElisaLocalFile::save()
Elisa::ElisaConfiguration::self()->save();
}
void KCMElisaLocalFile::setRootPath(QStringList rootPath)
void KCMElisaLocalFile::setRootPath(const QStringList &rootPath)
{
if (mRootPath == rootPath && !mRootPath.isEmpty()) {
return;
......
......@@ -42,7 +42,7 @@ public:
Q_SIGNALS:
void rootPathChanged(QStringList rootPath);
void rootPathChanged(const QStringList &rootPath);
public Q_SLOTS:
......@@ -52,7 +52,7 @@ public Q_SLOTS:
void save() override final;
void setRootPath(QStringList rootPath);
void setRootPath(const QStringList &rootPath);
private Q_SLOTS:
......
......@@ -413,7 +413,7 @@ void ManageAudioPlayer::setPlayerPosition(qint64 playerPosition)
QTimer::singleShot(0, this, [this]() {Q_EMIT playControlPositionChanged();});
}
void ManageAudioPlayer::setCurrentPlayingForRadios(QString title, QString nowPlaying)
void ManageAudioPlayer::setCurrentPlayingForRadios(const QString &title, const QString &nowPlaying)
{
if (mPlayListModel && mCurrentTrack.isValid()) {
Q_EMIT currentPlayingForRadiosChanged(title, MediaPlayList::TitleRole);
......
......@@ -155,7 +155,7 @@ Q_SIGNALS:
void playListModelChanged();
void playerSourceChanged(QUrl url);
void playerSourceChanged(const QUrl &url);
void urlRoleChanged();
......@@ -197,7 +197,7 @@ Q_SIGNALS:
void albumNameRoleChanged();
void sourceInError(QUrl source, QMediaPlayer::Error playerError);
void sourceInError(const QUrl &source, QMediaPlayer::Error playerError);
void displayTrackError(const QString &fileName);
......@@ -239,7 +239,7 @@ public Q_SLOTS:
void setPlayerPosition(qint64 playerPosition);
void setCurrentPlayingForRadios(QString title, QString nowPlaying);
void setCurrentPlayingForRadios(const QString &title, const QString &nowPlaying);
void setPlayControlPosition(int playerPosition);
......
......@@ -354,14 +354,18 @@ public:
explicit MediaPlayListEntry(qulonglong id) : mId(id), mIsValid(true) {
}
MediaPlayListEntry(QString title, QString artist, QString album, int trackNumber, int discNumber, ElisaUtils::PlayListEntryType entryType = ElisaUtils::Unknown)
MediaPlayListEntry(QString title, QString artist,
QString album, int trackNumber,
int discNumber, ElisaUtils::PlayListEntryType entryType = ElisaUtils::Unknown)
: mTitle(std::move(title)), mAlbum(std::move(album)), mArtist(std::move(artist)),
mTrackNumber(trackNumber), mDiscNumber(discNumber), mEntryType(entryType) {
}
MediaPlayListEntry(qulonglong id, QVariant title, QVariant artist, QVariant album, QVariant trackNumber, QVariant discNumber, ElisaUtils::PlayListEntryType entryType = ElisaUtils::Unknown)
MediaPlayListEntry(qulonglong id, QVariant title, QVariant artist, QVariant album,
QVariant trackNumber, QVariant discNumber,
ElisaUtils::PlayListEntryType entryType = ElisaUtils::Unknown)
: mTitle(std::move(title)), mAlbum(std::move(album)), mArtist(std::move(artist)),
mTrackNumber(trackNumber), mDiscNumber(discNumber), mId(id), mEntryType(entryType) {
mTrackNumber(std::move(trackNumber)), mDiscNumber(std::move(discNumber)), mId(id), mEntryType(entryType) {
}
explicit MediaPlayListEntry(const MediaPlayList::TrackDataType &track)
......
......@@ -677,7 +677,7 @@ void DataModel::radioRemoved(qulonglong removedRadioId)
endRemoveRows();
}
void DataModel::radioAdded(const DataModel::TrackDataType radioData)
void DataModel::radioAdded(const DataModel::TrackDataType &radioData)
{
if (d->mModelType != ElisaUtils::Radio) {
return;
......
......@@ -149,7 +149,7 @@ private Q_SLOTS:
private:
void radioAdded(const DataModel::TrackDataType radiosData);
void radioAdded(const TrackDataType &radiosData);
void radioModified(const DataModel::TrackDataType &modifiedRadio);
......
......@@ -64,7 +64,7 @@ void Mpris2::initDBusService()
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/mpris/MediaPlayer2"), this, QDBusConnection::ExportAdaptors);
connect(m_mp2.get(), SIGNAL(raisePlayer()), this, SIGNAL(raisePlayer()));
connect(m_mp2.get(), &MediaPlayer2::raisePlayer, this, &Mpris2::raisePlayer);
}
}
......
......@@ -87,7 +87,7 @@ Q_SIGNALS:
void openListView(ViewManager::ViewsType viewType, ElisaUtils::FilterType filterType, int expectedDepth,
const QString &mainTitle, const QString &secondaryTitle, qulonglong databaseId,
const QUrl &imageUrl, ElisaUtils::PlayListEntryType dataType, QVariant sortRole,
const QUrl &imageUrl, ElisaUtils::PlayListEntryType dataType, const QVariant &sortRole,
ViewManager::SortOrder sortOrder, bool displaySingleAlbum, ViewManager::AlbumViewStyle showDiscHeaders,
ViewManager::RadioSpecificStyle radioCase);
......
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