Skip to content

Commit

Permalink
Remove ProfilesSourceEntry for now
Browse files Browse the repository at this point in the history
  • Loading branch information
FWest98 committed Sep 10, 2022
1 parent 2e6f1ce commit bc628f6
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 131 deletions.
1 change: 0 additions & 1 deletion src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,6 @@ namespace winrt::TerminalApp::implementation
// separately. This collection is stored as a map <int, Profile>, so the correct
// profile index is already known.
case NewTabMenuEntryType::RemainingProfiles:
case NewTabMenuEntryType::Source:
{
const auto remainingProfilesEntry = entry.as<ProfileCollectionEntry>();
if (remainingProfilesEntry.Profiles() == nullptr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1279,30 +1279,6 @@ void CascadiaSettings::_resolveNewTabMenuProfilesSet(const IVector<Model::NewTab
_resolveNewTabMenuProfilesSet(folderEntries, remainingProfiles, remainingProfilesEntry);
break;
}

// For a "source" entry, we iterate through the list of all profiles and
// find all those generated by the given source. We make sure that none of these will
// be included in the "remaining profiles" either.
case NewTabMenuEntryType::Source:
{
const auto sourceEntry = entry.as<Model::ProfilesSourceEntry>();
sourceEntry.Profiles(single_threaded_map<int, Model::Profile>());

auto activeProfileCount = gsl::narrow_cast<int>(_activeProfiles.Size());
for (auto profileIndex = 0; profileIndex < activeProfileCount; profileIndex++)
{
const auto profile = _activeProfiles.GetAt(profileIndex);

// On a match, we store it in the entry and remove it from the remaining list
if (profile.Source() == sourceEntry.Source())
{
sourceEntry.Profiles().Insert(profileIndex, profile);
remainingProfiles.TryRemove(profileIndex);
}
}

break;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
<ClInclude Include="RemainingProfilesEntry.h">
<DependentUpon>NewTabMenuEntry.idl</DependentUpon>
</ClInclude>
<ClInclude Include="ProfilesSourceEntry.h">
<DependentUpon>NewTabMenuEntry.idl</DependentUpon>
</ClInclude>
<ClInclude Include="ProfileCollectionEntry.h">
<DependentUpon>NewTabMenuEntry.idl</DependentUpon>
</ClInclude>
Expand Down Expand Up @@ -199,9 +196,6 @@
<ClCompile Include="RemainingProfilesEntry.cpp">
<DependentUpon>NewTabMenuEntry.idl</DependentUpon>
</ClCompile>
<ClCompile Include="ProfilesSourceEntry.cpp">
<DependentUpon>NewTabMenuEntry.idl</DependentUpon>
</ClCompile>
<ClCompile Include="VsDevCmdGenerator.cpp" />
<ClCompile Include="VsDevShellGenerator.cpp" />
<ClCompile Include="VsSetupConfiguration.cpp" />
Expand Down
4 changes: 1 addition & 3 deletions src/cascadia/TerminalSettingsModel/NewTabMenuEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "FolderEntry.h"
#include "ProfileEntry.h"
#include "RemainingProfilesEntry.h"
#include "ProfilesSourceEntry.h"

#include "NewTabMenuEntry.g.cpp"

Expand All @@ -23,8 +22,7 @@ static const std::unordered_map<NewTabMenuEntryType, MenuEntryParser> typeDeseri
{ NewTabMenuEntryType::Separator, SeparatorEntry::FromJson },
{ NewTabMenuEntryType::Folder, FolderEntry::FromJson },
{ NewTabMenuEntryType::Profile, ProfileEntry::FromJson },
{ NewTabMenuEntryType::RemainingProfiles, RemainingProfilesEntry::FromJson },
{ NewTabMenuEntryType::Source, ProfilesSourceEntry::FromJson }
{ NewTabMenuEntryType::RemainingProfiles, RemainingProfilesEntry::FromJson }
};

NewTabMenuEntry::NewTabMenuEntry(const NewTabMenuEntryType type) noexcept :
Expand Down
11 changes: 1 addition & 10 deletions src/cascadia/TerminalSettingsModel/NewTabMenuEntry.idl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ namespace Microsoft.Terminal.Settings.Model
Profile,
Separator,
Folder,
RemainingProfiles,
Source
RemainingProfiles
};

[default_interface] unsealed runtimeclass NewTabMenuEntry
Expand Down Expand Up @@ -53,12 +52,4 @@ namespace Microsoft.Terminal.Settings.Model
{
RemainingProfilesEntry();
}

[default_interface] runtimeclass ProfilesSourceEntry : ProfileCollectionEntry
{
ProfilesSourceEntry();
ProfilesSourceEntry(String source);

String Source;
}
}
40 changes: 0 additions & 40 deletions src/cascadia/TerminalSettingsModel/ProfilesSourceEntry.cpp

This file was deleted.

42 changes: 0 additions & 42 deletions src/cascadia/TerminalSettingsModel/ProfilesSourceEntry.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,10 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::ScrollToMarkDirection)
// Possible NewTabMenuEntryType values
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::NewTabMenuEntryType)
{
JSON_MAPPINGS(5) = {
JSON_MAPPINGS(4) = {
pair_type{ "profile", ValueType::Profile },
pair_type{ "separator", ValueType::Separator },
pair_type{ "folder", ValueType::Folder },
pair_type{ "remainingProfiles", ValueType::RemainingProfiles },
pair_type{ "source", ValueType::Source }
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
<ClInclude Include="../RemainingProfilesEntry.h">
<DependentUpon>../NewTabMenuEntry.h</DependentUpon>
</ClInclude>
<ClInclude Include="../ProfilesSourceEntry.h">
<DependentUpon>../NewTabMenuEntry.h</DependentUpon>
</ClInclude>
<ClInclude Include="../ProfileCollectionEntry.h">
<DependentUpon>../NewTabMenuEntry.h</DependentUpon>
</ClInclude>
Expand Down

0 comments on commit bc628f6

Please sign in to comment.