Commit 279a3a10 authored by Eike Hein's avatar Eike Hein
Browse files

Clean up tab rename code a bit more.

svn path=/trunk/extragear/utils/yakuake/; revision=952405
parent 1f07a21e
...@@ -614,17 +614,6 @@ void TabBar::removeTab(int sessionId) ...@@ -614,17 +614,6 @@ void TabBar::removeTab(int sessionId)
emit tabSelected(m_tabs.last()); emit tabSelected(m_tabs.last());
} }
void TabBar::renameTab(int sessionId, const QString& newTitle)
{
if (sessionId == -1) return;
if (!m_tabTitles.contains(sessionId)) return;
if (!newTitle.isEmpty())
m_tabTitles[sessionId] = newTitle;
update();
}
void TabBar::interactiveRename(int sessionId) void TabBar::interactiveRename(int sessionId)
{ {
if (sessionId == -1) return; if (sessionId == -1) return;
...@@ -650,7 +639,7 @@ void TabBar::interactiveRenameDone() ...@@ -650,7 +639,7 @@ void TabBar::interactiveRenameDone()
m_renamingSessionId = -1; m_renamingSessionId = -1;
renameTab(sessionId, m_lineEdit->text().trimmed()); setTabTitle(sessionId, m_lineEdit->text().trimmed());
} }
void TabBar::selectTab(int sessionId) void TabBar::selectTab(int sessionId)
...@@ -740,7 +729,13 @@ QString TabBar::tabTitle(int sessionId) ...@@ -740,7 +729,13 @@ QString TabBar::tabTitle(int sessionId)
void TabBar::setTabTitle(int sessionId, const QString& newTitle) void TabBar::setTabTitle(int sessionId, const QString& newTitle)
{ {
if (!newTitle.isEmpty()) renameTab(sessionId, newTitle); if (sessionId == -1) return;
if (!m_tabTitles.contains(sessionId)) return;
if (!newTitle.isEmpty())
m_tabTitles[sessionId] = newTitle;
update();
} }
int TabBar::sessionAtTab(int index) int TabBar::sessionAtTab(int index)
......
...@@ -57,7 +57,6 @@ class TabBar : public QWidget ...@@ -57,7 +57,6 @@ class TabBar : public QWidget
void addTab(int sessionId, const QString& title = 0); void addTab(int sessionId, const QString& title = 0);
void removeTab(int sessionId = -1); void removeTab(int sessionId = -1);
void renameTab(int sessionId = -1, const QString& newTitle = 0);
void interactiveRename(int sessionId); void interactiveRename(int sessionId);
void selectTab(int sessionId); void selectTab(int sessionId);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment