| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #include "collaboratorsreceiver.h" |
| 6 | #include "mainframe/cvskeeper.h" |
| 7 | |
| 8 | #include "common/common.h" |
| 9 | |
| 10 | CollaboratorsReceiver::CollaboratorsReceiver(QObject *parent) |
| 11 | : dpf::EventHandler (parent) |
| 12 | , dpf::AutoEventHandlerRegister<CollaboratorsReceiver> () |
| 13 | { |
| 14 | |
| 15 | } |
| 16 | |
| 17 | dpf::EventHandler::Type CollaboratorsReceiver::type() |
| 18 | { |
| 19 | return dpf::EventHandler::Type::Sync; |
| 20 | } |
| 21 | |
| 22 | QStringList CollaboratorsReceiver::topics() |
| 23 | { |
| 24 | return {T_COLLABORATORS}; |
| 25 | } |
| 26 | |
| 27 | void CollaboratorsReceiver::eventProcess(const dpf::Event &event) |
| 28 | { |
| 29 | if (!topics().contains(event.topic())) |
| 30 | abort(); |
| 31 | |
| 32 | if (D_OPEN_REPOS == event.data()) { |
| 33 | CVSkeeper::instance()->openRepos(event.property(P_WORKSPACEFOLDER).toString()); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 |