From: Flavio Date: Fri, 10 Dec 2010 09:45:24 +0000 (+0100) Subject: Search for a YouTube URL X-Git-Tag: 1.3~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a4f623bdd2f2d3e23aa89561c7ec55b6a19a2b05;p=minitube Search for a YouTube URL --- diff --git a/src/ListModel.cpp b/src/ListModel.cpp index 761e5a4..1c146ee 100755 --- a/src/ListModel.cpp +++ b/src/ListModel.cpp @@ -202,6 +202,10 @@ void ListModel::addVideo(Video* video) { // save keyword QString query = searchParams->keywords(); + if (query.startsWith("http://")) { + // Save the video title + query += "|" + videos.first()->title(); + } QSettings settings; QStringList keywords = settings.value(recentKeywordsKey).toStringList(); keywords.removeAll(query); diff --git a/src/SearchView.cpp b/src/SearchView.cpp index d1907f0..76f7da4 100644 --- a/src/SearchView.cpp +++ b/src/SearchView.cpp @@ -135,9 +135,18 @@ void SearchView::updateRecentKeywords() { The::globalActions()->value("clearRecentKeywords")->setEnabled(!keywords.isEmpty()); foreach (QString keyword, keywords) { - QLabel *itemLabel = new QLabel(" 0 && separator + 1 < keyword.length()) { + link = keyword.left(separator); + display = keyword.mid(separator+1); + } + } + QLabel *itemLabel = new QLabel("" - + keyword + "", this); + + display + "", this); itemLabel->setMaximumWidth(queryEdit->width() + watchButton->width()); // itemLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);