From 96b0f0f2beb255c0df924a60fc6ed224078e7cba Mon Sep 17 00:00:00 2001 From: lizhiyuan Date: Mon, 29 Aug 2022 20:19:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20spk=20=E6=90=9C=E7=B4=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index c89262a..da22741 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -94,7 +94,7 @@ Widget::Widget(DBlurEffectWidget *parent) : connect(searchEdit, &DSearchEdit::returnPressed, this, [=]() { qDebug() << "触发了搜索,呜啦啦啦!"; - QString searchtext = searchEdit->text(); + QString searchtext = searchEdit->text().replace("\r",""); if(!searchtext.isEmpty()) { qDebug() << searchEdit->text(); @@ -1308,13 +1308,16 @@ void Widget::on_stackedWidget_currentChanged(int arg1) void Widget::on_webEngineView_urlChanged(const QUrl &arg1) { //分析出服务器中的分类名称 - QStringList url_ = arg1.path().split("/"); + QStringList url_ = arg1.path().replace("//", "/").split("/"); QString pname; - if(url_.size() > 3) + qDebug() << "URL size:" << url_.size(); + if (url_.size() > 3) { type_name = url_[2]; pname = url_[3]; } + qDebug() << "type_name:" << type_name << ";pname" << pname; + //如果是app.json就打开详情页 if(arg1.path().right(8) == "app.json") { @@ -1328,8 +1331,8 @@ void Widget::on_webEngineView_urlChanged(const QUrl &arg1) ui->label_appname->clear(); ui->pushButton_download->setEnabled(false); ui->stackedWidget->setCurrentIndex(2); - qDebug() << "https://d.store.deepinos.org.cn/" + type_name + "/" + pname; - qDebug() << "链接地址:" << arg1; + + qDebug() << "程序跳转链接地址:" << arg1; /* load.cancel(); // 打开并发加载线程前关闭正在执行的线程