From: Dawit Alemayehu Date: Wed, 3 Oct 2012 19:09:58 +0000 (-0400) Subject: Merge branch '4.9' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/bc662543042a7677538ecb95a16f31b460b2b661?hp=-c Merge branch '4.9' --- bc662543042a7677538ecb95a16f31b460b2b661 diff --combined src/dolphinmainwindow.cpp index 3bf3b3f55,babaf1486..b4a25a7cf --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -1560,12 -1560,12 +1560,12 @@@ void DolphinMainWindow::setupActions( KToggleAction* editableLocation = actionCollection()->add("editable_location"); editableLocation->setText(i18nc("@action:inmenu Navigation Bar", "Editable Location")); - editableLocation->setShortcut(Qt::CTRL | Qt::Key_L); + editableLocation->setShortcut(Qt::Key_F6); connect(editableLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation())); KAction* replaceLocation = actionCollection()->addAction("replace_location"); replaceLocation->setText(i18nc("@action:inmenu Navigation Bar", "Replace Location")); - replaceLocation->setShortcut(Qt::Key_F6); + replaceLocation->setShortcut(Qt::CTRL | Qt::Key_L); connect(replaceLocation, SIGNAL(triggered()), this, SLOT(replaceLocation())); // setup 'Go' menu @@@ -1704,7 -1704,7 +1704,7 @@@ void DolphinMainWindow::setupDockWidget connect(foldersPanel, SIGNAL(folderActivated(KUrl)), this, SLOT(changeUrl(KUrl))); connect(foldersPanel, SIGNAL(folderMiddleClicked(KUrl)), - this, SLOT(openNewActivatedTab(KUrl))); + this, SLOT(openNewTab(KUrl))); connect(foldersPanel, SIGNAL(errorMessage(QString)), this, SLOT(slotPanelErrorMessage(QString))); @@@ -1756,15 -1756,13 +1756,15 @@@ connect(placesPanel, SIGNAL(placeActivated(KUrl)), this, SLOT(changeUrl(KUrl))); connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)), - this, SLOT(openNewActivatedTab(KUrl))); + this, SLOT(openNewTab(KUrl))); connect(placesPanel, SIGNAL(errorMessage(QString)), this, SLOT(slotPanelErrorMessage(QString))); connect(this, SIGNAL(urlChanged(KUrl)), placesPanel, SLOT(setUrl(KUrl))); connect(placesDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotPlacesPanelVisibilityChanged(bool))); + connect(this, SIGNAL(settingsChanged()), + placesPanel, SLOT(readSettings())); // Add actions into the "Panels" menu KActionMenu* panelsMenu = new KActionMenu(i18nc("@action:inmenu View", "Panels"), this); @@@ -1955,8 -1953,6 +1955,8 @@@ void DolphinMainWindow::refreshViews( toggleSplitView(); } } + + emit settingsChanged(); } void DolphinMainWindow::clearStatusBar() @@@ -2061,7 -2057,13 +2061,13 @@@ void DolphinMainWindow::createSecondary 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 --combined src/kitemviews/kitemlistcontroller.cpp index c16488f9e,df940de7d..697e04fef --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@@ -40,7 -40,6 +40,7 @@@ #include #include #include +#include KItemListController::KItemListController(KItemModelBase* model, KItemListView* view, QObject* parent) : QObject(parent), @@@ -420,6 -419,8 +420,8 @@@ bool KItemListController::keyPressEvent default: m_keyboardManager->addKeys(event->text()); + // Make sure unconsumed events get propagated up the chain. #302329 + event->ignore(); return false; } @@@ -888,8 -889,6 +890,8 @@@ bool KItemListController::dropEvent(QGr emit itemDropEvent(m_view->itemAt(pos), event); } + QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropEnd); + return true; } @@@ -1137,7 -1136,6 +1139,7 @@@ void KItemListController::startDragging drag->setHotSpot(hotSpot); drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction); + QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropStart); } KItemListWidget* KItemListController::hoveredWidget() const diff --combined src/kitemviews/kitemlistview.cpp index 369906878,72b3fd8fc..f2ae37556 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@@ -23,7 -23,6 +23,7 @@@ #include "kitemlistview.h" #include +#include "kitemlistcontainer.h" #include "kitemlistcontroller.h" #include "kitemlistheader.h" #include "kitemlistselectionmanager.h" @@@ -44,8 -43,6 +44,8 @@@ #include #include +#include "kitemlistviewaccessible.h" + namespace { // Time in ms until reaching the autoscroll margin triggers // an initial autoscrolling @@@ -55,21 -52,6 +55,21 @@@ const int RepeatingAutoScrollDelay = 1000 / 60; } +#ifndef QT_NO_ACCESSIBILITY +QAccessibleInterface* accessibleInterfaceFactory(const QString &key, QObject *object) +{ + Q_UNUSED(key) + + if (KItemListContainer* container = qobject_cast(object)) { + return new KItemListContainerAccessible(container); + } else if (KItemListView* view = qobject_cast(object)) { + return new KItemListViewAccessible(view); + } + + return 0; +} +#endif + KItemListView::KItemListView(QGraphicsWidget* parent) : QGraphicsWidget(parent), m_enabledSelectionToggles(false), @@@ -128,11 -110,6 +128,11 @@@ m_headerWidget->setVisible(false); m_header = new KItemListHeader(this); + +#ifndef QT_NO_ACCESSIBILITY + QAccessible::installFactory(accessibleInterfaceFactory); +#endif + } KItemListView::~KItemListView() @@@ -869,8 -846,6 +869,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); } @@@ -1214,7 -1189,6 +1212,7 @@@ void KItemListView::slotItemsChanged(co doLayout(NoAnimation); } } + QAccessible::updateAccessibility(this, 0, QAccessible::TableModelChanged); } void KItemListView::slotGroupedSortingChanged(bool current) @@@ -1277,7 -1251,6 +1275,7 @@@ void KItemListView::slotCurrentChanged( if (currentWidget) { currentWidget->setCurrent(true); } + QAccessible::updateAccessibility(this, current+1, QAccessible::Focus); } void KItemListView::slotSelectionChanged(const QSet& current, const QSet& previous) diff --combined src/views/dolphinview.cpp index 05849729f,624aa185d..def574069 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@@ -122,7 -122,6 +122,6 @@@ DolphinView::DolphinView(const KUrl& ur 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 +129,10 @@@ 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); @@@ -792,14 -795,6 +795,14 @@@ void DolphinView::slotItemsActivated(co items.append(m_model->fileItem(index)); } + if (items.count() > 5) { + QString question = QString("Are you sure you want to open %1 items?").arg(items.count()); + const int answer = KMessageBox::warningYesNo(this, question); + if (answer != KMessageBox::Yes) { + return; + } + } + foreach (const KFileItem& item, items) { if (item.isDir()) { emit tabRequested(item.url());