aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-17 01:29:30 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-17 01:29:30 +0200
commit5b14fc424462a5d3a5a509bd177c04e9cba2ce17 (patch)
treead5e9b685be26d22d570ba4788a9b01a65ceb531 /src/browsertab.cpp
parent03253a724b6fdb3f511510d10c3e62615e305cf2 (diff)
downloadkristall-5b14fc424462a5d3a5a509bd177c04e9cba2ce17.tar.gz
Makes gemini protocol handler a bit more robust.Makes style preview a file in about: instead of hardcoding it. Starts to implement the options menu for redirection configuration.
Diffstat (limited to 'src/browsertab.cpp')
-rw-r--r--src/browsertab.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index 4e5f25c..09bb56c 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -59,6 +59,8 @@ BrowserTab::BrowserTab(MainWindow *mainWindow) : QWidget(nullptr),
this->ui->text_browser->setVisible(true);
this->ui->text_browser->setContextMenuPolicy(Qt::CustomContextMenu);
+
+ connect(this->ui->url_bar, &SearchBar::escapePressed, this, &BrowserTab::on_url_bar_escapePressed);
}
BrowserTab::~BrowserTab()
@@ -156,7 +158,7 @@ void BrowserTab::focusUrlBar()
void BrowserTab::on_url_bar_returnPressed()
{
- QUrl url{this->ui->url_bar->text()};
+ QUrl url { this->ui->url_bar->text().trimmed() };
if (url.scheme().isEmpty())
{
@@ -166,6 +168,11 @@ void BrowserTab::on_url_bar_returnPressed()
this->navigateTo(url, PushImmediate);
}
+void BrowserTab::on_url_bar_escapePressed()
+{
+ this->ui->url_bar->setText(this->current_location.toString(QUrl::FullyEncoded));
+}
+
void BrowserTab::on_refresh_button_clicked()
{
reloadPage();
@@ -443,8 +450,6 @@ void BrowserTab::on_redirected(const QUrl &uri, bool is_permanent)
}
}
- // TODO: Implement cross-protocol redirections
- // TODO: Implement cross-host redirection
if (this->startRequest(uri))
{
redirection_count += 1;