display songs not downloaded yet as gray
authorElias Woods <EliasWoods@gmail.com>
Sat, 8 Jan 2011 22:24:32 +0000 (17:24 -0500)
committerElias Woods <EliasWoods@gmail.com>
Sat, 8 Jan 2011 22:24:32 +0000 (17:24 -0500)
playlist.cpp

index 57f17b6..7ce8401 100644 (file)
@@ -35,6 +35,18 @@ QVariant playlist::data(const QModelIndex &index, int role) const
             default:
                 dat = QVariant();
             }
+        } else if (role == Qt::ForegroundRole) {
+            switch(index.column())
+            {
+            case sName:
+                if(!play->pList->at(index.row())->downloaded)
+                    dat = QVariant(Qt::gray);
+                else
+                    dat = QVariant();
+                break;
+            default:
+                dat = QVariant();
+            }
         } else if (role == Qt::DisplayRole) {
             switch(index.column())
             {