void TelegramMessagesModel::loadMore(bool force) { if( !p->telegram ) return; if( !p->dialog ) return; if( !force && p->messages.count() == 0 ) return; if( !force && p->load_limit == p->load_count + LOAD_STEP_COUNT) return; p->load_limit = p->load_count + LOAD_STEP_COUNT; Telegram *tgObject = p->telegram->telegram(); if(p->dialog->encrypted()) { Peer peer(Peer::typePeerChat); peer.setChatId(p->dialog->peer()->userId()); p->telegram->database()->readMessages(peer, p->load_count, LOAD_STEP_COUNT); return; } const InputPeer & peer = p->telegram->getInputPeer(peerId()); if(p->dialog->peer()->userId() != CutegramDialog::cutegramId()) { tgObject->messagesGetHistory(peer, p->load_count, p->maxId, p->load_limit ); p->refreshing = true; } p->telegram->database()->readMessages(TelegramMessagesModel::peer(), p->load_count, LOAD_STEP_COUNT); emit refreshingChanged(); }
void Texture::notifyStatus(QAbstractTexture::Status status) { auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); change->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); change->setPropertyName("status"); change->setValue(status); notifyObservers(change); }
void PhysicalDeviceProxy::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) { const auto typedChange = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<QAbstractPhysicalDeviceProxyData>>(change); const QAbstractPhysicalDeviceProxyData &data = typedChange->data; m_deviceName = data.deviceName; // Request to load the actual device m_manager->addPendingProxyToLoad(peerId()); }
void BoundingVolumeDebug::setRadius(float radius) { if (m_radius != radius) { m_radius = radius; auto e = Qt3DCore::QPropertyUpdatedChangePtr::create(peerdId()); e->setDeliveryFlags(Qt3DCore::QSceneChange::DeliverToAll); e->setPropertyName("radius"); e->setTargetNode(peerId()); e->setValue(QVariant(radius)); notifyObservers(e); } }
void BoundingVolumeDebug::setCenter(const QVector3D ¢er) { if (m_center != center) { m_center = center; auto e = Qt3DCore::QPropertyUpdatedChangePtr::create(peerdId()); e->setDeliveryFlags(Qt3DCore::QSceneChange::DeliverToAll); e->setPropertyName("center"); e->setTargetNode(peerId()); e->setValue(QVariant::fromValue(center)); notifyObservers(e); } }
void TelegramMessagesModel::setReaded() { if( !p->telegram ) return; if( !p->dialog ) return; if( p->telegram->invisible() ) return; p->telegram->messagesReadHistory(peerId()); p->dialog->setUnreadCount(0); }
void AnimationClip::setDuration(float duration) { if (qFuzzyCompare(duration, m_duration)) return; m_duration = duration; // Send a change to the frontend auto e = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); e->setDeliveryFlags(Qt3DCore::QSceneChange::DeliverToAll); e->setPropertyName("duration"); e->setValue(m_duration); notifyObservers(e); }
void Texture::updateFromData(QTextureDataPtr data) { if (data->width() != m_properties.width) { m_properties.width = data->width(); auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); change->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); change->setPropertyName("width"); change->setValue(data->width()); notifyObservers(change); } if (data->height() != m_properties.height) { m_properties.height = data->height(); auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); change->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); change->setPropertyName("height"); change->setValue(data->height()); notifyObservers(change); } if (data->depth() != m_properties.depth) { m_properties.depth = data->depth(); auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); change->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); change->setPropertyName("depth"); change->setValue(data->depth()); notifyObservers(change); } if (data->layers() != m_properties.layers) { m_properties.layers = data->layers(); auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); change->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); change->setPropertyName("layers"); change->setValue(data->layers()); notifyObservers(change); } if (data->format() != m_properties.format) { m_properties.format = data->format(); auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); change->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); change->setPropertyName("format"); change->setValue(data->format()); notifyObservers(change); } if (data->target() != m_properties.target) { // TODO frontend property is actually constant m_properties.target = data->target(); auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); change->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); change->setPropertyName("target"); change->setValue(data->target()); notifyObservers(change); } }
void PhysicalDeviceProxy::setDevice(QAbstractPhysicalDevice *device) { m_physicalDeviceId = Qt3DCore::QNodeId(); // Move the device to the main thread if (device != nullptr) { m_physicalDeviceId = device->id(); device->moveToThread(QCoreApplication::instance()->thread()); } auto e = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); e->setDeliveryFlags(Qt3DCore::QSceneChange::DeliverToAll); e->setPropertyName("device"); e->setValue(QVariant::fromValue(device)); notifyObservers(e); }
/** * Method called whenever a given peer has a QoS status change. * * @param address the address * @param bandwidth_in available amount of inbound bandwidth * @param bandwidth_out available amount of outbound bandwidth * @param ats performance data for the address (as far as known) * @param ats_count number of performance records in 'ats' */ void NetworkManager::peerATSstatusChange (const struct GNUNET_HELLO_Address *address, int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, const struct GNUNET_ATS_Information *ats, uint32_t ats_count) { const char* key = GNUNET_i2s_full (&address->peer); QString peerId(key); if(!theApp->models()->networkModel()){ qWarning() << "Recivied a peerATSstatus without network Model"; return; } Peer *peer = theApp->models()->networkModel()->getPeer(peerId); if (NULL == peer) { qWarning() << "Recivied a peerATSstatus, but the peer do not exist : " << peerId; return; } //TODO:: See what ATS can give to us GNUNET_ATS_Information * atsinfo = new GNUNET_ATS_Information[ats_count]; for(unsigned int i = 0 ; i < ats_count ; i++){ memcpy(&atsinfo[i], &ats[i], sizeof(GNUNET_ATS_Information)); qWarning() << QString("ATS - Type : %1 , Value: %2 ").arg( GNUNET_ATS_print_property_type(ntohl(atsinfo[i].type))).arg(atsinfo[i].value); } delete[] atsinfo; unsigned int bandIn = (unsigned int)ntohl(bandwidth_in.value__); unsigned int bandOut = (unsigned int)ntohl(bandwidth_out.value__); peer->setATSInfo(bandIn,bandOut); }
void TelegramMessagesModel::refresh() { if( !p->telegram ) return; if( !p->dialog ) return; Telegram *tgObject = p->telegram->telegram(); if(p->dialog->encrypted()) { Peer peer(Peer::typePeerChat); peer.setChatId(p->dialog->peer()->userId()); p->telegram->database()->readMessages(peer, 0, LOAD_STEP_COUNT); return; } const InputPeer & peer = p->telegram->getInputPeer(peerId()); if(p->dialog->peer()->userId() != CutegramDialog::cutegramId()) tgObject->messagesGetHistory(peer, 0, p->maxId, LOAD_STEP_COUNT ); p->telegram->database()->readMessages(TelegramMessagesModel::peer(), 0, LOAD_STEP_COUNT); }
// This will add the ShaderData to be cleared from updates at the end of the frame // by the cleanup job // Called by renderview jobs (several concurrent threads) void ShaderData::markDirty() { QMutexLocker lock(&m_mutex); if (!ShaderData::m_updatedShaderData.contains(peerId())) ShaderData::m_updatedShaderData.append(peerId()); }
void AnimationClip::setStatus(QAnimationClipLoader::Status status) { if (status != m_status) { m_status = status; Qt3DCore::QPropertyUpdatedChangePtr e = Qt3DCore::QPropertyUpdatedChangePtr::create(peerId()); e->setDeliveryFlags(Qt3DCore::QSceneChange::DeliverToAll); e->setPropertyName("status"); e->setValue(QVariant::fromValue(m_status)); notifyObservers(e); } }