]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Maintain bookmark scroll position on bookmark move. https://redmine.stoutner.com...
authorSoren Stoutner <soren@stoutner.com>
Thu, 9 Apr 2026 16:50:42 +0000 (09:50 -0700)
committerSoren Stoutner <soren@stoutner.com>
Thu, 9 Apr 2026 16:50:42 +0000 (09:50 -0700)
doc/index.docbook
src/dialogs/BookmarksDialog.cpp
src/helpers/FilterListHelper.cpp
src/helpers/UserAgentHelper.cpp

index dbbe8ebe9e53b7b974127afa88c936719a64ba68..532ab16cc04a7f778bcb54b63c9731e56e9f143e 100644 (file)
             <para>
                 <ulink url="https://easylist.to/easylist/fanboy-annoyance.txt">Fanboy’s Annoyance List</ulink> is released under the
                 <ulink url="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported license</ulink>, which is
-                <ulink url="https://www.gnu.org/licenses/license-list.en.html#ccby">compatible with the GPLv3+</ulink>. This lists is included unchanged in Privacy Browser.
+                <ulink url="https://www.gnu.org/licenses/license-list.en.html#ccby">compatible with the GPLv3+</ulink>. This list is included unchanged in Privacy Browser.
             </para>
 
             <para>
index d4349aa8191badf70aacd76682a74891a2598838..1845df2a808d92c5b8fcad9fc0634a7490c91e51 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-3.0-or-later
- * SPDX-FileCopyrightText: 2023-2024 Soren Stoutner <soren@stoutner.com>
+ * SPDX-FileCopyrightText: 2023-2024, 2026 Soren Stoutner <soren@stoutner.com>
  *
  * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc/>.
  *
@@ -31,6 +31,7 @@
 
 // Qt toolkit headers.
 #include <QDebug>
+#include <QScrollBar>
 #include <QStandardItemModel>
 
 // Construct the class.
@@ -141,6 +142,9 @@ void BookmarksDialog::deleteItems() const
 
 void BookmarksDialog::populateBookmarks() const
 {
+    // Store the current vertical scroll value.
+    int verticalScrollValue = draggableTreeViewPointer->verticalScrollBar()->value();
+
     // Clear the current contents of the tree model.
     treeModelPointer->clear();
 
@@ -196,9 +200,12 @@ void BookmarksDialog::populateBookmarks() const
     // Populate the subfolders, starting with the root folder ID (`0`).
     populateSubfolders(rootItemNamePointer, 0);
 
-    // Expand all the folder.
+    // Expand all the folders.
     draggableTreeViewPointer->expandAll();
 
+    // Restore the vertical scroll value.
+    draggableTreeViewPointer->verticalScrollBar()->setValue(verticalScrollValue);
+
     // Update the UI.
     updateUi();
 }
index 40e508bddf44a77c2206c2b4b0b8e57bc1c7fae4..1f60c8ce2fe4c169c7a56a31150715ef3fb57910 100644 (file)
@@ -861,7 +861,11 @@ FilterListStruct* FilterListHelper::populateFilterList(const QString &filterList
     QFile filterListFile(filterListFileName);
 
     // Open the filter list file.
-    filterListFile.open(QIODevice::ReadOnly);
+    bool fileOpenSuccessful = filterListFile.open(QIODevice::ReadOnly);
+
+    // Exit here if the file open was not successful.
+    if (!fileOpenSuccessful)
+        return new FilterListStruct;
 
     // Create a filter list text stream.
     QTextStream filterListTextStream(&filterListFile);
index 576b267c71217426c3ddb6713be5875ca03f865e..f67348554c2576fc66946fa2465b3ce4513ecea0 100644 (file)
@@ -38,12 +38,12 @@ const QString UserAgentHelper::SAFARI_MACOS_DATABASE = QLatin1String("Safari mac
 
 // Define the public user agent constants.
 const QString UserAgentHelper::PRIVACY_BROWSER_USER_AGENT = QLatin1String("PrivacyBrowser/1.0");
-const QString UserAgentHelper::FIREFOX_LINUX_USER_AGENT = QLatin1String("Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0");
-const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QLatin1String("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36");
-const QString UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0");
-const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36");
-const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0");
-const QString UserAgentHelper::SAFARI_MACOS_USER_AGENT = QLatin1String("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_Z) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15");
+const QString UserAgentHelper::FIREFOX_LINUX_USER_AGENT = QLatin1String("Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0");
+const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QLatin1String("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36");
+const QString UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0");
+const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36");
+const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0");
+const QString UserAgentHelper::SAFARI_MACOS_USER_AGENT = QLatin1String("macOS: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15");
 
 // Construct the class.
 UserAgentHelper::UserAgentHelper() {