[vlc-commits] qt: Remove save recents as a playlist.

Hugo Beauzée-Luyssen git at videolan.org
Wed May 10 14:28:15 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed May 10 14:15:26 2017 +0200| [36e7566a630f62a20bafe72dd791ad33494f240a] | committer: Hugo Beauzée-Luyssen

qt: Remove save recents as a playlist.

A specific playlist ndoe can't be exported in a thread safe manner with
current playlist code.
This is too heavy of a change for 3.0, so just remove the feature
entirely.
Hide user facing consequences of #17662

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=36e7566a630f62a20bafe72dd791ad33494f240a
---

 modules/gui/qt/dialogs_provider.cpp | 16 ----------------
 modules/gui/qt/dialogs_provider.hpp |  1 -
 modules/gui/qt/menus.cpp            |  1 -
 modules/gui/qt/recents.cpp          | 21 ---------------------
 modules/gui/qt/recents.hpp          |  1 -
 5 files changed, 40 deletions(-)

diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp
index e141bbc9de..1f349169a8 100644
--- a/modules/gui/qt/dialogs_provider.cpp
+++ b/modules/gui/qt/dialogs_provider.cpp
@@ -697,22 +697,6 @@ void DialogsProvider::savePlayingToPlaylist()
     saveAPlaylist(THEPL, THEPL->p_playing);
 }
 
-void DialogsProvider::saveRecentsToPlaylist()
-{
-    playlist_item_t *p_node_recents = RecentsMRL::getInstance(p_intf)->toPlaylist(0);
-
-    if (p_node_recents == NULL)
-    {
-        msg_Warn(p_intf, "cannot create playlist from recents");
-        return;
-    }
-
-    saveAPlaylist(THEPL, p_node_recents);
-    playlist_Lock(THEPL);
-    playlist_NodeDelete(THEPL, p_node_recents, false);
-    playlist_Unlock(THEPL);
-}
-
 /****************************************************************************
  * Sout emulation
  ****************************************************************************/
diff --git a/modules/gui/qt/dialogs_provider.hpp b/modules/gui/qt/dialogs_provider.hpp
index b119674c94..c0a15643be 100644
--- a/modules/gui/qt/dialogs_provider.hpp
+++ b/modules/gui/qt/dialogs_provider.hpp
@@ -176,7 +176,6 @@ public slots:
 
     void openAPlaylist();
     void savePlayingToPlaylist();
-    void saveRecentsToPlaylist();
 
     void loadSubtitlesFile();
 
diff --git a/modules/gui/qt/menus.cpp b/modules/gui/qt/menus.cpp
index cd3ac0898b..43c23aaca4 100644
--- a/modules/gui/qt/menus.cpp
+++ b/modules/gui/qt/menus.cpp
@@ -1619,7 +1619,6 @@ void VLCMenuBar::updateRecents( intf_thread_t *p_intf )
 
             recentsMenu->addSeparator();
             recentsMenu->addAction( qtr("&Clear"), rmrl, SLOT( clear() ) );
-            addDPStaticEntry( recentsMenu, qtr("&Save To Playlist"), "", SLOT( saveRecentsToPlaylist() ), "" );
             recentsMenu->setEnabled( true );
         }
     }
diff --git a/modules/gui/qt/recents.cpp b/modules/gui/qt/recents.cpp
index 1b7fad1729..4bd8ce3227 100644
--- a/modules/gui/qt/recents.cpp
+++ b/modules/gui/qt/recents.cpp
@@ -156,27 +156,6 @@ void RecentsMRL::save()
     getSettings()->setValue( "RecentsMRL/times", times );
 }
 
-playlist_item_t *RecentsMRL::toPlaylist(int length)
-{
-    vlc_playlist_locker locker(THEPL);
-
-    playlist_item_t *p_node_recent = playlist_NodeCreate(THEPL, _("Recently Played"), THEPL->p_root, PLAYLIST_END, PLAYLIST_RO_FLAG);
-
-    if ( p_node_recent == NULL )  return NULL;
-
-    if (length == 0 || recents.count() < length)
-        length = recents.count();
-
-    for (int i = 0; i < length; i++)
-    {
-        input_item_t *p_input = input_item_New(qtu(recents.at(i)), NULL);
-        playlist_NodeAddInput(THEPL, p_input, p_node_recent, 0, PLAYLIST_END);
-    }
-
-    /* locker goes out of scope and node is invalidated here */
-    return NULL;
-}
-
 void RecentsMRL::playMRL( const QString &mrl )
 {
     Open::openMRL( p_intf, mrl );
diff --git a/modules/gui/qt/recents.hpp b/modules/gui/qt/recents.hpp
index 3cb485ca85..1543055249 100644
--- a/modules/gui/qt/recents.hpp
+++ b/modules/gui/qt/recents.hpp
@@ -59,7 +59,6 @@ class RecentsMRL : public QObject, public Singleton<RecentsMRL>
 public:
     void addRecent( const QString & );
     QStringList recentList();
-    playlist_item_t *toPlaylist(int length);
     QSignalMapper *signalMapper;
 
     int time( const QString &mrl );



More information about the vlc-commits mailing list