aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpplistwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmidiplayer-desktop/qmpplistwindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpplistwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qmidiplayer-desktop/qmpplistwindow.cpp b/qmidiplayer-desktop/qmpplistwindow.cpp
index 5805fcb..799f99a 100644
--- a/qmidiplayer-desktop/qmpplistwindow.cpp
+++ b/qmidiplayer-desktop/qmpplistwindow.cpp
@@ -228,11 +228,19 @@ void qmpPlistWindow::on_pbShuffle_clicked()
}
}
-QString qmpPlistWindow::getFirstItem()
+QString qmpPlistWindow::getFirstItem(bool a)
{
if(ui->lwFiles->count()==0)return QString();
int id=0;
- if(shuffle)id=rand()%ui->lwFiles->count();
+ if(shuffle&&!a)id=rand()%ui->lwFiles->count();
+ ui->lwFiles->setCurrentRow(id);
+ return ui->lwFiles->item(id)->text();
+}
+QString qmpPlistWindow::getLastItem(bool a)
+{
+ if(ui->lwFiles->count()==0)return QString();
+ int id=ui->lwFiles->count()-1;
+ if(shuffle&&!a)id=rand()%ui->lwFiles->count();
ui->lwFiles->setCurrentRow(id);
return ui->lwFiles->item(id)->text();
}