]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch '4.9'
authorDawit Alemayehu <adawit@kde.org>
Wed, 3 Oct 2012 19:09:58 +0000 (15:09 -0400)
committerDawit Alemayehu <adawit@kde.org>
Wed, 3 Oct 2012 19:09:58 +0000 (15:09 -0400)
1  2 
src/dolphinmainwindow.cpp
src/kitemviews/kitemlistcontroller.cpp
src/kitemviews/kitemlistview.cpp
src/views/dolphinview.cpp

index 3bf3b3f558c72ce4965505c31e5e0457017c9c36,babaf1486ebe577ad60743d4b6447a77e0d172eb..b4a25a7cf4e6538dbc8ac902904ef0c2d1a97e6f
@@@ -1560,12 -1560,12 +1560,12 @@@ void DolphinMainWindow::setupActions(
  
      KToggleAction* editableLocation = actionCollection()->add<KToggleAction>("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)));
  
      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<int>() << newWidth << newWidth);
  
index c16488f9eb448e5563578b9e0b07d8a0e6ce1a35,df940de7dab3d63db878a081ad80081f47d90b41..697e04fefcc8fbabf48b765f712af2a9123baf24
@@@ -40,7 -40,6 +40,7 @@@
  #include <QGraphicsView>
  #include <QMimeData>
  #include <QTimer>
 +#include <QAccessible>
  
  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
index 369906878b5b554c70b384e4e0eca410e2634bd7,72b3fd8fcbfbaa43660fac359320c8227ade9063..f2ae37556d9413fd126ff49d6e969b7fb209bcdd
@@@ -23,7 -23,6 +23,7 @@@
  #include "kitemlistview.h"
  
  #include <KDebug>
 +#include "kitemlistcontainer.h"
  #include "kitemlistcontroller.h"
  #include "kitemlistheader.h"
  #include "kitemlistselectionmanager.h"
@@@ -44,8 -43,6 +44,8 @@@
  #include <QStyleOptionRubberBand>
  #include <QTimer>
  
 +#include "kitemlistviewaccessible.h"
 +
  namespace {
      // Time in ms until reaching the autoscroll margin triggers
      // an initial autoscrolling
      const int RepeatingAutoScrollDelay = 1000 / 60;
  }
  
 +#ifndef QT_NO_ACCESSIBILITY
 +QAccessibleInterface* accessibleInterfaceFactory(const QString &key, QObject *object)
 +{
 +    Q_UNUSED(key)
 +
 +    if (KItemListContainer* container = qobject_cast<KItemListContainer*>(object)) {
 +        return new KItemListContainerAccessible(container);
 +    } else if (KItemListView* view = qobject_cast<KItemListView*>(object)) {
 +        return new KItemListViewAccessible(view);
 +    }
 +
 +    return 0;
 +}
 +#endif
 +
  KItemListView::KItemListView(QGraphicsWidget* parent) :
      QGraphicsWidget(parent),
      m_enabledSelectionToggles(false),
      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<int>& current, const QSet<int>& previous)
index 05849729f95b2045794259c8ca2b2c68e72f6325,624aa185db8971a5341b506f0fcb4084827293ce..def57406946a309f04546c58dd59c700843a91a1
@@@ -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<QByteArray>() << "text");
      applyModeToView();
  
      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());