MuseScore/libmscore/icon.cpp
Joachim Schmitz f76946c2cf convert unnamed enum into enum class IconType
and change to a better sentinel for end of list.
Also move the Q_DECLARE_METATYPE(Ms::ValueType) nearer to its
definition.

This should conclude the work on the enums in libmsore/mscore.h.
2014-05-30 13:37:32 +02:00

49 lines
1.4 KiB
C++

//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2011 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// 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
//=============================================================================
#include "xml.h"
#include "icon.h"
namespace Ms {
//---------------------------------------------------------
// write
//---------------------------------------------------------
void Icon::write(Xml& xml) const
{
xml.stag(name());
xml.tag("subtype", int(_iconType));
if (_action)
xml.tag("action", _action);
xml.etag();
}
//---------------------------------------------------------
// read
//---------------------------------------------------------
void Icon::read(XmlReader& e)
{
while (e.readNextStartElement()) {
const QStringRef& tag(e.name());
if (tag == "action")
_action = strdup(e.readElementText().toLatin1().data());
else if (tag == "subtype")
_iconType = IconType(e.readInt());
else
e.unknown();
}
}
}