Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly use the ladspa plugin folder #2190

Merged
merged 1 commit into from
Jul 19, 2015
Merged

Correctly use the ladspa plugin folder #2190

merged 1 commit into from
Jul 19, 2015

Conversation

curlymorphic
Copy link
Contributor

The config manager was not using the loaded value for the ladspa folder
The default Ladspa plugin folder was incorrect under linux

This pull request fixes this.

Fixes #2159 Master branch can't find ladspa effects

Were introduced in #1908 Re organizing of the user lmms directory

@curlymorphic curlymorphic changed the title The ConfigManager was Incorrectly loading Ladspa plugin folder. Correctly use the ladspa plugin folder Jul 16, 2015
{
#if defined(LMMS_BUILD_WIN32)
m_ladDir = qApp->applicationDirPath() + "/plugins/ladspa" + QDir::separator();
#elif defined(LMMS_BUILD_APPLE)
m_ladDir = qApp->applicationDirPath() + "/../lib/lmms/ladspa/";
#else
m_ladDir = qApp->applicationDirPath() + '/' + LIB_DIR + "/ladspa/";
m_ladDir = qApp->applicationDirPath() + '/' + LIB_DIR + "lmms/ladspa/";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this fix well enough to critique it, but for consistency's sake, is there a reason we're using lmms/ladspa/ rather than /lmms/ladspa/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The``LIB_DIR` is terminated with a separator, I initially used /lmms/ladspa/ but this resulted in a path containing a double /.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, but should it? Is this where we set it?

https://github.com/LMMS/lmms/blob/master/src/CMakeLists.txt#L41

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this where we set it?

I belive so,

but should it?

IMO paths end with a trailing / (separator), filenames don't.

We could change LIB_DIR to not include the trailing separator, but that would involve changes across the codebase, outside the scope of this pull request. I am happy to work on that as a separate PR if required?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, all major OSes support double (or triple, etc) -slashes in paths. There's also QDir::cleanPath to strip redundant "/", "." and ".." if desired for formatting purposes.

It may be worth concatenating with an extra "/" for consistency or just in case LIB_DIR is ever modified to not have a trailing slash and then cleaning it with cleanPath afterward. This would also fix the display on apple caused by using ".." in qApp->applicationDirPath() + "/../lib/lmms/ladspa/" (e.g. /path/to/bin/../lib/lmms/ladspa would become /path/to/lib/lmms/ladspa)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally worth the extra slash IMO. It never hurts to have it, but to not have it might cause trouble.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do this when im back at my pc, as this seem to be the consensus.

@Wallacoloo
Copy link
Member

Wallacoloo commented Jul 17, 2015 via email

The default Ladspa plugin folder was incorrect under linux

This pull request fixes this.

Setting Dialog, Ladspa Directory Added leading /

Added a leading / to the lmms/ladspa plugin
Clean the path using QDir::cleanPath()
@curlymorphic
Copy link
Contributor Author

Added the Leading / to /lmms/ladspa and cleaned up the path using QDir::CleanPath

curlymorphic added a commit that referenced this pull request Jul 19, 2015
Correctly use the ladspa plugin folder
@curlymorphic curlymorphic merged commit 24649d4 into LMMS:master Jul 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants