From kde-commits Sat Dec 31 15:55:37 2016 From: Alexander Bikadorov Date: Sat, 31 Dec 2016 15:55:37 +0000 To: kde-commits Subject: [krusader] krusader: FIXED: [ 293370 ] After a file deletion old file name is still shown in the sta Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=148319974707043 Git commit bffdb35d9920103c8993b16b24ab52ee1644df66 by Alexander Bikadorov. Committed on 30/12/2016 at 19:06. Pushed by abikadorov into branch 'master'. FIXED: [ 293370 ] After a file deletion old file name is still shown in the= status bar Status bar is updated now on every "currentChange" signal from KrView. BUG: 293370 M +0 -5 krusader/Panel/krinterview.cpp M +1 -1 krusader/Panel/krmousehandler.cpp M +0 -14 krusader/Panel/krview.cpp M +2 -3 krusader/Panel/krview.h M +9 -5 krusader/Panel/listpanel.cpp M +1 -1 krusader/Panel/listpanel.h M +1 -1 krusader/krusader.cpp M +1 -1 krusader/krusader.h https://commits.kde.org/krusader/bffdb35d9920103c8993b16b24ab52ee1644df66 diff --git a/krusader/Panel/krinterview.cpp b/krusader/Panel/krinterview.cpp index 399d0353..a4aa7848 100644 --- a/krusader/Panel/krinterview.cpp +++ b/krusader/Panel/krinterview.cpp @@ -302,11 +302,6 @@ void KrInterView::prepareForActive() { KrView::prepareForActive(); _itemView->setFocus(); - KrViewItem * current =3D getCurrentKrViewItem(); - if (current !=3D 0) { - QString desc =3D current->description(); - op()->emitItemDescription(desc); - } } = void KrInterView::prepareForPassive() diff --git a/krusader/Panel/krmousehandler.cpp b/krusader/Panel/krmousehand= ler.cpp index d1bdccfe..7936191f 100644 --- a/krusader/Panel/krmousehandler.cpp +++ b/krusader/Panel/krmousehandler.cpp @@ -269,7 +269,7 @@ bool KrMouseHandler::mouseMoveEvent(QMouseEvent *e) if (!item) return false; = - QString desc =3D item->description(); + const QString desc =3D item->description(); _view->op()->emitItemDescription(desc); = if (_dragStartPos !=3D QPoint(-1, -1) && diff --git a/krusader/Panel/krview.cpp b/krusader/Panel/krview.cpp index e530d04f..e03713c4 100644 --- a/krusader/Panel/krview.cpp +++ b/krusader/Panel/krview.cpp @@ -630,20 +630,6 @@ void KrView::renameCurrentItem() = bool KrView::handleKeyEvent(QKeyEvent *e) { - bool res =3D handleKeyEventInt(e); - - // emit the new item description - KrViewItem * current =3D getCurrentKrViewItem(); - if (current !=3D 0) { - QString desc =3D current->description(); - op()->emitItemDescription(desc); - } - - return res; -} - -bool KrView::handleKeyEventInt(QKeyEvent *e) -{ switch (e->key()) { case Qt::Key_Enter : case Qt::Key_Return : { diff --git a/krusader/Panel/krview.h b/krusader/Panel/krview.h index 1e33fe9d..5128d61f 100644 --- a/krusader/Panel/krview.h +++ b/krusader/Panel/krview.h @@ -135,7 +135,7 @@ public: void emitLetsDrag(QStringList items, QPixmap icon) { emit letsDrag(items, icon); } - void emitItemDescription(QString &desc) { + void emitItemDescription(const QString &desc) { emit itemDescription(desc); } void emitContextMenu(const QPoint &point) { @@ -205,7 +205,7 @@ signals: void selectionChanged(); void gotDrop(QDropEvent *e); void letsDrag(QStringList items, QPixmap icon); - void itemDescription(QString &desc); + void itemDescription(const QString &desc); void contextMenu(const QPoint &point); void emptyContextMenu(const QPoint& point); void renameItem(const QString &oldName, const QString &newName); @@ -495,7 +495,6 @@ protected: virtual void doRestoreSettings(KConfigGroup grp); virtual KIO::filesize_t calcSize() =3D 0; virtual KIO::filesize_t calcSelectedSize() =3D 0; - bool handleKeyEventInt(QKeyEvent *e); void sortModeUpdated(KrViewProperties::ColumnType sortColumn, bool des= cending); void saveSortMode(KConfigGroup &group); void restoreSortMode(KConfigGroup &group); diff --git a/krusader/Panel/listpanel.cpp b/krusader/Panel/listpanel.cpp index 7ec2d409..235b25c1 100644 --- a/krusader/Panel/listpanel.cpp +++ b/krusader/Panel/listpanel.cpp @@ -420,14 +420,14 @@ void ListPanel::createView() connect(view->op(), SIGNAL(dirUp()), func, SLOT(dirUp())); connect(view->op(), SIGNAL(deleteFiles(bool)), func, SLOT(deleteFiles(= bool))); connect(view->op(), SIGNAL(middleButtonClicked(KrViewItem *)), SLOT(ne= wTab(KrViewItem *))); - connect(view->op(), SIGNAL(currentChanged(KrViewItem *)), SLOT(updateP= opupPanel(KrViewItem*))); + connect(view->op(), SIGNAL(currentChanged(KrViewItem *)), SLOT(slotCur= rentChanged(KrViewItem*))); connect(view->op(), SIGNAL(renameItem(const QString &, const QString &= )), func, SLOT(rename(const QString &, const QString &))); connect(view->op(), SIGNAL(executed(const QString&)), func, SLOT(execu= te(const QString&))); connect(view->op(), SIGNAL(goInside(const QString&)), func, SLOT(goIns= ide(const QString&))); connect(view->op(), SIGNAL(needFocus()), this, SLOT(slotFocusOnMe())); connect(view->op(), SIGNAL(selectionChanged()), this, SLOT(slotUpdateT= otals())); - connect(view->op(), SIGNAL(itemDescription(QString&)), krApp, SLOT(sta= tusBarUpdate(QString&))); + connect(view->op(), SIGNAL(itemDescription(const QString&)), krApp, SL= OT(statusBarUpdate(const QString&))); connect(view->op(), SIGNAL(contextMenu(const QPoint &)), this, SLOT(po= pRightClickMenu(const QPoint &))); connect(view->op(), SIGNAL(emptyContextMenu(const QPoint &)), this, SLOT(popEmptyRightClickMenu(const QPoint &))); @@ -688,7 +688,7 @@ void ListPanel::slotFocusOnMe(bool focus) emit activate(); _actions->activePanelChanged(); func->refreshActions(); - updatePopupPanel(view->getCurrentKrViewItem()); + slotCurrentChanged(view->getCurrentKrViewItem()); view->prepareForActive(); otherPanel()->gui->slotFocusOnMe(false); } else { @@ -1258,9 +1258,13 @@ void ListPanel::restoreSettings(KConfigGroup cfg) } } = -void ListPanel::updatePopupPanel(KrViewItem *item) +void ListPanel::slotCurrentChanged(KrViewItem *item) { - // which panel to display on? + // update status bar + if (item) + krApp->statusBarUpdate(item->description()); + + // update popup panel; which panel to display on? PanelPopup *p; if(popup && !popup->isHidden()) p =3D popup; diff --git a/krusader/Panel/listpanel.h b/krusader/Panel/listpanel.h index a38397b8..c3821803 100644 --- a/krusader/Panel/listpanel.h +++ b/krusader/Panel/listpanel.h @@ -174,7 +174,7 @@ protected: static bool isNavigatorEditModeSet(); // return the navigator edit mod= e setting = protected slots: - void updatePopupPanel(KrViewItem *item); + void slotCurrentChanged(KrViewItem *item); void handleDrop(QDropEvent *event, bool onView =3D false); // handle d= rops on frame or view void handleDrop(const QUrl &destination, QDropEvent *event); // handle= drops with destination void startDragging(QStringList, QPixmap); diff --git a/krusader/krusader.cpp b/krusader/krusader.cpp index cb634022..face40e5 100644 --- a/krusader/krusader.cpp +++ b/krusader/krusader.cpp @@ -370,7 +370,7 @@ bool Krusader::versionControl() return retval; } = -void Krusader::statusBarUpdate(QString& mess) +void Krusader::statusBarUpdate(const QString& mess) { // change the message on the statusbar for 5 seconds if (statusBar()->isVisible()) diff --git a/krusader/krusader.h b/krusader/krusader.h index e77949b6..be79e50f 100644 --- a/krusader/krusader.h +++ b/krusader/krusader.h @@ -123,7 +123,7 @@ public: = public slots: void moveToTop(); - void statusBarUpdate(QString& mess); + void statusBarUpdate(const QString& mess); // in use by Krusader only void saveSettings(); void savePosition();