diff options
author | Alessio Treglia <alessio@debian.org> | 2012-02-16 11:08:45 +0100 |
---|---|---|
committer | Alessio Treglia <alessio@debian.org> | 2012-02-16 11:08:45 +0100 |
commit | 65a64d260e05c7bf8d3bdf82e796637dc820e574 (patch) | |
tree | 600c2becea7f28fdefff51200bb3ed33514e4cc7 /src/urlhistory.cpp | |
parent | 1d323e54ee434609cf035598486075c9a918a2d3 (diff) |
Imported Upstream version 0.7.0
Diffstat (limited to 'src/urlhistory.cpp')
-rw-r--r-- | src/urlhistory.cpp | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/urlhistory.cpp b/src/urlhistory.cpp index e4e9515..727529d 100644 --- a/src/urlhistory.cpp +++ b/src/urlhistory.cpp @@ -1,5 +1,5 @@ /* smplayer, GUI front-end for mplayer. - Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org> + Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,6 @@ */ #include "urlhistory.h" -#include "constants.h" URLHistory::URLHistory() : Recents() { @@ -27,16 +26,13 @@ URLHistory::URLHistory() : Recents() URLHistory::~URLHistory() { } -void URLHistory::addUrl(QString url, bool is_playlist) { +void URLHistory::addUrl(QString url) { qDebug("Recents::addItem: '%s'", url.toUtf8().data()); // Delete duplicates QStringList::iterator iterator = l.begin(); while (iterator != l.end()) { QString s = (*iterator); - if (isPlaylist(s)) { - s = s.remove( QRegExp(IS_PLAYLIST_TAG_RX) ); - } if (s == url) iterator = l.erase(iterator); else @@ -44,29 +40,13 @@ void URLHistory::addUrl(QString url, bool is_playlist) { } // Add new item to list - if (is_playlist) url = url + IS_PLAYLIST_TAG; l.prepend(url); if (l.count() > max_items) l.removeLast(); } -void URLHistory::addUrl(QString url) { - bool is_playlist = isPlaylist(url); - if (is_playlist) url = url.remove( QRegExp(IS_PLAYLIST_TAG_RX) ); - addUrl(url, is_playlist); -} - QString URLHistory::url(int n) { QString s = l[n]; - if (isPlaylist(n)) s = s.remove( QRegExp(IS_PLAYLIST_TAG_RX) ); return s; } -bool URLHistory::isPlaylist(int n) { - return isPlaylist(l[n]); -} - -bool URLHistory::isPlaylist(QString url) { - return url.endsWith(IS_PLAYLIST_TAG); -} - |