2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
2013-04-02 20:46:07 +02:00
|
|
|
// Music Composition & Notation
|
2012-05-26 14:26:10 +02:00
|
|
|
//
|
2013-04-02 20:46:07 +02:00
|
|
|
// Copyright (C) 2002-2011 Werner Schweer
|
2012-05-26 14:26:10 +02:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
2013-04-02 20:46:07 +02:00
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENCE.GPL
|
2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#include "xml.h"
|
|
|
|
#include "icon.h"
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// write
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Icon::write(Xml& xml) const
|
|
|
|
{
|
|
|
|
xml.stag(name());
|
2014-05-30 10:14:57 +02:00
|
|
|
xml.tag("subtype", int(_iconType));
|
2014-11-16 19:44:55 +01:00
|
|
|
if (!_action.isEmpty())
|
2014-11-14 18:08:02 +01:00
|
|
|
xml.tag("action", _action.data());
|
2012-05-26 14:26:10 +02:00
|
|
|
xml.etag();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// read
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2013-01-11 18:10:18 +01:00
|
|
|
void Icon::read(XmlReader& e)
|
2012-05-26 14:26:10 +02:00
|
|
|
{
|
2013-01-11 18:10:18 +01:00
|
|
|
while (e.readNextStartElement()) {
|
|
|
|
const QStringRef& tag(e.name());
|
2012-05-26 14:26:10 +02:00
|
|
|
if (tag == "action")
|
2014-11-14 18:08:02 +01:00
|
|
|
_action = e.readElementText().toLocal8Bit();
|
2012-05-26 14:26:10 +02:00
|
|
|
else if (tag == "subtype")
|
2014-05-30 10:14:57 +02:00
|
|
|
_iconType = IconType(e.readInt());
|
2012-05-26 14:26:10 +02:00
|
|
|
else
|
2013-01-11 18:10:18 +01:00
|
|
|
e.unknown();
|
2012-05-26 14:26:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
}
|
|
|
|
|