From cf5b01a5f40a060e312539a36b6f583f45dedbef Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 31 Aug 2022 01:07:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3wayland=E4=B8=8B=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=AF=BC=E8=87=B4=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E8=8F=9C=E5=8D=95=E9=98=BB=E5=A1=9E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 6 ++++++ src/UserInterface/ListView/klistview.cpp | 5 +++-- src/UserInterface/ListView/listview.cpp | 4 +++- src/UserInterface/ListView/rightlistview.cpp | 5 +++-- .../Widget/full_commonuse_widget.cpp | 10 ---------- .../Widget/full_commonuse_widget.h | 5 ----- .../Widget/full_function_widget.cpp | 10 ---------- src/UserInterface/Widget/full_function_widget.h | 5 ----- src/UserInterface/Widget/full_letter_widget.cpp | 10 ---------- src/UserInterface/Widget/full_letter_widget.h | 5 ----- .../Widget/full_searchresult_widget.cpp | 9 --------- .../Widget/full_searchresult_widget.h | 5 ----- src/UserInterface/mainwindow.cpp | 2 ++ src/UtilityFunction/utility.cpp | 17 ++++++++++------- 14 files changed, 27 insertions(+), 71 deletions(-) diff --git a/debian/changelog b/debian/changelog index 395da66..9184f9a 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ukui-menu (3.1.1-ok4~0831) yangtze; urgency=medium + + * close-cd # 131373 【wayland】【软件更新器】点击打开软件更新器后,开始菜单过6s左右才退出; + + -- lixueman Wed, 31 Aug 2022 00:52:08 +0800 + ukui-menu (3.1.1-ok4~0818) yangtze; urgency=medium * close-cd #125159 修改全屏下固定到收藏不生效问题 diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index fcf4480..d5eb537 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -2,6 +2,7 @@ #include "klistview.h" #include "utility.h" #include +#include #include "rightclickmenu.h" KListView::KListView(QWidget *parent): @@ -42,11 +43,11 @@ void KListView::updateData(QStringList data) void KListView::onClicked(QModelIndex index) { QVariant var = listmodel->data(index, Qt::DisplayRole); - if (var.isValid()) { QString desktopfp = var.value(); + myDebug() << "KListView点击应用" << desktopfp << "触发隐藏信号"; Q_EMIT sendHideMainWindowSignal(); - execApp(desktopfp); + QtConcurrent::run(execApp, QString(desktopfp)); } } diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp index 368f25a..c90d452 100755 --- a/src/UserInterface/ListView/listview.cpp +++ b/src/UserInterface/ListView/listview.cpp @@ -21,6 +21,7 @@ #include "utility.h" #include #include +#include ListView::ListView(QWidget *parent/*, int width, int height, int module*/): KListView(parent) @@ -107,8 +108,9 @@ void ListView::onClicked(QModelIndex index) if (var.value().at(1).toInt() == 0) { Q_EMIT sendAppClassificationBtnClicked(); } else { + myDebug() << "ListView打开应用触发隐藏"; Q_EMIT sendHideMainWindowSignal(); - execApp(desktopfp); + QtConcurrent::run(execApp, QString(desktopfp)); } } } diff --git a/src/UserInterface/ListView/rightlistview.cpp b/src/UserInterface/ListView/rightlistview.cpp index 7725222..5a456bb 100755 --- a/src/UserInterface/ListView/rightlistview.cpp +++ b/src/UserInterface/ListView/rightlistview.cpp @@ -22,6 +22,7 @@ #include #include #include +#include RightListView::RightListView(QWidget *parent): KListView(parent) @@ -128,12 +129,12 @@ void RightListView::keyPressEvent(QKeyEvent *e) void RightListView::onClicked(QModelIndex index) { - Q_EMIT sendHideMainWindowSignal(); QVariant var = listmodel->data(index, Qt::DisplayRole); QString desktopfp = var.value().at(0); if (var.isValid()) { QString desktopfp = var.value(); - execApp(desktopfp); + Q_EMIT sendHideMainWindowSignal(); + QtConcurrent::run(execApp, QString(desktopfp)); } } diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp index 6f138f1..05d9d14 100755 --- a/src/UserInterface/Widget/full_commonuse_widget.cpp +++ b/src/UserInterface/Widget/full_commonuse_widget.cpp @@ -147,7 +147,6 @@ void FullCommonUseWidget::initAppListWidget() m_listView->installEventFilter(this); m_scrollAreaWidLayout->addWidget(m_listView); m_listView->setFixedWidth(m_scrollAreaWid->width()); - connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullCommonUseWidget::execApplication); connect(m_listView, &FullListView::sendUpdateAppListSignal, this, &FullCommonUseWidget::updateListViewSlot); connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullCommonUseWidget::sendCollectViewUpdate); connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullCommonUseWidget::sendHideMainWindowSignal); @@ -185,15 +184,6 @@ void FullCommonUseWidget::fillAppList() resizeScrollAreaControls(); } -/** - * 执行应用程序 - */ -void FullCommonUseWidget::execApplication(QString desktopfp) -{ - Q_EMIT sendHideMainWindowSignal(); - execApp(desktopfp); -} - void FullCommonUseWidget::selectFirstItem() { m_listView->setCurrentIndex(m_listView->model()->index(0, 0)); diff --git a/src/UserInterface/Widget/full_commonuse_widget.h b/src/UserInterface/Widget/full_commonuse_widget.h index d13ad45..cfce3da 100755 --- a/src/UserInterface/Widget/full_commonuse_widget.h +++ b/src/UserInterface/Widget/full_commonuse_widget.h @@ -102,11 +102,6 @@ protected: bool eventFilter(QObject *watched, QEvent *event); public Q_SLOTS: - /** - * @brief Open the application - * @param arg: Desktop file path - */ - void execApplication(QString desktopfp); /** * @brief Update the application list slot function */ diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp index b07133f..09cc615 100755 --- a/src/UserInterface/Widget/full_function_widget.cpp +++ b/src/UserInterface/Widget/full_function_widget.cpp @@ -208,21 +208,11 @@ void FullFunctionWidget::insertAppList(QStringList desktopfplist) } listview->addData(m_data); - connect(listview, &FullListView::sendItemClickedSignal, this, &FullFunctionWidget::execApplication); connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullFunctionWidget::sendHideMainWindowSignal); connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullFunctionWidget::sendUpdateCommonView); connect(listview, &FullListView::sendCollectViewUpdate, this, &FullFunctionWidget::sendCollectViewUpdate); } -/** - * 执行应用程序 - */ -void FullFunctionWidget::execApplication(QString desktopfp) -{ - Q_EMIT sendHideMainWindowSignal(); - execApp(desktopfp); -} - void FullFunctionWidget::on_setAreaScrollBarValue(int value) { // m_scrollArea->verticalScrollBar()->setMaximum(maxmumValue); diff --git a/src/UserInterface/Widget/full_function_widget.h b/src/UserInterface/Widget/full_function_widget.h index 22e2a99..88493a0 100755 --- a/src/UserInterface/Widget/full_function_widget.h +++ b/src/UserInterface/Widget/full_function_widget.h @@ -142,11 +142,6 @@ protected: bool eventFilter(QObject *watched, QEvent *event); public Q_SLOTS: - /** - * @brief Open the application - * @param arg: Desktop file path - */ - void execApplication(QString desktopfp); /** * @brief Respond to button click * @param btn: QButtonGroup button diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index 64e7537..bd51f38 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -206,7 +206,6 @@ void FullLetterWidget::fillAppList() } listview->addData(m_data); - connect(listview, &FullListView::sendItemClickedSignal, this, &FullLetterWidget::execApplication); connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullLetterWidget::sendHideMainWindowSignal); connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullLetterWidget::sendUpdateCommonView); connect(listview, &FullListView::sendCollectViewUpdate, this, &FullLetterWidget::sendCollectViewUpdate); @@ -216,15 +215,6 @@ void FullLetterWidget::fillAppList() resizeScrollAreaControls(); } -/** - * 执行应用程序 - */ -void FullLetterWidget::execApplication(QString desktopfp) -{ - Q_EMIT sendHideMainWindowSignal(); - execApp(desktopfp); -} - void FullLetterWidget::on_setAreaScrollBarValue(int value) { // m_scrollArea->verticalScrollBar()->setMaximum(maxmumValue); diff --git a/src/UserInterface/Widget/full_letter_widget.h b/src/UserInterface/Widget/full_letter_widget.h index 9799ee4..72c25a0 100755 --- a/src/UserInterface/Widget/full_letter_widget.h +++ b/src/UserInterface/Widget/full_letter_widget.h @@ -147,11 +147,6 @@ public Q_SLOTS: * @param btn: QButtonGroup button */ void btnGroupClickedSlot(QAbstractButton *btn); - /** - * @brief Open the application - * @param arg: Desktop file path - */ - void execApplication(QString desktopfp); /** * @brief Update application list slot function */ diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp index e42d151..a37fc83 100755 --- a/src/UserInterface/Widget/full_searchresult_widget.cpp +++ b/src/UserInterface/Widget/full_searchresult_widget.cpp @@ -136,7 +136,6 @@ void FullSearchResultWidget::initAppListWidget() m_listView->installEventFilter(this); m_scrollAreaWidLayout->addWidget(m_listView); m_listView->setFixedWidth(m_scrollArea->width()); - connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullSearchResultWidget::execApplication); connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullSearchResultWidget::sendHideMainWindowSignal); connect(m_listView, &FullListView::sendSetslidebar, this, &FullSearchResultWidget::onSetSlider); connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullSearchResultWidget::sendCollectViewUpdate); @@ -148,14 +147,6 @@ void FullSearchResultWidget::fillAppList() m_listView->addData(m_data); resizeScrollAreaControls(); } -/** - * 执行应用程序 - */ -void FullSearchResultWidget::execApplication(QString desktopfp) -{ - Q_EMIT sendHideMainWindowSignal(); - execApp(desktopfp); -} void FullSearchResultWidget::updateAppListView(QVector arg) { diff --git a/src/UserInterface/Widget/full_searchresult_widget.h b/src/UserInterface/Widget/full_searchresult_widget.h index e557b7d..73a42df 100755 --- a/src/UserInterface/Widget/full_searchresult_widget.h +++ b/src/UserInterface/Widget/full_searchresult_widget.h @@ -90,11 +90,6 @@ protected: bool eventFilter(QObject *watched, QEvent *event); public Q_SLOTS: - /** - * @brief Open the application - * @param arg: Desktop file path - */ - void execApplication(QString desktopfp); void selectFirstItemTab(); diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index c45be17..13b1b23 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -1316,11 +1316,13 @@ void MainWindow::hideWindow() { myDebug() << "调用开始菜单隐藏"; if (m_fullWindow->isVisible()) { + myDebug() << "全屏窗口隐藏"; m_fullWindow->hide(); m_fullWindow->resetEditline(); this->clearFocus(); m_isFullScreen = true; } else { + myDebug() << "默认窗口隐藏"; this->hide(); m_topStackedWidget->setCurrentIndex(0); m_lineEdit->clear(); diff --git a/src/UtilityFunction/utility.cpp b/src/UtilityFunction/utility.cpp index 40c6f08..1e320a3 100755 --- a/src/UtilityFunction/utility.cpp +++ b/src/UtilityFunction/utility.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "ukuimenuinterface.h" #define DATABASENAME QDir::homePath()+"/.config/ukui/"+"UkuiMenu.db" @@ -710,14 +711,16 @@ bool deleteAppRecord(QString desktopfn) void execApp(QString desktopfp) { + QDBusReply result; + if (QDBusConnection::connectToBus(QDBusConnection::SessionBus, QString("com.kylin.AppManager")).isConnected()) { + QDBusInterface iface("com.kylin.AppManager", "/com/kylin/AppManager", "com.kylin.AppManager"); + if (iface.isValid()) { + result = iface.call("LaunchApp", desktopfp); + myDebug() << "LaunchApp desktopFile:" << desktopfp; + } + } - QDBusInterface iface("com.kylin.AppManager", - "/com/kylin/AppManager", - "com.kylin.AppManager", - QDBusConnection::sessionBus()); - QDBusReply res = iface.call("LaunchApp", desktopfp); - - if (!res.isValid() || !res) { + if (!result.isValid() || !result) { UkuiMenuInterface interface;