diff options
| author | Kevin Ottens <[email protected]> | 2007-04-02 08:45:08 +0000 |
|---|---|---|
| committer | Kevin Ottens <[email protected]> | 2007-04-02 08:45:08 +0000 |
| commit | 1554df47db71bbbbae4be1431eaba5cd2c442e0c (patch) | |
| tree | 9ba38e4de3457056758078fc581e178fc30a4fcd /src | |
| parent | 55f6f1d4114d4602b32f33237ba1f800a16c1c5d (diff) | |
Fixes the URL handling in this model. QVariant breaks KUrl in strange
ways, hence the nasty code. If anybody has a better idea feel free to
point me to the right solution.
svn path=/trunk/KDE/kdebase/apps/; revision=649200
Diffstat (limited to 'src')
| -rw-r--r-- | src/kfileplacesmodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kfileplacesmodel.cpp b/src/kfileplacesmodel.cpp index 00ee52d43..9199057bd 100644 --- a/src/kfileplacesmodel.cpp +++ b/src/kfileplacesmodel.cpp @@ -151,9 +151,9 @@ QModelIndex KFilePlacesModel::closestItem(const KUrl &url) const KUrl itemUrl; if (item->isDevice()) { - itemUrl = KUrl(d->deviceData(item->deviceIndex(), UrlRole).toString()); + itemUrl = KUrl(d->deviceData(item->deviceIndex(), UrlRole).toUrl()); } else { - itemUrl = KUrl(d->bookmarkData(item->bookmarkAddress(), UrlRole).toString()); + itemUrl = KUrl(d->bookmarkData(item->bookmarkAddress(), UrlRole).toUrl()); } if (itemUrl.isParentOf(url)) { @@ -184,7 +184,7 @@ QVariant KFilePlacesModel::Private::bookmarkData(const QString &address, int rol case Qt::DecorationRole: return KIcon(bookmark.icon()); case UrlRole: - return bookmark.url(); + return QUrl(bookmark.url()); case MountNeededRole: return false; default: @@ -198,7 +198,7 @@ QVariant KFilePlacesModel::Private::deviceData(const QPersistentModelIndex &inde switch (role) { case UrlRole: - return KUrl(deviceModel->deviceForIndex(index).as<Solid::Volume>()->mountPoint()); + return QUrl(KUrl(deviceModel->deviceForIndex(index).as<Solid::Volume>()->mountPoint())); case MountNeededRole: return !deviceModel->deviceForIndex(index).as<Solid::Volume>()->isMounted(); default: |
