From ccdb60211fca6a9f11d3aacbaa00e2514ee6ad94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kundr=C3=A1t?= Date: Mon, 6 Oct 2008 00:47:22 +0200 Subject: [PATCH] add files from the FS view by doubleclicking --- src/core/PlayerWindow.cpp | 8 ++++++++ src/core/PlayerWindow.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/core/PlayerWindow.cpp b/src/core/PlayerWindow.cpp index c12513d..25a14b9 100644 --- a/src/core/PlayerWindow.cpp +++ b/src/core/PlayerWindow.cpp @@ -696,6 +696,7 @@ namespace Jerboa mFileSystemView->setDragDropMode(QAbstractItemView::DragOnly); mFileSystemView->setSelectionMode(QAbstractItemView::ExtendedSelection); mFileSystemView->setExpandsOnDoubleClick(false); + connect(mFileSystemView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(fileSystemViewItemDoubleClicked(const QModelIndex&))); // Layout time (no dad, no!) QVBoxLayout *playerLayout = new QVBoxLayout(); @@ -762,6 +763,13 @@ namespace Jerboa } mPlaylistModel->dropMimeData(mCollectionFilterProxyModel->mimeData(indexes), Qt::CopyAction, mPlaylistModel->rowCount(), 0, QModelIndex()); } + + void PlayerWindow::fileSystemViewItemDoubleClicked( const QModelIndex& index ) + { + QModelIndexList indexes; + indexes << index; + mPlaylistModel->dropMimeData(mFileSystemModel->mimeData(indexes), Qt::CopyAction, mPlaylistModel->rowCount(), 0, QModelIndex()); + } void PlayerWindow::searchingDone() { diff --git a/src/core/PlayerWindow.h b/src/core/PlayerWindow.h index a02475e..236aa4a 100644 --- a/src/core/PlayerWindow.h +++ b/src/core/PlayerWindow.h @@ -84,6 +84,7 @@ namespace Jerboa void scanFiles(); void playerStateChanged(Phonon::State newState, Phonon::State oldState); void playlistItemDoubleClicked(const QModelIndex& index); + void fileSystemViewItemDoubleClicked(const QModelIndex& index); void previousTriggered(); void nextTriggered(); -- 2.11.4.GIT