Merge lp:~mihirsoni/ubuntu-calculator-app/1213464 into lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk

Proposed by Mihir Soni
Status: Rejected
Rejected by: Gustavo Pichorim Boiko
Proposed branch: lp:~mihirsoni/ubuntu-calculator-app/1213464
Merge into: lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk
Diff against target: 15 lines (+4/-1)
1 file modified
Simple/SimplePage.qml (+4/-1)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calculator-app/1213464
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Disapprove
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
David Planella Needs Fixing
Mihir Soni Pending
Review via email: mp+180717@code.launchpad.net

Commit message

Now , user will be able to start calculation with operators

Description of the change

Now, if user clicks on Operator first , the formula will start with 0 , instead of not allowing user to start calculation with operators.

Testing Scenario :-
1) Open Calculator
2) Press any operator
3) Press new operands
4) Result

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Thanks a lot Mihir for the branch. However, his requires some design team input. As it is now, I agree with the comments in the bug that this should be working differently.

If I want to do 0 x 3 = 0 I believe I should enter the 0 explicitly.

review: Needs Fixing
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

As described in the bug report, that is not really the behavior wanted.

The behavior wanted is to actually do as it is working already: to not do anything if an operator is pressed before an operand.

I'm sorry you spent time on that Mihir, but unfortunately I will have to reject this change.

review: Disapprove

Unmerged revisions

138. By Mihir Soni

enabled formula start with 0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Simple/SimplePage.qml'
2--- Simple/SimplePage.qml 2013-08-12 12:13:12 +0000
3+++ Simple/SimplePage.qml 2013-08-17 21:31:51 +0000
4@@ -39,7 +39,10 @@
5 if(last.type === CALC.T_NUMBER || last.type === CALC.T_UNARY_MINUS){
6 screenFormula[screenFormula.length - 1]._number += last.value.toString();
7 } else if (last.type === CALC.T_OPERATOR){
8-
9+ formula.push("0"); // User has entered first operator, so push 0 in formula
10+ screenFormula[screenFormula.length - 1]._number += "0";
11+ formula.push(visual) // Push the acutal formula
12+ screenFormula.push({_text:'', _operation: last.value.toString(), _number: ''})
13 }
14 else {
15 screenFormula.push({_text:'', _operation: last.value.toString(), _number: ''})

Subscribers

People subscribed via source and target branches