[Aptitude-devel] tabs-manager-eliminate-casts-qt

Piotr Galiszewski piotr at galiszewski.pl
Tue Jul 27 10:00:04 UTC 2010


2010/7/27 Daniel Burrows <dburrows at debian.org>:
>  I have a proof-of-concept branch up showing one way of eliminating the
> explicit casts from QWidget in tabs_manager.  It works by writing an
> explicit interface describing what the manager needs from its associated
> widget, with protections assigned so that only the manager can invoke
> the methods.  To the other widgets, this object is just an opaque
> reference that they pass along to the manager.
>
>  The branch tabs-manager-eliminate-casts-qt in my personal git
> repository (SHA c32f42b) has the patches.
>
>  I also created a branch tabs-manager-eliminate-casts-sigc (SHA
> b9dc49b) with a sigc++-based implementation.  I think this is a lot
> cleaner (there are some kind of ugly things in the Qt implementation),
> but it doesn't fit into the Qt idioms in src/qt/.
>

Thanks a lot for this patches. I do not have strong preferences about
one of them and I could work on top of each of them. I am already used
to using sigc++ code in Qt classes ;)

On the other hand tabs_manager::tabs_manager_impl::tab_destroyed()
method doesn't work in actual code. I discovered this during writing
Update Cache tab, the first tab, which is for real benefit from this
method. I changed this in the same patch. New version doesn't use
qobject_cast. Is it allowed that this patch come later, or should I
rebase all series and send this chunk earlier? There are also some
casts in tab_deletion_requested, but they could be easily removed.

I also decided that all new classes I am writing are hidden behind
abstract interface, as in other aptitude's code. I am not rewriting
eralier patches, because without problems it could be done later
(interfaces for other classes doesn't changed). I use create_object()
methods. I am not sure what is preffered. Functions outside class, or
static create methods in class? For tabs I will use ::create()
methods, so create_or_display will work without problems.

Another question: What brackets' policy should I use in my code. I am
still little confused about this ;):
if()
  {
    some_method();
  }

or

if()
{
  some_method();
}

Probably it is also good time to write something about my current
work. As DebConf is fast approaching I  am concentrating now on
features development (I'd like to have as much functions as it is
possible to work before presentation about project). After
conference's starting I will come back to normal coding (including
refactoring and writing missing comments ;) )

>  Daniel
>
> _______________________________________________
> Aptitude-devel mailing list
> Aptitude-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/aptitude-devel
>
-- 
Regards
Piotr Galiszewski



More information about the Aptitude-devel mailing list