* Converting various variables to the new command version.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@891 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-04-17 14:57:56 +00:00
parent 7c121ac049
commit 81637ff5a0
14 changed files with 275 additions and 210 deletions
+2
View File
@@ -1,6 +1,8 @@
noinst_LIBRARIES = libsub_utils.a
libsub_utils_a_SOURCES = \
command_slot.cc \
command_slot.h \
command_variable.cc \
command_variable.h \
directory.cc \
-13
View File
@@ -291,19 +291,6 @@ VariableDownloadStringSlot::set_d(core::Download* download, const torrent::Objec
}
}
void
VariableListSlot::set(const torrent::Object& arg) {
switch (arg.type()) {
// case torrent::Object::TYPE_STRING:
// break;
case torrent::Object::TYPE_LIST:
m_slotSet(arg.as_list());
break;
default:
throw torrent::input_error("Not a list.");
}
}
void
VariableDownloadListSlot::set_d(core::Download* download, const torrent::Object& arg) {
switch (arg.type()) {
-15
View File
@@ -295,21 +295,6 @@ private:
torrent::Object m_cache;
};
class VariableListSlot : public Variable {
public:
typedef rak::function1<void, const list_type&> slot_set_type;
template <typename SlotSet>
VariableListSlot(SlotSet* slotSet) {
m_slotSet.set(slotSet);
}
virtual void set(const torrent::Object& arg);
private:
slot_set_type m_slotSet;
};
class VariableDownloadListSlot : public Variable {
public:
typedef rak::function2<void, core::Download*, const list_type&> slot_set_type;