From 949ec7e9b37a3f434bbf358d1724decd6a0a82b1 Mon Sep 17 00:00:00 2001 From: Flavio Date: Tue, 8 Jan 2013 16:19:20 +0100 Subject: [PATCH] video source name --- src/iconloader/qticonloader.h | 56 ----------------------------------- src/ytsinglevideosource.cpp | 7 ++++- src/ytsinglevideosource.h | 1 + 3 files changed, 7 insertions(+), 57 deletions(-) delete mode 100644 src/iconloader/qticonloader.h diff --git a/src/iconloader/qticonloader.h b/src/iconloader/qticonloader.h deleted file mode 100644 index a40da0f..0000000 --- a/src/iconloader/qticonloader.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -****************************************************************************/ - - -#ifndef QTICONLOADER_H -#define QTICONLOADER_H - -#include - -// This is the QtIconLoader -// Version 0.1 -// - -class QtIconLoader -{ -public: - static QIcon icon(const QString &name); -}; - -#endif // QTICONLOADER_H diff --git a/src/ytsinglevideosource.cpp b/src/ytsinglevideosource.cpp index c6130d4..bf40ff9 100644 --- a/src/ytsinglevideosource.cpp +++ b/src/ytsinglevideosource.cpp @@ -44,7 +44,7 @@ const QStringList & YTSingleVideoSource::getSuggestions() { } QString YTSingleVideoSource::getName() { - return QString(); + return name; } void YTSingleVideoSource::parse(QByteArray data) { @@ -53,6 +53,11 @@ void YTSingleVideoSource::parse(QByteArray data) { YTFeedReader reader(data); QList videos = reader.getVideos(); + if (name.isEmpty() && !videos.isEmpty() && skip == 1) { + name = videos.first()->title(); + emit nameChanged(name); + } + foreach (Video *video, videos) emit gotVideo(video); diff --git a/src/ytsinglevideosource.h b/src/ytsinglevideosource.h index f60d812..62aeb9a 100644 --- a/src/ytsinglevideosource.h +++ b/src/ytsinglevideosource.h @@ -26,6 +26,7 @@ private: bool aborted; int skip; int max; + QString name; }; #endif // YTSINGLEVIDEOSOURCE_H -- 2.39.5