diff --git a/io/path.cpp b/io/path.cpp index fe8a813f0..b90e13345 100644 --- a/io/path.cpp +++ b/io/path.cpp @@ -7,14 +7,8 @@ QString real_app_dir; -QString get_effects_dir() { - QString env_path(qgetenv("OLIVE_EFFECTS_PATH")); - if (!env_path.isEmpty()) return env_path; - return get_app_dir() + "/effects"; -} - QString get_app_dir() { - if (real_app_dir.isEmpty()) { + if (real_app_dir.isEmpty()) { QString app_path = QCoreApplication::applicationFilePath(); real_app_dir = app_path.left(app_path.lastIndexOf('/')); } diff --git a/io/path.h b/io/path.h index b53476693..31ff1e651 100644 --- a/io/path.h +++ b/io/path.h @@ -5,6 +5,5 @@ QString get_app_dir(); QString get_data_path(); -QString get_effects_dir(); #endif // PATH_H diff --git a/project/effect.cpp b/project/effect.cpp index 153987319..cfb628bc0 100644 --- a/project/effect.cpp +++ b/project/effect.cpp @@ -155,48 +155,55 @@ void load_internal_effects() { } void load_shader_effects() { - QString effects_path = get_effects_dir(); - QDir effects_dir(effects_path); - if (effects_dir.exists()) { - QList entries = effects_dir.entryList(QStringList("*.xml"), QDir::Files); - for (int i=0;i effects_paths; + effects_paths.append(get_app_dir() + "/effects"); + effects_paths.append(get_app_dir() + "/../share/olive-editor/effects"); - QXmlStreamReader reader(&file); - while (!reader.atEnd()) { - if (reader.name() == "effect") { - QString effect_name = ""; - QString effect_cat = ""; - const QXmlStreamAttributes attr = reader.attributes(); - for (int j=0;j entries = effects_dir.entryList(QStringList("*.xml"), QDir::Files); + for (int i=0;isetText(em->name); if (!em->filename.isEmpty()) { - QFile effect_file(get_effects_dir() + "/" + em->filename); + QFile effect_file(em->filename); if (effect_file.open(QFile::ReadOnly)) { QXmlStreamReader reader(&effect_file); @@ -400,7 +407,7 @@ Effect::Effect(Clip* c, const EffectMeta *em) : fragPath = attr.value().toString(); } } - } else if (reader.name() == "superimpose" && reader.isStartElement()) { + }/* else if (reader.name() == "superimpose" && reader.isStartElement()) { enable_superimpose = true; const QXmlStreamAttributes& attributes = reader.attributes(); for (int i=0;iaddShaderFromSourceFile(QOpenGLShader::Vertex, get_effects_dir() + "/" + vertPath); - if (!fragPath.isEmpty()) glslProgram->addShaderFromSourceFile(QOpenGLShader::Fragment, get_effects_dir() + "/" + fragPath); + if (!vertPath.isEmpty()) glslProgram->addShaderFromSourceFile(QOpenGLShader::Vertex, meta->path + "/" + vertPath); + if (!fragPath.isEmpty()) glslProgram->addShaderFromSourceFile(QOpenGLShader::Fragment, meta->path + "/" + fragPath); glslProgram->link(); isOpen = true; } diff --git a/project/effect.h b/project/effect.h index 08fcc13b4..3123af3cc 100644 --- a/project/effect.h +++ b/project/effect.h @@ -29,6 +29,7 @@ struct EffectMeta { QString name; QString category; QString filename; + QString path; int internal; int type; int subtype;