Back to index

kdeartwork  4.3.2
Public Member Functions | Protected Attributes
KXSStringItem Class Reference

#include <kxsitem.h>

Inheritance diagram for KXSStringItem:
Inheritance graph
[legend]
Collaboration diagram for KXSStringItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 KXSStringItem (const QString &name, KConfig &config)
 KXSStringItem (const QString &name, const QXmlAttributes &attr)
virtual QString command ()
virtual void save (KConfig &config)
virtual void read (KConfig &config)

Protected Attributes

QString mSwitch
QString mValue
QString mName
QString mLabel

Detailed Description

Definition at line 117 of file kxsitem.h.


Constructor & Destructor Documentation

KXSStringItem::KXSStringItem ( const QString &  name,
KConfig &  config 
)

Definition at line 213 of file kxsitem.cpp.

  : KXSConfigItem(name, config)
{
  KConfigGroup grp(&config, name);
  mValue = grp.readEntry("Value");
  mSwitch = grp.readEntry("Switch");
  int pos = mSwitch.indexOf( '%' );
  if (pos >= 0) {
    mSwitch.insert(pos+1, "\"");
    mSwitch.insert(pos, "\"");
  }
}
KXSStringItem::KXSStringItem ( const QString &  name,
const QXmlAttributes &  attr 
)

Definition at line 226 of file kxsitem.cpp.

  : KXSConfigItem(name, attr)
{
  mSwitch = attr.value("arg");
  int pos = mSwitch.indexOf( '%' );
  if (pos >= 0) {
    mSwitch.insert(pos+1, "1\"");
    mSwitch.insert(pos, "\"");
  }
}

Member Function Documentation

QString KXSStringItem::command ( ) [virtual]

Implements KXSConfigItem.

Definition at line 237 of file kxsitem.cpp.

{
  if (!mValue.isEmpty())
      return mSwitch.arg(mValue);
  return "";
}
void KXSStringItem::read ( KConfig &  config) [virtual]

Implements KXSConfigItem.

Reimplemented in KXSFileControl, and KXSLineEditControl.

Definition at line 244 of file kxsitem.cpp.

{
  KConfigGroup grp = config.group(mName);
  if (grp.hasKey("Value"))
      mValue = grp.readEntry("Value");
}
void KXSStringItem::save ( KConfig &  config) [virtual]

Implements KXSConfigItem.

Definition at line 251 of file kxsitem.cpp.

{
  KConfigGroup grp = config.group(mName);
  grp.writeEntry("Value", mValue);
}

Member Data Documentation

QString KXSConfigItem::mLabel [protected, inherited]

Definition at line 43 of file kxsitem.h.

QString KXSConfigItem::mName [protected, inherited]

Definition at line 42 of file kxsitem.h.

QString KXSStringItem::mSwitch [protected]

Definition at line 128 of file kxsitem.h.

QString KXSStringItem::mValue [protected]

Definition at line 129 of file kxsitem.h.


The documentation for this class was generated from the following files: