[Qgis-developer] Re: [Qgis-community-team] Context sensitive help id generator

Jürgen E. Fischer jef at norbit.de
Tue Nov 17 12:50:40 EST 2009


Hi Gary,

On Tue, 17. Nov 2009 at 06:12:34 -0900, Gary Sherman wrote:
> I agree it would be easier, however it creates another data management
> problem. The oriinal idea behind using a number was to make it unique
> for all time. Using the class name as the seed is just a way to get
> that number. If we switch to file names or class names as Jurgen
> suggests, it means that developers will need to be aware of the
> context help system when refactoring. If a class gets renamed, the
> help file would be orphaned. The developer would have to rename all
> the help files for the class (each translation) in order for the help
> system to work. Using a unique ID eliminates that burden.

Renaming is not a big deal And maybe most of the time the context help also
needs updating when the dialog is renamed - as the name is probably not the
only thing that changes.

BTW there already a mismatch in resources/context_help/contextids.txt -
QgsBookmark instead of QgsBookmark.

But my initial idea doesn't work.  You can't do slots on Non-QObjects and you
can't inherit from different QObjects.   And moc doesn't expand macros.

So I had to add following slot to all the classes:

void contextHelp() { QgsContextHelp::run( metaObject()->className() ); }

The patch is at [1].   Opinions on commiting?


Jürgen

[1] http://www.norbit.de/~jef/context-help.diff.gz

-- 
Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-20
Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
Software Engineer         D-26506 Norden               http://www.norbit.de

-- 
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502



More information about the Qgis-community-team mailing list