<table><tr><td style="">EspadaV8 added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D16837">View Revision</a></tr></table><br /><div><div><p>Sorry, I tried to update <a href="https://phabricator.kde.org/D16482" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;">D16482</a> using <tt style="background: #ebebeb; font-size: 13px;">arc</tt> but it's created a new revision instead. I wanted to update the previous one so that it used the <tt style="background: #ebebeb; font-size: 13px;">--background-mode</tt> flag instead of adding a new option. The update should now mean that if Konsole is started with <tt style="background: #ebebeb; font-size: 13px;">--background-mode</tt> it will behave like Yakuake does so that if the last tab is closed, the window is hidden and a new default session is started for when the window it shown again.</p>
<p>As I mentioned in <a href="https://phabricator.kde.org/D16482" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;">D16482</a>, I was originally using Yakuake, but rather than updating that it seemed better to update Konsole with a (long term) goal of deprecating Yakuake. I'm not aware of many features that Yakuake offers over Konsole while it does lack some and has bugs related to others (like the <tt style="background: #ebebeb; font-size: 13px;">Start in same directory as current tab</tt> mentioned in <a href="https://phabricator.kde.org/D16482" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;">D16482</a>).</p>
<p>Regarding this revision, I'm not super happy with how the <tt style="background: #ebebeb; font-size: 13px;">MainWindow</tt> needs to have the new public signal and private slot to emit <tt style="background: #ebebeb; font-size: 13px;">lastTabClosed</tt> that the <tt style="background: #ebebeb; font-size: 13px;">Application</tt> needs to listen to. I couldn't think of another nice way to handle this since <tt style="background: #ebebeb; font-size: 13px;">Application</tt> is the only place that knows if the programme was started with <tt style="background: #ebebeb; font-size: 13px;">--background-mode</tt>. Passing that down into <tt style="background: #ebebeb; font-size: 13px;">MainWindow</tt> seemed wrong and having <tt style="background: #ebebeb; font-size: 13px;">Application</tt> handle the closing of <tt style="background: #ebebeb; font-size: 13px;">window</tt>s seems wrong too (although less wrong). Also, is there any way to emit <tt style="background: #ebebeb; font-size: 13px;">lastTabClosed(this)</tt> without needing to wrap it in the <tt style="background: #ebebeb; font-size: 13px;">allTabsClosed</tt> method? I was hoping that the <tt style="background: #ebebeb; font-size: 13px;">connect(...)</tt> line could just pass in a pointer but I couldn't find a way to do that.</p>
<p>Other than that I think the code is pretty straight forward. We can easily check in <tt style="background: #ebebeb; font-size: 13px;">Application</tt> if <tt style="background: #ebebeb; font-size: 13px;">_backgroundInstance</tt> is set and if it isn't we know to tell <tt style="background: #ebebeb; font-size: 13px;">window</tt> to <tt style="background: #ebebeb; font-size: 13px;">close()</tt>, otherwise we want to create a new default session and call <tt style="background: #ebebeb; font-size: 13px;">_backgroundInstance->hide()</tt>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16837">https://phabricator.kde.org/D16837</a></div></div><br /><div><strong>To: </strong>EspadaV8<br /><strong>Cc: </strong>konsole-devel, ngraham, maximilianocuria, hindenburg<br /></div>