diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-02 22:14:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-02 22:14:54 +0300 |
commit | 65b614a0d142e229206fbde22a25f4a3b20b1dbc (patch) | |
tree | cb1f90dbbc8aedd3ef2dd7e2269a08b115d9fc7b /src/gui/widgets | |
parent | bead0d26642bbc0c5e570306c226676c66d18b86 (diff) | |
download | manaverse-65b614a0d142e229206fbde22a25f4a3b20b1dbc.tar.gz manaverse-65b614a0d142e229206fbde22a25f4a3b20b1dbc.tar.bz2 manaverse-65b614a0d142e229206fbde22a25f4a3b20b1dbc.tar.xz manaverse-65b614a0d142e229206fbde22a25f4a3b20b1dbc.zip |
In drag and drop use ints and images but not pointer to item.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 2a65a57c1..ac2916c1d 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -214,11 +214,10 @@ void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) } else { - Item *const selected = dragDrop.getSelected(); - if (selected) + if (dragDrop.isSelected()) { - dropShortcut->setItems(index, selected->getId(), - selected->getColor()); + dropShortcut->setItems(index, dragDrop.getSelected(), + dragDrop.getSelectedColor()); dragDrop.deselect(); } } @@ -255,13 +254,10 @@ void DropShortcutContainer::mouseReleased(gcn::MouseEvent &event) } if (!dragDrop.isEmpty()) { - Item *const item = dragDrop.getItem(); - if (item) - { - dropShortcut->setItems(index, item->getId(), item->getColor()); - dragDrop.clear(); - dragDrop.deselect(); - } + dropShortcut->setItems(index, dragDrop.getItem(), + dragDrop.getItemColor()); + dragDrop.clear(); + dragDrop.deselect(); } mItemClicked = false; |