Review Request: Port the Calculator applet to QML

Romário Rios luizromario at gmail.com
Tue Nov 6 21:57:51 UTC 2012



> On Nov. 6, 2012, 4:34 p.m., Mark Gaiser wrote:
> > applets/calculator/package/contents/ui/calculator.qml, lines 89-177
> > <http://git.reviewboard.kde.org/r/107001/diff/4/?file=93822#file93822line89>
> >
> >     (personal preference) Move the javascript functions to a javascript file.
> >     
> >     Then include it like so:
> >     import "helper.js" as Helper
> >     
> >     Then use it like so:
> >     Helper.functionName()
> >     
> >     Again, just my preference. Feel free to ignore it :)

As these aren't used anywhere else, I don't see how's that necessary.


> On Nov. 6, 2012, 4:34 p.m., Mark Gaiser wrote:
> > applets/calculator/package/contents/ui/calculator.qml, lines 235-240
> > <http://git.reviewboard.kde.org/r/107001/diff/4/?file=93822#file93822line235>
> >
> >     Again my personal preference, but it cleans up your code. So here it is.
> >     
> >     I would put the button in a custom component since you are setting the width and height to the same value every time.
> >     
> >     // CustomButton.qml
> >     PlasmaComponents.Button {
> >         width: buttonWidth;
> >         height: buttonHeight;
> >     }
> >     
> >     Then in this case you call:
> >     CustomButton {
> >         text: "-"
> >         onClicked: setOperator("/")
> >     }
> >     
> >     The same for the other buttons. Seems cleaner to me..

A repeater seems simpler to me in this case.


On Nov. 6, 2012, 4:34 p.m., Romário Rios wrote:
> > Hope that helps. Sorry for the nitpicking :p

Oh, don't worry, I know how KDE rolls.


- Romário


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107001/#review21491
-----------------------------------------------------------


On Nov. 6, 2012, 2:54 a.m., Romário Rios wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107001/
> -----------------------------------------------------------
> 
> (Updated Nov. 6, 2012, 2:54 a.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Description
> -------
> 
> This diff replaces the C++ Calculator applet by its QMLfied version, which seems to be feature-par with the latter.
> 
> 
> Diffs
> -----
> 
>   applets/calculator/CMakeLists.txt 732145c 
>   applets/calculator/calculator.h f7339be 
>   applets/calculator/calculator.cpp 6bc3ddc 
>   applets/calculator/package/contents/ui/calculator.qml PRE-CREATION 
>   applets/calculator/package/metadata.desktop PRE-CREATION 
>   applets/calculator/plasma-applet-calculator.desktop 0760729 
> 
> Diff: http://git.reviewboard.kde.org/r/107001/diff/
> 
> 
> Testing
> -------
> 
> Tested as both applet and popupapplet, with the Air theme and the Oxygen theme. It seems to work fine.
> 
> 
> Thanks,
> 
> Romário Rios
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20121106/13901a83/attachment-0001.html>


More information about the Plasma-devel mailing list