X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fdialogs%2FBookmarksDialog.cpp;fp=src%2Fdialogs%2FBookmarksDialog.cpp;h=683d24059e69be00037ca100c7c032036dfd2ece;hp=0fa2b4f983f63721973139ad0b3f363d8265c789;hb=5e66d268d985552aeeae3e9ae7d0967d359a557f;hpb=2374794c9a71745376c9d2db0ee403e6b0969d39 diff --git a/src/dialogs/BookmarksDialog.cpp b/src/dialogs/BookmarksDialog.cpp index 0fa2b4f..683d240 100644 --- a/src/dialogs/BookmarksDialog.cpp +++ b/src/dialogs/BookmarksDialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2023 Soren Stoutner . + * Copyright 2023-2024 Soren Stoutner . * * This file is part of Privacy Browser PC . * @@ -34,8 +34,8 @@ #include // Construct the class. -BookmarksDialog::BookmarksDialog(QString currentWebsiteTitle, QString currentWebsiteUrl, QIcon currentWebsiteFavorieIcon) : - QDialog(nullptr), websiteFavoriteIcon(currentWebsiteFavorieIcon), websiteTitle(currentWebsiteTitle), websiteUrl(currentWebsiteUrl) +BookmarksDialog::BookmarksDialog(QWidget *parentWidgetPointer, QIcon currentWebsiteFavorieIcon, QString currentWebsiteTitle, QString currentWebsiteUrl) : + QDialog(parentWidgetPointer), websiteFavoriteIcon(currentWebsiteFavorieIcon), websiteTitle(currentWebsiteTitle), websiteUrl(currentWebsiteUrl) { // Set the dialog window title. setWindowTitle(i18nc("The bookmarks dialog window title", "Bookmarks")); @@ -301,7 +301,7 @@ void BookmarksDialog::selectSubfolderContents(const QModelIndex &parentModelInde } } -void BookmarksDialog::showAddBookmarkDialog() const +void BookmarksDialog::showAddBookmarkDialog() { // Return the most recently selected index. QModelIndex currentIndex = treeSelectionModelPointer->currentIndex(); @@ -322,7 +322,7 @@ void BookmarksDialog::showAddBookmarkDialog() const } // Instantiate an add bookmark dialog. - AddBookmarkDialog *addBookmarkDialogPointer = new AddBookmarkDialog(websiteTitle, websiteUrl, websiteFavoriteIcon, parentFolderId); + AddBookmarkDialog *addBookmarkDialogPointer = new AddBookmarkDialog(this, websiteTitle, websiteUrl, websiteFavoriteIcon, parentFolderId); // Update the displayed bookmarks when a new one is added. connect(addBookmarkDialogPointer, SIGNAL(bookmarkAdded()), this, SLOT(refreshBookmarks())); @@ -331,7 +331,7 @@ void BookmarksDialog::showAddBookmarkDialog() const addBookmarkDialogPointer->show(); } -void BookmarksDialog::showAddFolderDialog() const +void BookmarksDialog::showAddFolderDialog() { // Get the most recently selected index. QModelIndex currentIndex = treeSelectionModelPointer->currentIndex(); @@ -352,7 +352,7 @@ void BookmarksDialog::showAddFolderDialog() const } // Instantiate an add folder dialog. - AddFolderDialog *addFolderDialogPointer = new AddFolderDialog(websiteFavoriteIcon, parentFolderId); + AddFolderDialog *addFolderDialogPointer = new AddFolderDialog(this, websiteFavoriteIcon, parentFolderId); // Update the displayed bookmarks when a folder is added. connect(addFolderDialogPointer, SIGNAL(folderAdded()), this, SLOT(refreshBookmarks())); @@ -370,7 +370,7 @@ void BookmarksDialog::showEditDialog() if (currentIndex.siblingAtColumn(IS_FOLDER_COLUMN).data().toInt() == 1) // The selected item is a folder. { // Instantiate an edit folder dialog. - QDialog *editFolderDialogPointer = new EditFolderDialog(currentIndex.siblingAtColumn(DATABASE_ID_COLUMN).data().toInt(), websiteFavoriteIcon); + QDialog *editFolderDialogPointer = new EditFolderDialog(this, currentIndex.siblingAtColumn(DATABASE_ID_COLUMN).data().toInt(), websiteFavoriteIcon); // Show the dialog. editFolderDialogPointer->show(); @@ -381,7 +381,7 @@ void BookmarksDialog::showEditDialog() else // The selected item is a bookmark. { // Instantiate an edit bookmark dialog. - QDialog *editBookmarkDialogPointer = new EditBookmarkDialog(currentIndex.siblingAtColumn(DATABASE_ID_COLUMN).data().toInt(), websiteFavoriteIcon); + QDialog *editBookmarkDialogPointer = new EditBookmarkDialog(this, currentIndex.siblingAtColumn(DATABASE_ID_COLUMN).data().toInt(), websiteFavoriteIcon); // Show the dialog. editBookmarkDialogPointer->show();