Changeset 124 for smplayer/trunk/src/urlhistory.cpp
- Timestamp:
- Mar 16, 2012, 4:02:47 PM (13 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 121-122
- Property svn:mergeinfo changed
-
smplayer/trunk/src/urlhistory.cpp
r119 r124 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 1 Ricardo Villalba <rvm@escomposlinux.org>2 Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 18 18 19 19 #include "urlhistory.h" 20 #include "constants.h"21 20 22 21 URLHistory::URLHistory() : Recents() … … 28 27 } 29 28 30 void URLHistory::addUrl(QString url , bool is_playlist) {29 void URLHistory::addUrl(QString url) { 31 30 qDebug("Recents::addItem: '%s'", url.toUtf8().data()); 32 31 … … 35 34 while (iterator != l.end()) { 36 35 QString s = (*iterator); 37 if (isPlaylist(s)) {38 s = s.remove( QRegExp(IS_PLAYLIST_TAG_RX) );39 }40 36 if (s == url) 41 37 iterator = l.erase(iterator); … … 45 41 46 42 // Add new item to list 47 if (is_playlist) url = url + IS_PLAYLIST_TAG;48 43 l.prepend(url); 49 44 … … 51 46 } 52 47 53 void URLHistory::addUrl(QString url) {54 bool is_playlist = isPlaylist(url);55 if (is_playlist) url = url.remove( QRegExp(IS_PLAYLIST_TAG_RX) );56 addUrl(url, is_playlist);57 }58 59 48 QString URLHistory::url(int n) { 60 49 QString s = l[n]; 61 if (isPlaylist(n)) s = s.remove( QRegExp(IS_PLAYLIST_TAG_RX) );62 50 return s; 63 51 } 64 52 65 bool URLHistory::isPlaylist(int n) {66 return isPlaylist(l[n]);67 }68 69 bool URLHistory::isPlaylist(QString url) {70 return url.endsWith(IS_PLAYLIST_TAG);71 }72
Note:
See TracChangeset
for help on using the changeset viewer.