videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp
changeset 28 c48470be1ba7
parent 20 b9e04db066d4
child 52 e3cecb93e76a
--- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp	Thu May 27 12:53:14 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp	Fri Jun 11 13:39:54 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 65 %
+// Version : %version: 66 %
 
 // INCLUDE FILES
 #include <qstringlist.h>
@@ -525,11 +525,14 @@
 //
 TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const
 {
-    QModelIndex sourceIndex = mapToSource(index);
     TMPXItemId mpxId = TMPXItemId::InvalidId();
-    if(mModel && sourceIndex.isValid())
+    if(index.isValid())
     {
-        mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+        QModelIndex sourceIndex = mapToSource(index);
+        if(mModel && sourceIndex.isValid())
+        {
+            mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+        }
     }
     return mpxId;
 }