Review Request: Social About Dialog implementation for KDElibs
David Faure
faure at kde.org
Tue Nov 9 21:40:41 GMT 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5794/#review8600
-----------------------------------------------------------
Ship it!
Looks good, just a few things I noticed, but you can commit after fixing them.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistdelegate_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment8994>
These constants should just be static const int .. = ...; at the top of the file.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistdelegate_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment8993>
Why is this a pointer to a QSize, rather than just a QSize member?
In fact this member (m_widgetSizeHint) doesn't seem to be used anywhere, can be removed.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistdelegate_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment8996>
Why the setPen, if this method only uses drawPixmap?
This means the save + the restore can be removed too.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistdelegate_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment8995>
KToolInvocation::invokeBrowser
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.h
<http://svn.reviewboard.kde.org/r/5794/#comment8997>
This is going to create all these KIcons at startup of any program that uses kdeui. Fortunately this doesn't actually load the icons, but that's still quite some "new" calls on app startup that we can do without.
My suggestion: static const char s_profileOcsLinkIcons[][16] = { { "..." }, { "..." } ... }
This makes the data "really const", which means the .rodata section in the executable, which means shared between all processes.
Same thing for the list of qstringlist above, too.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.h
<http://svn.reviewboard.kde.org/r/5794/#comment8998>
The QString() is not useful, that's the default value anyway. So m_name() would be enough (or nothing, but initializing members is good practice).
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment8999>
The kdecore/subdir/ in the include surprises me, we don't do that anywhere else. I recommend not doing it, since people copying that in header files will break stuff outside kdelibs.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment9001>
Why does this start at 2?
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment9002>
the QByteArray() ctor call is not needed, readAll returns a QByteArray already.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment9003>
The = QPixmap() is not needed, "QPixmap pixmap;" would already create an empty pixmap :)
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment9004>
Why the emit layoutChanged()? When a cell changes, dataChanged() is enough.
trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.cpp
<http://svn.reviewboard.kde.org/r/5794/#comment9000>
(well technically it could be, using I18N_NOOP).
But anyway, a better solution then would be to use a switch, rather than creating the list every time just to extract one element. But I guess I'm mostly nitpicking, performance is definitely not an issue here.
For maintainance reasons, all these lists should really be merged into a single list of structs, in fact. It would then be much easier to add or remove entries. I can do that change after you commit, if you don't see what I mean.
- David
On 2010-11-09 09:22:50, Teo Mrnjavac wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5794/
> -----------------------------------------------------------
>
> (Updated 2010-11-09 09:22:50)
>
>
> Review request for kdelibs.
>
>
> Summary
> -------
>
> The present review request contains the implementation of a Social About Dialog feature for KDE apps, and is a rewrite of Amarok's Social About Dialog (See http://teom.wordpress.com/2009/08/23/social-desktop-integration-in-kaboutdialog/ ). For those who don't have time to read through that link, the Social About Dialog is an evolution of our old KAboutDialog which adds optional Open Collaboration Services features to complete the contributors' data.
> The only changes that concern the API are in kaboutdata.{h,cpp}, and I've tried to keep it binary compatible to the best of my abilities by following the instructions on our Techbase, I hope I did it right.
> The only new dependency is the Attica library, except if we are building with KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION, in that case all social features are #ifdef'ed out and the dialog behaves very much like the old KAboutDialog.
> The dialog itself uses model/view/delegate, not very different from KNewStuff3, and most of the action happens in the model (jobs to get data from Attica/OCS) and in the delegate.
> As we're getting dangerously close to the string freeze, I've decided to put this up for review even though there are still a couple TODOs in the code. These are:
> * The icons are placeholders, we are going to need some real icons for links and social networks. We already have some of those for Amarok's about dialog but this needs to be cleanly solved in a way that would not make us liable for IP infringement in any way. IANAL here so a discussion as to how to proceed is welcome.
> * In the optional translators tab there's a short but not very short text about the translation team. I've added it as a label but it tends to take a bit more room than I'd like, so I'm requesting for comments on what to do with it. Also, I don't know how translators' names are added. If translators can't add their OCS usernames anyway then I'll easily revert to the old about view for them and the problem of the tall translation team text is automatically solved.
> * Since kdeui does not depend on KIO, I couldn't use KIO::get and had to use QNAM instead. For the same reason I had to use QDesktopServices instead of KRun::runUrl() to launch URLs. As it is now, stuff works, but to make it nicer the plan could be to add an Attica::PixmapFromUrlJob (which I've been told would satisfy other unrelated needs too) to Attica to remove the single instance where QNAM is used instead of KIO.
>
> Except maybe for the translators tab issues, none of the TODOs require string changes.
>
> To test the feature you only need to compile KDElibs with the patch and run any KDE app which has an about dialog, however you won't be able to try the social features unless you also add OCS usernames (by default the provider is openDesktop.org) to one or more contributors in the KAboutData of a KDE app of your choice.
> For example: aboutData.addAuthor( ki18n("Random Dude") , ki18n("Random stuff"), "randomdude at kde.org", "http://example.com", "random-dude's-oD.o-username");
>
>
> Diffs
> -----
>
> trunk/KDE/kdelibs/kdecore/kernel/kaboutdata.h 1194020
> trunk/KDE/kdelibs/kdecore/kernel/kaboutdata.cpp 1194020
> trunk/KDE/kdelibs/kdeui/CMakeLists.txt 1194020
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationconfigattica_p.h.cmake PRE-CREATION
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationdialog.h 1194020
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationdialog.cpp 1194020
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistdelegate_p.h PRE-CREATION
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistdelegate_p.cpp PRE-CREATION
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistview_p.h PRE-CREATION
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonlistview_p.cpp PRE-CREATION
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.h PRE-CREATION
> trunk/KDE/kdelibs/kdeui/dialogs/kaboutapplicationpersonmodel_p.cpp PRE-CREATION
> trunk/KDE/kdelibs/kdeui/dialogs/thumb_frame.png UNKNOWN
>
> Diff: http://svn.reviewboard.kde.org/r/5794/diff
>
>
> Testing
> -------
>
> Testing during development, both with Attica enabled and disabled.
>
>
> Screenshots
> -----------
>
> The social about dialog as it appears when OCS usernames for openDesktop.org are provided in addAuthor()
> http://svn.reviewboard.kde.org/r/5794/s/552/
>
>
> Thanks,
>
> Teo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20101109/ff880d4b/attachment.htm>
More information about the kde-core-devel
mailing list