Subversion Repositories public

Rev

Rev 232 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 232 Rev 313
Line 247... Line 247...
247
/*
247
/*
248
 * This is called every time a new start element was parsed.
248
 * This is called every time a new start element was parsed.
249
 */
249
 */
250
bool gmn_import::startElement( const QString&, const QString&,
250
bool gmn_import::startElement( const QString&, const QString&,
251
                                    const QString& qName,
251
                                    const QString& qName,
252
                                    const QXmlAttributes&)
252
                                    const QXmlAttributes& att)
253
{
253
{
254
int i = CON_FIRST;
254
int i = CON_FIRST;
-
 
255
int index;
255
 
256
 
256
	while (i <= CON_LAST)
257
	while (i <= CON_LAST)
257
	{
258
	{
258
	   if (qName.toLower() == getKey(i).toLower())
259
	   if (qName.toLower() == getKey(i).toLower())
259
	   {
260
	   {
Line 269... Line 270...
269
		 else
270
		 else
270
		    con = "course";
271
		    con = "course";
271
 
272
 
272
		 run.track_index = 0;
273
		 run.track_index = 0;
273
		 run.first_lap_index = 0;
274
		 run.first_lap_index = 0;
-
 
275
		 // Find sport type, if there is one
-
 
276
		 if ((index = att.index(QString("Sport"))) != -1)
-
 
277
		 {
-
 
278
		    if (att.value(index).toAscii().toLower() == QString("Running").toLower())
274
		 run.sport_type = 0;		// Running
279
				run.sport_type = D1000_running;
-
 
280
			else if (att.value(index).toAscii().toLower() == QString("Biking").toLower())
-
 
281
				run.sport_type = D1000_biking;
-
 
282
			else if (att.value(index).toAscii().toLower() == QString("Other").toLower())
-
 
283
				run.sport_type = D1000_other;
-
 
284
			else
-
 
285
				run.sport_type = D1000_other;
-
 
286
		 }
-
 
287
		 else
-
 
288
			run.sport_type = D1000_other;		// Other
-
 
289
 
275
		 tk = i;
290
		 tk = i;
276
	      }
291
	      }
277
 
292
 
278
	      if (qName.toLower() == QString("lap"))
293
	      if (qName.toLower() == QString("lap"))
279
	      {
294
	      {