From kde-panel-devel Fri Apr 29 10:24:58 2011 From: "Aaron J. Seigo" Date: Fri, 29 Apr 2011 10:24:58 +0000 To: kde-panel-devel Subject: Re: Review Request: Preconfigurable plasmoids Message-Id: <20110429102458.31048.42761 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=130407273908686 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1113132980==" --===============1113132980== Content-Type: multipart/alternative; boundary="===============6873800680575528647==" --===============6873800680575528647== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/101251/#review2961 ----------------------------------------------------------- plasma/pluginloader.cpp coding style: 'if (' not 'if(' = = same for all lines that follow in this patch. plasma/pluginloader.cpp config does not need to cascade. you only need a KSimpleConfig here plasma/pluginloader.cpp applet->config() probably does not return the actual config group, but = a temporary group that gets migrated later. i assume this works (and that y= ou have test it :). this would be overly easy to break, however. = as a result, i'd like to see an automated test in kdelibs/plasma/tests/= that tests this mechanism, otherwise it will be far too easy for it to bre= ak accidentally leaving all widgets that use it non-operational. - Aaron J. On April 29, 2011, 1:09 a.m., David Palacio wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/101251/ > ----------------------------------------------------------- > = > (Updated April 29, 2011, 1:09 a.m.) > = > = > Review request for Plasma. > = > = > Summary > ------- > = > There is some code duplication in that some plasmoids share very much of = program logic but actually differ in just a setting. E.g. the recently made= ShowActivityManager plasmoid, which just is a DBus call launcher. The Icon= plasmoid is an example of this made right. I'd like to have more generic p= lasmoids. Even better, I'd like to have an easy way to configure them. = = = = > = = = > Let's see the code. config.patch shows a way to load a config metadata fi= le and fill a designated plasmoid with the configuration data (metadata.des= ktop). We search for a X-Plasma-ConfigApplet property that defines the plas= moid to configure and load. Additional properties define the plasmoid setti= ngs. This allows us, for example, to easily provide access to any webservic= e without code duplication. = = = > = > = > Diffs > ----- > = > plasma/data/servicetypes/plasma-applet.desktop 8fabddb = > plasma/pluginloader.cpp e57cac5 = > = > Diff: http://git.reviewboard.kde.org/r/101251/diff > = > = > Testing > ------- > = > Loading of plasmoids works. > = > Testcase: Install these widgets: > http://kde-look.org/content/show.php/Label?content=3D99881 > http://kde-look.org/content/show.php?content=3D141270 > = > Add configlabel to desktop. > = > = > Thanks, > = > David > = > --===============6873800680575528647== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
This is an automatically generated e-mail. To reply, visit: http://git.revie= wboard.kde.org/r/101251/

= =
plasma/pluginloader.cpp (Diff revision 3)
Applet *PluginLoader::loadApplet(const QString &name, uint appl=
etId, const QVariantList &args)
110
    if(!offer->property(<=
/span>"X-Plasma-ConfigApplet").toString().isEmpty()) {
coding style: 'if (' not 'if(' =


same for all lines that follow in this patch.

= =
plasma/pluginloader.cpp (Diff revision 3)
Applet *PluginLoader::loadApplet(const QString &name, uint appl=
etId, const QVariantList &args)
119
        KConfig desktop(offe=
r->entryPath(), KConfig::CascadeConfig, =
"services");
config does not need to cascade. you only need a KSimpleConfig here<=
/pre>

= =
plasma/pluginloader.cpp (Diff revision 3)
Applet *PluginLoader::loadApplet(const QString &name, uint appl=
etId, const QVariantList &args)
121
        KConfigGroup =
config =3D applet->config();
applet->config() probably does not return the actual config group=
, but a temporary group that gets migrated later. i assume this works (and =
that you have test it :). this would be overly easy to break, however.

as a result, i'd like to see an automated test in kdelibs/plasma/tests/=
 that tests this mechanism, otherwise it will be far too easy for it to bre=
ak accidentally leaving all widgets that use it non-operational.

- Aaron J.


On April 29th, 2011, 1:09 a.m., David Palacio wrote:

Review request for Plasma.
By David Palacio.

Updated April 29, 2011, 1:09 a.m.

Descripti= on

There is some code duplication in that some plasmoids share =
very much of program logic but actually differ in just a setting. E.g. the =
recently made ShowActivityManager plasmoid, which just is a DBus call launc=
her. The Icon plasmoid is an example of this made right. I'd like to ha=
ve more generic plasmoids. Even better, I'd like to have an easy way to=
 configure them.                                                           =
                                                                           =
                                                      =

                                                                           =
                                                                           =
                                                     =

Let's see the code. config.patch shows a way to load a config metadata =
file and fill a designated plasmoid with the configuration data (metadata.d=
esktop). We search for a X-Plasma-ConfigApplet property that defines the pl=
asmoid to configure and load. Additional properties define the plasmoid set=
tings. This allows us, for example, to easily provide access to any webserv=
ice without code duplication.                                              =
                                                                           =
                               

Testing <= /h1>
Loading of plasmoids works.

Testcase: Install these widgets:
http://kde-look.org/content/show.php/Label?content=3D99881
http://kde-look.org/content/show.php?content=3D141270

Add configlabel to desktop.

Diffs=

  • plasma/data/servicetypes/plasma-applet.desktop (8fabddb)
  • plasma/pluginloader.cpp (e57cac5)

View Diff

--===============6873800680575528647==-- --===============1113132980== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel --===============1113132980==--