adding more tests and method to receive an item's actual path identifier

This commit is contained in:
2021-12-12 03:23:51 -05:00
parent 56ba974dec
commit cf354c3fa9
3 changed files with 105 additions and 47 deletions

View File

@@ -258,6 +258,22 @@ func (c *Collection) Modified() (modified time.Time, isChanged bool, err error)
return
}
/*
PathName returns the "real" name of a Collection.
In some cases, the Collection.Label may not be the actual *name* of the collection
(i.e. the label is different from the name used in the Dbus path).
This is a thin wrapper around simply extracting the last item from
the Collection.Dbus.Path().
*/
func (c *Collection) PathName() (realName string) {
var pathSplit []string = strings.Split(string(c.Dbus.Path()), "/")
realName = pathSplit[len(pathSplit)-1]
return
}
/*
setModify updates the Collection's modification time (as specified by Collection.Modified).
It seems that this does not update automatically.