From 65b7e3b785e4f368f1b8cb39df9344bfd6324b4b Mon Sep 17 00:00:00 2001 From: Dawit Alemayehu Date: Fri, 28 Sep 2012 13:56:51 -0400 Subject: Redo the fix for CTRL+Tab not working when using Dolphin's filemanagement part in Konqueror. The original fix, commit 4f7ed2b, prevents drag and drop from working correctly. CCBUG: 302329 REVIEW: 106569 --- src/kitemviews/kitemlistcontroller.cpp | 2 ++ src/kitemviews/kitemlistview.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 5a7175e4c..df940de7d 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -419,6 +419,8 @@ bool KItemListController::keyPressEvent(QKeyEvent* event) default: m_keyboardManager->addKeys(event->text()); + // Make sure unconsumed events get propagated up the chain. #302329 + event->ignore(); return false; } diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 05f2f697f..72b3fd8fc 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -846,8 +846,6 @@ 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); } -- cgit v1.3 From 0e49df921450da38a94b4cf10837c67b8e968ae9 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sat, 29 Sep 2012 19:47:00 +0200 Subject: Find out the main window by calling the parent widget's window() member KFileItemModel calls the dir lister's setMainWindow() method to make sure that the dir lister caches authentication data. However, the method used to determine the main window (qApp->activeWindow()) is not guaranteed to yield the DolphinMainWindow or the KonqMainWindow. In particular, if "Split View" is enabled in Dolphin's settings dialog, the active window is the dialog, and when it is closed, any later access to the stored pointer leads to a crash. A better method is to verify that the model's parent is a QWidget and then use this widget's window(). I had to make a small modification in DolphinMainWindow to make sure that it also works correctly when the view is split (the new view container had been created with a 0 parent previously). I tested it in Dolphin and Konqueror and verified that the "main window" passed to the dir lister is really the application's main window. BUG: 306459 FIXED-IN: 4.9.3 --- src/dolphinmainwindow.cpp | 8 +++++++- src/kitemviews/kfileitemmodel.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 17268297c..babaf1486 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -2057,7 +2057,13 @@ void DolphinMainWindow::createSecondaryView(int tabIndex) const int newWidth = (viewTab.primaryView->width() - splitter->handleWidth()) / 2; const DolphinView* view = viewTab.primaryView->view(); - viewTab.secondaryView = createViewContainer(view->url(), 0); + // The final parent of the new view container will be set by adding it + // to the splitter. However, we must make sure that the DolphinMainWindow + // is a parent of the view container already when it is constructed + // because this enables the container's KFileItemModel to assign its + // dir lister to the right main window. The dir lister can then cache + // authentication data. + viewTab.secondaryView = createViewContainer(view->url(), this); splitter->addWidget(viewTab.secondaryView); splitter->setSizes(QList() << newWidth << newWidth); diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 752bc9365..61f512a8e 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -31,6 +31,7 @@ #include #include #include +#include // #define KFILEITEMMODEL_DEBUG @@ -59,7 +60,11 @@ KFileItemModel::KFileItemModel(QObject* parent) : m_dirLister = new KFileItemModelDirLister(this); m_dirLister->setAutoUpdate(true); m_dirLister->setDelayedMimeTypes(true); - m_dirLister->setMainWindow(qApp->activeWindow()); + + const QWidget* parentWidget = qobject_cast(parent); + if (parentWidget) { + m_dirLister->setMainWindow(parentWidget->window()); + } connect(m_dirLister, SIGNAL(started(KUrl)), this, SIGNAL(directoryLoadingStarted())); connect(m_dirLister, SIGNAL(canceled()), this, SLOT(slotCanceled())); -- cgit v1.3 From 2277ccaf2369fccf7346dc931c6ff1a86c5b7d3b Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Wed, 3 Oct 2012 10:14:20 +0200 Subject: Fix the hidden "EnlargeSmallPreviews" option This option, introduced in 99e4eb0f3a58c53277b099114a5fd8945937fb9a, did not work any more since 2069c200211c93e401c3d19850f41eade09d64be. CCBUG: 307522 --- src/views/dolphinview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index f0dc3caba..624aa185d 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -122,7 +122,6 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) : m_model = new KFileItemModel(this); m_view = new DolphinItemListView(); m_view->setEnabledSelectionToggles(GeneralSettings::showSelectionToggle()); - m_view->setEnlargeSmallPreviews(GeneralSettings::enlargeSmallPreviews()); m_view->setVisibleRoles(QList() << "text"); applyModeToView(); @@ -130,6 +129,10 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) : const int delay = GeneralSettings::autoExpandFolders() ? 750 : -1; controller->setAutoActivationDelay(delay); + // The EnlargeSmallPreviews setting can only be changed after the model + // has been set in the view by KItemListController. + m_view->setEnlargeSmallPreviews(GeneralSettings::enlargeSmallPreviews()); + m_container = new KItemListContainer(controller, this); m_container->installEventFilter(this); setFocusProxy(m_container); -- cgit v1.3