Changeset View
Changeset View
Standalone View
Standalone View
app/mainwindow.cpp
Show First 20 Lines • Show All 1263 Lines • ▼ Show 20 Line(s) | 1253 | { | |||
---|---|---|---|---|---|
1264 | d->mContextManager->setUrlToSelect(url); | 1264 | d->mContextManager->setUrlToSelect(url); | ||
1265 | } | 1265 | } | ||
1266 | 1266 | | |||
1267 | void MainWindow::updatePreviousNextActions() | 1267 | void MainWindow::updatePreviousNextActions() | ||
1268 | { | 1268 | { | ||
1269 | bool hasPrevious; | 1269 | bool hasPrevious; | ||
1270 | bool hasNext; | 1270 | bool hasNext; | ||
1271 | QModelIndex currentIndex = d->mContextManager->selectionModel()->currentIndex(); | 1271 | QModelIndex currentIndex = d->mContextManager->selectionModel()->currentIndex(); | ||
1272 | if (currentIndex.isValid() && !d->indexIsDirOrArchive(currentIndex)) { | 1272 | if (d->mContextManager->selectionModel()->hasSelection() | ||
1273 | && currentIndex.isValid() | ||||
1274 | && !d->indexIsDirOrArchive(currentIndex)) { | ||||
1273 | int row = currentIndex.row(); | 1275 | int row = currentIndex.row(); | ||
huoni: Problem 3 fix | |||||
1274 | QModelIndex prevIndex = d->mDirModel->index(row - 1, 0); | 1276 | QModelIndex prevIndex = d->mDirModel->index(row - 1, 0); | ||
1275 | QModelIndex nextIndex = d->mDirModel->index(row + 1, 0); | 1277 | QModelIndex nextIndex = d->mDirModel->index(row + 1, 0); | ||
1276 | hasPrevious = prevIndex.isValid() && !d->indexIsDirOrArchive(prevIndex); | 1278 | hasPrevious = prevIndex.isValid() && !d->indexIsDirOrArchive(prevIndex); | ||
1277 | hasNext = nextIndex.isValid() && !d->indexIsDirOrArchive(nextIndex); | 1279 | hasNext = nextIndex.isValid() && !d->indexIsDirOrArchive(nextIndex); | ||
1278 | } else { | 1280 | } else { | ||
1279 | hasPrevious = false; | 1281 | hasPrevious = false; | ||
1280 | hasNext = false; | 1282 | hasNext = false; | ||
1281 | } | 1283 | } | ||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |
Problem 3 fix