From a740120fe157ab2ceb168b90d57204784e606309 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 24 Sep 2012 22:59:59 +0200 Subject: [PATCH 1/6] Fix crash when receiving Nepomuk info for a recently deleted file. BUG: 306036 FIXED-IN: 4.9.2 --- src/kitemviews/kfileitemmodelrolesupdater.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 6dba2245dd..f3d4c0e76f 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -595,6 +595,13 @@ void KFileItemModelRolesUpdater::applyChangedNepomukRoles(const Nepomuk::Resourc #ifdef HAVE_NEPOMUK const KUrl itemUrl = m_nepomukUriItems.value(resource.resourceUri()); const KFileItem item = m_model->fileItem(itemUrl); + + if (item.isNull()) { + // itemUrl is not in the model anymore, probably because + // the corresponding file has been deleted in the meantime. + return; + } + QHash data = rolesData(item); const KNepomukRolesProvider& rolesProvider = KNepomukRolesProvider::instance(); From c330be5f5c9e6fe09d1b06869f600a04ac28583e Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Wed, 12 Sep 2012 19:33:28 +0200 Subject: [PATCH 2/6] Fixes Bug 305783 - dragging a file over a directory #c4 does not expand the dir => Bug discovered: When you drag a item onto a folder-view-item and then move it away instantly before the autoactivation event is triggered (After 750ms), the folder will be opened anyway. BUG: 305783 REVIEW: 106381 FIXED-IN: 4.9.2 (cherry picked from commit 9ab8bcd6aa3ce5d96ee380d5f22d77c2f0a38881) --- src/kitemviews/kitemlistcontroller.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 41a86324bb..5a7175e4cc 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -489,7 +489,16 @@ void KItemListController::slotAutoActivationTimeout() return; } - if (m_model->supportsDropping(index)) { + /* m_view->isUnderMouse() fixes a bug in the Folder-View-Panel and in the + * Places-Panel. + * + * Bug: When you drag a file onto a Folder-View-Item or a Places-Item and + * then move away before the auto-activation timeout triggers, than the + * item still becomes activated/expanded. + * + * See Bug 293200 and 305783 + */ + if (m_model->supportsDropping(index) && m_view->isUnderMouse()) { if (m_view->supportsItemExpanding() && m_model->isExpandable(index)) { const bool expanded = m_model->isExpanded(index); m_model->setExpanded(index, !expanded); From 7cef34939d5c0517c922fbb0d8762c5c15c42f32 Mon Sep 17 00:00:00 2001 From: Dawit Alemayehu Date: Tue, 25 Sep 2012 03:40:50 -0400 Subject: [PATCH 3/6] Fixed CTRL+Tab not working when using Dolphin's filemanagement part in Konqueror. BUG: 302329 FIXED-IN: 4.9.2 REVIEW: 106569 --- src/kitemviews/kitemlistview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 72b3fd8fcb..05f2f697fe 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -846,6 +846,8 @@ bool KItemListView::event(QEvent* event) event->accept(); return true; } + // Make sure events unconsumed events get propagated up the chain. #302329 + event->ignore(); return QGraphicsWidget::event(event); } From 63561edb4598035e8631575dbc19d0581e85823a Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Wed, 26 Sep 2012 17:36:51 +0200 Subject: [PATCH 4/6] Fix a Bug in KFileItemModelRolesUpdate::setEnabledPlugins. Changes were never overtaken because of a wrong comparison. FIXED-IN: 4.9.2 --- src/kitemviews/kfileitemmodelrolesupdater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index f3d4c0e76f..f5de6b6dd7 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -215,7 +215,7 @@ bool KFileItemModelRolesUpdater::enlargeSmallPreviews() const void KFileItemModelRolesUpdater::setEnabledPlugins(const QStringList& list) { - if (m_enabledPlugins == list) { + if (m_enabledPlugins != list) { m_enabledPlugins = list; if (m_previewShown) { updateAllPreviews(); From 831251d0f3bd960449e31d7a82baec1bba131e15 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 27 Sep 2012 08:11:53 +0200 Subject: [PATCH 5/6] Add a new config option for the icon size in the Places Panel To change the icon size in the Places Panel to, e.g., 60 pixels, add the following lines to $KDEHOME/share/config/dolphinrc : [PlacesPanel] IconSize=60 A value of -1 means that the standard "Small" size should be used (which has been the default before this commit). It is planned to add an "Icon Size" submenu to the context menu of the Places Panel in KDE 4.10, but we cannot do this in the 4.9 branch because of the string freeze. FIXED-IN: 4.9.2 BUG: 301959 --- src/CMakeLists.txt | 2 + .../places/dolphin_placespanelsettings.kcfg | 14 +++++++ .../places/dolphin_placespanelsettings.kcfgc | 4 ++ src/panels/places/placespanel.cpp | 4 +- src/panels/places/placesview.cpp | 35 +++++++++++++++++ src/panels/places/placesview.h | 38 +++++++++++++++++++ 6 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 src/panels/places/dolphin_placespanelsettings.kcfg create mode 100644 src/panels/places/dolphin_placespanelsettings.kcfgc create mode 100644 src/panels/places/placesview.cpp create mode 100644 src/panels/places/placesview.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1c6b40c4b4..8f7f4db778 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -171,6 +171,7 @@ set(dolphin_SRCS panels/places/placesitemlistwidget.cpp panels/places/placesitemmodel.cpp panels/places/placesitemsignalhandler.cpp + panels/places/placesview.cpp panels/panel.cpp panels/folders/foldersitemlistwidget.cpp panels/folders/treeviewcontextmenu.cpp @@ -204,6 +205,7 @@ set(dolphin_SRCS kde4_add_kcfg_files(dolphin_SRCS panels/folders/dolphin_folderspanelsettings.kcfgc panels/information/dolphin_informationpanelsettings.kcfgc + panels/places/dolphin_placespanelsettings.kcfgc settings/dolphin_compactmodesettings.kcfgc settings/dolphin_detailsmodesettings.kcfgc settings/dolphin_generalsettings.kcfgc diff --git a/src/panels/places/dolphin_placespanelsettings.kcfg b/src/panels/places/dolphin_placespanelsettings.kcfg new file mode 100644 index 0000000000..b2ef8e5741 --- /dev/null +++ b/src/panels/places/dolphin_placespanelsettings.kcfg @@ -0,0 +1,14 @@ + + + + + + + + -1 + + + diff --git a/src/panels/places/dolphin_placespanelsettings.kcfgc b/src/panels/places/dolphin_placespanelsettings.kcfgc new file mode 100644 index 0000000000..65a77ec34b --- /dev/null +++ b/src/panels/places/dolphin_placespanelsettings.kcfgc @@ -0,0 +1,4 @@ +File=dolphin_placespanelsettings.kcfg +ClassName=PlacesPanelSettings +Singleton=true +Mutators=true diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 4b28c85102..a81b99770b 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -42,6 +41,7 @@ #include "placesitemlistgroupheader.h" #include "placesitemlistwidget.h" #include "placesitemmodel.h" +#include "placesview.h" #include #include #include @@ -94,7 +94,7 @@ void PlacesPanel::showEvent(QShowEvent* event) connect(m_model, SIGNAL(errorMessage(QString)), this, SIGNAL(errorMessage(QString))); - KStandardItemListView* view = new KStandardItemListView(); + PlacesView* view = new PlacesView(); view->setWidgetCreator(new KItemListWidgetCreator()); view->setGroupHeaderCreator(new KItemListGroupHeaderCreator()); diff --git a/src/panels/places/placesview.cpp b/src/panels/places/placesview.cpp new file mode 100644 index 0000000000..dce5083d75 --- /dev/null +++ b/src/panels/places/placesview.cpp @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (C) 2012 by Frank Reininghaus * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "placesview.h" + +#include "dolphin_placespanelsettings.h" + +PlacesView::PlacesView(QGraphicsWidget* parent) : + KStandardItemListView(parent) +{ + const int iconSize = PlacesPanelSettings::iconSize(); + if (iconSize >= 0) { + KItemListStyleOption option = styleOption(); + option.iconSize = iconSize; + setStyleOption(option); + } +} + +#include "placesview.moc" diff --git a/src/panels/places/placesview.h b/src/panels/places/placesview.h new file mode 100644 index 0000000000..87eb3a50be --- /dev/null +++ b/src/panels/places/placesview.h @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2012 by Frank Reininghaus * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef PLACESVIEW_H +#define PLACESVIEW_H + +#include + +/** + * @brief View class for the Places Panel. + * + * Reads the icon size from GeneralSettings::placesPanelIconSize(). + */ +class PlacesView : public KStandardItemListView +{ + Q_OBJECT + +public: + explicit PlacesView(QGraphicsWidget* parent = 0); +}; + +#endif From 9b01d1bcc1ddeffd3f59cee73341ec440ef6f1e0 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 30 Aug 2012 16:31:34 +0530 Subject: [PATCH 6/6] Dolphin Places: Only show file results in Nepomuk Queries Dolphin is a file manager, and shouldn't be concerned with non-file resources like notes, contacts and other stuff. Use FileQuery instead of Query. This also results in a faster queries. With File Queries Nepomuk can perform some internal optimizations. BUG: 306029 REVIEW: 106274 Cherry-picked from 6892d39d292d4f64d808e64c58ef20fa081f0259 --- src/panels/places/placesitemmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 706092bc73..4770c6b109 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -54,7 +54,7 @@ #include #include #include - #include + #include #include #include #include @@ -1172,7 +1172,7 @@ KUrl PlacesItemModel::createSearchUrl(const KUrl& url) #ifdef HAVE_NEPOMUK KUrl PlacesItemModel::searchUrlForTerm(const Nepomuk::Query::Term& term) { - const Nepomuk::Query::Query query(term); + const Nepomuk::Query::FileQuery query(term); return query.toSearchUrl(); } #endif