footageviewer: allows users to drag video or audio only
Updates drag mime data to include a variable determining which streams are enabled and which ones aren't (a binary qint64 where the 0s are disabled and the 1s are enabled) rather than relying solely on the stream->enabled values which can't be modified as part of the drag process.
This commit is contained in:
@@ -272,7 +272,7 @@ QMimeData *ProjectViewModel::mimeData(const QModelIndexList &indexes) const
|
||||
// Check if we've dragged this item before
|
||||
if (!dragged_items.contains(index.internalPointer())) {
|
||||
// If not, add it to the stream (and also keep track of it in the vector)
|
||||
stream << index.row() << reinterpret_cast<quintptr>(index.internalPointer());
|
||||
stream << static_cast<Footage*>(index.internalPointer())->get_enabled_stream_flags() << index.row() << reinterpret_cast<quintptr>(index.internalPointer());
|
||||
dragged_items.append(index.internalPointer());
|
||||
}
|
||||
}
|
||||
@@ -316,6 +316,7 @@ bool ProjectViewModel::dropMimeData(const QMimeData *data, Qt::DropAction action
|
||||
// Variables to deserialize into
|
||||
quintptr item_ptr;
|
||||
int r;
|
||||
quint64 enabled_streams;
|
||||
|
||||
// Loop through all data
|
||||
QUndoCommand* move_command = new QUndoCommand();
|
||||
@@ -323,7 +324,7 @@ bool ProjectViewModel::dropMimeData(const QMimeData *data, Qt::DropAction action
|
||||
move_command->setText(tr("Move Items"));
|
||||
|
||||
while (!stream.atEnd()) {
|
||||
stream >> r >> item_ptr;
|
||||
stream >> enabled_streams >> r >> item_ptr;
|
||||
|
||||
Item* item = reinterpret_cast<Item*>(item_ptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user