X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fchannelview.cpp;h=eb6ccf902f876040ae6f8324e2bf57e2a1582814;hb=HEAD;hp=0ce9a2c313cf64137119be10248f14c2e3fadcd4;hpb=c8cd3bb736bf2dc877718d0bedef5548178bade1;p=minitube diff --git a/src/channelview.cpp b/src/channelview.cpp index 0ce9a2c..c9e1e8b 100644 --- a/src/channelview.cpp +++ b/src/channelview.cpp @@ -34,6 +34,10 @@ $END_LICENSE */ #endif #include "channellistview.h" +#include "ivchannelsource.h" +#include "videoapi.h" +#include "ytjschannelsource.h" + namespace { const QString sortByKey = "subscriptionsSortBy"; const QString showUpdatedKey = "subscriptionsShowUpdated"; @@ -70,6 +74,8 @@ ChannelView::ChannelView(QWidget *parent) : View(parent), showUpdated(false), so void ChannelView::setupActions() { QSettings settings; + statusActions << MainWindow::instance()->getAction("importSubscriptions"); + sortBy = static_cast(settings.value(sortByKey, SortByName).toInt()); QMenu *sortMenu = new QMenu(this); @@ -168,9 +174,17 @@ void ChannelView::itemActivated(const QModelIndex &index) { params->setChannelId(channel->getChannelId()); params->setSortBy(SearchParams::SortByNewest); params->setTransient(true); - YTSearch *videoSource = new YTSearch(params); - videoSource->setAsyncDetails(true); - emit activated(videoSource); + VideoSource *vs = nullptr; + if (VideoAPI::impl() == VideoAPI::YT3) { + YTSearch *videoSource = new YTSearch(params); + videoSource->setAsyncDetails(true); + vs = videoSource; + } else if (VideoAPI::impl() == VideoAPI::IV) { + vs = new IVChannelSource(params); + } else if (VideoAPI::impl() == VideoAPI::JS) { + vs = new YTJSChannelSource(params); + } + emit activated(vs); channel->updateWatched(); } else if (itemType == ChannelModel::ItemAggregate) { AggregateVideoSource *videoSource = new AggregateVideoSource();