1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Improved Add From Installed IDE project dialog

This commit is contained in:
Brian Fiete 2022-06-24 10:29:40 -07:00
parent 48635c1939
commit d204922403
4 changed files with 76 additions and 4 deletions

View file

@ -2973,6 +2973,8 @@ namespace IDE
{
using (mBeefConfig.mRegistry.mMonitor.Enter())
{
BeefConfig.RegistryEntry matchedEntry = null;
for (int regEntryIdx = mBeefConfig.mRegistry.mEntries.Count - 1; regEntryIdx >= 0; regEntryIdx--)
{
var regEntry = mBeefConfig.mRegistry.mEntries[regEntryIdx];
@ -2982,11 +2984,19 @@ namespace IDE
if (regEntry.mProjName == projectName)
{
useVerSpec = regEntry.mLocation;
verConfigDir = regEntry.mConfigFile.mConfigDir;
break FindLoop;
// Prioritize a lib file over a non-lib
if ((matchedEntry == null) ||
((!matchedEntry.mTargetType.IsLib) && (regEntry.mTargetType.IsLib)))
matchedEntry = regEntry;
}
}
if (matchedEntry != null)
{
useVerSpec = matchedEntry.mLocation;
verConfigDir = matchedEntry.mConfigFile.mConfigDir;
break FindLoop;
}
}
mBeefConfig.mRegistry.WaitFor();
}