Commit 00ee923e authored by Silas Lenz's avatar Silas Lenz Committed by Peter Mühlenpfordt

Update filename in fullscreen view on rename

Summary:
When a file was renamed in fullscreen view the filename displayed in InformationLabel was not updated until you navigated to another image and back. This was  caused by the current url not being updated, which also resulted in edits and saves affecting the wrong image. This patch fixes the missing url update. Also makes full screen thumbnailBar scroll to the new file similar to other thumbnailviews.

BUG: 390332
Closes T8071

Test Plan:
Case 1:
1. Open image in fullscreen view.
2. Rename image using F2 or right click menu.
3. Verify that all visible filenames are updated, and that navigation between images still work.

Case 2:
1. Open image in normal view.
2. Rename image using F2 or Operations sidebar.
3. Verify that all visible filenames are updated, and that navigation between images still work.

Case 3:
1. Select image thumbnail in browse view.
2. Rename image using F2 or right click menu.
3. Verify that all visible filenames are updated, and that the image is still selected.

Reviewers: #gwenview, muhlenpfordt

Reviewed By: #gwenview, muhlenpfordt

Subscribers: rkflx, muhlenpfordt

Tags: #gwenview

Maniphest Tasks: T8071

Differential Revision: https://phabricator.kde.org/D10745
parent efaebe29
......@@ -220,7 +220,7 @@ void showMenuForDroppedUrls(QWidget* parent, const QList<QUrl>& urlList, const Q
KJobWidgets::setWindow(job, parent);
}
void rename(const QUrl &oldUrl, QWidget* parent)
void rename(const QUrl &oldUrl, QWidget* parent, ContextManager* contextManager)
{
QString name = QInputDialog::getText(parent,
i18nc("@title:window", "Rename") /* caption */,
......@@ -240,6 +240,7 @@ void rename(const QUrl &oldUrl, QWidget* parent)
job->uiDelegate()->showErrorMessage();
return;
}
contextManager->setCurrentUrl(newUrl);
ThumbnailProvider::moveThumbnail(oldUrl, newUrl);
}
......
......@@ -40,7 +40,7 @@ void moveTo(const QList<QUrl>& urlList, QWidget* parent, ContextManager* context
void linkTo(const QList<QUrl>& urlList, QWidget* parent, ContextManager* contextManager);
void trash(const QList<QUrl>& urlList, QWidget* parent);
void del(const QList<QUrl>& urlList, QWidget* parent);
void rename(const QUrl &url, QWidget* parent);
void rename(const QUrl &url, QWidget* parent, ContextManager* contextManager);
void showMenuForDroppedUrls(QWidget* parent, const QList<QUrl>& urlList, const QUrl &destUrl);
......
......@@ -349,7 +349,7 @@ void FileOpsContextManagerItem::rename()
QModelIndex index = mThumbnailView->currentIndex();
mThumbnailView->edit(index);
} else {
FileOperations::rename(urlList().first(), mGroup);
FileOperations::rename(urlList().first(), mGroup, contextManager());
contextManager()->slotSelectionChanged();
}
}
......
......@@ -1161,6 +1161,7 @@ void MainWindow::slotDirListerCompleted()
}
d->mThumbnailView->scrollToSelectedIndex();
d->mViewMainPage->thumbnailBar()->scrollToSelectedIndex();
d->mFullScreenContent->thumbnailBar()->scrollToSelectedIndex();
}
void MainWindow::goToPrevious()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment