summaryrefslogtreecommitdiffstats
path: root/tdelirc/tdelirc/mode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdelirc/tdelirc/mode.cpp')
-rw-r--r--tdelirc/tdelirc/mode.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/tdelirc/tdelirc/mode.cpp b/tdelirc/tdelirc/mode.cpp
new file mode 100644
index 0000000..9402573
--- /dev/null
+++ b/tdelirc/tdelirc/mode.cpp
@@ -0,0 +1,51 @@
+//
+//
+// 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);
+}
+