mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Abort loading the current URL if the user presses Escape
BUG: 323181 FIXED-IN: 4.12.0 REVIEW: 113234
This commit is contained in:
parent
011299eb6e
commit
77fd0e771a
|
@ -403,6 +403,7 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
|
|||
m_selectionManager->clearSelection();
|
||||
}
|
||||
m_keyboardManager->cancelSearch();
|
||||
emit escapePressed();
|
||||
break;
|
||||
|
||||
case Qt::Key_Space:
|
||||
|
|
|
@ -230,6 +230,11 @@ signals:
|
|||
*/
|
||||
void aboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
|
||||
|
||||
/**
|
||||
* Is emitted if the Escape key is pressed.
|
||||
*/
|
||||
void escapePressed();
|
||||
|
||||
void modelChanged(KItemModelBase* current, KItemModelBase* previous);
|
||||
void viewChanged(KItemListView* current, KItemListView* previous);
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) :
|
|||
connect(controller, SIGNAL(itemHovered(int)), this, SLOT(slotItemHovered(int)));
|
||||
connect(controller, SIGNAL(itemUnhovered(int)), this, SLOT(slotItemUnhovered(int)));
|
||||
connect(controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
|
||||
connect(controller, SIGNAL(escapePressed()), this, SLOT(stopLoading()));
|
||||
connect(controller, SIGNAL(modelChanged(KItemModelBase*,KItemModelBase*)), this, SLOT(slotModelChanged(KItemModelBase*,KItemModelBase*)));
|
||||
|
||||
connect(m_model, SIGNAL(directoryLoadingStarted()), this, SLOT(slotDirectoryLoadingStarted()));
|
||||
|
@ -485,11 +486,6 @@ void DolphinView::reload()
|
|||
restoreState(restoreStream);
|
||||
}
|
||||
|
||||
void DolphinView::stopLoading()
|
||||
{
|
||||
m_model->cancelDirectoryLoading();
|
||||
}
|
||||
|
||||
void DolphinView::readSettings()
|
||||
{
|
||||
const int oldZoomLevel = m_view->zoomLevel();
|
||||
|
@ -724,6 +720,11 @@ void DolphinView::pasteIntoFolder()
|
|||
}
|
||||
}
|
||||
|
||||
void DolphinView::stopLoading()
|
||||
{
|
||||
m_model->cancelDirectoryLoading();
|
||||
}
|
||||
|
||||
bool DolphinView::eventFilter(QObject* watched, QEvent* event)
|
||||
{
|
||||
switch (event->type()) {
|
||||
|
|
|
@ -217,7 +217,6 @@ public:
|
|||
QList<QByteArray> visibleRoles() const;
|
||||
|
||||
void reload();
|
||||
void stopLoading();
|
||||
|
||||
/**
|
||||
* Refreshes the view to get synchronized with the settings (e.g. icons size,
|
||||
|
@ -369,6 +368,8 @@ public slots:
|
|||
*/
|
||||
void pasteIntoFolder();
|
||||
|
||||
void stopLoading();
|
||||
|
||||
/** Activates the view if the item list container gets focus. */
|
||||
virtual bool eventFilter(QObject* watched, QEvent* event);
|
||||
|
||||
|
|
Loading…
Reference in a new issue