Ignore:
Timestamp:
08/01/13 18:30:31 (11 years ago)
Author:
Marek Kurdej
Message:

Major: changed plugins section name to plugings. Parameters section will be used for something else.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/src/PacpusLib/XmlComponentConfig.cpp

    r162 r165  
    1414DECLARE_STATIC_LOGGER("pacpus.core.XmlComponentConfig");
    1515
    16 // FIXME: const char* instead of const string
    17 static const string kPropertyComponentName = "name";
    18 static const string kPropertyComponentType = "type";
    19 static const string kPropertyConnectionType = "type";
    20 static const string kPropertyConnectionInput = "input";
    21 static const string kPropertyConnectionOutput = "output";
    22 static const string kPropertyConnectionPriority = "priority";
    23 //static const string kPropertyConnectionInputC = "inputC";
    24 //static const string kPropertyConnectionInputP = "inputP";
    25 //static const string kPropertyConnectionOutputC = "outputC";
    26 //static const string kPropertyConnectionOutputP = "outputP";
     16static const char* kPropertyComponentName = "name";
     17static const char* kPropertyComponentType = "type";
     18static const char* kPropertyConnectionType = "type";
     19static const char* kPropertyConnectionInput = "input";
     20static const char* kPropertyConnectionOutput = "output";
     21static const char* kPropertyConnectionPriority = "priority";
    2722
    2823XmlComponentConfig::XmlComponentConfig(const QString& name)
     
    4742    {
    4843        LOG_ERROR("cannot add component property:"
    49                   << " component '" << component_.attribute(kPropertyComponentName.c_str()) << "'"
     44                  << " component '" << component_.attribute(kPropertyComponentName) << "'"
    5045                  << " already contains property '" << name << "'"
    5146                  << " and its value is '" << component_.attribute(name) << "'"
     
    5752    component_.setAttribute(name, 0);
    5853    LOG_INFO("property '" << name << "'"
    59               << " was added to the component " << component_.attribute(kPropertyComponentName.c_str()) << "'"
     54              << " was added to the component " << component_.attribute(kPropertyComponentName) << "'"
    6055              << " and set to '" << component_.attribute(name) << "'"
    6156              );
     
    6661    if (!hasProperty(name)) {
    6762        LOG_WARN("cannot delete compoenent property '" << name << "'"
    68                  << " of component '" << component_.attribute(kPropertyComponentName.c_str()) << "'"
     63                 << " of component '" << component_.attribute(kPropertyComponentName) << "'"
    6964                 << ". Component does not contain this property."
    7065                 );
     
    7570    component_.removeAttribute(name);
    7671    LOG_INFO("property '" << name << "' "
    77       << " of component '" << component_.attribute(kPropertyComponentName.c_str()) << "'"
     72      << " of component '" << component_.attribute(kPropertyComponentName) << "'"
    7873      << " was deleted"
    7974      );
     
    8782    {
    8883        LOG_WARN("cannot retrieve component property '" << name << "'"
    89                  << " of component '" << component_.attribute(kPropertyComponentName.c_str()) << "'"
     84                 << " of component '" << component_.attribute(kPropertyComponentName) << "'"
    9085                 << ". Component does not contain this property."
    9186                 );
     
    116111    component_.setAttribute(name, value);
    117112    LOG_INFO("property " << name
    118              << " of the component " << component_.attribute(kPropertyComponentName.c_str())
     113             << " of the component " << component_.attribute(kPropertyComponentName)
    119114             << " was set to : " << value
    120115             );
     
    138133QString const XmlComponentConfig::getComponentName() const
    139134{
    140     //return component_.attribute(kPropertyComponentName.c_str());
    141     return getProperty(kPropertyComponentName.c_str());
     135    return getProperty(kPropertyComponentName);
    142136}
    143137
    144138QString const XmlComponentConfig::getComponentType() const
    145139{
    146     return getProperty(kPropertyComponentType.c_str());
     140    return getProperty(kPropertyComponentType);
    147141}
    148142
    149143QString const XmlComponentConfig::getConnectionType() const
    150144{
    151     return getProperty(kPropertyConnectionType.c_str());
     145    return getProperty(kPropertyConnectionType);
    152146}
    153147
    154148QString const XmlComponentConfig::getConnectionInput() const
    155149{
    156     return getProperty(kPropertyConnectionInput.c_str());
     150    return getProperty(kPropertyConnectionInput);
    157151}
    158152
    159153QString const XmlComponentConfig::getConnectionOutput() const
    160154{
    161     return getProperty(kPropertyConnectionOutput.c_str());
     155    return getProperty(kPropertyConnectionOutput);
    162156}
    163157
    164158int const XmlComponentConfig::getConnectionPriority() const
    165159{
    166     return getIntProperty(kPropertyConnectionPriority.c_str(),0);
     160    return getIntProperty(kPropertyConnectionPriority, /*defaultValue=*/0);
    167161}
Note: See TracChangeset for help on using the changeset viewer.