// Prevent the notification from being autodeleted if it is closed. Otherwise, the updates to the notification below cause a crash.
fileDownloadNotificationPointer->setAutoDelete(false);
- // Display the notification.
- fileDownloadNotificationPointer->sendEvent();
-
// Handle clicks on the cancel button.
connect(fileDownloadNotificationPointer, &KNotification::action1Activated, [webEngineDownloadItemPointer, saveFileName] ()
{
fileDownloadNotificationPointer->update();
});
+ // Display the notification.
+ fileDownloadNotificationPointer->sendEvent();
+
// Start the download.
webEngineDownloadItemPointer->accept();
}