Skip to content

Conversation

@re2zero
Copy link

@re2zero re2zero commented Jul 10, 2025

Add more logs. 74.92%

Log: More logs.

Summary by Sourcery

Add extensive logging across the application to improve traceability of operations, including job lifecycle events, UI interactions, plugin management, file and configuration handling.

Enhancements:

  • Insert debug, info, and warning messages in archive job classes to log construction, destruction, work steps, and progress signals.
  • Add logging for UI components to record initialization, event handling (mouse, key, drag-and-drop), and user actions in views and dialogs.
  • Instrument plugin manager, interface creation, and desktop file parsing with logs to trace plugin selection and MIME handling.
  • Log file system operations, configuration reading/writing, and size calculations for better diagnostics during file and setting management.

Add more logs. 74.92%

Log: More logs.
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • ArchiveManager类中,get_instance方法中添加了调试信息,有助于跟踪实例的创建过程。
  • ArchiveManager类的destory_instance方法中,添加了调试信息,有助于跟踪实例的销毁过程。
  • ArchiveManager类的多个方法中,添加了调试信息,有助于跟踪文件操作的过程。
  • BatchJob类中,添加了调试信息,有助于跟踪批处理作业的执行过程。
  • CreateJobExtractJobDeleteJobRenameJobOpenJobUpdateJobCommentJobConvertJobStepExtractJob等类中,添加了调试信息,有助于跟踪单个作业的执行过程。
  • CalculateSizeThreadCustomSuggestButtonCustomComboboxCustomPushButtonCustomSwitchButtonCustomCheckBoxCustomCommandLinkButtonDDesktopServicesThreadMimeTypeDisplayManagerOpenFileWatcherPluginPluginManagerUiToolsCompressorApplicationDesktopFileMimesAppsManagerOpenWithDialogTipDialogSimpleQueryDialogOverwriteQueryDialogConvertDialogAppendDialogRenameDialogSettingDialogGenerateSettingTranslateMainWindowCompressPageCompressSettingPageProgressPageUnCompressPageCompressViewDataModelDataTreeViewTreeHeaderViewUnCompressView等类中,添加了调试信息,有助于跟踪应用程序的执行过程。

是否建议立即修改:

  • 否,这些调试信息有助于开发和调试,但不会影响应用程序的功能。

@sourcery-ai
Copy link

sourcery-ai bot commented Jul 10, 2025

Reviewer's Guide

This PR introduces comprehensive logging across the codebase by injecting qDebug, qInfo, and qWarning statements at key points in core workflows, job lifecycles, UI initialization and event handling, plugin and MIME management, and utility methods to improve visibility into runtime behavior.

Class diagram for logging additions in job classes

classDiagram
    class CreateJob {
        +doWork()
        +doKill()
        +cleanCompressFileCancel()
        <<logging added>>
    }
    class ExtractJob {
        +ExtractJob(...)
        +~ExtractJob()
        +doWork()
        <<logging added>>
    }
    class DeleteJob {
        +DeleteJob(...)
        +~DeleteJob()
        +doWork()
        <<logging added>>
    }
    class RenameJob {
        +RenameJob(...)
        +~RenameJob()
        +doWork()
        <<logging added>>
    }
    class OpenJob {
        +OpenJob(...)
        +~OpenJob()
        +doWork()
        +slotFinished(...)
        <<logging added>>
    }
    class UpdateJob {
        +UpdateJob(...)
        +~UpdateJob()
        +start()
        +doWork()
        <<logging added>>
    }
    class CommentJob {
        +CommentJob(...)
        +~CommentJob()
        +doWork()
        <<logging added>>
    }
    class ComplexJob {
        +ComplexJob(...)
        +~ComplexJob()
        +doPause()
        +doContinue()
        +doKill()
        +slotHandleSingleJobProgress(...)
        +slotHandleSingleJobCurFileName(...)
        <<logging added>>
    }
    class ConvertJob {
        +ConvertJob(...)
        +~ConvertJob()
        +start()
        +slotHandleExtractFinished()
        <<logging added>>
    }
    class StepExtractJob {
        +StepExtractJob(...)
        +~StepExtractJob()
        +start()
        +slotHandleExtractFinished()
        +doKill()
        <<logging added>>
    }
Loading

Class diagram for logging additions in utility and manager classes

classDiagram
    class UiTools {
        +UiTools(...)
        +~UiTools()
        +getConfigPath()
        +renderSVG(...)
        +humanReadableSize(...)
        +isExistMimeType(...)
        +readConf()
        +toShortString(...)
        +createInterface(...)
        +transSplitFileName(...)
        +handleFileName(...)
        +isLocalDeviceFile(...)
        +removeSameFileName(...)
        +isWayland()
        <<logging added>>
    }
    class ArchiveManager {
        +get_instance()
        +destory_instance()
        +createArchive(...)
        +loadArchive(...)
        +addFiles(...)
        +extractFiles(...)
        +extractFiles2Path(...)
        +deleteFiles(...)
        +renameFiles(...)
        +batchExtractFiles(...)
        +openFile(...)
        +updateArchiveCacheData(...)
        +updateArchiveComment(...)
        +convertArchive(...)
        +pauseOperation()
        +continueOperation()
        +cancelOperation()
        +getCurFilePassword()
        +currentStatus()
        +slotJobFinished()
        <<logging added>>
    }
    class MimeAppsWorker {
        +~MimeAppsWorker()
        +initConnect()
        +startWatch()
        +handleDirectoryChanged(...)
        +handleFileChanged(...)
        +updateCache()
        +writeData(...)
        +readData(...)
        <<logging added>>
    }
    class MimesAppsManager {
        +getMimeTypeByFileName(...)
        +getDefaultAppByFileName(...)
        +getDefaultAppByMimeType(...)
        +getDefaultAppDisplayNameByMimeType(...)
        +getDefaultAppDisplayNameByGio(...)
        +getDefaultAppDesktopFileByMimeType(...)
        +getRecommendedAppsByGio(...)
        +getApplicationsFolders()
        +getMimeAppsCacheFile()
        +getMimeInfoCacheFilePath()
        +getMimeInfoCacheFileRootPath()
        +getDesktopFilesCacheFile()
        +getDesktopIconsCacheFile()
        +getDesktopFiles()
        +getDDEMimeTypeFile()
        +getDesktopObjs()
        +initMimeTypeApps()
        +lessByDateTime(...)
        +removeOneDupFromList(...)
        <<logging added>>
    }
    class MimeTypeDisplayManager {
        +initConnect()
        +displayName(...)
        +displayNameToEnum(...)
        +defaultIcon(...)
        +displayNames()
        +readlines(...)
        +loadSupportMimeTypes()
        +supportArchiveMimetypes()
        +supportVideoMimeTypes()
        <<logging added>>
    }
Loading

Class diagram for logging additions in UI and dialog classes

classDiagram
    class UnCompressView {
        +setArchivePath(...)
        +setDefaultUncompressPath(...)
        +mousePressEvent(...)
        +mouseMoveEvent(...)
        +clearDragData()
        +mouseDoubleClickEvent(...)
        +initUI()
        +initConnections()
        +calDirItemCount(...)
        +handleDoubleClick(...)
        +refreshDataByCurrentPath()
        +refreshDataByCurrentPathChanged()
        +addNewFiles(...)
        +getCurPath()
        +setModifiable(...)
        +isModifiable()
        +clear()
        +getCurPathFiles()
        +getSelEntry()
        +extract2Path(...)
        +calEntrySizeByParentPath(...)
        +slotDragFiles(...)
        +slotShowRightMenu(...)
        +slotExtract()
        +slotExtract2Here()
        +slotDeleteFile()
        +slotRenameFile()
        +slotOpen()
        +slotOpenStyleClicked()
        +slotPreClicked()
        <<logging added>>
    }
    class OpenWithDialogListItem {
        +OpenWithDialogListItem(...)
        +~OpenWithDialogListItem()
        +setChecked(...)
        +text()
        +resizeEvent(...)
        +enterEvent(...)
        +leaveEvent(...)
        +paintEvent(...)
        <<logging added>>
    }
    class OpenWithDialogListSparerItem {
        +OpenWithDialogListSparerItem(...)
        +~OpenWithDialogListSparerItem()
        <<logging added>>
    }
    class OpenWithDialog {
        +getOpenStyle(...)
        +resizeEvent(...)
        +eventFilter(...)
        +showOpenWithDialog(...)
        +getProgramPathByExec(...)
        +init()
        +initConnections()
        +initData()
        +checkItem(...)
        +createItem(...)
        +slotUseOtherApplication(...)
        <<logging added>>
    }
    class CompressSettingPage {
        +initUI()
        +initConnections()
        +setTypeImage(...)
        +checkFileNameVaild(...)
        +setEncryptedEnabled(...)
        +slotEchoModeChanged(...)
        +setListEncryptionEnabled(...)
        +setSplitEnabled(...)
        +refreshCompressLevel(...)
        +setCommentEnabled(...)
        +checkCompressOptionValid()
        +checkFile(...)
        +showWarningDialog(...)
        +setDefaultName(...)
        +initConfig()
        +slotShowRightMenu(...)
        +slotTypeChanged(...)
        +slotRefreshFileNameEdit()
        +slotAdvancedEnabled(...)
        +slotSplitEdtEnabled()
        +slotCompressClicked()
        +slotCommentTextChanged()
        +slotPasswordChanged()
        +getCompressBtn()
        +getComment()
        +eventFilter(...)
        +isOrderMode()
        +getClickLbl()
        <<logging added>>
    }
    class TypeLabel {
        +TypeLabel(...)
        +~TypeLabel()
        +mousePressEvent(...)
        +paintEvent(...)
        +focusInEvent(...)
        +focusOutEvent(...)
        <<logging added>>
    }
Loading

File-Level Changes

Change Details Files
Instrument job lifecycle and execution classes with logging
  • Added debug logs in constructors, destructors, doWork and slotFinished for all Job subclasses
  • Logged state transitions (start, completion, errors, synchronous vs asynchronous paths)
  • Emitted warnings on null interfaces and operation failures
singlejob.cpp
CreateJob.cpp
ExtractJob.cpp
DeleteJob.cpp
RenameJob.cpp
OpenJob.cpp
UpdateJob.cpp
CommentJob.cpp
ComplexJob.cpp
ConvertJob.cpp
StepExtractJob.cpp
batchjob.cpp
Log UI component initialization and event handling
  • Added entry logs in initUI and initConnections for pages and views
  • Logged user interactions (mousePress, mouseMove, keyPress, drag/drop events) and context menu actions
  • Instrumented dialogs (TipDialog, SimpleQueryDialog, OverwriteQueryDialog, ConvertDialog, AppendDialog, RenameDialog) with autoFeed and changeEvent logs
compresssettingpage.cpp
compresspage.cpp
uncompresspage.cpp
progresspage.cpp
popupdialog.cpp
openwithdialog.cpp
mimesappsmanager.cpp
compressview.cpp
uncompressview.cpp
datatreeview.cpp
treeheaderview.cpp
datamodel.cpp
Enhance utilities and plugin/MIME management with tracing logs
  • Logged calls in UiTools methods for path, size conversion, interface creation and split filename handling
  • Added detailed logs in PluginManager and Plugin for plugin discovery, filtering, priority, and executables checks
  • Instrumented MimeAppsManager, DesktopFile and MimeTypeDisplayManager to trace cache reads, file operations and type mappings
uitools.cpp
pluginmanager.cpp
plugin.cpp
desktopfile.cpp
mimetypedisplaymanager.cpp
mimesappsmanager.cpp
Trace ArchiveManager operations
  • Logged method entries in create, load, add, extract, delete, rename, open, convert and cache update flows
  • Added warnings on interface creation failures and post-creation job startup logs
  • Logged pause, continue and cancel requests for archive jobs
archivemanager.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, re2zero

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lzwind lzwind merged commit d468e9a into linuxdeepin:develop/snipe Jul 11, 2025
14 checks passed
@re2zero re2zero deleted the bugfix branch July 11, 2025 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants