/* properties.cc This file is part of the Project::OSiRiON world editor and is distributed under the terms and conditions of the GNU General Public License version 2 */ #include "properties.h" namespace editor { Properties::Properties() { } Properties::Properties(const Properties & other) { assign(other); } Properties::~Properties() { } void Properties::assign(const Properties & other) { properties_comment = other.properties_comment; properties_comments.clear(); for (Comments::const_iterator i = properties_comments.constBegin(); i != properties_comments.constEnd(); ++i) { set_comment(i.key(), i.value()); } properties_label = other.properties_label; properties_name = other.properties_name; properties_location = other.properties_location; properties_color = other.properties_color; properties_info = other.properties_info; properties_values = other.properties_values; } void Properties::add_value(const QString &key, const QString &value, const QString &comment) { if (comment.size()) properties_values += comment; properties_values += key; properties_values += '='; properties_values += value; properties_values += '\n'; } void Properties::add_info(const QString &text) { properties_info += text; properties_info += '\n'; } void Properties::save_comment(QTextStream &textstream, const QString &attribute) { QString text = comment(attribute); if (text.size()) { textstream << text; } } } // namespace editor