MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / onSyncTimeout

Method onSyncTimeout

src/WizMessageListView.cpp:650–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648}
649
650void WizMessageListView::onSyncTimeout()
651{
652 if (!m_api) {
653 m_api = new WizAsyncApi(this);
654
655 connect(m_api, SIGNAL(uploadMessageReadStatusFinished(QString)),
656 SLOT(on_uploadReadStatus_finished(QString)));
657 connect(m_api, SIGNAL(uploadMessageDeleteStatusFinished(QString)),
658 SLOT(on_uploadDeleteStatus_finished(QString)));
659 }
660
661 if (m_readList.count() > 0)
662 {
663 QString ids;
664 for (int i = 0; i < m_readList.size(); i++) {
665 ids += QString::number(m_readList.at(i));
666
667 if (i != m_readList.size() - 1) {
668 ids += ",";
669 }
670 }
671
672 if (ids.isEmpty())
673 return;
674
675 qDebug() << "upload messages read status:" << ids;
676 m_api->setMessageReadStatus(ids, 1);
677
678 m_readList.clear();
679 }
680
681 if (m_deleteList.count() > 0)
682 {
683 QString ids;
684 for (int i = 0; i < m_deleteList.size(); i++) {
685 ids += QString::number(m_deleteList.at(i));
686
687 if (i != m_deleteList.size() - 1) {
688 ids += ",";
689 }
690 }
691
692 if (ids.isEmpty())
693 return;
694
695 qDebug() << "upload messages delete status:" << ids;
696 m_api->setMessageDeleteStatus(ids, 1);
697
698 m_deleteList.clear();
699 }
700}
701
702void WizMessageListView::updateTreeItem()
703{

Callers

nothing calls this directly

Calls 7

connectFunction · 0.85
sizeMethod · 0.80
isEmptyMethod · 0.80
countMethod · 0.45
setMessageReadStatusMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected