Changeset View
Changeset View
Standalone View
Standalone View
src/dolphintabwidget.cpp
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Line(s) | |||||
221 | } | 221 | } | ||
222 | 222 | | |||
223 | void DolphinTabWidget::closeTab(const int index) | 223 | void DolphinTabWidget::closeTab(const int index) | ||
224 | { | 224 | { | ||
225 | Q_ASSERT(index >= 0); | 225 | Q_ASSERT(index >= 0); | ||
226 | Q_ASSERT(index < count()); | 226 | Q_ASSERT(index < count()); | ||
227 | 227 | | |||
228 | if (count() < 2) { | 228 | if (count() < 2) { | ||
229 | // Never close the last tab. | 229 | // Close Dolphin when closing the last tab. | ||
230 | parentWidget()->close(); | ||||
230 | return; | 231 | return; | ||
231 | } | 232 | } | ||
232 | 233 | | |||
233 | DolphinTabPage* tabPage = tabPageAt(index); | 234 | DolphinTabPage* tabPage = tabPageAt(index); | ||
234 | emit rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState()); | 235 | emit rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState()); | ||
235 | 236 | | |||
236 | removeTab(index); | 237 | removeTab(index); | ||
237 | tabPage->deleteLater(); | 238 | tabPage->deleteLater(); | ||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |