diff options
author | xerus2000 <27jf@pm.me> | 2020-05-21 22:24:01 +0200 |
---|---|---|
committer | xerus2000 <27jf@pm.me> | 2020-05-21 22:24:01 +0200 |
commit | bc862eda302bbded3d4790c315db6970d7ec83a4 (patch) | |
tree | f7fc79ad6c2c4cac4aacbe39cb853ca3cc71d4df | |
parent | d98243811e3564ffe32ccf157797a5245eea4042 (diff) |
Replace weirdly formatted QStringLiteral by joined QStringList
-rw-r--r-- | src/library/banshee/bansheeplaylistmodel.cpp | 66 |
1 files changed, 24 insertions, 42 deletions
diff --git a/src/library/banshee/bansheeplaylistmodel.cpp b/src/library/banshee/bansheeplaylistmodel.cpp index 3de59b40cc..c579225ed7 100644 --- a/src/library/banshee/bansheeplaylistmodel.cpp +++ b/src/library/banshee/bansheeplaylistmodel.cpp @@ -101,48 +101,30 @@ void BansheePlaylistModel::setTableModel(int playlistId) { LOG_FAILED_QUERY(query); } - query.prepare(QStringLiteral( - "INSERT INTO %1 (" // - CLM_TRACK_ID ", " // - CLM_VIEW_ORDER ", " // - CLM_ARTIST ", " // - CLM_TITLE ", " // - CLM_DURATION ", " // - CLM_URI ", " // - CLM_ALBUM ", " // - CLM_ALBUM_ARTIST ", " // - CLM_YEAR ", " // - CLM_RATING ", " // - CLM_GENRE ", " // - CLM_GROUPING ", " // - CLM_TRACKNUMBER ", " // - CLM_DATEADDED ", " // - CLM_BPM ", " // - CLM_BITRATE ", " // - CLM_COMMENT ", " // - CLM_PLAYCOUNT ", " // - CLM_COMPOSER - ") VALUES (:" // - CLM_TRACK_ID ", :" // - CLM_VIEW_ORDER ", :" // - CLM_ARTIST ", :" // - CLM_TITLE ", :" // - CLM_DURATION ", :" // - CLM_URI ", :" // - CLM_ALBUM ", :" // - CLM_ALBUM_ARTIST ", :" // - CLM_YEAR ", :" // - CLM_RATING ", :" // - CLM_GENRE ", :" // - CLM_GROUPING ", :" // - CLM_TRACKNUMBER ", :" // - CLM_DATEADDED ", :" // - CLM_BPM ", :" // - CLM_BITRATE ", :" // - CLM_COMMENT ", :" // - CLM_PLAYCOUNT ", :" // - CLM_COMPOSER ") ") - .arg(m_tempTableName)); + QStringList insertColumns; + insertColumns + << CLM_TRACK_ID + << CLM_VIEW_ORDER + << CLM_ARTIST + << CLM_TITLE + << CLM_DURATION + << CLM_URI + << CLM_ALBUM + << CLM_ALBUM_ARTIST + << CLM_YEAR + << CLM_RATING + << CLM_GENRE + << CLM_GROUPING + << CLM_TRACKNUMBER + << CLM_DATEADDED + << CLM_BPM + << CLM_BITRATE + << CLM_COMMENT + << CLM_PLAYCOUNT + << CLM_COMPOSER; + query.prepare( + QStringLiteral("INSERT INTO %1 (%2) VALUES (:%3)") + .arg(m_tempTableName, insertColumns.join(", "), insertColumns.join(", :"))); QList<struct BansheeDbConnection::PlaylistEntry> list = m_pConnection->getPlaylistEntries(playlistId); |