File indexing completed on 2024-03-03 04:09:36

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "enclosure.h"
0009 
0010 namespace Syndication
0011 {
0012 Enclosure::~Enclosure()
0013 {
0014 }
0015 
0016 QString Enclosure::debugInfo() const
0017 {
0018     QString info = QLatin1String("# Enclosure begin #################\n");
0019 
0020     const QString durl = url();
0021 
0022     if (!durl.isNull()) {
0023         info += QLatin1String("url: #") + durl + QLatin1String("#\n");
0024     }
0025 
0026     const QString dtitle = title();
0027 
0028     if (!dtitle.isNull()) {
0029         info += QLatin1String("title: #") + dtitle + QLatin1String("#\n");
0030     }
0031 
0032     const QString dtype = type();
0033 
0034     if (!dtype.isNull()) {
0035         info += QLatin1String("type: #") + dtype + QLatin1String("#\n");
0036     }
0037 
0038     const int dlength = length();
0039 
0040     if (dlength != 0) {
0041         info += QLatin1String("length: #") + QString::number(dlength) + QLatin1String("#\n");
0042     }
0043 
0044     uint dduration = duration();
0045 
0046     if (dduration != 0) {
0047         int hours = dduration / 3600;
0048         int minutes = (dduration - hours * 3600) / 60;
0049         int seconds = dduration - hours * 3600 - minutes * 60;
0050         info += QStringLiteral("duration: #%1 (%2:%3:%4)#\n").arg(dduration).arg(hours).arg(minutes).arg(seconds);
0051     }
0052 
0053     info += QLatin1String("# Enclosure end ###################\n");
0054 
0055     return info;
0056 }
0057 
0058 } // namespace Syndication