$END_LICENSE */
#include "channelview.h"
-#include "ytuser.h"
+#include "ytchannel.h"
#include "ytsearch.h"
#include "searchparams.h"
#include "channelmodel.h"
setupActions();
- connect(ChannelAggregator::instance(), SIGNAL(channelChanged(YTUser*)),
- channelsModel, SLOT(updateChannel(YTUser*)));
+ connect(ChannelAggregator::instance(), SIGNAL(channelChanged(YTChannel*)),
+ channelsModel, SLOT(updateChannel(YTChannel*)));
connect(ChannelAggregator::instance(), SIGNAL(unwatchedCountChanged(int)),
SLOT(unwatchedCountChanged(int)));
void ChannelView::setupActions() {
QSettings settings;
- SortBy sortBy = static_cast<SortBy>(settings.value(sortByKey, SortByName).toInt());
+ sortBy = static_cast<SortBy>(settings.value(sortByKey, SortByName).toInt());
QMenu *sortMenu = new QMenu(this);
QActionGroup *sortGroup = new QActionGroup(this);
foreach (QAction* action, statusActions)
MainWindow::instance()->showActionInStatusBar(action, true);
setFocus();
- ChannelAggregator::instance()->run();
+ ChannelAggregator::instance()->start();
}
void ChannelView::disappear() {
+ ChannelAggregator::instance()->stop();
foreach (QAction* action, statusActions)
MainWindow::instance()->showActionInStatusBar(action, false);
}
void ChannelView::itemActivated(const QModelIndex &index) {
ChannelModel::ItemTypes itemType = channelsModel->typeForIndex(index);
if (itemType == ChannelModel::ItemChannel) {
- YTUser *user = channelsModel->userForIndex(index);
+ YTChannel *channel = channelsModel->channelForIndex(index);
SearchParams *params = new SearchParams();
- params->setAuthor(user->getUserId());
+ params->setChannelId(channel->getChannelId());
params->setSortBy(SearchParams::SortByNewest);
params->setTransient(true);
YTSearch *videoSource = new YTSearch(params, this);
+ videoSource->setAsyncDetails(true);
emit activated(videoSource);
- user->updateWatched();
+ channel->updateWatched();
} else if (itemType == ChannelModel::ItemAggregate) {
AggregateVideoSource *videoSource = new AggregateVideoSource(this);
videoSource->setName(tr("All Videos"));
const QModelIndex index = indexAt(point);
if (!index.isValid()) return;
- YTUser *user = channelsModel->userForIndex(index);
- if (!user) return;
+ YTChannel *channel = channelsModel->channelForIndex(index);
+ if (!channel) return;
unsetCursor();
QMenu menu;
- if (user->getNotifyCount() > 0) {
- QAction *markAsWatchedAction = menu.addAction(tr("Mark as Watched"), user, SLOT(updateWatched()));
+ if (channel->getNotifyCount() > 0) {
+ QAction *markAsWatchedAction = menu.addAction(tr("Mark as Watched"), channel, SLOT(updateWatched()));
connect(markAsWatchedAction, SIGNAL(triggered()),
ChannelAggregator::instance(), SLOT(updateUnwatchedCount()));
menu.addSeparator();
notificationsAction->setChecked(true);
*/
- QAction *unsubscribeAction = menu.addAction(tr("Unsubscribe"), user, SLOT(unsubscribe()));
+ QAction *unsubscribeAction = menu.addAction(tr("Unsubscribe"), channel, SLOT(unsubscribe()));
connect(unsubscribeAction, SIGNAL(triggered()),
ChannelAggregator::instance(), SLOT(updateUnwatchedCount()));