Skip to content

Commit

Permalink
Lv2Instrument_updating_StringPair_usage
Browse files Browse the repository at this point in the history
  • Loading branch information
szeli1 committed Nov 3, 2024
1 parent 2012037 commit c3c9d86
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions plugins/Lv2Instrument/Lv2Instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,15 @@ Lv2InsView::Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent) :

void Lv2InsView::dragEnterEvent(QDragEnterEvent *_dee)
{
// For mimeType() and MimeType enum class
using namespace Clipboard;

void (QDragEnterEvent::*reaction)() = &QDragEnterEvent::ignore;

if (_dee->mimeData()->hasFormat( mimeType( MimeType::StringPair )))
if (_dee->mimeData()->hasFormat( Clipboard::mimeType(Clipboard::MimeType::StringPair)))
{
const QString txt =
_dee->mimeData()->data( mimeType( MimeType::StringPair ) );
if (txt.section(':', 0, 0) == "pluginpresetfile") {
_dee->mimeData()->data(Clipboard::mimeType(Clipboard::MimeType::StringPair));
const Clipboard::StringPairDataType type = Clipboard::decodeKey(_dee.mimeData());
if (type == Clipboard::StringPairDataType::PluginPresetFile)
{
reaction = &QDragEnterEvent::acceptProposedAction;
}
}
Expand All @@ -279,9 +278,9 @@ void Lv2InsView::dragEnterEvent(QDragEnterEvent *_dee)

void Lv2InsView::dropEvent(QDropEvent *_de)
{
const QString type = StringPairDrag::decodeKey(_de);
const Clipboard::StringPairDataType type = StringPairDrag::decodeKey(_de);
const QString value = StringPairDrag::decodeValue(_de);
if (type == "pluginpresetfile")
if (type == Clipboard::StringPairDataType::PluginPresetFile)
{
castModel<Lv2Instrument>()->loadFile(value);
_de->accept();
Expand Down

0 comments on commit c3c9d86

Please sign in to comment.