From 3ca51bee00e6c97c7f6cf79128168e3ea672361a Mon Sep 17 00:00:00 2001 From: ut001910 Date: Tue, 29 Oct 2024 15:00:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20fleming=E5=AE=9A=E5=88=B6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=AD=98=E5=82=A8=E5=8E=8B=E7=BC=A9=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=85=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fleming定制默认存储压缩方式优先 Log: fleming定制默认存储压缩方式优先 --- src/source/mainwindow.cpp | 2 +- src/source/page/compresssettingpage.cpp | 14 +++++++++----- src/source/page/compresssettingpage.h | 7 ++++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/source/mainwindow.cpp b/src/source/mainwindow.cpp index 49fc09cf..76c8c2f0 100644 --- a/src/source/mainwindow.cpp +++ b/src/source/mainwindow.cpp @@ -3327,7 +3327,7 @@ void MainWindow::slotFinishCalculateSize(qint64 size, QString strArchiveFullPath { if (StartupType::ST_Compresstozip7z == m_eStartupType) { #ifdef DTKCORE_CLASS_DConfigFile - if(m_pCompressSettingPage->property("devName").toString().contains("PGUX", Qt::CaseInsensitive)) { + if(m_pCompressSettingPage->isOrderMode()) { DConfig *dconfig = DConfig::create("org.deepin.compressor","org.deepin.compressor.method"); if(strArchiveFullPath.endsWith("7z")) { if(dconfig && dconfig->isValid() && dconfig->keyList().contains("special7zCompressor")){ diff --git a/src/source/page/compresssettingpage.cpp b/src/source/page/compresssettingpage.cpp index f8d8debc..0461d1a4 100644 --- a/src/source/page/compresssettingpage.cpp +++ b/src/source/page/compresssettingpage.cpp @@ -168,7 +168,7 @@ void CompressSettingPage::refreshMenu() } } #ifdef DTKCORE_CLASS_DConfigFile - if(m_isPanguX) { + if(m_isOrderMode) { DConfig *dconfig = (DConfig *)m_dconfig; int nCompType = -1; if(dconfig && dconfig->isValid() && dconfig->keyList().contains("specialCompressorType")){ @@ -467,7 +467,7 @@ void CompressSettingPage::setSplitEnabled(bool bEnabled) void CompressSettingPage::refreshCompressLevel(const QString &strType) { #ifdef DTKCORE_CLASS_DConfigFile - if(m_isPanguX) { + if(m_isOrderMode) { // 其余格式支持设置压缩方式 // 设置压缩方式可用 m_pCompressLevelCmb->setEnabled(true); @@ -698,8 +698,7 @@ void CompressSettingPage::initConfig() QStringList lines = result.split('\n'); for (const QString &line : lines) { if (line.contains("String 4", Qt::CaseInsensitive)) { - m_isPanguX = line.contains("PGUX", Qt::CaseInsensitive); - setProperty("devName", line); + m_isOrderMode = line.contains("PGUX", Qt::CaseInsensitive) || line.contains("FXK11", Qt::CaseInsensitive); } } process.close(); @@ -812,7 +811,7 @@ void CompressSettingPage::slotAdvancedEnabled(bool bEnabled) if (m_pCompressTypeLbl->text() == "tar.gz") { m_pCpuCmb->setCurrentIndex(m_pCpuCmb->count() - 1); #ifdef DTKCORE_CLASS_DConfigFile - if(m_isPanguX) { + if(m_isOrderMode) { DConfig *dconfig = (DConfig *)m_dconfig; if(dconfig && dconfig->isValid() && dconfig->keyList().contains("specialCpuTarGzCompressor")){ int nCpu = dconfig->value("specialCpuTarGzCompressor").toInt(); @@ -1005,6 +1004,11 @@ bool CompressSettingPage::eventFilter(QObject *watched, QEvent *event) } } +bool CompressSettingPage::isOrderMode() +{ + return m_isOrderMode; +} + TypeLabel *CompressSettingPage::getClickLbl() const { return m_pClickLbl; diff --git a/src/source/page/compresssettingpage.h b/src/source/page/compresssettingpage.h index 7ff8649a..6ecbcb7a 100644 --- a/src/source/page/compresssettingpage.h +++ b/src/source/page/compresssettingpage.h @@ -83,6 +83,11 @@ class CompressSettingPage : public DWidget * @return */ bool eventFilter(QObject *watched, QEvent *event) override; + /** + * @brief 是否定制模式 + * @return + */ + bool isOrderMode(); private: /** @@ -259,7 +264,7 @@ private slots: QScrollArea *m_pRightScroll = nullptr; void *m_dconfig = nullptr; //读取dconfig配置 - bool m_isPanguX = false; //是否pangux系统 + bool m_isOrderMode = false; //是否定制模式存储压缩方式优先 }; #endif // COMPRESSSETTINGPAGE_H