letsfindaway / OpenBoard

I'm using this fork to contribute features and fixes to the upstream project. In order to create good pull requests, I'm rebasing my feature branches, squashing and reordering commits, etc. If you fork this repository be aware that my development branches may rewrite history without prior notice.
http://openboard.ch/
GNU General Public License v3.0
9 stars 0 forks source link

Pasting unaccessible URL disables drag operations #123

Closed letsfindaway closed 1 year ago

letsfindaway commented 1 year ago

When pasting a URL to the board, which leads to an error (e.g. 404), the download dialog stays open on the board. After closing it, all operations involving dragging items are blocked, e.g. resizing, moving or rotating. The debug output of OpenBoard shows the following:

something has been dropped on the board! Url is:  "https://github.com/letsfindaway/OpenBoard/error"
Actual downloads size:  1
Actual downloads size:  1
"https://github.com/letsfindaway/OpenBoard/error" get finished with error :  QNetworkReply::ContentNotFoundError

A similar situation occurs when pasting a URL to content with a mime type OpenBoard cannot handle. Here however the download dialog closes automatically:

something has been dropped on the board! Url is:  "https://github.com/letsfindaway/OpenBoard/issues/123"
Actual downloads size:  1
Actual downloads size:  1
"https://github.com/letsfindaway/OpenBoard/issues/123" http get finished ...
ignoring mime type "text/html; charset=utf-8"
letsfindaway commented 1 year ago

The problematic code is here:

https://github.com/letsfindaway/OpenBoard/blob/9de37af2df1a7c0d88f71c94ab2db1815d082862/src/core/UBDownloadManager.cpp#L611-L624

In the error case, downloadError() is emitted. This signal is however not connected. Instead in all cases downloadFinished() should be emitted. The pSuccess parameter indicates whether the download was successful or not.

Looking further, I found the slot UBDownloadManager::onDownloadError(). This slot however does nothing useful and is also not connected. It should be removed.

letsfindaway commented 1 year ago

Closed as related branch was merged.