summaryrefslogtreecommitdiff
path: root/noncore/tools/calculator/calculatorimpl.cpp
Unidiff
Diffstat (limited to 'noncore/tools/calculator/calculatorimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/calculator/calculatorimpl.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/noncore/tools/calculator/calculatorimpl.cpp b/noncore/tools/calculator/calculatorimpl.cpp
index dead03d..05cb9b5 100644
--- a/noncore/tools/calculator/calculatorimpl.cpp
+++ b/noncore/tools/calculator/calculatorimpl.cpp
@@ -23,26 +23,33 @@
23 * Added support for Temperature conversions. 23 * Added support for Temperature conversions.
24 */ 24 */
25// Sat 03-09-2002 L.J. Potter added the inlined pixmaps here 25// Sat 03-09-2002 L.J. Potter added the inlined pixmaps here
26 26
27#include "calculatorimpl.h" 27#include "calculatorimpl.h"
28 28
29/* OPIE */
30#include <opie2/odebug.h>
29#include <qpe/resource.h> 31#include <qpe/resource.h>
30#include <qpe/qmath.h> 32#include <qpe/qmath.h>
31#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34using namespace Opie::Core;
32 35
36/* QT */
33#include <qpushbutton.h> 37#include <qpushbutton.h>
34#include <qcombobox.h> 38#include <qcombobox.h>
35#include <qlabel.h> 39#include <qlabel.h>
36#include <qfont.h> 40#include <qfont.h>
37#include <qlayout.h> 41#include <qlayout.h>
38#include <qstringlist.h> 42#include <qstringlist.h>
39#include <qfile.h> 43#include <qfile.h>
40#include <qtextstream.h> 44#include <qtextstream.h>
41#include <qmessagebox.h> 45#include <qmessagebox.h>
46
47/* STD */
42#include <math.h> 48#include <math.h>
49
43/* XPM */ 50/* XPM */
44static char *oneoverx_xpm[] = { 51static char *oneoverx_xpm[] = {
45/* width height num_colors chars_per_pixel */ 52/* width height num_colors chars_per_pixel */
46" 13 11 2 1", 53" 13 11 2 1",
47/* colors */ 54/* colors */
48". c None", 55". c None",
@@ -230,13 +237,13 @@ CalculatorImpl::CalculatorImpl( QWidget * parent, const char * name,
230 // now add in the conversion modes 237 // now add in the conversion modes
231 // when the menu gets done, these should be in a submenu 238 // when the menu gets done, these should be in a submenu
232 QString tmp = QPEApplication::qpeDir(); 239 QString tmp = QPEApplication::qpeDir();
233 tmp += "etc/unit_conversion.dat"; 240 tmp += "etc/unit_conversion.dat";
234 QFile myfile(tmp); 241 QFile myfile(tmp);
235 if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) { 242 if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) {
236 qDebug("Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp); 243 odebug << "Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp << oendl;
237 // disable the f button if no conv file available 244 // disable the f button if no conv file available
238 ComboBoxFunction->setEnabled(FALSE); 245 ComboBoxFunction->setEnabled(FALSE);
239 } 246 }
240 else { 247 else {
241 QString line, line2; 248 QString line, line2;
242 QTextStream ts(&myfile); 249 QTextStream ts(&myfile);
@@ -504,13 +511,13 @@ void CalculatorImpl::execOp( Operation i )
504 } 511 }
505 case oCloseBrace: { 512 case oCloseBrace: {
506 if ( numOpenBraces == 0 ) 513 if ( numOpenBraces == 0 )
507 return; 514 return;
508 processStack( oAdd ); 515 processStack( oAdd );
509 if ( operationStack.top().operation != oOpenBrace ) 516 if ( operationStack.top().operation != oOpenBrace )
510 qDebug( "Calculator: internal Error" ); 517 odebug << "Calculator: internal Error" << oendl;
511 operationStack.pop(); 518 operationStack.pop();
512 state = sNewNumber; 519 state = sNewNumber;
513 numOpenBraces--; 520 numOpenBraces--;
514 break; 521 break;
515 } 522 }
516 523