Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2730 closed bug (invalid)

Changing filetype won't add extra attributes of new type

Reported by: humdinger Owned by: axeld
Priority: normal Milestone: R1
Component: Applications/Tracker Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


On vmware, hrev27407.

When you change a file type from e.g. text/plain to text/email, the extra attributes like "subject" aren't added.


When you have files with extra attributes that are editable in a folder, display those attributes with the Attributes menu.

Now create a new text/plain. You can now enter data into the respective attribute column and have these attributes added to your text/plain file. (See attached screenshot, where DVDdb is a custom filetype for a workshop I'm writing; I entered TEST as title+cast and 0 for rating).

I don't think this is a wanted behaviour.

Attachments (1)

Attribute_to_file.png (50.3 KB) - added by humdinger 11 years ago.
Add any data to any filetype

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by humdinger

Attachment: Attribute_to_file.png added

Add any data to any filetype

comment:1 Changed 11 years ago by stippi

Resolution: invalid
Status: newclosed

I can understand that you find this irritating, but this is how it's supposed to work.

  • Any file can have any attributes. (!)
  • Certain attributes are "associated" with certain file types via the FileTypes preflet. This is only for Tracker so that it offers these attributes to be edited or displayed when it encounters files of a certain types. The information is also available to other applications via the BMimeType API.
  • An individual file may or may not truly have certain attributes that are associated to it's type. The binding is lose. If for example you associate an attribute to a file, nothing will happen, only the mimtype database entry will save the setting. Not a single file of the affected type in the system will automatically get any attribute written because of the change. All that happens is that Tracker will now offer this attribute column. In the same sense, if you remove associated attributes from a type, nothing will happen to files that already have this attribute.
  • If you change the type of a file, nothing will happen to attributes that are already attached to the file on disk. Only the Tracker Attributes menu may change.
  • Tracker stores the folder/window settings with regard to the displayed attribute columns. The columns are not automatically removed, in the same way as they are not automatically added. So just because files in a folder change their type, or are removed, or are added to the folder, does not automatically affect the attribute columns. Since attribute data is part of a file, the data will be displayed truthfully when a column happens to be there. Regardless of whether the attribute is still associated with the file.

All this is a lose binding where several applications work together. FileTypes influences the Tracker attribute column offering and the mime database which is also available via the OS API for other applications (the Registrar makes it available). The attributes that are on disk for a given file doesn't really have anything to do with this.

comment:2 Changed 11 years ago by humdinger

You know, some of your points did come to me when I was in the shower this morning... Thanks for clearing things up. May I use your explanations in a wiki article I'm writing?

Let me just describe how I was confused (I wasn't irritated BTW :) : I created an extra attribute called DVDdb:rating and originally gave it an Int-8 type. Then I created a few files with that attribute until I decided to try the rating with Int-32 and made the changes in Filetypes Preferences. Of course, the old files will still have Int-8 rating. Now I created a new, empty file in the folder with the other files, changed its filetype to my custom one, and filled in the rating attribute. As you know now, also the new file got the rating attribute as Int-8 even though I have changed the attribute to Int-32 before creating it.

The trick is: You have to hide the rating column in the tracker window, create the file and then show the column again to fill in data. From now on every new file where you fill the rating attribut will get DVDdb:rating as Int-32.

Tricky. Confusing. Irritating. :)

Also, the attribute column titles of the Tracker window aren't checked against changes in the MIME database. I changed "Rating" to "Rating 1-10" and had to do the hide&show atrribute dance for it to update in the Tracker window.

Maybe a solution would be to query Tracker window layout attributes when making changes in FileTypes Preferences and update them with the changes.

comment:3 Changed 11 years ago by axeld

Tracker memorizes the window layout exactly as you specified it. This has the advantage that it will also work with removable media, even if you don't have the MIME type defined, or changed its attributes.

Of course, the downside is that changes aren't immediately visible. But in reality, I don't think one changes attributes that often, so that the persistence feature wins. And when it's properly documented, it should also be much less irritating.

comment:4 Changed 11 years ago by humdinger

Ah right, I forgot about removable media... Thanks for clearing things up so nicely.

Note: See TracTickets for help on using tickets.