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 00004 ** you did not receive the LICENSE file with this file, you may obtain it 00005 ** from the 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 00008 ** the terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file dangerousversionevent.cpp 00013 ** \version $Id: dangerousversionevent.cpp 2362 2008-02-29 04:30:11Z edmanm $ 00014 ** \brief Event sent when Tor realizes its version is not recommended 00015 */ 00016 00017 #include "dangerousversionevent.h" 00018 00019 00020 /** Returns a DangerousVersionEvent::Reason enum value for <b>str</b>, 00021 * representing the reason why Tor thinks its version is dangerous. */ 00022 DangerousVersionEvent::Reason 00023 DangerousVersionEvent::reasonFromString(const QString &str) 00024 { 00025 if (!str.compare("UNRECOMMENDED", Qt::CaseInsensitive)) 00026 return UnrecommendedVersion; 00027 if (!str.compare("OLD", Qt::CaseInsensitive) 00028 || !str.compare("OBSOLETE", Qt::CaseInsensitive)) 00029 return ObsoleteVersion; 00030 if (!str.compare("NEW", Qt::CaseInsensitive)) 00031 return NewVersion; 00032 return UnrecognizedReason; 00033 } 00034