[Qgis-developer] Re: [Qgis-community-team] Context sensitive
help id generator
Werner Macho
werner.macho at gmail.com
Wed Nov 18 02:25:12 EST 2009
hi!
To be honest - I'm with Milena and her "selfspeaking" nameschema! I'm
sure it would be easier to remember and easier to handle to all
documentationi writers out there and also to translators.
I agree with the fact that a unique ID will (probably) never make any
problems but as Jürgen already said. If theres something changing (Class
Name) theres a big chance that the help file would change anyway.
Now its very hard to see which help is in which file and there has to be
some kind of "database" to look what you are searching for. (Or you open
every file until you find what you want).
For consistence it should be not a big deal to write a script that
checks if for every Help(Name) a file exists..
So +1 from me for the naming after the function - and also for
implementing the "selfnaming" Class.
regards
Werner
> 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
>
>
More information about the Qgis-developer
mailing list