+void TabWidget::reloadAndBypassCache() const
+{
+ // Reload the website, bypassing the cache.
+ currentWebEnginePagePointer->triggerAction(QWebEnginePage::ReloadAndBypassCache);
+}
+
+void TabWidget::saveArchive()
+{
+ // Get the suggested file name.
+ QString suggestedFileName = currentPrivacyWebEngineViewPointer->title() + ".mht";
+
+ // Get the download directory.
+ QString downloadDirectory = Settings::downloadDirectory();
+
+ // Resolve the system download directory if specified.
+ if (downloadDirectory == QLatin1String("System Download Directory"))
+ downloadDirectory = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+
+ // Get a file path from the file picker.
+ QString saveFilePath = QFileDialog::getSaveFileName(this, i18nc("Save file dialog caption", "Save File"), downloadDirectory + QLatin1Char('/') + suggestedFileName);
+
+ // Save the webpage as an archive if the file save path is populated.
+ if (!saveFilePath.isEmpty())
+ {
+ // Update the download directory if specified.
+ if (Settings::autoUpateDownloadDirectory())
+ updateDownloadDirectory(saveFilePath);
+
+ // Set the saving archive flag. Otherwise, a second download tries to run.
+ savingArchive = true;
+
+ // Save the archive.
+ currentWebEnginePagePointer->save(saveFilePath);
+ }
+}
+