00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file clientstatusevent.cpp 00013 ** \version $Id: clientstatusevent.cpp 2780 2008-06-21 21:48:32Z edmanm $ 00014 ** \brief Base class for all Tor client status events 00015 */ 00016 00017 #include "clientstatusevent.h" 00018 00019 00020 /** Returns a ClientStatusEvent::Status enum value for the status event type 00021 * represented by <b>str</b>. */ 00022 ClientStatusEvent::Status 00023 ClientStatusEvent::statusFromString(const QString &str) 00024 { 00025 if (!str.compare("ENOUGH_DIR_INFO", Qt::CaseInsensitive)) 00026 return EnoughDirectoryInfo; 00027 if (!str.compare("NOT_ENOUGH_DIR_INFO", Qt::CaseInsensitive)) 00028 return NotEnoughDirectoryInfo; 00029 if (!str.compare("CIRCUIT_ESTABLISHED", Qt::CaseInsensitive)) 00030 return CircuitEstablished; 00031 if (!str.compare("CIRCUIT_NOT_ESTABLISHED", Qt::CaseInsensitive)) 00032 return CircuitNotEstablished; 00033 if (!str.compare("DANGEROUS_SOCKS", Qt::CaseInsensitive)) 00034 return DangerousSocks; 00035 if (!str.compare("SOCKS_UNKNOWN_PROTOCOL", Qt::CaseInsensitive)) 00036 return UnknownSocksProtocol; 00037 if (!str.compare("SOCKS_BAD_HOSTNAME", Qt::CaseInsensitive)) 00038 return SocksBadHostname; 00039 if (!str.compare("BOOTSTRAP", Qt::CaseInsensitive)) 00040 return Bootstrap; 00041 return UnrecognizedStatus; 00042 } 00043