Review Request: Refactoring of FileType, get Type from Database, some Code Changes as Example of the Advantage of the Refactoring

Stefan Derkits stefan at derkits.at
Sat Oct 30 18:57:01 CEST 2010


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

(Updated 2010-10-30 16:57:01.568987)


Review request for Amarok.


Changes
-------

"Reverted" Refactoring (Amarok now again uses the enum everywhere)
FileType.cpp mostly implements static Helper Methods for use with FileTypes & has the List of all available FileTypes
Also changed CollectionScanner to set the default Filetype based on the FileExtension


Summary
-------

Refactoring of FileType & some Changes that use the advantages of the new FileType Class:
-) Old enum FileType is now FileTypeEnum (still in there because it's needed to create the new FileType Objects)
-) Created new Class & some Helper Functions
-) Changed MetaQueryWidget to use the QStringList that contains all Filetypes
-) Meta::SqlTrack.type() now gets it's Information from the Database instead of the FileExtension

Please give me your Feedback on this Patch.
One thing I don't really like that much is the Constructor. But without the enums the Constructor would have to use ugly Ints.
An Option would be an additional Constructor that takes a QString as Argument (e.g. I could think of Amarok::FileType = "mp3"), and creates an Object by looking up the FileType in the QStringList.


Diffs (updated)
-----

  shared/FileType.h 55c80b9 
  shared/FileType.cpp PRE-CREATION 
  src/CMakeLists.txt 5f2ac9d 
  src/browsers/CollectionTreeItemModelBase.cpp c25549b 
  src/core-impl/collections/sqlcollection/CMakeLists.txt f530d67 
  src/core-impl/collections/sqlcollection/SqlMeta.h afdf937 
  src/core-impl/collections/sqlcollection/SqlMeta.cpp b1a0694 
  src/core-impl/collections/support/MemoryFilter.cpp c076494 
  src/widgets/MetaQueryWidget.cpp 99e8993 
  tests/synchronization/CMakeLists.txt e5df2df 
  utilities/collectionscanner/CMakeLists.txt 70c86d0 
  utilities/collectionscanner/CollectionScanner.cpp 033ea84 

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


Testing
-------

Tested in the App, found no wrong Behaviour


Thanks,

Stefan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/amarok-devel/attachments/20101030/6a96488a/attachment-0001.htm 


More information about the Amarok-devel mailing list