aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qmmpui/playlistmodel.cpp7
-rw-r--r--src/qmmpui/playlistmodel.h9
2 files changed, 9 insertions, 7 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp
index cb3907aac..efcf2cbd7 100644
--- a/src/qmmpui/playlistmodel.cpp
+++ b/src/qmmpui/playlistmodel.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright(C) 2006-2008 by Ilya Kotov *
+ * Copyright(C) 2006-2009 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -126,6 +126,11 @@ PlayListItem* PlayListModel::currentItem()
return m_items.at(qMin(m_items.size() - 1, m_current));
}
+PlayListItem* PlayListModel::item(int row) const
+{
+ return (row < m_items.size() && row >= 0) ? m_items.at(row) : 0;
+}
+
int PlayListModel::currentRow()
{
return m_current;
diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h
index 3c2ca50f7..e90bc007c 100644
--- a/src/qmmpui/playlistmodel.h
+++ b/src/qmmpui/playlistmodel.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006-2008 by Ilya Kotov *
+ * Copyright (C) 2006-2009 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -90,14 +90,11 @@ public:
int count();
PlayListItem* currentItem();
- int row(PlayListItem* item)const
+ int row(PlayListItem* item) const
{
return m_items.indexOf(item);
}
- PlayListItem* item(int row)const
- {
- return m_items.at(row);
- }
+ PlayListItem* item(int row) const;
int currentRow();
bool setCurrent (int);
bool isSelected(int);