Skip to content

Commit

Permalink
fix: opening files from command line
Browse files Browse the repository at this point in the history
  • Loading branch information
g-fb committed Apr 1, 2022
1 parent 51ad93a commit af80d0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void MainWindow::openMangaFolder()

void MainWindow::loadImages(const QString &path, bool recursive)
{
if (m_currentPath == m_view->manga()) {
if (!m_currentPath.isEmpty() && m_currentPath == m_view->manga()) {
m_view->goToPage(m_startPage);
return;
}
Expand Down
3 changes: 3 additions & 0 deletions src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ void View::setArchive(KArchive *newArchive)

void View::goToPage(int number)
{
if (m_images.isEmpty()) {
return;
}
verticalScrollBar()->setValue(m_start[number]);
}

Expand Down

0 comments on commit af80d0b

Please sign in to comment.