}
@Override
public boolean dropMimeData(QTreeWidgetItem parent, int index, QMimeData data, Qt.DropAction action) {
if (data.hasFormat("application/x-nevernote-tag")) {
QByteArray d = data.data("application/x-nevernote-tag");
String current = d.toString();
// Check we don't do a dumb thing like move a parent to a child of itself
if (!checkParent(parent, current))
return false;
QTreeWidgetItem newChild;
if (parent == null) {
// tagSignal.changeParent.emit(current, "");
db.getTagTable().updateTagParent(current, "");
newChild = new QTreeWidgetItem(this);
} else {
// tagSignal.changeParent.emit(current, parent.text(2));
db.getTagTable().updateTagParent(current, parent.text(2));
newChild = new QTreeWidgetItem(parent);
}
copyTreeItem(currentItem(), newChild);
currentItem().setHidden(true);
sortItems(0, SortOrder.AscendingOrder);
return true;
}
// If we are dropping a note
if (data.hasFormat("application/x-nevernote-note")) {
String notebookGuid = db.getTagTable().getNotebookGuid(parent.text(2));
QByteArray d = data.data("application/x-nevernote-note");
String s = d.toString();
String noteGuidArray[] = s.split(" ");
for (String element : noteGuidArray) {
Note n = db.getNoteTable().getNote(element.trim(), false, false, false, false, false);
// Check that...