| 20 | using namespace Data; |
| 21 | |
| 22 | SyncthingMenuAction::SyncthingMenuAction(const KFileItemListProperties &properties, const QList<QAction *> &actions, QWidget *parentWidget) |
| 23 | : QAction(parentWidget) |
| 24 | , m_properties(properties) |
| 25 | , m_notifier(SyncthingFileItemAction::staticData().connection()) |
| 26 | , m_parentWidget(parentWidget) |
| 27 | { |
| 28 | #ifdef CPP_UTILITIES_DEBUG_BUILD |
| 29 | std::cerr << EscapeCodes::Phrases::Info << "Creating SyncthingMenuAction: " << this << EscapeCodes::Phrases::EndFlush; |
| 30 | #endif |
| 31 | |
| 32 | // init according to current state |
| 33 | createMenu(actions); |
| 34 | updateActionStatus(); |
| 35 | |
| 36 | // setup handling future state change |
| 37 | m_notifier.setEnabledNotifications(SyncthingHighLevelNotification::ConnectedDisconnected); |
| 38 | connect(&m_notifier, &SyncthingNotifier::connected, this, &SyncthingMenuAction::handleConnectedChanged); |
| 39 | connect(&m_notifier, &SyncthingNotifier::disconnected, this, &SyncthingMenuAction::handleConnectedChanged); |
| 40 | } |
| 41 | |
| 42 | #ifdef CPP_UTILITIES_DEBUG_BUILD |
| 43 | SyncthingMenuAction::~SyncthingMenuAction() |
nothing calls this directly
no test coverage detected