void CircleWidget::dropEvent(QDropEvent* event) { setExpanded(true, false); // Check, that the element is dropped from qTox QObject* o = event->source(); FriendWidget* widget = qobject_cast<FriendWidget*>(o); if (!widget) return; // Check, that the user has a friend with the same ToxId ToxId toxId(event->mimeData()->text()); Friend* f = FriendList::findFriend(toxId.getPublicKey()); if (!f) return; // Save CircleWidget before changing the Id int circleId = Settings::getInstance().getFriendCircleID(toxId.getPublicKey()); CircleWidget* circleWidget = getFromID(circleId); addFriendWidget(widget, f->getStatus()); Settings::getInstance().savePersonal(); if (circleWidget != nullptr) { circleWidget->updateStatus(); Widget::getInstance()->searchCircle(circleWidget); } setContainerAttribute(Qt::WA_UnderMouse, false); }
int CBubbleRobContainer::insert(CBubbleRob* theBubbleRob) { int newID=0; while (getFromID(newID)!=NULL) newID++; _allBubbleRobs.push_back(theBubbleRob); theBubbleRob->setID(newID); return(newID); }