Commit f2f7fd69 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: add a new class helper to open files

parent 643b9dbc
......@@ -22,6 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "qt4.hpp"
#include "recents.hpp"
#include "dialogs_provider.hpp"
#include "menus.hpp"
......@@ -161,3 +162,18 @@ playlist_item_t *RecentsMRL::toPlaylist(int length)
return p_node_recent;
}
void Open::openMRL( intf_thread_t *p_intf,
const QString &mrl,
bool b_start,
bool b_playlist)
{
playlist_Add( THEPL, qtu(mrl), NULL,
PLAYLIST_APPEND | (b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE),
PLAYLIST_END,
b_playlist,
pl_Unlocked );
if( b_start && b_playlist )
RecentsMRL::getInstance( p_intf )->addRecent( mrl );
}
......@@ -35,6 +35,15 @@ class QSignalMapper;
#define RECENTS_LIST_SIZE 10
class Open
{
public:
void static openMRL( intf_thread_t*,
const QString &,
bool b_start = true,
bool b_playlist = true);
};
class RecentsMRL : public QObject, public Singleton<RecentsMRL>
{
Q_OBJECT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment