2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Removed App::wnd from classes that have pointer to Window::Controller.

This commit is contained in:
23rd
2021-02-03 06:31:11 +03:00
committed by John Preston
parent 0783a682dc
commit 0b4d0b83c2
12 changed files with 71 additions and 79 deletions

View File

@@ -713,14 +713,14 @@ void Inner::updateSelected() {
_pressed = _selected;
if (row >= 0 && col >= 0) {
auto layout = _rows.at(row).items.at(col);
if (const auto w = App::wnd()) {
if (const auto previewDocument = layout->getPreviewDocument()) {
w->showMediaPreview(
Data::FileOrigin(),
previewDocument);
} else if (auto previewPhoto = layout->getPreviewPhoto()) {
w->showMediaPreview(Data::FileOrigin(), previewPhoto);
}
if (const auto previewDocument = layout->getPreviewDocument()) {
_controller->widget()->showMediaPreview(
Data::FileOrigin(),
previewDocument);
} else if (auto previewPhoto = layout->getPreviewPhoto()) {
_controller->widget()->showMediaPreview(
Data::FileOrigin(),
previewPhoto);
}
}
}
@@ -740,12 +740,14 @@ void Inner::showPreview() {
int row = _pressed / MatrixRowShift, col = _pressed % MatrixRowShift;
if (row < _rows.size() && col < _rows.at(row).items.size()) {
auto layout = _rows.at(row).items.at(col);
if (const auto w = App::wnd()) {
if (const auto previewDocument = layout->getPreviewDocument()) {
_previewShown = w->showMediaPreview(Data::FileOrigin(), previewDocument);
} else if (const auto previewPhoto = layout->getPreviewPhoto()) {
_previewShown = w->showMediaPreview(Data::FileOrigin(), previewPhoto);
}
if (const auto previewDocument = layout->getPreviewDocument()) {
_previewShown = _controller->widget()->showMediaPreview(
Data::FileOrigin(),
previewDocument);
} else if (const auto previewPhoto = layout->getPreviewPhoto()) {
_previewShown = _controller->widget()->showMediaPreview(
Data::FileOrigin(),
previewPhoto);
}
}
}