Tags: patch
I completely forgot about this bug, sorry :) Maybe it's too obsolete now...
This patch changes the name of a bunch of variables (kde code is hard
to understand), adds docs, and (to actually fix the bug), adds a
signal itemSelected -> slotResetAffect... This resets the affect
position pointer every time we select a new view so operations happen
on the new view until the user makes a new right click. I also
removed some calls to the reset function which are redundant now.
This also fixes moving a tab after moving *to* a different tab using
shift+arrow which I didn't notice in the original report.
diff --git a/yakuake/src/main_window.cpp b/yakuake/src/main_window.cpp
index 7a15bde..62e8703 100644
--- a/yakuake/src/main_window.cpp
+++ b/yakuake/src/main_window.cpp
@@ -380,10 +380,9 @@ void MainWindow::slotRemoveSession(int session_id)
void MainWindow::slotHandleRemoveSession(KAction::ActivationReason reason, Qt::ButtonState /* state */)
{
if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
{
-slotRemoveSession(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotRemoveSession(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
}
else
slotRemoveSession();
@@ -653,10 +652,9 @@ void MainWindow::windowActivationChange(bool old_active)
void MainWindow::slotHandleHorizontalSplit(KAction::ActivationReason reason, Qt::ButtonState /* state */)
{
if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
{
-slotSplitHorizontally(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotSplitHorizontally(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
}
else
slotSplitHorizontally();
@@ -665,10 +663,9 @@ void MainWindow::slotHandleHorizontalSplit(KAction::ActivationReason reason, Qt:
void MainWindow::slotHandleVerticalSplit(KAction::ActivationReason reason, Qt::ButtonState /* state */)
{
if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
{
-slotSplitVertically(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotSplitVertically(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
}
else
slotSplitVertically();
@@ -678,10 +675,9 @@ void MainWindow::slotHandleVerticalSplit(KAction::ActivationReason reason, Qt::B
void MainWindow::slotHandleRemoveTerminal(KAction::ActivationReason reason, Qt::ButtonState /* state */)
{
if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
{
-slotRemoveTerminal(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotRemoveTerminal(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
}
else
slotRemoveTerminal();
@@ -1323,7 +1319,7 @@ void MainWindow::slotPollMouse()
if (pos.y() == 0)
{
-if (Settings::screen() == 0)
+if (Settings::screen() == 0)
slotToggleState(); // no need to check x since yakuake should open where the mouse pointer is
else if (pos.x() >= getDesktopGeometry().x() && pos.x() <= (getDesktopGeometry().x() + getDesktopGeometry().width()))
slotToggleState();
diff --git a/yakuake/src/tab_bar.cpp b/yakuake/src/tab_bar.cpp
index 72347db..52aa26b 100644
--- a/yakuake/src/tab_bar.cpp
+++ b/yakuake/src/tab_bar.cpp
@@ -21,7 +21,6 @@
#include
#include
-
TabBar::TabBar(QWidget* parent, const char* name, bool translucency, const QString & skin)
: TranslucentWidget(parent, name, translucency)
{
@@ -41,15 +40,9 @@ TabBar::~TabBar()
delete minus_button;
}
-int TabBar::pressedPosition()
-{
-return tabs_widget->pressedPosition();
-}
-
-
-void TabBar::resetPressedPosition()
+int TabBar::affectPosition()
{
-tabs_widget->resetPressedPosition();
+return tabs_widget->affectPosition();
}
void TabBar::addItem(int session_id)
diff --git a/yakuake/src/tab_bar.h b/yakuake/src/tab_bar.h
index 6e8f3a0..2e05449 100644
--- a/yakuake/src/tab_bar.h
+++ b/yakuake/src/tab_bar.h
@@ -41,8 +41,8 @@ class TabBar : public TranslucentWidget
void setSessionMenu(KPopupMenu* menu);
-int pressedPosition();
-void resetPressedPosition();
+int affectPosition();
+// void resetAffectPosition();
void addItem(int session_id);
int removeItem(int session_id);
diff --git a/yakuake/src/tabbed_widget.cpp b/yakuake/src/tabbed_widget.cpp
index c2b3961..46c4649 100644
--- a/yakuake/src/tabbed_widget.cpp