Review Request: Get FileType of SQLTracks from Database instead of File Extension

Stefan Derkits stefan at derkits.at
Wed Sep 29 16:11:39 CEST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100004/
-----------------------------------------------------------

(Updated 2010-09-29 14:11:39.676725)


Review request for amarok.


Changes
-------

-) Initialize m_filetype in Constructor of SQLTrack (with Amarok::Unknown)
-) Moved the Method that returns a QString from a Filetype to FileType.h (don't know if the Naming and making it "inline static" is good & correct)

It's a start and has some limitations, as it can only recognize the FileTypes that were in FileType.h
e.g. previously the type of a file.wma returned "wma", now it returns "unknown"
Anyways the other Filetypes need to be "implemented" so that they can be used elsewhere (e.g. in the Filter)


Summary
-------

-) Added a new Class Variable to SqlTrack to hold the FileType of a Track
-) Retrieve FileType from Database and save it in the Class Variable
-) Return a QString Representation of the Amarok::FileType when calling the Method SqlTrack::type()


Diffs (updated)
-----

  src/core-impl/collections/sqlcollection/SqlMeta.h ee3ec21 
  src/core-impl/collections/sqlcollection/SqlMeta.cpp 2da0333 

Diff: http://git.reviewboard.kde.org/r/100004/diff


Testing
-------

Hard to test, but the TagDialog displays the correct Filetypes
Wanted to test it with a Testcase where FileType in Database is different then the FileExtension but realized that only certain FileExtensions are read by the CollectionScanner/TagLib :)
So actually atm, the Code doesn't make much difference, but in my opinion this is a cleaner (and more future proof) Solution to display the Filetype then just displaying the Extension of the File


Thanks,

Stefan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/amarok-devel/attachments/20100929/3e4d9a49/attachment.htm 


More information about the Amarok-devel mailing list