Revision 839519

Go back to digest for 3rd August 2008

Features in Educational

David Capel committed changes in /trunk/KDE/kdeedu/libkdeedu/keduvocdocument:

NOTE: Breaks binary compatibility. Make sure to make install after you make this.

This consolidates various enums of word properties into one: KEduVocWordFlags

This stores the following sets of properties:
* Number
* Part of Speech
* Gender
* Definiteness
* Regularity
* Phrase (if it is actually a phrase and not a word)

Others may come later, but those work for now.

Instead of having functions accept multiple parameters for each type (gender, number, etc), they accept one KEduVocWordFlags parameter.

You can pass as many flags as you want by bitwise ORing (a|b) them together, similar to how Qt accepts various flags. QFlags is a handy helper class that does this magic for us.

This implementation has the following benefits over the previous one: (the previous had multiple enums floating around in various classes, new combinations were frequently made by making a new enum entry.)
* All the flags are in one place, instead of scattered and duplicated.
* You only need to set the flags you care about -- no dummy parameter-filling flags needed.
* We can extend the flags without breaking binary compatibility.
* It allows optional extra flags like verb regularity.

File Changes

Added 1 files
  • /trunk/KDE/kdeedu/libkdeedu/keduvocdocument/keduvocwordflags.h
Modified 9 files
  • /trunk/KDE/kdeedu/libkdeedu/keduvocdocument
  •   /CMakeLists.txt
  •   /keduvocarticle.cpp
  •   /keduvocarticle.h
  •   /keduvockvtml2reader.cpp
  •   /keduvockvtml2writer.cpp
  •   /keduvockvtmlcompability.cpp
  •   /keduvockvtmlwriter.cpp
  •   /keduvocwordtype.cpp
  •   /keduvocwordtype.h
10 files changed in total