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

Gary Sherman gsherman at mrcc.com
Tue Nov 17 13:52:42 EST 2009


On Tue, Nov 17, 2009 at 8:50 AM, Jürgen E. <jef at norbit.de> wrote:
> 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.
>

Yes, renaming is not a big deal. The problem is making sure it happens
consistently when a developer or patch submitter isn't fully aware of
the context help system.

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

I'm not seeing any difference in those two...

Again, the class name is just a way to get a unique ID, it doesn't
matter if the class name is changed later on, the ID will still work.
You could just as easily base the hash on the current seconds since
epoch :)

>
> 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?

I would prefer to see some opinions from others before committing. It
doesn't matter to me as long as things are maintained...

-gary

>
>
> 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
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Gary Sherman
Chair, QGIS Project Steering Committee
-Desktop GIS Book:
 *http://desktopgisbook.com
-Spatial Hosting:
 *http://mrcc.com/hosting
"We work virtually everywhere"
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-


More information about the Qgis-developer mailing list