Summary: | Calculator plasmoid does not accept entries with more than 4 digits | ||
---|---|---|---|
Product: | [Unmaintained] plasma4 | Reporter: | Sergio <sergio.callegari> |
Component: | widget-misc | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | agostinelli, annma, dweeble01103, joanmaspons, lightningstrike35, rshah0385 |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Sergio
2011-09-06 15:54:35 UTC
Still present in 4.7.1 Confirmed in 4.7.1, Archlinux binaries. On further inspection, the bug can be also reproduced with US english locale Same problem in Kubuntu 11.10 (4.7.1) Still buggy in 4.7.2. Please, consider removing the plasmoid altogether from the software compilation and readding when eventually fixed. Plasmoid has already remained broken through 3 point releases. Having broken stuff just creates confusion and kalgebra is a valid substitute anyway. Seems to hasve an additional bug as well (4.7.2) - it doesn't like any numbers (even 4 digit ones) which have a 5 or a 6 in them - I'd agree with sergio, if this has been buggy since back at 4.7.1 or earlier, I'd go with "remove the entire plasmoid." We don't even need a calculator widget, this is why we have kcalc :) I tried adding some kDebug lines like below. The result of currentValue is 0, may be something wrong at readNumber. void CalculatorApplet::slotDigitClicked() { Plasma::PushButton *clickedButton = qobject_cast<Plasma::PushButton *>(sender()); int newDigit = clickedButton->text().toInt(); if (inputText == QLatin1String( "0" ) && newDigit == 0.0) return; if (inputText.length() >= MaxInputLength) return; if (waitingForDigit) { inputText.clear(); waitingForDigit = false; } inputText += QString::number(newDigit); if (!inputText.contains(KGlobal::locale()->decimalSymbol())) { //If there is no decimal, then we need to reformat the number inputText = "1234567"; kDebug() << "Input =" << inputText; double currentValue = KGlobal::locale()->readNumber(inputText); kDebug() << "Current value=" << currentValue; QString localizedString = KGlobal::locale()->formatNumber(currentValue, 0); mOutputDisplay->setText(localizedString); } else { //Once we have a decimal, then all we have to do is append the number mOutputDisplay->setText(mOutputDisplay->text()+QString::number(newDigit)); } } +1 to remove it if it's not going to be fixed This bug is a duplicate of 288963 and the bug is not in the Calculator widget code but in kdelibs. I tracked down the faulty code but I am not sure I can fix it, this code is tricky. I'll do my best to have this fixed before 4.8 is out. *** This bug has been marked as a duplicate of bug 288963 *** |