[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krusader] krusader: FIXED: [ 293370 ] After a file deletion old file name is still shown in the sta
From:       Alexander Bikadorov <null () kde ! org>
Date:       2016-12-31 15:55:37
Message-ID: E1cNM0P-0004f1-KP () code ! kde ! org
[Download RAW message or body]

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 = getCurrentKrViewItem();
-    if (current != 0) {
-        QString desc = current->description();
-        op()->emitItemDescription(desc);
-    }
 }
 
 void KrInterView::prepareForPassive()
diff --git a/krusader/Panel/krmousehandler.cpp b/krusader/Panel/krmousehandler.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 = item->description();
+    const QString desc = item->description();
     _view->op()->emitItemDescription(desc);
 
     if (_dragStartPos != 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 = handleKeyEventInt(e);
-
-    // emit the new item description
-    KrViewItem * current = getCurrentKrViewItem();
-    if (current != 0) {
-        QString desc = 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() = 0;
     virtual KIO::filesize_t calcSelectedSize() = 0;
-    bool handleKeyEventInt(QKeyEvent *e);
     void sortModeUpdated(KrViewProperties::ColumnType sortColumn, bool descending);
     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(newTab(KrViewItem *)));
-    connect(view->op(), SIGNAL(currentChanged(KrViewItem *)), \
SLOT(updatePopupPanel(KrViewItem*))); +    connect(view->op(), \
                SIGNAL(currentChanged(KrViewItem *)), \
                SLOT(slotCurrentChanged(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(execute(const \
                QString&)));
     connect(view->op(), SIGNAL(goInside(const QString&)), func, SLOT(goInside(const \
                QString&)));
     connect(view->op(), SIGNAL(needFocus()), this, SLOT(slotFocusOnMe()));
     connect(view->op(), SIGNAL(selectionChanged()), this, SLOT(slotUpdateTotals()));
-    connect(view->op(), SIGNAL(itemDescription(QString&)), krApp, \
SLOT(statusBarUpdate(QString&))); +    connect(view->op(), \
SIGNAL(itemDescription(const QString&)), krApp, SLOT(statusBarUpdate(const \
                QString&)));
     connect(view->op(), SIGNAL(contextMenu(const QPoint &)), this, \
SLOT(popRightClickMenu(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 = 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 mode setting
 
 protected slots:
-    void updatePopupPanel(KrViewItem *item);
+    void slotCurrentChanged(KrViewItem *item);
     void handleDrop(QDropEvent *event, bool onView = false); // handle drops 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();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic