Skip to content

Commit

Permalink
ConfigHub/swap profiles: switch index is no longer returned.
Browse files Browse the repository at this point in the history
As no code caling ConfigHub.swapProfiles will ask for switch index, this argument is gone. Along with it, change the method to become a procedure (returning nothing).
  • Loading branch information
josephsl committed Jan 26, 2021
1 parent c1cdd4e commit 92b8f18
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions addon/appModules/splstudio/splconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,10 @@ def switchProfileEnd(self, prevProfile: Optional[str], newProfile: str, switchTy

# Used from config dialog and other places.
# Show switch index is used when deleting profiles so it doesn't have to look up index for old profiles.
def swapProfiles(
self, prevProfile: Optional[str], newProfile: str, showSwitchIndex: bool = False
) -> Optional[int]:
def swapProfiles(self, prevProfile: Optional[str], newProfile: str) -> None:
former = self.profileIndexByName(prevProfile if prevProfile is not None else self.switchHistory[-1])
current = self.profileIndexByName(newProfile)
self.profiles[current], self.profiles[former] = self.profiles[former], self.profiles[current]
if showSwitchIndex:
return current


# Default config spec container.
Expand Down

0 comments on commit 92b8f18

Please sign in to comment.