Use GetPath accessor

This commit is contained in:
Stefan Haller
2025-02-28 21:12:10 +01:00
parent 55fe6ade88
commit 475f14e37d
3 changed files with 6 additions and 6 deletions

View File

@@ -221,7 +221,7 @@ func (self *CommitFilesController) openCopyMenu() error {
copyPathItem := &types.MenuItem{
Label: self.c.Tr.CopyFilePath,
OnPress: func() error {
if err := self.c.OS().CopyToClipboard(node.Path); err != nil {
if err := self.c.OS().CopyToClipboard(node.GetPath()); err != nil {
return err
}
self.c.Toast(self.c.Tr.FilePathCopiedToast)

View File

@@ -410,7 +410,7 @@ func (self *FilesController) pressWithLock(selectedNodes []*filetree.FileNode) e
toPaths := func(nodes []*filetree.FileNode) []string {
return lo.Map(nodes, func(node *filetree.FileNode, _ int) string {
return node.Path
return node.GetPath()
})
}
@@ -875,7 +875,7 @@ func (self *FilesController) openDiffTool(node *filetree.FileNode) error {
return self.c.RunSubprocessAndRefresh(
self.c.Git().Diff.OpenDiffToolCmdObj(
git_commands.DiffToolCmdOptions{
Filepath: node.Path,
Filepath: node.GetPath(),
FromCommit: fromCommit,
ToCommit: "",
Reverse: reverse,
@@ -973,7 +973,7 @@ func (self *FilesController) openCopyMenu() error {
copyPathItem := &types.MenuItem{
Label: self.c.Tr.CopyFilePath,
OnPress: func() error {
if err := self.c.OS().CopyToClipboard(node.Path); err != nil {
if err := self.c.OS().CopyToClipboard(node.GetPath()); err != nil {
return err
}
self.c.Toast(self.c.Tr.FilePathCopiedToast)

View File

@@ -293,7 +293,7 @@ func getColorForChangeStatus(changeStatus string) style.TextStyle {
}
func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
splitName := split(node.Path)
splitName := split(node.GetPath())
name := join(splitName[depth:])
if node.File != nil && node.File.IsRename() {
@@ -314,7 +314,7 @@ func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
}
func commitFileNameAtDepth(node *filetree.Node[models.CommitFile], depth int) string {
splitName := split(node.Path)
splitName := split(node.GetPath())
name := join(splitName[depth:])
return name