[Kalzium] KDE/kdeedu/kalzium/src

Carsten Niehaus cniehaus at gmx.de
Tue Jan 3 13:14:16 CET 2006


SVN commit 493822 by cniehaus:

Ok, activating the calculator again. The problem is that it somehow crashes in the parser...
The only line with QString::at() (as stated in comment #6) is this line:

   m_nextChar = m_str.at(++m_index).toLatin1();

(that is in Parser::getNextChar).

#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb63639b1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb63652c9 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb65d4227 in qt_message_output (msgType=QtFatalMsg,
    buf=0xbfc14e40 "ASSERT: \"i >= 0 && i < size()\" in file /home/kde4/svn/qt-copy/include/Qt/../../src/corelib/tools/qstring.h, line 541")
    at global/qglobal.cpp:1958
#4  0xb65d4278 in qFatal (msg=0xb669dd1c "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2174
#5  0xb65d42de in qt_assert (assertion=0xb7f01214 "i >= 0 && i < size()",
	            file=0xb7f011d0 "/home/kde4/svn/qt-copy/include/Qt/../../src/corelib/tools/qstring.h", line=541) at global/qglobal.cpp:1723
#6  0xb7f00a04 in QString::at (this=0x8187314, i=3) at qstring.h:541
#7  0xb7f0051d in Parser::getNextChar (this=0x8187310) at /home/kde4/svn/kdeedu/libkdeedu/libscience/parser.cpp:151
#8  0xb7f0065a in Parser::parseInt (this=0x8187310, _result=0x8187324) at /home/kde4/svn/kdeedu/libkdeedu/libscience/parser.cpp:82
#9  0xb7f00869 in Parser::getNextToken (this=0x8187310) at /home/kde4/svn/kdeedu/libkdeedu/libscience/parser.cpp:192
#10 0xb7eff01b in MoleculeParser::getNextToken (this=0x8187310) at /home/kde4/svn/kdeedu/libkdeedu/libscience/moleculeparser.cpp:285
#11 0xb7eff4e6 in MoleculeParser::parseTerm (this=0x8187310, _resultMass=0xbfc16fe8, _resultMap=0xbfc16fe4)
				                    at /home/kde4/svn/kdeedu/libkdeedu/libscience/moleculeparser.cpp:213
#12 0xb7eff40b in MoleculeParser::parseSubmolecule (this=0x8187310, _resultMass=0x818ba9c, _resultMap=0x818baa8)
									                            at /home/kde4/svn/kdeedu/libkdeedu/libscience/moleculeparser.cpp:179
#13 0xb7eff6bd in MoleculeParser::weight (this=0x8187310, _moleculeString=@0xbfc1703c, _resultMass=0x818ba9c, _resultMap=0x818baa8)
																                                    at /home/kde4/svn/kdeedu/libkdeedu/libscience/moleculeparser.cpp:151
#14 0x0807ba9d in MolcalcWidget::slotCalcButtonClicked (this=0x818ba58) at /home/kde4/svn/kdeedu/kalzium/src/molcalcwidget.cpp:150


CCMAIL:kalzium at kde.org


 M  +1 -2      molcalcwidget.cpp  


--- trunk/KDE/kdeedu/kalzium/src/molcalcwidget.cpp #493821:493822
@@ -121,7 +121,6 @@
 
 QString MolcalcWidget::compositionString( ElementCountMap &_map )
 {
-	kdDebug() << "MolcalcWidget::compositionString()" << endl;
 	QString  str;
 
 	ElementCountMap::Iterator  it    = _map.begin();
@@ -147,7 +146,7 @@
 
 	// Parse the molecule, and at the same time calculate the total
 	// mass, and the composition of it.
-	//m_validInput = m_parser->weight("CO2", &m_mass, &m_elementMap);
+	m_validInput = m_parser->weight(molecule, &m_mass, &m_elementMap);
 
 	updateUI();
 }


More information about the Kalzium mailing list