From 0446e0e9e20e2deac880600053fc79a23ba5340e Mon Sep 17 00:00:00 2001
From: Super User <root@localhost.localdomain>
Date: Thu, 21 Sep 2023 18:32:29 +0800
Subject: [PATCH 2/2] add boot.log file judge

---
 application/loglistview.cpp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/application/loglistview.cpp b/application/loglistview.cpp
index 1e44d72..e426367 100644
--- a/application/loglistview.cpp
+++ b/application/loglistview.cpp
@@ -197,15 +197,17 @@ void LogListView::initUI()
         m_pModel->appendRow(item);
         m_logTypes.push_back(BOOT_KLU_TREE_DATA);
     } else {
-        item = new QStandardItem(QIcon::fromTheme("dp_start"), DApplication::translate("Tree", "Boot Log"));
-        setIconSize(QSize(ICON_SIZE, ICON_SIZE));
-        item->setToolTip(DApplication::translate("Tree", "Boot Log")); // add by Airy for bug 16245
-        item->setData(BOOT_TREE_DATA, ITEM_DATE_ROLE);
-        item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT));
-        item->setData(VListViewItemMargin, Dtk::MarginsRole);
-        item->setAccessibleText("Boot Log");
-        m_pModel->appendRow(item);
-        m_logTypes.push_back(BOOT_TREE_DATA);
+	    if (isFileExist("/var/log/boot.log")) {
+        	item = new QStandardItem(QIcon::fromTheme("dp_start"), DApplication::translate("Tree", "Boot Log"));
+        	setIconSize(QSize(ICON_SIZE, ICON_SIZE));
+        	item->setToolTip(DApplication::translate("Tree", "Boot Log")); // add by Airy for bug 16245
+        	item->setData(BOOT_TREE_DATA, ITEM_DATE_ROLE);
+        	item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT));
+        	item->setData(VListViewItemMargin, Dtk::MarginsRole);
+        	item->setAccessibleText("Boot Log");
+        	m_pModel->appendRow(item);
+        	m_logTypes.push_back(BOOT_TREE_DATA);
+	}
     }
     if (isCentos) {
         item = new QStandardItem(QIcon::fromTheme("dp_d"), DApplication::translate("Tree", "dnf Log"));
-- 
2.41.0

