| 19 | using namespace GammaRay; |
| 20 | |
| 21 | SelectionModelServer::SelectionModelServer(const QString &objectName, QAbstractItemModel *model, |
| 22 | QObject *parent) |
| 23 | : NetworkSelectionModel(objectName, model, parent) |
| 24 | , m_timer(new QTimer(this)) |
| 25 | , m_monitored(false) |
| 26 | { |
| 27 | // We do use a timer to group requests to avoid network overhead |
| 28 | m_timer->setSingleShot(true); |
| 29 | m_timer->setInterval(125); |
| 30 | connect(m_timer, &QTimer::timeout, this, &SelectionModelServer::timeout); |
| 31 | |
| 32 | m_myAddress = Server::instance()->registerObject(objectName, this, Server::ExportNothing); |
| 33 | Server::instance()->registerMessageHandler(m_myAddress, this, "newMessage"); |
| 34 | Server::instance()->registerMonitorNotifier(m_myAddress, this, "modelMonitored"); |
| 35 | connect(Endpoint::instance(), &Endpoint::disconnected, this, [this] { modelMonitored(); }); |
| 36 | } |
| 37 | |
| 38 | SelectionModelServer::~SelectionModelServer() = default; |
| 39 |
nothing calls this directly
no test coverage detected