]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/windows/BrowserWindow.cpp
Display Unicode URLs in Punycode. https://redmine.stoutner.com/issues/1108
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.cpp
index 805b592f5326375bb7e1b91a48beb8648657317c..8382e0085806359ba141d0e34cc0d8dba820cddf 100644 (file)
@@ -225,7 +225,8 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer)
     searchEngineYahooActionPointer->setIcon(QIcon::fromTheme(QLatin1String("im-yahoo"), QIcon::fromTheme(QLatin1String("edit-find"))));
     searchEngineCustomActionPointer->setIcon(QIcon::fromTheme(QLatin1String("edit-find")));
     zoomFactorActionPointer->setIcon(QIcon::fromTheme(QLatin1String("zoom-fit-best")));
-    viewBookmarksToolBarActionPointer->setIcon(QIcon::fromTheme(QLatin1String("bookmarks")));
+    editBookmarksActionPointer->setIcon(QIcon::fromTheme(QLatin1String("bookmark-edit"), QIcon::fromTheme(QLatin1String("bookmark-new"))));
+    viewBookmarksToolBarActionPointer->setIcon(QIcon::fromTheme(QLatin1String("bookmarks"), QIcon::fromTheme(QLatin1String("bookmark-new"))));
     domainSettingsActionPointer->setIcon(QIcon::fromTheme(QLatin1String("settings-configure"), QIcon::fromTheme(QLatin1String("preferences-desktop"))));
     cookiesActionPointer->setIcon(QIcon::fromTheme(QLatin1String("preferences-web-browser-cookies"), QIcon::fromTheme(QLatin1String("appointment-new"))));
     findCaseSensitiveActionPointer->setIcon(QIcon::fromTheme(QLatin1String("format-text-lowercase"), QIcon::fromTheme(QLatin1String("/usr/share/icons/gnome/32x32/apps/fonts.png"))));
@@ -342,6 +343,8 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer)
     connect(findCaseSensitiveActionPointer, SIGNAL(triggered()), this, SLOT(toggleFindCaseSensitive()));
     connect(hideFindTextActionPointer, SIGNAL(triggered()), this, SLOT(hideFindTextActions()));
 
+
+
     // Setup the GUI based on the browserwindowui.rc file.
     setupGUI(StandardWindowOption::Default, ("browserwindowui.rc"));
 
@@ -644,7 +647,7 @@ void BrowserWindow::addFinalBookmarkFolderMenuActions(QMenu *menuPointer, double
     // Add the edit folder action to the menu if this is not the root bookmark menu.
     if (folderId != 0)
     {
-        QAction *editFolderActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("edit-entry")), i18nc("The edit folder action", "Edit Folder"), [=]
+        QAction *editFolderActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("document-edit")), i18nc("The edit folder action", "Edit Folder"), [=]
             {
                 // Get the current tab favorite icon.
                 QIcon currentTabFavoriteIcon = tabWidgetPointer->getCurrentTabFavoritIcon();
@@ -665,7 +668,7 @@ void BrowserWindow::addFinalBookmarkFolderMenuActions(QMenu *menuPointer, double
     }
 
     // Add the delete folder action to the menu.
-    QAction *deleteFolderActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("delete")), i18nc("Delete folder context menu entry", "Delete Folder"), [=]
+    QAction *deleteFolderActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18nc("Delete folder context menu entry", "Delete Folder"), [=]
         {
             // Create an items to delete list.
             QList<int>* itemsToDeleteListPointer = new QList<int>;
@@ -1296,7 +1299,7 @@ void BrowserWindow::showBookmarkContextMenu(const QPoint &point)
             bookmarkContextMenuPointer->addSeparator();
 
             // Add the edit action to the menu.
-            bookmarkContextMenuPointer->addAction(QIcon::fromTheme(QLatin1String("edit-entry")), i18nc("Edit bookmark context menu entry", "Edit"), [=]
+            bookmarkContextMenuPointer->addAction(QIcon::fromTheme(QLatin1String("document-edit")), i18nc("Edit bookmark context menu entry", "Edit"), [=]
                 {
                     // Get the current tab favorite icon.
                     QIcon currentTabFavoriteIcon = tabWidgetPointer->getCurrentTabFavoritIcon();
@@ -1330,7 +1333,7 @@ void BrowserWindow::showBookmarkContextMenu(const QPoint &point)
             bookmarkContextMenuPointer->addSeparator();
 
             // Add the delete action to the menu.
-            bookmarkContextMenuPointer->addAction(QIcon::fromTheme(QLatin1String("delete")), i18nc("Delete bookmark context menu entry", "Delete"), [=]
+            bookmarkContextMenuPointer->addAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18nc("Delete bookmark context menu entry", "Delete"), [=]
                 {
                     // Get the parent folder ID.
                     double parentFolderId = BookmarksDatabase::getParentFolderId(databaseId);
@@ -1965,8 +1968,8 @@ void BrowserWindow::updateSearchEngineLabel(const QString &searchEngineString) c
 
 void BrowserWindow::updateUrlLineEdit(const QUrl &newUrl)
 {
-    // Get the new URL string.
-    QString newUrlString = newUrl.toString();
+    // Get the new URL string in encoded form, which displays punycode.
+    QString newUrlString = newUrl.toEncoded();
 
     // Update the view source actions.
     if (newUrlString.startsWith(QLatin1String("view-source:")))  // The source is currently being viewed.