Vidalia 0.2.15
|
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.torproject.org/projects/vidalia.html. No part of Vidalia, 00007 ** including this file, may be copied, modified, propagated, or distributed 00008 ** except according to the terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file PackageInfo.cpp 00013 ** \brief Contains information about a single available updated software 00014 ** package. 00015 */ 00016 00017 #include "Packageinfo.h" 00018 00019 00020 PackageInfo::PackageInfo() 00021 { 00022 } 00023 00024 bool 00025 PackageInfo::isValid() const 00026 { 00027 return (! _name.isEmpty() && ! _version.isEmpty()); 00028 } 00029 00030 void 00031 PackageInfo::setName(const QString &name) 00032 { 00033 _name = name; 00034 } 00035 00036 QString 00037 PackageInfo::name() const 00038 { 00039 return _name; 00040 } 00041 00042 void 00043 PackageInfo::setVersion(const QString &version) 00044 { 00045 _version = version; 00046 } 00047 00048 QString 00049 PackageInfo::version() const 00050 { 00051 return _version; 00052 } 00053 00054 void 00055 PackageInfo::setLongDescription(const QString &lang, const QString &desc) 00056 { 00057 _longDescription.insert(lang, desc); 00058 } 00059 00060 QString 00061 PackageInfo::longDescription(const QString &lang) const 00062 { 00063 return _longDescription.value(lang); 00064 } 00065 00066 bool 00067 PackageInfo::hasLongDescription(const QString &lang) const 00068 { 00069 return _longDescription.contains(lang); 00070 } 00071 00072 void 00073 PackageInfo::setShortDescription(const QString &lang, const QString &desc) 00074 { 00075 _shortDescription.insert(lang, desc); 00076 } 00077 00078 00079 QString 00080 PackageInfo::shortDescription(const QString &lang) const 00081 { 00082 return _shortDescription.value(lang); 00083 } 00084 00085 00086 bool 00087 PackageInfo::hasShortDescription(const QString &lang) const 00088 { 00089 return _shortDescription.contains(lang); 00090 } 00091