[Panel-devel] KDE/kdebase/workspace/plasma/tools/plasmoidviewer

Aaron J. Seigo aseigo at kde.org
Fri Dec 21 15:49:11 CET 2007


On Friday 21 December 2007, you wrote:
> This doesn't work for now as resizeEvent doesn't get called

it works perfectly here.

> --- trunk/KDE/kdebase/workspace/plasma/tools/plasmoidviewer/fullview.cpp
> #751240:751241 @@ -30,17 +30,20 @@
>  #include <KStandardDirs>
>  #include <KIconLoader>
>  #include <QIcon>
> +#include <QResizeEvent>
>
>  using namespace Plasma;
>
>  FullView::FullView(const QString &ff, QWidget *parent)
>
>      : QGraphicsView(parent),
>
> -      m_formfactor(Plasma::Planar),


and now what happens when something that isn't vertical, planar or horizontal 
gets passed in? there's no harm in keeping the initialization, and in fact 
it's better practice.

>      QString formfactor = ff.toLower();
> -    if (formfactor == "vertical") {
> +//     kDebug() << formfactor;
> +    if (ff.isEmpty() || formfactor == "planar") {

minor nitpick: this reads a bit odd. should probably be if 
(formfactor.isEmpty() ... for clarity

> +        m_formfactor = Plasma::Planar;
> +    } else if (formfactor == "vertical") {
>          m_formfactor = Plasma::Vertical;
>      } else if (formfactor == "horizontal") {
>          m_formfactor = Plasma::Horizontal;


> @@ -80,10 +83,29 @@
>  void FullView::resizeEvent(QResizeEvent *event)
>  {
>      if (!m_applet) {
> +        kDebug() << "no applet";
>          return;
>      }



-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071221/a547d4f9/attachment.pgp 


More information about the Panel-devel mailing list