qpdfview shows warning independent of the quiet option

Bug #1407014 reported by Martin Babutzka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qpdfview
Fix Released
Low
Adam Reichold

Bug Description

Hello,

I noticed the effect that qpdfview shows a warning on missing files on start when it tries to restore the stored tabs. These warnings appear independent of the --quiet option or the quiet=true constant in main.cpp.

I tracked down the reason for this:
main.cpp:422 mainWindow = new MainWindow();
database.cpp:167 emit tabRestored ...
mainwindow.cpp:2021 if(openInNewTab(absoluteFilePath))
mainwindow.cpp:237 bool MainWindow::openInNewTab(const QString& filePath, int page, const QRectF& highlight, bool quiet)
--> quiet variable out of scope and not transported to the call. Default quiet=false resulting in
mainwindow.cpp:303 QMessageBox::warning(this, tr("Warning"), tr("Could not open '%1'.").arg(filePath));

This is annoying because I often close qpdfview with some tabs opened but some of these are temporary files or mounted externally - I dont want to have warnings for all these files missing on a fresh start of a qpdfview instance. This still applies to my most recent version 0.4.13 I got.

Patch proposal:
mainwindow.cpp
2021c2021
< if(openInNewTab(absoluteFilePath))
---
> if(openInNewTab(absoluteFilePath,-1,QRectF(),true))

OR track the global/argument "quiet" setting into the MainWindow class, maybe as MainWindow(bool quiet=false).

Kind regards,
Martin

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Martin,

thanks for taking the time to report this! I agree that the restoration of previously opened tabs should not generate any warnings (since the application does this 'on its own' and the warning is intended as user feedback). Hence I have integrated your suggested patch into trunk. Could you build from source (there a automatically built packages for Ubuntu, openSUSE and Arch available) and test at least trunk revision 1815? Thank you.

Best regards, Adam.

Changed in qpdfview:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → Adam Reichold (adamreichold)
milestone: none → 0.4.14
Revision history for this message
Martin Babutzka (martin-babutzka) wrote :

Fix resolved the problem. Thanks for the fast reaction.

I am on your PPA right now in the hope to get the most advanced version of the imo best Linux PDF viewer I have seen. Comments and selection are still little intuitive. But the code looks decent so might be I join in on development.

Changed in qpdfview:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.