habe da mal wieder ein problemchen
wenn ich hier ein Item auswähle, liest er die endsprechende datei, funktioniert auch aber,
Code: Alles auswählen
QString log, dart, exc, pryd, car, orc, ava, broc, lyo, sto, ys, cam;
log.append("keep-xml/de/logres/keeps.xml");
dart.append("keep-xml/de/dartmoor/keeps.xml");
exc.append("keep-xml/en/excalibur/keeps.xml");
pryd.append("keep-xml/en/prydwen/keeps.xml");
car.append("keep-xml/fr/carnac/keeps.xml");
orc.append("keep-xml/fr/orcanie/keeps.xml");
ava.append("keep-xml/full/avalon/keeps.xml");
broc.append("keep-xml/full/broceliande/keeps.xml");
lyo.append("keep-xml/full/lyonesse/keeps.xml");
sto.append("keep-xml/full/stonehenge/keeps.xml");
ys.append("keep-xml/full/ys/keeps.xml");
cam.append("keep-xml/pvp/keeps.xml");
QListViewItemIterator it( listView_Server );
while( it.current() ){
if ( listView_Server->currentItem()->text(0) == de_logres ){
slotListViewFill( log );
}else if ( listView_Server->currentItem()->text(0) == de_dartmoor ){
slotListViewFill( dart );
}else if ( listView_Server->currentItem()->text(0) == en_excalibur ){
slotListViewFill( exc );
}else if ( listView_Server->currentItem()->text(0) == en_prydwen ){
slotListViewFill( pryd );
}else if ( listView_Server->currentItem()->text(0) == fr_carnac ){
slotListViewFill( car );
}else if ( listView_Server->currentItem()->text(0) == fr_orcanie ){
slotListViewFill( orc );
}else if ( listView_Server->currentItem()->text(0) == full_avalon ){
slotListViewFill( ava );
}else if ( listView_Server->currentItem()->text(0) == full_broceliande ){
slotListViewFill( broc );
}else if ( listView_Server->currentItem()->text(0) == full_lyonesse ){
slotListViewFill( lyo );
}else if ( listView_Server->currentItem()->text(0) == full_stonehenge ){
slotListViewFill( sto );
}else if ( listView_Server->currentItem()->text(0) == full_ys ){
slotListViewFill( ys );
}else if ( listView_Server->currentItem()->text(0) == pvp_camlann ){
slotListViewFill( cam );
}else{
++it;
}
}
nicht warum
Code: Alles auswählen
QListViewItem *item;
item = new QListViewItem( listView_KeepInfo );
item->setOpen( true );
QFile xmlKeep( fileName );
QDomDocument doc;
doc.setContent( &xmlKeep );
xmlKeep.close();
QDomNode node = doc.documentElement().firstChild();
while ( !node.isNull() ) {
if ( node.toElement().tagName() == "keep" ){
item->setText( 0, node.toElement().attribute( "id" ) );
item->setText( 1, node.toElement().attribute( "guild" ) );
item->setText( 2, node.toElement().attribute( "guildname" ) );
item->setText( 3, node.toElement().attribute( "orig_realm" ) );
item->setText( 4, node.toElement().attribute( "realm" ) );
item->setText( 5, node.toElement().attribute( "relic" ) );
}
node = node.nextSibling();
}