bool CWizSearchIndexer::deleteDocument(const WIZDOCUMENTDATAEX& doc)
{
    Q_ASSERT(!doc.strGUID.isEmpty());

    CWizDocumentDataArray arrayDocuments;
    arrayDocuments.push_back(doc);
    return deleteDocuments(arrayDocuments);
}
void CWizDocumentOperator::deleteDocuments(const CWizDocumentDataArray& arrayDocument)
{
    m_arrayDocument = arrayDocument;
    //
    m_thread = new QThread();
    moveToThread(m_thread);
    connect(m_thread, SIGNAL(started()), SLOT(deleteDocuments()));
    m_thread->start();
}
Exemple #3
0
    void Notifier::onDeleteDocument()
    {
        if (_queryInfo.isNull)
            return;

        QModelIndex selectedIndex = _observer->selectedIndex();
        if (!selectedIndex.isValid())
            return;

        BsonTreeItem *documentItem = QtUtils::item<BsonTreeItem*>(selectedIndex);
        std::vector<BsonTreeItem*> vec;
        vec.push_back(documentItem);
        return deleteDocuments(vec,false);
    }
Exemple #4
0
    void Notifier::onDeleteDocuments()
    {
        if (_queryInfo.isNull)
            return;

        QModelIndexList selectedIndexes = _observer->selectedIndexes();
        if (!detail::isMultySelection(selectedIndexes))
            return;
        int answer = QMessageBox::question(dynamic_cast<QWidget*>(_observer), "Delete", "Do you want to delete all selected documents?");
        if (answer == QMessageBox::Yes) {
            std::vector<BsonTreeItem*> items;
            for (QModelIndexList::const_iterator it = selectedIndexes.begin(); it!= selectedIndexes.end(); ++it) {
                BsonTreeItem *item = QtUtils::item<BsonTreeItem*>(*it);
                items.push_back(item);                
            }
            deleteDocuments(items,true);
        }
    }
Exemple #5
0
    void Notifier::onDeleteDocuments()
    {
        if (!_queryInfo._info.isValid())
            return;

        QModelIndexList selectedIndexes = _observer->selectedIndexes();
        if (!detail::isMultiSelection(selectedIndexes))
            return;

        int const answer = QMessageBox::question(dynamic_cast<QWidget*>(_observer), "Delete", 
                                           QString("Do you want to delete %1 selected documents?").
                                           arg(selectedIndexes.count()));

        if (QMessageBox::Yes == answer) {
            std::vector<BsonTreeItem*> items;
            for (auto index : selectedIndexes) 
                items.push_back(QtUtils::item<BsonTreeItem*>(index));
            
            deleteDocuments(items, true);
        }
    }