| 32 | } |
| 33 | |
| 34 | Ref<PluginSource> PluginManager::get_source(const String &plugin_name) { |
| 35 | // Check if we already have a source for this plugin |
| 36 | Ref<PluginSource> default_source; |
| 37 | for (int i = 0; i < source_count; ++i) { |
| 38 | if (sources[i]->handles_plugin(plugin_name)) { |
| 39 | if (sources[i]->is_default()) { |
| 40 | default_source = sources[i]; |
| 41 | continue; |
| 42 | } |
| 43 | return sources[i]; |
| 44 | } |
| 45 | } |
| 46 | return default_source; |
| 47 | } |
| 48 | |
| 49 | void PluginManager::register_source(Ref<PluginSource> source, bool at_front) { |
| 50 | if (source_count < MAX_SOURCES) { |
no test coverage detected