1 /* This file is part of KsirK.
2 Copyright (C) 2005-2007 Gael de Chalendar <kleag@free.fr>
3
4 KsirK is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation, either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA
18 */
19
20 /* begin : Mon Feb 07 2005 */
21
22 #include "ksirkgamexmlloader.h"
23 #include "ksirkgamexmlhandler.h"
24
25 #include <KMessageBox>
26 #include <KLocalizedString>
27
28 namespace Ksirk
29 {
30 namespace SaveLoad
31 {
32
GameXmlLoader(const QString & fileName,KGameWindow & game,QList<GameLogic::PlayerMatrix> & waitedPlayers)33 GameXmlLoader::GameXmlLoader(const QString& fileName, KGameWindow& game,
34 QList<GameLogic::PlayerMatrix>& waitedPlayers)
35 {
36 GameXmlHandler handler(game, waitedPlayers);
37
38 QFile xmlFile( fileName );
39 QXmlInputSource source( &xmlFile );
40
41 QXmlSimpleReader reader;
42 reader.setContentHandler( &handler );
43
44 if (!reader.parse( source ))
45 {
46 KMessageBox::error(0, i18n("Skin file parsing error"),
47 i18n("KsirK - Error"));
48 exit(0);
49 }
50 }
51
52 } // closing namespace SaveLoad
53 } // closing namespace Ksirk
54
55