* Cleanup of old Variable stuff.

* Fixed a bug that would cause ^O to make an extra call to
"set_directory" for the log, instead of "get_directory".


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@909 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-05-31 16:40:34 +00:00
parent 13dc0c942a
commit 8a1220fd5b
11 changed files with 48 additions and 756 deletions
+9 -28
View File
@@ -53,37 +53,18 @@ const torrent::Object
CommandSlot::call_list(Variable* rawVariable, const torrent::Object& rawArgs) {
CommandSlot* command = static_cast<CommandSlot*>(rawVariable);
// const torrent::Object& arg = to_single_argument(rawArgs);
// switch (arg.type()) {
// case torrent::Object::TYPE_VALUE:
// variable->m_variable = arg.as_value() ? (int64_t)1 : (int64_t)0;
// break;
// case torrent::Object::TYPE_STRING:
// // Move the checks into some is_true, is_false think in Variable.
// if (arg.as_string() == "yes" || arg.as_string() == "true")
// variable->m_variable = (int64_t)1;
// else if (arg.as_string() == "no" || arg.as_string() == "false")
// variable->m_variable = (int64_t)0;
// else
// throw torrent::input_error("String does not parse as a boolean.");
// break;
// default:
// throw torrent::input_error("Input is not a boolean.");
// }
// return variable->m_variable;
switch (rawArgs.type()) {
// case torrent::Object::TYPE_STRING:
// break;
case torrent::Object::TYPE_LIST:
return command->m_slot(rawArgs);
case torrent::Object::TYPE_VALUE:
case torrent::Object::TYPE_STRING:
{
torrent::Object tmpList(torrent::Object::TYPE_LIST);
tmpList.as_list().push_back(rawArgs);
return command->m_slot(tmpList);
}
default:
throw torrent::input_error("Not a list.");
}