| 51 | } |
| 52 | |
| 53 | bool DiscoveryService::Install() { |
| 54 | // Create the host |
| 55 | host = localRegistry.AddNew<DiscoveryHost>(); |
| 56 | |
| 57 | // Create the resolver |
| 58 | resolver = localRegistry.AddNew<PluginResolver>(); |
| 59 | |
| 60 | // Find all plugins |
| 61 | PluginList list; |
| 62 | if (!resolver->FindPlugins("discovery", &list)) { |
| 63 | return false; |
| 64 | } |
| 65 | |
| 66 | // Attempt to install all plugins |
| 67 | if (!resolver->InstallPlugins(list)) { |
| 68 | return false; |
| 69 | } |
| 70 | |
| 71 | // Get the number of listeners |
| 72 | uint32_t listenerCount{0}; |
| 73 | host->Enumerate(&listenerCount, nullptr); |
| 74 | |
| 75 | // Get all listeners |
| 76 | listeners.resize(listenerCount); |
| 77 | host->Enumerate(&listenerCount, listeners.data()); |
| 78 | |
| 79 | // Add notify icon listener |
| 80 | listeners.push_back(localRegistry.New<NotifyIconDiscoveryListener>()); |
| 81 | |
| 82 | // OK |
| 83 | return true; |
| 84 | } |
| 85 | |
| 86 | bool DiscoveryService::IsGloballyInstalled() { |
| 87 | // Install all |
no test coverage detected