mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Improved VS detection
This commit is contained in:
parent
d82aab3b3f
commit
b94f69b976
3 changed files with 76 additions and 11 deletions
|
@ -22,9 +22,11 @@ namespace IDE
|
|||
public String mBin64Path = new .() ~ delete _;
|
||||
public List<String> mLib32Paths = new .() ~ DeleteContainerAndItems!(_);
|
||||
public List<String> mLib64Paths = new .() ~ DeleteContainerAndItems!(_);
|
||||
public bool mManuallySet;
|
||||
|
||||
public void Serialize(StructuredData sd)
|
||||
{
|
||||
sd.Add("ManuallySet", mManuallySet);
|
||||
sd.Add("Bin32Path", mBin32Path);
|
||||
sd.Add("Bin64Path", mBin64Path);
|
||||
using (sd.CreateArray("Lib32Paths"))
|
||||
|
@ -41,6 +43,10 @@ namespace IDE
|
|||
|
||||
public void Deserialize(StructuredData sd)
|
||||
{
|
||||
mManuallySet = sd.GetBool("ManuallySet");
|
||||
if ((!mManuallySet) && (!mBin64Path.IsEmpty))
|
||||
return;
|
||||
|
||||
sd.GetString("Bin32Path", mBin32Path);
|
||||
sd.GetString("Bin64Path", mBin64Path);
|
||||
|
||||
|
@ -85,6 +91,7 @@ namespace IDE
|
|||
|
||||
public void SetDefaults()
|
||||
{
|
||||
mManuallySet = false;
|
||||
#if BF_PLATFORM_WINDOWS
|
||||
StringView vsInfo = .(VSSupport_Find());
|
||||
|
||||
|
@ -111,6 +118,25 @@ namespace IDE
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Equals(List<String> lhs, List<String> rhs)
|
||||
{
|
||||
if (lhs.Count != rhs.Count)
|
||||
return false;
|
||||
for (int idx < lhs.Count)
|
||||
if (lhs[idx] != rhs[idx])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Equals(VSSettings vsSettings)
|
||||
{
|
||||
return
|
||||
(Equals(mLib32Paths, vsSettings.mLib32Paths)) &&
|
||||
(Equals(mLib64Paths, vsSettings.mLib64Paths)) &&
|
||||
(mBin32Path == vsSettings.mBin32Path) &&
|
||||
(mBin64Path == vsSettings.mBin64Path);
|
||||
}
|
||||
}
|
||||
|
||||
public class DebuggerSettings
|
||||
|
|
|
@ -395,7 +395,18 @@ namespace IDE.ui
|
|||
{
|
||||
if (propPage == null)
|
||||
continue;
|
||||
ApplyChanges(propPage, ref hadChanges);
|
||||
bool pageHadChanges = false;
|
||||
ApplyChanges(propPage, ref pageHadChanges);
|
||||
if (pageHadChanges)
|
||||
{
|
||||
hadChanges = true;
|
||||
if ((CategoryType)@propPage == .VisualStudio)
|
||||
{
|
||||
Settings.VSSettings defaultSettings = scope .();
|
||||
defaultSettings.SetDefaults();
|
||||
gApp.mSettings.mVSSettings.mManuallySet = !defaultSettings.Equals(gApp.mSettings.mVSSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hadChanges)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue