mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 15:26:55 +03:00
Fix LockSystemProfiles
This commit is contained in:
parent
05b56cdc0a
commit
87762c82aa
@ -104,4 +104,6 @@ public class ProfileManagerTests : ContextualTests
|
||||
Assert.Equal(2, profiles[0].Version);
|
||||
Assert.Equal(1, profiles[0].UpgradedFrom);
|
||||
}
|
||||
|
||||
// TODO: Add tests for LockSystemProfiles etc
|
||||
}
|
@ -151,7 +151,7 @@ public class ProfileManager : IProfileManager
|
||||
}
|
||||
|
||||
var systemProfileNames = new HashSet<string>(systemProfiles.Select(x => x.DisplayName));
|
||||
foreach (var profile in userProfiles)
|
||||
foreach (var profile in userProfiles.ToList())
|
||||
{
|
||||
if (systemProfileNames.Contains(profile.DisplayName))
|
||||
{
|
||||
|
@ -31,7 +31,12 @@ public class ScanProfile
|
||||
public ScanProfile Clone()
|
||||
{
|
||||
// Easy deep copy. Ideally we'd do this in a more efficient way.
|
||||
return this.ToXml().FromXml<ScanProfile>();
|
||||
var copy = this.ToXml().FromXml<ScanProfile>();
|
||||
// Copy XmlIgnore properties
|
||||
copy.UpgradedFrom = UpgradedFrom;
|
||||
copy.IsLocked = IsLocked;
|
||||
copy.IsDeviceLocked = IsDeviceLocked;
|
||||
return copy;
|
||||
}
|
||||
|
||||
public override string ToString() => DisplayName;
|
||||
|
Loading…
Reference in New Issue
Block a user