[glade--]Patches related to "Make Separate Class"

Hello again,
I ran into a couple issues when trying to divide parts of my
ui into separate classes (but still in the same file). Here are my fixes.
They are not tested with separate classes in separate files, but works
fine if the classes are in the same file.

 - The user classes' header files needs to be included in order to use
   those classes. (This actually gives an ugly cross dependency, but I
   can't think of another simple fix right now...)

 - For some strange reason did not the check for external classes work
   when generating the top class, so the widgets were generated twice,
   once for the separate class and once for the encapsulating class.
   There were two problems with this. First of all does not the
   ti_w->getBool(CXX_SEPERATE_CLASS) work, it always returns false.
   Second, there was need for more checks of this flag (I might have
   struck some special case that was originally overlooked).

   My fix is not very beautiful, as I build a temporary Widget object from
   the tag structure, just to read its CXX_SEPERATE_CLASS property instead
   of reading it directly from the tag structure. But I could not find
   the bug in the tag related classes, so this works mostly as a temporary
   fix. I am also not very confident with the added property check.
   I hope Petig has the time to verify it. (It would help if the code was
   just a little bit better documented :-)

 - This is totally unrelated... gcc 3.0 refuses to compile the newest
   version of this file, as you try to modify a const string. My fix is to
   choose the string contents at initialization time instead.

Björn Axelsson

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]