void LipstickCompositorWindow::tryRemove() { if (canRemove() && !m_removePosted) { m_removePosted = true; QCoreApplication::postEvent(this, new QEvent(QEvent::User)); } }
bool LipstickCompositorWindow::event(QEvent *e) { bool rv = QWaylandSurfaceItem::event(e); if (e->type() == QEvent::User) { m_removePosted = false; if (canRemove()) delete this; } return rv; }
bool VersionFinal::remove(const int index) { if (canRemove(index) && QFile::remove(versionFiles.at(index)->filename)) { beginResetModel(); versionFiles.removeAt(index); reapply(true); endResetModel(); return true; } return false; }