]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/widgets/TabWidget.cpp
Additional fix for notifications on Xfce. https://redmine.stoutner.com/issues/1017
[PrivacyBrowserPC.git] / src / widgets / TabWidget.cpp
index dd11a6776c0f0fdc798fe4492879ff2ce5a84a08..84cd3aca089de34bcd188e3e5baa006508254595 100644 (file)
@@ -673,6 +673,24 @@ std::list<QNetworkCookie>* TabWidget::getCookieList() const
     return currentPrivacyWebEngineViewPointer->cookieListPointer;
 }
 
+QIcon TabWidget::getCurrentTabFavoritIcon() const
+{
+    // Return the current Privacy WebEngine favorite icon.
+    return currentPrivacyWebEngineViewPointer->favoriteIcon;
+}
+
+QString TabWidget::getCurrentTabTitle() const
+{
+    // Return the current Privacy WebEngine title.
+    return currentPrivacyWebEngineViewPointer->title();
+}
+
+QString TabWidget::getCurrentTabUrl() const
+{
+    // Return the current Privacy WebEngine URL as a string.
+    return currentPrivacyWebEngineViewPointer->url().toString();
+}
+
 QString& TabWidget::getDomainSettingsName() const
 {
     // Return the domain settings name.
@@ -918,9 +936,6 @@ void TabWidget::showSaveDialog(QWebEngineDownloadItem *webEngineDownloadItemPoin
                 // 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] ()
                 {
@@ -985,6 +1000,9 @@ void TabWidget::showSaveDialog(QWebEngineDownloadItem *webEngineDownloadItemPoin
                     fileDownloadNotificationPointer->update();
                 });
 
+                // Display the notification.
+                fileDownloadNotificationPointer->sendEvent();
+
                 // Start the download.
                 webEngineDownloadItemPointer->accept();
             }