- // adjust the root of the tree to the base place
- KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel();
- KUrl baseUrl = placesModel->url(placesModel->closestItem(url));
- if (!baseUrl.isValid()) {
- // it's possible that no closest item is available and hence an
- // empty URL is returned
- if (url.isLocalFile()) {
- // use the root directory as base for local URLs
- baseUrl = KUrl("file:///");
- } else {
- // clear the path for non-local URLs and use it as base
- baseUrl = url;
- baseUrl.setPath(QString());
- }
+ m_horizontalPos = m_treeView->horizontalScrollBar()->value();
+
+ KUrl baseUrl = url;
+ if (url.isLocalFile()) {
+ // use the root directory as base for local URLs
+ baseUrl = KUrl("file:///");
+ } else {
+ // clear the path for non-local URLs and use it as base
+ baseUrl = url;
+ baseUrl.setPath(QString());