aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-04 13:28:56 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-04 11:17:12 +0100
commit2d3aa901727da641eca5daae7d5cee3eedca6e7f (patch)
tree499311db2c4500755c99d73a341aceceac9072fd /src/browsertab.cpp
parent3d795469818177c5b9932df3577bb6e9c1d0ab2e (diff)
Remove toggleIsFavourite - no longer needed
also rename addToFavouritesPopup to showFavouritesPopup
Diffstat (limited to 'src/browsertab.cpp')
-rw-r--r--src/browsertab.cpp35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index c8fc307..820952a 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -188,37 +188,6 @@ void BrowserTab::reloadPage()
this->navigateTo(this->current_location, DontPush);
}
-void BrowserTab::toggleIsFavourite()
-{
- toggleIsFavourite(not this->ui->fav_button->isChecked());
-}
-
-void BrowserTab::toggleIsFavourite(bool shouldBeFavourite)
-{
- // isFavourite is the "new" state of the checkbox, so when it's true
- // we yet need to add it.
- if (shouldBeFavourite)
- {
- kristall::favourites.addUnsorted(this->current_location, this->page_title);
- }
- else
- {
- auto answer = QMessageBox::question(
- this,
- "Kristall",
- tr("Do you really want to remove this page from your favourites?")
- );
- if(answer != QMessageBox::Yes)
- {
- this->updateUI();
- return;
- }
- kristall::favourites.removeUrl(this->current_location);
- }
-
- this->updateUI();
-}
-
void BrowserTab::focusUrlBar()
{
this->ui->url_bar->setFocus(Qt::ShortcutFocusReason);
@@ -873,7 +842,7 @@ void BrowserTab::pushToHistory(const QUrl &url)
this->updateUI();
}
-void BrowserTab::addToFavouritesPopup()
+void BrowserTab::showFavouritesPopup()
{
// We add it to favourites immediately.
kristall::favourites.addUnsorted(this->current_location, this->page_title);
@@ -895,7 +864,7 @@ void BrowserTab::addToFavouritesPopup()
void BrowserTab::on_fav_button_clicked()
{
- this->addToFavouritesPopup();
+ this->showFavouritesPopup();
}
void BrowserTab::on_text_browser_anchorClicked(const QUrl &url, bool open_in_new_tab)