The problem is that it doesn't save the relative path, but rather the name. Therefore, the relative path it will always read will be the project directory, since that's equivalent to no path at all (only the name).
From the beginning, if you provided Qtractor with a valid path to the plugin (whether relative or absolute), Qtractor's first action is to load it. And if the "not found" warning doesn't appear. (I think it's in the session file)
It is unnecessary checks if it exists or not in the configuration paths... because if it's there, it's because it exists, regardless of where... whether within the paths defined in the configuration or in the paths defined by the session paths.
This seems to work, although I'm not sure if the last "return false" is necessary. As you say // Might never reach here! :)
// Check/sanitize plugin file-path to save (absolute->relative)...
bool qtractorPlugin::savePluginFilename (
QString& sFilename, qtractorPluginType::Hint typeHint ) const
{
// Care of internal pseudo-plugins...
if (sFilename.isEmpty())
return false;
// LV2 plug-ins are identified by URI...
if (typeHint == qtractorPluginType::Lv2)
return true;
// Force plugin relative path...
qtractorSession *pSession = qtractorSession::getInstance();
if (pSession) {
sFilename = pSession->relativeFilePath(sFilename);
return true;
}
// Might never reach here!...
return false;
}
The problem is that it doesn't save the relative path, but rather the name. Therefore, the relative path it will always read will be the project directory, since that's equivalent to no path at all (only the name).
From the beginning, if you provided Qtractor with a valid path to the plugin (whether relative or absolute), Qtractor's first action is to load it. And if the "not found" warning doesn't appear. (I think it's in the session file)
It is unnecessary checks if it exists or not in the configuration paths... because if it's there, it's because it exists, regardless of where... whether within the paths defined in the configuration or in the paths defined by the session paths.
This seems to work, although I'm not sure if the last "return false" is necessary. As you say // Might never reach here! :)
// Check/sanitize plugin file-path to save (absolute->relative)... bool qtractorPlugin::savePluginFilename ( QString& sFilename, qtractorPluginType::Hint typeHint ) const { // Care of internal pseudo-plugins... if (sFilename.isEmpty()) return false; // LV2 plug-ins are identified by URI... if (typeHint == qtractorPluginType::Lv2) return true; // Force plugin relative path... qtractorSession *pSession = qtractorSession::getInstance(); if (pSession) { sFilename = pSession->relativeFilePath(sFilename); return true; } // Might never reach here!... return false; }