Skip to content

Commit

Permalink
Playlist: Move new QMimeData
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Nov 23, 2024
1 parent 9bff55e commit 376af26
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/playlist/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,8 +1295,6 @@ QMimeData *Playlist::mimeData(const QModelIndexList &indexes) const {
// We only want one index per row, but we can't just take column 0 because the user might have hidden it.
const int first_column = indexes.first().column();

QMimeData *mimedata = new QMimeData;

QList<QUrl> urls;
QList<int> rows;
for (const QModelIndex &idx : indexes) {
Expand All @@ -1308,7 +1306,6 @@ QMimeData *Playlist::mimeData(const QModelIndexList &indexes) const {

QBuffer buf;
if (!buf.open(QIODevice::WriteOnly)) {
delete mimedata;
return nullptr;
}
QDataStream stream(&buf);
Expand All @@ -1321,6 +1318,7 @@ QMimeData *Playlist::mimeData(const QModelIndexList &indexes) const {
stream.writeRawData(reinterpret_cast<const char*>(&pid), sizeof(pid));
buf.close();

QMimeData *mimedata = new QMimeData;
mimedata->setUrls(urls);
mimedata->setData(QLatin1String(kRowsMimetype), buf.data());

Expand Down

0 comments on commit 376af26

Please sign in to comment.