From d5317b6badb66ba7b9162b53360839f63222ade5 Mon Sep 17 00:00:00 2001 From: Flavio Date: Fri, 5 Aug 2011 20:53:06 +0200 Subject: [PATCH] Ensure playing item is always visible Also consider https links --- src/MediaView.cpp | 9 ++++++++- src/SearchView.cpp | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/MediaView.cpp b/src/MediaView.cpp index 66fc5ec..d41c69e 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -177,7 +177,7 @@ void MediaView::search(SearchParams *searchParams) { QString keyword = searchParams->keywords(); QString display = keyword; - if (keyword.startsWith("http://")) { + if (keyword.startsWith("http://") || keyword.startsWith("https://")) { int separator = keyword.indexOf("|"); if (separator > 0 && separator + 1 < keyword.length()) { display = keyword.mid(separator+1); @@ -323,6 +323,13 @@ void MediaView::activeRowChanged(int row) { The::globalActions()->value("download")->setEnabled(DownloadManager::instance()->itemForVideo(video) == 0); + // ensure active item is visible + // int row = listModel->activeRow(); + if (row != -1) { + QModelIndex index = listModel->index(row, 0, QModelIndex()); + listView->scrollTo(index, QAbstractItemView::EnsureVisible); + } + // see you in gotStreamUrl... } diff --git a/src/SearchView.cpp b/src/SearchView.cpp index bdb20e1..11f86d0 100644 --- a/src/SearchView.cpp +++ b/src/SearchView.cpp @@ -204,7 +204,7 @@ void SearchView::updateRecentKeywords() { foreach (QString keyword, keywords) { QString link = keyword; QString display = keyword; - if (keyword.startsWith("http://")) { + if (keyword.startsWith("http://") || keyword.startsWith("https://")) { int separator = keyword.indexOf("|"); if (separator > 0 && separator + 1 < keyword.length()) { link = keyword.left(separator); @@ -244,7 +244,7 @@ void SearchView::updateRecentChannels() { foreach (QString keyword, keywords) { QString link = keyword; QString display = keyword; - if (keyword.startsWith("http://")) { + if (keyword.startsWith("http://") || keyword.startsWith("https://")) { int separator = keyword.indexOf("|"); if (separator > 0 && separator + 1 < keyword.length()) { link = keyword.left(separator); -- 2.39.5