From: Flavio Date: Mon, 7 Jan 2013 16:22:42 +0000 (+0100) Subject: 2013 X-Git-Tag: 2.0~45 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=88a355db54b6be2f52e7790243fe1ecf51186fe0;p=minitube 2013 --- diff --git a/src/aboutview.cpp b/src/aboutview.cpp index 9a5e259..78d4a34 100644 --- a/src/aboutview.cpp +++ b/src/aboutview.cpp @@ -69,7 +69,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) { "

" + tr("Released under the GNU General Public License") .arg("http://www.gnu.org/licenses/gpl.html") + "

" #endif - "

© 2009-2012 " + Constants::ORG_NAME + "

" + "

© 2009-2013 " + Constants::ORG_NAME + "

" ""; QLabel *infoLabel = new QLabel(info, this); infoLabel->setOpenExternalLinks(true); diff --git a/src/listmodel.cpp b/src/listmodel.cpp deleted file mode 100644 index 4e8662b..0000000 --- a/src/listmodel.cpp +++ /dev/null @@ -1,470 +0,0 @@ -#include "listmodel.h" -#include "videomimedata.h" - -#define MAX_ITEMS 10 -static const QString recentKeywordsKey = "recentKeywords"; -static const QString recentChannelsKey = "recentChannels"; - -ListModel::ListModel(QWidget *parent) : QAbstractListModel(parent) { - youtubeSearch = 0; - searching = false; - canSearchMore = true; - m_activeVideo = 0; - m_activeRow = -1; - skip = 1; - - hoveredRow = -1; - authorHovered = false; - authorPressed = false; -} - -ListModel::~ListModel() { - delete youtubeSearch; -} - -int ListModel::rowCount(const QModelIndex &/*parent*/) const { - int count = videos.size(); - - // add the message item - if (videos.isEmpty() || !searching) - count++; - - return count; -} - -QVariant ListModel::data(const QModelIndex &index, int role) const { - - int row = index.row(); - - if (row == videos.size()) { - - QPalette palette; - QFont boldFont; - boldFont.setBold(true); - - switch (role) { - case ItemTypeRole: - return ItemTypeShowMore; - case Qt::DisplayRole: - case Qt::StatusTipRole: - if (!errorMessage.isEmpty()) return errorMessage; - if (searching) return tr("Searching..."); - if (canSearchMore) return tr("Show %1 More").arg(MAX_ITEMS); - if (videos.isEmpty()) return tr("No videos"); - else return tr("No more videos"); - case Qt::TextAlignmentRole: - return QVariant(int(Qt::AlignHCenter | Qt::AlignVCenter)); - case Qt::ForegroundRole: - if (!errorMessage.isEmpty()) - return palette.color(QPalette::ToolTipText); - else - return palette.color(QPalette::Dark); - case Qt::BackgroundColorRole: - if (!errorMessage.isEmpty()) - return palette.color(QPalette::ToolTipBase); - else - return QVariant(); - case Qt::FontRole: - return boldFont; - default: - return QVariant(); - } - - } else if (row < 0 || row >= videos.size()) - return QVariant(); - - Video *video = videos.at(row); - - switch (role) { - case ItemTypeRole: - return ItemTypeVideo; - case VideoRole: - return QVariant::fromValue(QPointer