@@ -135,12 +135,6 @@ namespace AppInstaller::Repository
135135 return AddOrUpdateFromDetails (details, &ISourceFactory::Update, progress);
136136 }
137137
138- bool EditSource (SourceDetails& details, const SourceEdit& edits)
139- {
140- auto factory = ISourceFactory::GetForType (details.Type );
141- return factory->Edit (details, edits);
142- }
143-
144138 AddOrUpdateResult BackgroundUpdateSourceFromDetails (SourceDetails& details, IProgressCallback& progress)
145139 {
146140 return AddOrUpdateFromDetails (details, &ISourceFactory::BackgroundUpdate, progress);
@@ -493,29 +487,6 @@ namespace AppInstaller::Repository
493487 m_sourceReferences.emplace_back (CreateSourceFromDetails (details));
494488 }
495489
496- Source::Source (std::string_view name, std::optional<bool > isExplicit)
497- {
498- SourceList sourceList;
499- auto source = sourceList.GetCurrentSource (name);
500- if (!source)
501- {
502- AICLI_LOG (Repo, Info, << " Named source requested, but not found: " << name);
503- }
504- else
505- {
506- AICLI_LOG (Repo, Info, << " Named source requested, found: " << source->Name );
507-
508- // This is intended to support Editing a source, and at present only the Explicit
509- // property of SourceDetails can be edited.
510- if (isExplicit.has_value ())
511- {
512- source->Explicit = isExplicit.value ();
513- }
514-
515- m_sourceReferences.emplace_back (CreateSourceFromDetails (*source));
516- }
517- }
518-
519490 Source::Source (const std::vector<Source>& availableSources)
520491 {
521492 std::shared_ptr<CompositeSource> compositeSource = std::make_shared<CompositeSource>(" *CompositeSource" );
@@ -1020,7 +991,7 @@ namespace AppInstaller::Repository
1020991 return result;
1021992 }
1022993
1023- bool Source::Edit (const SourceEdit& edits)
994+ void Source::Edit (const SourceEdit& edits)
1024995 {
1025996 THROW_HR_IF (HRESULT_FROM_WIN32 (ERROR_INVALID_STATE), m_isSourceToBeAdded || m_sourceReferences.size () != 1 || m_source);
1026997
@@ -1030,15 +1001,17 @@ namespace AppInstaller::Repository
10301001 // This is intentionally the same policy checks as Remove. If the source cannot be removed then it cannot be edited.
10311002 EnsureSourceIsRemovable (details);
10321003
1033- // Apply the edits and update source list.
1034- bool result = EditSource (details, edits);
1035- if (result)
1004+ if (RequiresChanges (edits))
10361005 {
1006+ if (edits.Explicit .has_value ())
1007+ {
1008+ details.Explicit = edits.Explicit .value ();
1009+ }
1010+
1011+ // Apply the edits and update source list.
10371012 SourceList sourceList;
10381013 sourceList.EditSource (details);
10391014 }
1040-
1041- return result;
10421015 }
10431016
10441017 bool Source::RequiresChanges (const SourceEdit& edits)
0 commit comments