diff --git a/src/content-widget.cpp b/src/content-widget.cpp index 8972807..469b2a5 100644 --- a/src/content-widget.cpp +++ b/src/content-widget.cpp @@ -253,7 +253,7 @@ QString ContentWidget::getTitleName(const int& type) { } /** - * @brief ContentWidget::clearLayout 清空搜索结果列表 + * @brief ContentWidget::clearLayout 清空某个布局 * @param layout 需要清空的布局 */ void ContentWidget::clearLayout(QLayout * layout) { diff --git a/src/control/search-detail-view.cpp b/src/control/search-detail-view.cpp index a7a3d07..be7df2c 100644 --- a/src/control/search-detail-view.cpp +++ b/src/control/search-detail-view.cpp @@ -209,7 +209,9 @@ void SearchDetailView::setupWidget(const int& type, const QString& path) { void SearchDetailView::execActions(const int& type, const int& option, const QString& path) { switch (option) { case OptionView::Options::Open: { - openAction(type, path); + if (openAction(type, path)) { + writeConfigFile(path); + } break; } case OptionView::Options::Shortcut: { @@ -243,7 +245,6 @@ bool SearchDetailView::openAction(const int& type, const QString& path) { GDesktopAppInfo * desktopAppInfo = g_desktop_app_info_new_from_filename(path.toLocal8Bit().data()); g_app_info_launch(G_APP_INFO(desktopAppInfo),nullptr, nullptr, nullptr); g_object_unref(desktopAppInfo); - writeConfigFile(path); return true; break; } @@ -255,7 +256,6 @@ bool SearchDetailView::openAction(const int& type, const QString& path) { connect(process, static_cast(&QProcess::finished), this, [ = ]() { process->deleteLater(); }); - writeConfigFile(path); return true; break; } @@ -266,11 +266,11 @@ bool SearchDetailView::openAction(const int& type, const QString& path) { connect(process, static_cast(&QProcess::finished), this, [ = ]() { process->deleteLater(); }); - writeConfigFile(path); return true; break; } default: + return false; break; } }