Skip to content
Snippets Groups Projects
Commit 169fd67e authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Expand %# %w in the "Copy Input To" dialog session list.

Duplicate the code in SessionController.cpp to expand %# %w in the
copy input dialog.  This is not the ideal solution but it not trivial
to fix w/ all the tab/window titles issues in Konsole.

BUG: 175755
FIXED-IN: 4.10
(cherry picked from commit f43dd28d)
parent ef2bcfc8
No related branches found
No related tags found
No related merge requests found
......@@ -60,10 +60,20 @@ QVariant SessionListModel::data(const QModelIndex& index, int role) const
switch (role) {
case Qt::DisplayRole:
if (column == 1)
return _sessions[row]->title(Session::DisplayedTitleRole);
else if (column == 0)
if (column == 1) {
// This code is duplicated from SessionController.cpp
QString title = _sessions[row]->title(Session::DisplayedTitleRole);
// special handling for the "%w" marker which is replaced with the
// window title set by the shell
title.replace("%w", _sessions[row]->userTitle());
// special handling for the "%#" marker which is replaced with the
// number of the shell
title.replace("%#", QString::number(_sessions[row]->sessionId()));
return title;
} else if (column == 0) {
return _sessions[row]->sessionId();
}
break;
case Qt::DecorationRole:
if (column == 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment