File indexing completed on 2024-05-05 03:49:15

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Utku Aydın <utkuaydin34@gmail.com>
0004 //
0005 
0006 #include "RouteItem.h"
0007 
0008 #include <QUrl>
0009 #include <QIcon>
0010 
0011 namespace Marble {
0012 
0013 class Q_DECL_HIDDEN RouteItem::Private {
0014 
0015 public:
0016     QString m_identifier;
0017     QString m_name;
0018     QIcon m_preview;
0019     QUrl m_previewUrl;
0020     QString m_distance;
0021     QString m_duration;
0022     bool m_onCloud;
0023 };
0024 
0025 RouteItem::RouteItem() : d( new Private() )
0026 {
0027 }
0028 
0029 RouteItem::RouteItem( const RouteItem &other  ) : d( new Private( *other.d ) )
0030 {
0031 }
0032 
0033 RouteItem::~RouteItem()
0034 {
0035     delete d;
0036 }
0037 
0038 RouteItem &RouteItem::operator=( const RouteItem &other )
0039 {
0040     *d = *other.d;
0041     return *this;
0042 }
0043 
0044 bool RouteItem::operator==( const RouteItem& other ) const
0045 {
0046     return identifier() == other.identifier();
0047 }
0048 
0049 QString RouteItem::identifier() const
0050 {
0051     return d->m_identifier;
0052 }
0053 
0054 void RouteItem::setIdentifier( const QString &timestamp )
0055 {
0056     d->m_identifier = timestamp;
0057 }
0058 
0059 QString RouteItem::name() const
0060 {
0061     return d->m_name;
0062 }
0063 
0064 void RouteItem::setName( const QString &name )
0065 {
0066     d->m_name = name;
0067 }
0068 
0069 QIcon RouteItem::preview() const
0070 {
0071     return d->m_preview;
0072 }
0073 
0074 void RouteItem::setPreview( const QIcon &preview )
0075 {
0076     d->m_preview = preview;
0077 }
0078 
0079 QUrl RouteItem::previewUrl() const
0080 {
0081     return d->m_previewUrl;
0082 }
0083 
0084 void RouteItem::setPreviewUrl( const QUrl &previewUrl )
0085 {
0086     d->m_previewUrl = previewUrl;
0087 }
0088 
0089 QString RouteItem::distance() const
0090 {
0091     return d->m_distance;
0092 }
0093 
0094 void RouteItem::setDistance( const QString &distance )
0095 {
0096     d->m_distance = distance;
0097 }
0098 
0099 QString RouteItem::duration() const
0100 {
0101     return d->m_duration;
0102 }
0103 
0104 void RouteItem::setDuration( const QString &duration )
0105 {
0106     d->m_duration = duration;
0107 }
0108 
0109 bool RouteItem::onCloud() const
0110 {
0111     return d->m_onCloud;
0112 }
0113 
0114 void RouteItem::setOnCloud( const bool onCloud )
0115 {
0116     d->m_onCloud = onCloud;
0117 }
0118 
0119 }