Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: Fixed errors that occurred with shortcut items in git repositories #17015

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marcofranzen99
Copy link
Contributor

Resolved / Related Issues

Description
The problem was that GitShortcutItem cannot be cast to ShortcutItem because GitShortcutItem only inherits from GitItem and IShortcutItem. It cannot additionally inherit from ShortcutItem, since a class in C# cannot have multiple base classes.

Simply casting to IShortcutItem everywhere did not work, as the IShortcutItem interface would lack properties of the ListedItem (such as ItemPath).

That's why I decided to create an interface IListedItem. IShortcutItem & IGitItem now both inherit from this interface.

Problems only occurred with shortcut items that are part of a git repository. Not all of them led to a crash, some only displayed error messages or led to incorrect behavior. Here is a list of affected actions:

  • Selecting a shortcut item
  • Selecting a shortcut item with preview pane open
  • Open Properties Window for a shortcut item
  • Save modified properties of a shortcut via properties window
  • Open in new tab
  • Open in new pane
  • Open in new Window
  • Pin To Start
  • Unpin From Start
  • Share Item

Steps used to test these changes

  1. tested if the actions listed above work correctly

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Selecting a shortcut in a git folder crashes Files
3 participants