Changeset View
Changeset View
Standalone View
Standalone View
src/dolphintabwidget.cpp
Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Line(s) | 196 | while (it != dirs.constEnd()) { | |||
---|---|---|---|---|---|
201 | if (index >= 0) { | 201 | if (index >= 0) { | ||
202 | setCurrentIndex(index); | 202 | setCurrentIndex(index); | ||
203 | const auto tabPage = tabPageAt(index); | 203 | const auto tabPage = tabPageAt(index); | ||
204 | if (isInPrimaryView) { | 204 | if (isInPrimaryView) { | ||
205 | tabPage->primaryViewContainer()->setActive(true); | 205 | tabPage->primaryViewContainer()->setActive(true); | ||
206 | } else { | 206 | } else { | ||
207 | tabPage->secondaryViewContainer()->setActive(true); | 207 | tabPage->secondaryViewContainer()->setActive(true); | ||
208 | } | 208 | } | ||
209 | // BUG: 147230 | ||||
210 | // Required for updateViewState() call in openFiles() to work as expected | ||||
211 | // If there is a selection, updateViewState() calls are effectively a no-op | ||||
212 | tabPage->activeViewContainer()->view()->clearSelection(); | ||||
209 | continue; | 213 | continue; | ||
210 | } | 214 | } | ||
211 | if (splitView && (it != dirs.constEnd())) { | 215 | if (splitView && (it != dirs.constEnd())) { | ||
212 | const QUrl& secondaryUrl = *(it++); | 216 | const QUrl& secondaryUrl = *(it++); | ||
213 | openNewActivatedTab(primaryUrl, secondaryUrl); | 217 | openNewActivatedTab(primaryUrl, secondaryUrl); | ||
214 | } else { | 218 | } else { | ||
215 | openNewActivatedTab(primaryUrl); | 219 | openNewActivatedTab(primaryUrl); | ||
216 | } | 220 | } | ||
Show All 17 Lines | 225 | { | |||
234 | 238 | | |||
235 | const int oldTabCount = count(); | 239 | const int oldTabCount = count(); | ||
236 | openDirectories(dirs, splitView); | 240 | openDirectories(dirs, splitView); | ||
237 | const int tabCount = count(); | 241 | const int tabCount = count(); | ||
238 | 242 | | |||
239 | // Select the files. Although the files can be split between several | 243 | // Select the files. Although the files can be split between several | ||
240 | // tabs, there is no need to split 'files' accordingly, as | 244 | // tabs, there is no need to split 'files' accordingly, as | ||
241 | // the DolphinView will just ignore invalid selections. | 245 | // the DolphinView will just ignore invalid selections. | ||
242 | for (int i = oldTabCount; i < tabCount; ++i) { | 246 | for (int i = 0; i < tabCount; ++i) { | ||
broulik: I think we don't want to change existing tabs, only thew new ones.
You probably want to check… | |||||
243 | DolphinTabPage* tabPage = tabPageAt(i); | 247 | DolphinTabPage* tabPage = tabPageAt(i); | ||
244 | tabPage->markUrlsAsSelected(files); | 248 | tabPage->markUrlsAsSelected(files); | ||
245 | tabPage->markUrlAsCurrent(files.first()); | 249 | tabPage->markUrlAsCurrent(files.first()); | ||
250 | if (i < oldTabCount) { | ||||
251 | // Force selection of file if directory was already open, BUG: 417230 | ||||
252 | tabPage->activeViewContainer()->view()->updateViewState(); | ||||
253 | } | ||||
246 | } | 254 | } | ||
247 | } | 255 | } | ||
248 | 256 | | |||
249 | void DolphinTabWidget::closeTab() | 257 | void DolphinTabWidget::closeTab() | ||
250 | { | 258 | { | ||
251 | closeTab(currentIndex()); | 259 | closeTab(currentIndex()); | ||
252 | } | 260 | } | ||
253 | 261 | | |||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |
I think we don't want to change existing tabs, only thew new ones.
You probably want to check