From 04229f8f6c3b5c7732251ea4dd038b5fc81fc388 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sun, 23 Jun 2013 10:01:24 +0200 Subject: [PATCH 1/2] Prevent possible infinite recursion in ViewProperties If each directory can have its own view properties, and loadting the .directory file fails in a directory, we have to load the global view properties. However, if we try to do this by changing the "global view properties setting" and loading the view properties for the same directory again, we might get an infinite recursion if changing the setting fails. We now force a loading of the global view properties by constructing a new ViewProperties object with an empty URL. Thanks to Kurt Hindenburg for helping to debug this issue (which was only reproducible on MacOS). BUG: 316209 FIXED-IN: 4.10.5 REVIEW: 111182 --- dolphin/src/views/viewproperties.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dolphin/src/views/viewproperties.cpp b/dolphin/src/views/viewproperties.cpp index 30deb7277d..d4ecfafa08 100644 --- a/dolphin/src/views/viewproperties.cpp +++ b/dolphin/src/views/viewproperties.cpp @@ -53,7 +53,7 @@ ViewProperties::ViewProperties(const KUrl& url) : m_node(0) { GeneralSettings* settings = GeneralSettings::self(); - const bool useGlobalViewProps = settings->globalViewProps(); + const bool useGlobalViewProps = settings->globalViewProps() || url.isEmpty(); bool useDetailsViewWithPath = false; // We try and save it to the file .directory in the directory being viewed. @@ -100,13 +100,13 @@ ViewProperties::ViewProperties(const KUrl& url) : setVisibleRoles(QList() << "path"); } else { // The global view-properties act as default for directories without - // any view-property configuration - settings->setGlobalViewProps(true); - - ViewProperties defaultProps(url); + // any view-property configuration. Constructing a ViewProperties + // instance for an empty KUrl ensures that the global view-properties + // are loaded. + KUrl emptyUrl; + ViewProperties defaultProps(emptyUrl); setDirProperties(defaultProps); - settings->setGlobalViewProps(false); m_changedProps = false; } } From c847aacf4c3f8e6bd9579d66078fde16510552ef Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Mon, 24 Jun 2013 11:11:37 +0200 Subject: [PATCH 2/2] Use the target url of a item when creating the QMimeData in KFileItemModel::createMimeData. BUG: 307336 FIXED-IN: 4.10.5 REVIEW: 111209 --- dolphin/src/kitemviews/kfileitemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphin/src/kitemviews/kfileitemmodel.cpp b/dolphin/src/kitemviews/kfileitemmodel.cpp index 400d29849e..787d36ae61 100644 --- a/dolphin/src/kitemviews/kfileitemmodel.cpp +++ b/dolphin/src/kitemviews/kfileitemmodel.cpp @@ -249,7 +249,7 @@ QMimeData* KFileItemModel::createMimeData(const QSet& indexes) const const int index = it.next(); const KFileItem item = fileItem(index); if (!item.isNull()) { - urls << item.url(); + urls << item.targetUrl(); bool isLocal; mostLocalUrls << item.mostLocalUrl(isLocal);