aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/mainwindow.cpp5
-rw-r--r--src/ui/playlistmodel.cpp3
-rw-r--r--src/ui/playlistmodel.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp
index e177426f1..0b66c44d0 100644
--- a/src/ui/mainwindow.cpp
+++ b/src/ui/mainwindow.cpp
@@ -168,6 +168,7 @@ MainWindow::~MainWindow()
void MainWindow::play()
{
+ disconnect(m_playListModel, SIGNAL(firstAdded()), this, SLOT(play()));
m_playListModel->doCurrentVisibleRequest();
if (m_core->isPaused())
@@ -785,8 +786,12 @@ void MainWindow::savePlaylist()
void MainWindow::setFileList(const QStringList & l)
{
+ connect(m_playListModel, SIGNAL(firstAdded()), SLOT(play()));
if (!m_playListModel->setFileList(l))
+ {
+ disconnect(m_playListModel, SIGNAL(firstAdded()), this, SLOT(play()));
addFile();
+ }
}
void MainWindow::playPause()
diff --git a/src/ui/playlistmodel.cpp b/src/ui/playlistmodel.cpp
index f752ebb75..85adfe6d8 100644
--- a/src/ui/playlistmodel.cpp
+++ b/src/ui/playlistmodel.cpp
@@ -109,6 +109,9 @@ void PlayListModel::load ( MediaFile *file )
m_total_length += file->length();
m_files << file;
+ if (m_files.size() == 1)
+ emit firstAdded();
+
//if (!m_block_update_signals)
emit listChanged();
}
diff --git a/src/ui/playlistmodel.h b/src/ui/playlistmodel.h
index 798442514..8fff71e72 100644
--- a/src/ui/playlistmodel.h
+++ b/src/ui/playlistmodel.h
@@ -220,6 +220,7 @@ public:
signals:
void listChanged();
void currentChanged();
+ void firstAdded();
public slots:
void load(MediaFile *);