Skip to content

Commit

Permalink
fix: 【ARM64】【LOONG64】if not AMD64 platform, do not show ai search config
Browse files Browse the repository at this point in the history
Description: 【ARM64】【LOONG64】if not AMD64 platform, do not show ai search config

Log:

Bug: BUG-295519
  • Loading branch information
lichaofan2008 authored and deepin-bot[bot] committed Dec 18, 2024
1 parent 8322b59 commit 97da4a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/grand-search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ set(BIN_NAME ${SEARCH_BIN_NAME})
# 集成测试标签
ADD_DEFINITIONS(-DENABLE_ACCESSIBILITY)

if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips"
OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"
OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw"
OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64"
)
message(${CMAKE_SYSTEM_PROCESSOR} ": disable ai search")
else()
message(${CMAKE_SYSTEM_PROCESSOR} ": enable ai search")
ADD_DEFINITIONS(-DENABLE_AI_SEARCH)
endif()

# 依赖包
find_package(PkgConfig REQUIRED)
find_package(DtkWidget REQUIRED)
Expand Down
11 changes: 10 additions & 1 deletion src/grand-search/gui/searchconfig/indexwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,25 @@ IndexWidget::IndexWidget(QWidget *parent)
m_groupLabel = new QLabel(tr("Index"));
DFontSizeManager::instance()->bind(m_groupLabel, DFontSizeManager::T5, QFont::Bold);

m_intelligent = new IntelligentRetrievalWidget(this);
m_mainLayout->addWidget(m_groupLabel);

#ifdef ENABLE_AI_SEARCH
// 目前非amd64架构,用不了AI搜索
m_intelligent = new IntelligentRetrievalWidget(this);
m_mainLayout->addWidget(m_intelligent);
#endif

m_mainLayout->addSpacing(10);
m_mainLayout->addWidget(m_blackListWidget);
}

bool IndexWidget::onCloseEvent()
{
#ifdef ENABLE_AI_SEARCH
return m_intelligent->onCloseEvent();
#else
return true;
#endif
}

IndexWidget::~IndexWidget()
Expand Down

0 comments on commit 97da4a6

Please sign in to comment.