MCPcopy Create free account
hub / github.com/KDAB/GammaRay / newMessage

Method newMessage

common/networkselectionmodel.cpp:164–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164void NetworkSelectionModel::newMessage(const Message &msg)
165{
166 Q_ASSERT(msg.address() == m_myAddress);
167 switch (msg.type()) {
168 case Protocol::SelectionModelSelect: {
169 Util::SetTempValue<bool> guard(m_handlingRemoteMessage, true);
170 m_pendingSelection = readSelection(msg);
171 msg >> m_pendingCommand;
172 applyPendingSelection();
173 break;
174 }
175 case Protocol::SelectionModelCurrent: {
176 SelectionFlags flags;
177 Protocol::ModelIndex index;
178 msg >> flags >> index;
179 const QModelIndex qmi = Protocol::toQModelIndex(model(), index);
180 if (!qmi.isValid())
181 break;
182 Util::SetTempValue<bool> guard(m_handlingRemoteMessage, true);
183 setCurrentIndex(qmi, flags);
184 break;
185 }
186 case Protocol::SelectionModelStateRequest:
187 sendSelection();
188 break;
189 default:
190 Q_ASSERT(false);
191 }
192}
193
194void NetworkSelectionModel::slotCurrentChanged(const QModelIndex &current,
195 const QModelIndex &previous)

Callers

nothing calls this directly

Calls 5

applyPendingSelectionFunction · 0.85
toQModelIndexFunction · 0.85
addressMethod · 0.45
typeMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected