Vidalia 0.2.10

PackageInfo.cpp

Go to the documentation of this file.
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 PackageInfo.cpp
00013 ** \version $Id: PackageInfo.cpp 3735 2009-04-28 20:28:01Z edmanm $
00014 ** \brief Contains information about a single available updated software
00015 ** package.
00016 */
00017 
00018 #include "Packageinfo.h"
00019 
00020 
00021 PackageInfo::PackageInfo()
00022 {
00023 }
00024 
00025 bool
00026 PackageInfo::isValid() const
00027 {
00028   return (! _name.isEmpty() && ! _version.isEmpty());
00029 }
00030 
00031 void
00032 PackageInfo::setName(const QString &name)
00033 {
00034   _name = name;
00035 }
00036 
00037 QString
00038 PackageInfo::name() const
00039 {
00040   return _name;
00041 }
00042 
00043 void
00044 PackageInfo::setVersion(const QString &version)
00045 {
00046   _version = version;
00047 }
00048 
00049 QString
00050 PackageInfo::version() const
00051 {
00052   return _version;
00053 }
00054 
00055 void
00056 PackageInfo::setLongDescription(const QString &lang, const QString &desc)
00057 {
00058   _longDescription.insert(lang, desc);
00059 }
00060 
00061 QString
00062 PackageInfo::longDescription(const QString &lang) const
00063 {
00064   return _longDescription.value(lang);
00065 }
00066 
00067 bool
00068 PackageInfo::hasLongDescription(const QString &lang) const
00069 {
00070   return _longDescription.contains(lang);
00071 }
00072 
00073 void
00074 PackageInfo::setShortDescription(const QString &lang, const QString &desc)
00075 {
00076   _shortDescription.insert(lang, desc);
00077 }
00078 
00079 
00080 QString
00081 PackageInfo::shortDescription(const QString &lang) const
00082 {
00083   return _shortDescription.value(lang);
00084 }
00085 
00086 
00087 bool
00088 PackageInfo::hasShortDescription(const QString &lang) const
00089 {
00090   return _shortDescription.contains(lang);
00091 }
00092