diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/ClientStore.cpp | 14 | ||||
-rw-r--r-- | src/common/interface/Plugin.hpp | 6 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.cpp | 3 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 4943cf71..97d130da 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -274,12 +274,20 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) cerr << "}" << endl;*/ bool is_path = Path::is_valid(uri.str()); - bool is_meta = uri.substr(0, 8) == "meta:#"; + bool is_meta = uri.substr(0, 6) == "meta:#"; if (!(is_path || is_meta)) { const URI& type_uri = properties.find("rdf:type")->second.get_uri(); - SharedPtr<PluginModel> p(new PluginModel(uri, type_uri, properties)); - add_plugin(p); + if (Plugin::type_from_uri(type_uri.str()) != Plugin::NIL) { + SharedPtr<PluginModel> p(new PluginModel(uri, type_uri, properties)); + add_plugin(p); + return; + } + } + + string path_str = is_meta ? (string("/") + uri.chop_start("#")) : uri.str(); + if (!Path::is_valid(path_str)) { + cerr << "ERROR: Bad path: " << uri.str() << " - " << path_str << endl; return; } diff --git a/src/common/interface/Plugin.hpp b/src/common/interface/Plugin.hpp index 9b908fb8..12d8b4d0 100644 --- a/src/common/interface/Plugin.hpp +++ b/src/common/interface/Plugin.hpp @@ -29,7 +29,7 @@ namespace Shared { class Plugin : virtual public Resource { public: - enum Type { LV2, LADSPA, Internal, Patch }; + enum Type { NIL, LV2, LADSPA, Internal, Patch }; virtual Type type() const = 0; @@ -52,9 +52,7 @@ public: return Internal; else if (uri == "ingen:Patch") return Patch; - else - std::cerr << "WARNING: Unknown plugin type " << uri << std::endl; - return Internal; + return NIL; } }; diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 04a49927..a4adf44e 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -246,6 +246,9 @@ LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin) case Plugin::Patch: row[_plugins_columns._col_type] = "Patch"; break; + case Plugin::NIL: + row[_plugins_columns._col_type] = "?"; + break; } row[_plugins_columns._col_uri] = plugin->uri().str(); |