]> cloud.milkyroute.net Git - dolphin.git/commitdiff
compile++
authorKevin Ottens <ervin@kde.org>
Tue, 21 Nov 2006 21:10:33 +0000 (21:10 +0000)
committerKevin Ottens <ervin@kde.org>
Tue, 21 Nov 2006 21:10:33 +0000 (21:10 +0000)
Welcome to Dolphin! Trying to help a bit with the porting. If I did
something wrong, feel free to blame me. :-)

CCMAIL: peter.penz@gmx.at

svn path=/trunk/playground/utils/dolphin/; revision=606802

src/bookmarkselector.cpp
src/dolphindetailsview.cpp
src/dolphindirlister.cpp
src/dolphiniconsview.cpp
src/dolphinsettings.cpp
src/itemeffectsmanager.cpp
src/urlbutton.cpp
src/viewproperties.cpp

index 4c091d33b5f3834d575acff7cb55e5c661d9ac2b..49267f8738357ff70ff3ea45409260128c1141fa 100644 (file)
@@ -38,7 +38,7 @@ BookmarkSelector::BookmarkSelector(URLNavigator* parent) :
     URLButton(parent),
     m_selectedIndex(0)
 {
-    setFocusPolicy(QWidget::NoFocus);
+    setFocusPolicy(Qt::NoFocus);
 
     m_bookmarksMenu = new Q3PopupMenu(this);
 
@@ -83,7 +83,7 @@ void BookmarkSelector::updateSelection(const KUrl& url)
     while (!bookmark.isNull()) {
         const KUrl bookmarkURL = bookmark.url();
         if (bookmarkURL.isParentOf(url)) {
-            const int length = bookmarkURL.prettyURL().length();
+            const int length = bookmarkURL.prettyUrl().length();
             if (length > maxLength) {
                 m_selectedIndex = i;
                 setPixmap(SmallIcon(bookmark.icon()));
@@ -144,7 +144,7 @@ void BookmarkSelector::drawButton(QPainter* painter)
     }
 
     // draw button backround
-    painter->setPen(NoPen);
+    painter->setPen(Qt::NoPen);
     painter->setBrush(backgroundColor);
     painter->drawRect(0, 0, buttonWidth, buttonHeight);
 
index 1c779b8dc847204bda4ab3c57b97d55bc71fad98..bffd134c9712037f0a0f57554ac72f0cdb043acc 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "dolphindetailsview.h"
 
-#include <kurldrag.h>
 #include <qpainter.h>
 #include <qobject.h>
 #include <q3header.h>
 #include <QMouseEvent>
 #include <QEvent>
 #include <QPaintEvent>
+#include <QStyleOptionFocusRect>
 #include <klocale.h>
 #include <kglobalsettings.h>
+#include <kicontheme.h>
 #include <qscrollbar.h>
 #include <qcursor.h>
 #include <qstyle.h>
@@ -51,7 +52,7 @@
 #include "detailsmodesettings.h"
 
 DolphinDetailsView::DolphinDetailsView(DolphinView* parent) :
-    KFileDetailView(parent, 0),
+    KFileDetailView(parent),
     m_dolphinView(parent),
     m_resizeTimer(0),
     m_scrollTimer(0),
@@ -195,8 +196,8 @@ void DolphinDetailsView::zoomIn()
     if (isZoomInPossible()) {
         DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
         switch (settings->iconSize()) {
-            case KIcon::SizeSmall:  settings->setIconSize(KIcon::SizeMedium); break;
-            case KIcon::SizeMedium: settings->setIconSize(KIcon::SizeLarge); break;
+            case K3Icon::SizeSmall:  settings->setIconSize(K3Icon::SizeMedium); break;
+            case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeLarge); break;
             default: assert(false); break;
         }
         ItemEffectsManager::zoomIn();
@@ -208,8 +209,8 @@ void DolphinDetailsView::zoomOut()
     if (isZoomOutPossible()) {
         DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
         switch (settings->iconSize()) {
-            case KIcon::SizeLarge:  settings->setIconSize(KIcon::SizeMedium); break;
-            case KIcon::SizeMedium: settings->setIconSize(KIcon::SizeSmall); break;
+            case K3Icon::SizeLarge:  settings->setIconSize(K3Icon::SizeMedium); break;
+            case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeSmall); break;
             default: assert(false); break;
         }
         ItemEffectsManager::zoomOut();
@@ -219,13 +220,13 @@ void DolphinDetailsView::zoomOut()
 bool DolphinDetailsView::isZoomInPossible() const
 {
     DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
-    return settings->iconSize() < KIcon::SizeLarge;
+    return settings->iconSize() < K3Icon::SizeLarge;
 }
 
 bool DolphinDetailsView::isZoomOutPossible() const
 {
     DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
-    return settings->iconSize() > KIcon::SizeSmall;
+    return settings->iconSize() > K3Icon::SizeSmall;
 }
 
 void DolphinDetailsView::resizeContents(int width, int height)
@@ -255,7 +256,7 @@ void DolphinDetailsView::slotOnItem(Q3ListViewItem* item)
 void DolphinDetailsView::slotOnViewport()
 {
     resetActivatedItem();
-    m_dolphinView->requestItemInfo(KURL());
+    m_dolphinView->requestItemInfo(KUrl());
 }
 
 void DolphinDetailsView::setContextPixmap(void* context,
@@ -322,7 +323,8 @@ void DolphinDetailsView::resizeEvent(QResizeEvent* event)
 
 bool DolphinDetailsView::acceptDrag(QDropEvent* event) const
 {
-    bool accept = KURLDrag::canDecode(event) &&
+    KUrl::List uriList = KUrl::List::fromMimeData( event->mimeData() );
+    bool accept = !uriList.isEmpty() &&
                   (event->action() == QDropEvent::Copy ||
                    event->action() == QDropEvent::Move ||
                    event->action() == QDropEvent::Link);
@@ -369,9 +371,9 @@ void DolphinDetailsView::contentsDropEvent(QDropEvent* event)
     }
 
     emit dropped(event, 0);
-    KURL::List urls;
-    if (KURLDrag::decode(event, urls) && !urls.isEmpty()) {
-        emit dropped(event, urls, KURL());
+    KUrl::List urls = KUrl::List::fromMimeData( event->mimeData() );
+    if (!urls.isEmpty()) {
+        emit dropped(event, urls, KUrl());
         sig->dropURLs(0, event, urls);
     }
 }
@@ -395,9 +397,9 @@ void DolphinDetailsView::contentsMousePressEvent(QMouseEvent* event)
         KFileDetailView::contentsMousePressEvent(event);
     }
     else if (event->button() == Qt::LeftButton) {
-        const ButtonState keyboardState = KApplication::keyboardMouseState();
-        const bool isSelectionActive = (keyboardState & ShiftButton) ||
-                                       (keyboardState & ControlButton);
+        const Qt::KeyboardModifiers keyboardState = QApplication::keyboardModifiers();
+        const bool isSelectionActive = (keyboardState & Qt::ShiftModifier) ||
+                                       (keyboardState & Qt::ControlModifier);
         if (!isSelectionActive) {
             clearSelection();
         }
@@ -475,15 +477,16 @@ void DolphinDetailsView::drawRubber()
 
     QPainter p;
     p.begin(viewport());
-    p.setRasterOp(NotROP);
-    p.setPen(QPen(color0, 1));
-    p.setBrush(NoBrush);
+    //p.setRasterOp(NotROP);
+    p.setPen(QPen(Qt::color0, 1));
+    p.setBrush(Qt::NoBrush);
 
     QPoint point(m_rubber->x(), m_rubber->y());
     point = contentsToViewport(point);
-    style().drawPrimitive(QStyle::PE_FocusRect, &p,
-                          QRect(point.x(), point.y(), m_rubber->width(), m_rubber->height()),
-                          colorGroup(), QStyle::Style_Default, colorGroup().base());
+    QStyleOptionFocusRect option;
+    option.initFrom(this);
+    option.rect = QRect(point.x(), point.y(), m_rubber->width(), m_rubber->height());
+    style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &p);
     p.end();
 }
 
@@ -506,19 +509,19 @@ void DolphinDetailsView::slotActivationUpdate()
 
     // TODO: there must be a simpler way to say
     // "update all children"
-    const QObjectList* list = children();
-    if (list == 0) {
+    const QList<QObject*> list = children();
+    if (list.isEmpty()) {
         return;
     }
 
-    QObjectListIterator it(*list);
+    QListIterator<QObject*> it(list);
     QObject* object = 0;
-    while ((object = it.current()) != 0) {
+    while (it.hasNext()) {
+        object = it.next();
         if (object->inherits("QWidget")) {
             QWidget* widget = static_cast<QWidget*>(object);
             widget->update();
         }
-        ++it;
     }
 }
 
@@ -647,7 +650,7 @@ void DolphinDetailsView::slotItemRenamed(Q3ListViewItem* item,
                                          int /* column */)
 {
     KFileItem* fileInfo = static_cast<KFileListViewItem*>(item)->fileInfo();
-    m_dolphinView->rename(KURL(fileInfo->url()), name);
+    m_dolphinView->rename(KUrl(fileInfo->url()), name);
 }
 
 void DolphinDetailsView::slotHeaderClicked(int /* section */)
index 160c4193d44605aebf58fde0bf0c65f14acd1528..cfb41d3319fadca82a2702217250e68ec60d4ede 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdio.h>
 
 DolphinDirLister::DolphinDirLister() :
-    KDirLister(true)
+    KDirLister()
 {
 }
 
index 2576abba8ed357bf368cfd1962e244067a70975c..dbf03491ea80e65df09f2d2172227b1703026547 100644 (file)
 #include <kapplication.h>
 #include <qobject.h>
 #include <kglobalsettings.h>
-#include <kurldrag.h>
 #include <qclipboard.h>
 #include <assert.h>
 #include <kaction.h>
 #include <kstdaction.h>
 #include <kfileitem.h>
+#include <kactioncollection.h>
 
 #include "dolphinview.h"
 #include "viewproperties.h"
@@ -52,7 +52,7 @@ DolphinIconsView::DolphinIconsView(DolphinView* parent, LayoutMode layoutMode) :
     m_dolphinView(parent)
 {
     setAcceptDrops(true);
-    setMode(KIconView::Execute);
+    setMode(K3IconView::Execute);
     setSelectionMode(KFile::Extended);
     Dolphin& dolphin = Dolphin::mainWin();
 
@@ -216,13 +216,13 @@ bool DolphinIconsView::isZoomInPossible() const
 {
     IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
     const int size = (m_layoutMode == Icons) ? settings->iconSize() : settings->previewSize();
-    return size < KIcon::SizeEnormous;
+    return size < K3Icon::SizeEnormous;
 }
 
 bool DolphinIconsView::isZoomOutPossible() const
 {
     IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
-    return settings->iconSize() > KIcon::SizeSmall;
+    return settings->iconSize() > K3Icon::SizeSmall;
 }
 
 void DolphinIconsView::arrangeItemsInGrid( bool updated )
@@ -309,11 +309,11 @@ void DolphinIconsView::drawBackground(QPainter* painter, const QRect& rect)
 
 Q3DragObject* DolphinIconsView::dragObject()
 {
-    KURL::List urls;
-    KFileItemListIterator it(*KFileView::selectedItems());
-    while (it.current() != 0) {
-        urls.append((*it)->url());
-        ++it;
+    KUrl::List urls;
+    QListIterator<KFileItem*> it(*KFileView::selectedItems());
+    while (it.hasNext()) {
+        KFileItem *item = it.next();
+        urls.append(item->url());
     }
 
     QPixmap pixmap;
@@ -331,9 +331,12 @@ Q3DragObject* DolphinIconsView::dragObject()
         pixmap = currentFileItem()->pixmap(iconSize());
     }
 
+    /* This should be ported to QMimeData
     Q3DragObject* dragObj = new KURLDrag(urls, widget());
     dragObj->setPixmap(pixmap);
     return dragObj;
+    */
+    return 0;
 }
 
 void DolphinIconsView::contentsDragEnterEvent(QDragEnterEvent* event)
@@ -351,7 +354,8 @@ void DolphinIconsView::contentsDragEnterEvent(QDragEnterEvent* event)
         return;
     }
 
-    const bool accept = KURLDrag::canDecode(event) &&
+    KUrl::List uriList = KUrl::List::fromMimeData( event->mimeData() );
+    const bool accept = !uriList.isEmpty() &&
                         (event->action() == QDropEvent::Copy ||
                          event->action() == QDropEvent::Move ||
                          event->action() == QDropEvent::Link );
@@ -397,7 +401,8 @@ void DolphinIconsView::contentsDropEvent(QDropEvent* event)
     }
 
     KFileIconViewItem* item = static_cast<KFileIconViewItem*>(findItem(contentsToViewport(event->pos())));
-    const bool accept = KURLDrag::canDecode(event) &&
+    KUrl::List urls = KUrl::List::fromMimeData( event->mimeData() );
+    const bool accept = !urls.isEmpty() &&
                         (event->action() == QDropEvent::Copy ||
                          event->action() == QDropEvent::Move ||
                          event->action() == QDropEvent::Link ) &&
@@ -412,9 +417,8 @@ void DolphinIconsView::contentsDropEvent(QDropEvent* event)
         return;
     }
     emit dropped(event, fileItem);
-    KURL::List urls;
-    if (KURLDrag::decode(event, urls) && !urls.isEmpty()) {
-        emit dropped(event, urls, fileItem != 0 ? fileItem->url() : KURL());
+    if (!urls.isEmpty()) {
+        emit dropped(event, urls, fileItem != 0 ? fileItem->url() : KUrl());
         sig->dropURLs(fileItem, event, urls);
     }
 }
@@ -431,7 +435,7 @@ void DolphinIconsView::slotOnItem(Q3IconViewItem* item)
 void DolphinIconsView::slotOnViewport()
 {
     resetActivatedItem();
-    m_dolphinView->requestItemInfo(KURL());
+    m_dolphinView->requestItemInfo(KUrl());
 }
 
 void DolphinIconsView::slotContextMenuRequested(Q3IconViewItem* item,
@@ -448,7 +452,7 @@ void DolphinIconsView::slotItemRenamed(Q3IconViewItem* item,
                                        const QString& name)
 {
     KFileItem* fileInfo = static_cast<KFileIconViewItem*>(item)->fileInfo();
-    m_dolphinView->rename(KURL(fileInfo->url()), name);
+    m_dolphinView->rename(KUrl(fileInfo->url()), name);
 }
 
 void DolphinIconsView::slotActivationUpdate()
@@ -457,19 +461,19 @@ void DolphinIconsView::slotActivationUpdate()
 
     // TODO: there must be a simpler way to say
     // "update all children"
-    const QObjectList* list = children();
-    if (list == 0) {
+    const QList<QObject*> list = children();
+    if (list.isEmpty()) {
         return;
     }
 
-    QObjectListIterator it(*list);
+    QListIterator<QObject*> it(list);
     QObject* object = 0;
-    while ((object = it.current()) != 0) {
+    while (it.hasNext()) {
+        object = it.next();
         if (object->inherits("QWidget")) {
             QWidget* widget = static_cast<QWidget*>(object);
             widget->update();
         }
-        ++it;
     }
 }
 
@@ -482,11 +486,11 @@ int DolphinIconsView::increasedIconSize(int size) const
 {
     int incSize = 0;
     switch (size) {
-        case KIcon::SizeSmall:       incSize = KIcon::SizeSmallMedium; break;
-        case KIcon::SizeSmallMedium: incSize = KIcon::SizeMedium; break;
-        case KIcon::SizeMedium:      incSize = KIcon::SizeLarge; break;
-        case KIcon::SizeLarge:       incSize = KIcon::SizeHuge; break;
-        case KIcon::SizeHuge:        incSize = KIcon::SizeEnormous; break;
+        case K3Icon::SizeSmall:       incSize = K3Icon::SizeSmallMedium; break;
+        case K3Icon::SizeSmallMedium: incSize = K3Icon::SizeMedium; break;
+        case K3Icon::SizeMedium:      incSize = K3Icon::SizeLarge; break;
+        case K3Icon::SizeLarge:       incSize = K3Icon::SizeHuge; break;
+        case K3Icon::SizeHuge:        incSize = K3Icon::SizeEnormous; break;
         default: assert(false); break;
     }
     return incSize;
@@ -496,11 +500,11 @@ int DolphinIconsView::decreasedIconSize(int size) const
 {
     int decSize = 0;
     switch (size) {
-        case KIcon::SizeSmallMedium: decSize = KIcon::SizeSmall; break;
-        case KIcon::SizeMedium: decSize = KIcon::SizeSmallMedium; break;
-        case KIcon::SizeLarge: decSize = KIcon::SizeMedium; break;
-        case KIcon::SizeHuge: decSize = KIcon::SizeLarge; break;
-        case KIcon::SizeEnormous: decSize = KIcon::SizeHuge; break;
+        case K3Icon::SizeSmallMedium: decSize = K3Icon::SizeSmall; break;
+        case K3Icon::SizeMedium: decSize = K3Icon::SizeSmallMedium; break;
+        case K3Icon::SizeLarge: decSize = K3Icon::SizeMedium; break;
+        case K3Icon::SizeHuge: decSize = K3Icon::SizeLarge; break;
+        case K3Icon::SizeEnormous: decSize = K3Icon::SizeHuge; break;
         default: assert(false); break;
     }
     return decSize;
index 8e040d76713049fe13a95497590d810fab027807..ccb9442d25f934ce2752b6e8f86c796814c39794 100644 (file)
@@ -66,9 +66,9 @@ KBookmarkManager* DolphinSettings::bookmarkManager() const
 {
     QString basePath = KGlobal::instance()->instanceName();
     basePath.append("/bookmarks.xml");
-    const QString file = locateLocal("data", basePath);
+    const QString file = KStandardDirs::locateLocal("data", basePath);
 
-    return KBookmarkManager::managerForFile(file, false);
+    return KBookmarkManager::managerForFile(file, "dolphin", false);
 }
 
 void DolphinSettings::save()
@@ -81,9 +81,9 @@ void DolphinSettings::save()
 
     QString basePath = KGlobal::instance()->instanceName();
     basePath.append("/bookmarks.xml");
-    const QString file = locateLocal( "data", basePath);
+    const QString file = KStandardDirs::locateLocal( "data", basePath);
 
-    KBookmarkManager* manager = KBookmarkManager::managerForFile(file, false);
+    KBookmarkManager* manager = KBookmarkManager::managerForFile(file, "dolphin", false);
     manager->save(false);
 }
 
@@ -100,14 +100,14 @@ void DolphinSettings::calculateGridSize(int hint)
     int gridHeight = 0;
     if (arrangement == Q3IconView::LeftToRight) {
         int widthUnit = maxSize + (maxSize / 2);
-        if (widthUnit < KIcon::SizeLarge) {
-            widthUnit = KIcon::SizeLarge;
+        if (widthUnit < K3Icon::SizeLarge) {
+            widthUnit = K3Icon::SizeLarge;
         }
 
-        gridWidth = widthUnit + hint * KIcon::SizeLarge;
+        gridWidth = widthUnit + hint * K3Icon::SizeLarge;
 
         gridHeight = iconSize;
-        if (gridHeight <= KIcon::SizeMedium) {
+        if (gridHeight <= K3Icon::SizeMedium) {
             gridHeight = gridHeight * 2;
         }
         else {
@@ -141,10 +141,10 @@ int DolphinSettings::textWidthHint() const
     int hint = 0;
     if (arrangement == Q3IconView::LeftToRight) {
         int widthUnit = maxSize + (maxSize / 2);
-        if (widthUnit < KIcon::SizeLarge) {
-            widthUnit = KIcon::SizeLarge;
+        if (widthUnit < K3Icon::SizeLarge) {
+            widthUnit = K3Icon::SizeLarge;
         }
-        hint = (gridWidth - widthUnit) / KIcon::SizeLarge;
+        hint = (gridWidth - widthUnit) / K3Icon::SizeLarge;
     }
     else {
         assert(arrangement == Q3IconView::TopToBottom);
index f47c439986d1388595ab79bce36b7bffbc7fc9ab..8a1c948f75b45fdba94113e464216f6a8ce98005 100644 (file)
@@ -26,7 +26,6 @@
 #include <QPixmap>
 #include <kglobalsettings.h>
 #include <qclipboard.h>
-#include <kurldrag.h>
 #include <klocale.h>
 
 #include "dolphin.h"
@@ -76,8 +75,8 @@ void ItemEffectsManager::activateItem(void* context)
         // apply an icon effect to the item below the mouse pointer
         KIconEffect iconEffect;
         QPixmap pixmap = iconEffect.apply(*itemPixmap,
-                                          KIcon::Desktop,
-                                          KIcon::ActiveState);
+                                          K3Icon::Desktop,
+                                          K3Icon::ActiveState);
         setContextPixmap(context, pixmap);
     }
 
@@ -99,8 +98,8 @@ void ItemEffectsManager::resetActivatedItem()
             // the highlighted item has been found and is restored to the default state
             KIconEffect iconEffect;
             QPixmap pixmap = iconEffect.apply(*m_pixmapCopy,
-                                              KIcon::Desktop,
-                                              KIcon::DefaultState);
+                                              K3Icon::Desktop,
+                                              K3Icon::DefaultState);
 
             // TODO: KFileIconView does not emit any signal when the preview has been finished.
             // Hence check the size to prevent that a preview is hidden by restoring a
@@ -144,15 +143,14 @@ void ItemEffectsManager::updateDisabledItems()
     }
 
     QClipboard* clipboard = QApplication::clipboard();
-    QMimeSource* data = clipboard->data();
-    if (!KUrlDrag::canDecode(data)) {
+    const QMimeData* data = clipboard->mimeData();
+    KUrl::List urls = KUrl::List::fromMimeData(data);
+    if (urls.isEmpty()) {
         return;
     }
 
     // The clipboard contains items, which have been cutted. Change the pixmaps of all those
     // items to the disabled state.
-    KUrl::List urls;
-    KUrlDrag::decode(data, urls);
     for (void* context = firstContext(); context != 0; context = nextContext(context)) {
         const KFileItem* fileInfo = contextFileInfo(context);
         const KUrl& fileURL = fileInfo->url();
@@ -168,8 +166,8 @@ void ItemEffectsManager::updateDisabledItems()
 
                     KIconEffect iconEffect;
                     QPixmap disabledPixmap = iconEffect.apply(*itemPixmap,
-                                                              KIcon::Desktop,
-                                                              KIcon::DisabledState);
+                                                              K3Icon::Desktop,
+                                                              K3Icon::DisabledState);
                     setContextPixmap(context, disabledPixmap);
                 }
                 break;
index d441ab1845e9ba0145b18c225ff96ea110d96a6d..057bcff5a3e827381a3d7b73380b604483abe66e 100644 (file)
@@ -25,8 +25,6 @@
 #include <qfontmetrics.h>
 //Added by qt3to4:
 #include <QEvent>
-#include <kurldrag.h>
-#include <kpopupmenu.h>
 #include <kiconloader.h>
 #include <klocale.h>
 
@@ -91,8 +89,8 @@ void URLButton::leaveEvent(QEvent* event)
 QColor URLButton::mixColors(const QColor& c1,
                             const QColor& c2) const
 {
-    const int Qt::red   = (c1.Qt::red()   + c2.Qt::red())   / 2;
-    const int Qt::green = (c1.Qt::green() + c2.Qt::green()) / 2;
-    const int Qt::blue  = (c1.Qt::blue()  + c2.Qt::blue())  / 2;
-    return QColor(Qt::red, Qt::green, Qt::blue);
+    const int red   = (c1.red()   + c2.red())   / 2;
+    const int green = (c1.green() + c2.green()) / 2;
+    const int blue  = (c1.blue()  + c2.blue())  / 2;
+    return QColor(red, green, blue);
 }
index 52129bd8025cc7a36397ed7d064360fca7c8f9a4..a3a8ec46bbf16d3671bbad4821d71711733fdc0e 100644 (file)
@@ -27,6 +27,7 @@
 #include <klocale.h>
 #include <kstandarddirs.h>
 #include <kurl.h>
+#include <kinstance.h>
 
 #include "viewproperties.h"
 
@@ -40,7 +41,7 @@ ViewProperties::ViewProperties(KUrl url) :
       m_subDirValidityHidden(false),
       m_node(0)
 {
-    url.cleanPath(true);
+    url.cleanPath();
     m_filepath = url.path();
 
     if ((m_filepath.length() < 1) || (m_filepath.at(0) != QChar('/'))) {
@@ -58,14 +59,14 @@ ViewProperties::ViewProperties(KUrl url) :
         if (!info.isWritable()) {
             QString basePath = KGlobal::instance()->instanceName();
             basePath.append("/view_properties/local");
-            rootDir = locateLocal("data", basePath);
+            rootDir = KStandardDirs::locateLocal("data", basePath);
             m_filepath = rootDir + m_filepath;
         }
     }
     else {
         QString basePath = KGlobal::instance()->instanceName();
         basePath.append("/view_properties/remote/").append(url.host());
-        rootDir = locateLocal("data", basePath);
+        rootDir = KStandardDirs::locateLocal("data", basePath);
         m_filepath = rootDir + m_filepath;
     }
 
@@ -86,7 +87,8 @@ ViewProperties::ViewProperties(KUrl url) :
                                   (parentNode.timestamp() > m_node->timestamp());
 
         if (inheritProps) {
-            *m_node = parentNode;
+            delete m_node;
+            m_node = new ViewPropertySettings(KSharedConfig::openConfig(dir.path() + FILE_NAME));
             break;
         }
     }