You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdeutils/tdelirc/tdelirc/mode.cpp

52 lines
1.1 KiB

//
//
// C++ Implementation: $MODULE$
//
// Description:
//
//
// Author: Gav Wood <gav@kde.org>, (C) 2003
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include <tdeconfig.h>
#include "modes.h"
#include "mode.h"
Mode::Mode() : theName(TQString())
{
}
Mode::Mode(const TQString &remote, const TQString &name, const TQString &iconFile)
{
theRemote = remote;
theName = name;
theIconFile = iconFile;
}
Mode::~Mode()
{
}
const Mode &Mode::loadFromConfig(TDEConfig &theConfig, int index)
{
TQString Prefix = "Mode" + TQString().setNum(index);
theName = theConfig.readEntry(Prefix + "Name");
theRemote = theConfig.readEntry(Prefix + "Remote");
theIconFile = theConfig.readEntry(Prefix + "IconFile");
if(theIconFile.isEmpty()) theIconFile = TQString();
return *this;
}
void Mode::saveToConfig(TDEConfig &theConfig, int index)
{
TQString Prefix = "Mode" + TQString().setNum(index);
theConfig.writeEntry(Prefix + "Name", theName);
theConfig.writeEntry(Prefix + "Remote", theRemote);
theConfig.writeEntry(Prefix + "IconFile", theIconFile);
}