Skip to content

Commit

Permalink
If a project was created with lower case plugin IDs, try also with no…
Browse files Browse the repository at this point in the history
…n lower case IDs for newly created nodes
  • Loading branch information
MrKepzie committed May 3, 2016
1 parent f06a79d commit 7c3958a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Engine/AppInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ AppInstance::createNodeInternal(CreateNodeArgs& args)
QString findId;

//Roto has moved to a built-in plugin
if ( ( (args.reason == eCreateNodeReasonUserCreate) || (args.reason == eCreateNodeReasonProjectLoad) ) &&
if ( (args.reason == eCreateNodeReasonUserCreate || args.reason == eCreateNodeReasonInternal || args.reason == eCreateNodeReasonProjectLoad) &&
( ( !_imp->_projectCreatedWithLowerCaseIDs && ( args.pluginID == QString::fromUtf8(PLUGINID_OFX_ROTO) ) ) || ( _imp->_projectCreatedWithLowerCaseIDs && ( args.pluginID == QString::fromUtf8(PLUGINID_OFX_ROTO).toLower() ) ) ) ) {
findId = QString::fromUtf8(PLUGINID_NATRON_ROTO);
} else {
Expand Down
15 changes: 9 additions & 6 deletions Engine/AppManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1715,19 +1715,22 @@ AppManager::getPluginBinary(const QString & pluginId,
PluginsMap::const_iterator foundID = _imp->_plugins.end();

for (PluginsMap::const_iterator it = _imp->_plugins.begin(); it != _imp->_plugins.end(); ++it) {
QString pID = QString::fromUtf8( it->first.c_str() );
if ( convertToLowerCase &&
!pluginId.startsWith( QString::fromUtf8(NATRON_ORGANIZATION_DOMAIN_TOPLEVEL "." NATRON_ORGANIZATION_DOMAIN_SUB ".built-in.") ) ) {
QString lowerCase = QString::fromUtf8( it->first.c_str() ).toLower();

QString lowerCase = pID.toLower();
if (lowerCase == pluginId) {
foundID = it;
break;
}
} else {
if (QString::fromUtf8( it->first.c_str() ) == pluginId) {
foundID = it;
break;
}
}

if (pID == pluginId) {
foundID = it;
break;
}

}


Expand Down

0 comments on commit 7c3958a

Please sign in to comment.