Changeset View
Changeset View
Standalone View
Standalone View
src/dolphintabwidget.cpp
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | |||||
174 | { | 174 | { | ||
175 | Q_ASSERT(dirs.size() > 0); | 175 | Q_ASSERT(dirs.size() > 0); | ||
176 | 176 | | |||
177 | QList<QUrl>::const_iterator it = dirs.constBegin(); | 177 | QList<QUrl>::const_iterator it = dirs.constBegin(); | ||
178 | while (it != dirs.constEnd()) { | 178 | while (it != dirs.constEnd()) { | ||
179 | const QUrl& primaryUrl = *(it++); | 179 | const QUrl& primaryUrl = *(it++); | ||
180 | if (splitView && (it != dirs.constEnd())) { | 180 | if (splitView && (it != dirs.constEnd())) { | ||
181 | const QUrl& secondaryUrl = *(it++); | 181 | const QUrl& secondaryUrl = *(it++); | ||
182 | openNewTab(primaryUrl, secondaryUrl); | 182 | openNewActivatedTab(primaryUrl, secondaryUrl); | ||
183 | } else { | 183 | } else { | ||
184 | openNewTab(primaryUrl); | 184 | openNewActivatedTab(primaryUrl); | ||
185 | } | 185 | } | ||
186 | } | 186 | } | ||
187 | } | 187 | } | ||
188 | 188 | | |||
189 | void DolphinTabWidget::openFiles(const QList<QUrl>& files, bool splitView) | 189 | void DolphinTabWidget::openFiles(const QList<QUrl>& files, bool splitView) | ||
190 | { | 190 | { | ||
191 | Q_ASSERT(files.size() > 0); | 191 | Q_ASSERT(files.size() > 0); | ||
192 | 192 | | |||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 273 | { | |||
276 | QStringList args; | 276 | QStringList args; | ||
277 | 277 | | |||
278 | const DolphinTabPage* tabPage = tabPageAt(index); | 278 | const DolphinTabPage* tabPage = tabPageAt(index); | ||
279 | args << tabPage->primaryViewContainer()->url().url(); | 279 | args << tabPage->primaryViewContainer()->url().url(); | ||
280 | if (tabPage->splitViewEnabled()) { | 280 | if (tabPage->splitViewEnabled()) { | ||
281 | args << tabPage->secondaryViewContainer()->url().url(); | 281 | args << tabPage->secondaryViewContainer()->url().url(); | ||
282 | args << QStringLiteral("--split"); | 282 | args << QStringLiteral("--split"); | ||
283 | } | 283 | } | ||
284 | args << QStringLiteral("--new-window"); | ||||
284 | 285 | | |||
285 | const QString command = QStringLiteral("dolphin %1").arg(KShell::joinArgs(args)); | 286 | const QString command = QStringLiteral("dolphin %1").arg(KShell::joinArgs(args)); | ||
286 | KRun::runCommand(command, this); | 287 | KRun::runCommand(command, this); | ||
287 | 288 | | |||
288 | closeTab(index); | 289 | closeTab(index); | ||
289 | } | 290 | } | ||
290 | 291 | | |||
291 | void DolphinTabWidget::openNewActivatedTab(int index) | 292 | void DolphinTabWidget::openNewActivatedTab(int index) | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
359 | { | 360 | { | ||
360 | if (!tabPage) { | 361 | if (!tabPage) { | ||
361 | return QString(); | 362 | return QString(); | ||
362 | } | 363 | } | ||
363 | QString name = tabPage->activeViewContainer()->caption(); | 364 | QString name = tabPage->activeViewContainer()->caption(); | ||
364 | // Make sure that a '&' inside the directory name is displayed correctly | 365 | // Make sure that a '&' inside the directory name is displayed correctly | ||
365 | // and not misinterpreted as a keyboard shortcut in QTabBar::setTabText() | 366 | // and not misinterpreted as a keyboard shortcut in QTabBar::setTabText() | ||
366 | return name.replace('&', QLatin1String("&&")); | 367 | return name.replace('&', QLatin1String("&&")); | ||
367 | } | 368 | } | ||
elvisangelaccio: Coding style: missing camelcase
Do we actually need this variable, though? | |||||
Please put tabPageAt(i)->activeViewContainer()->url() in a variable to simplify this condition. elvisangelaccio: Please put `tabPageAt(i)->activeViewContainer()->url()` in a variable to simplify this… | |||||
elvisangelaccio: Coding style: opening brace should go to previous line. |
Coding style: missing camelcase
Do we actually need this variable, though?