]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kfileplacesmodel.cpp
Further cleanup to prepare the move.
[dolphin.git] / src / kfileplacesmodel.cpp
index 9199057bde405c11f8a8f31aa259447ab5d03bd0..273830b3ebc4f64004021ef7f2014cbd21d2c7d6 100644 (file)
@@ -81,7 +81,7 @@ KFilePlacesModel::~KFilePlacesModel()
 
 KUrl KFilePlacesModel::url(const QModelIndex &index) const
 {
-    return KUrl(data(index, UrlRole).toString());
+    return KUrl(data(index, UrlRole).toUrl());
 }
 
 bool KFilePlacesModel::mountNeeded(const QModelIndex &index) const
@@ -89,6 +89,16 @@ bool KFilePlacesModel::mountNeeded(const QModelIndex &index) const
     return data(index, MountNeededRole).toBool();
 }
 
+KIcon KFilePlacesModel::icon(const QModelIndex &index) const
+{
+    return KIcon(data(index, Qt::DecorationRole).value<QIcon>());
+}
+
+QString KFilePlacesModel::text(const QModelIndex &index) const
+{
+    return data(index, Qt::DisplayRole).toString();
+}
+
 QVariant KFilePlacesModel::data(const QModelIndex &index, int role) const
 {
     if (!index.isValid())
@@ -134,7 +144,7 @@ int KFilePlacesModel::rowCount(const QModelIndex &parent) const
 int KFilePlacesModel::columnCount(const QModelIndex &parent) const
 {
     Q_UNUSED(parent)
-    // We only know 1 information for a particualiar entry
+    // We only know 1 piece of information for a particular entry
     return 1;
 }