dde-file-manager
dde-file-manager copied to clipboard
修复两个桌面整理的问题
Summary by Sourcery
Enhance the desktop organizer plugin by introducing screen‐specific style configurations with fallback to the last used layout, deprecating legacy custom‐style code, and fixing collection relayout selection issues.
Bug Fixes:
- Ensure newly created collections are included in relayout and deduplicated by switching to QSet for relayoutedCollectionIDs.
- Fallback to the last saved style configuration when no layout exists for the current screen resolution.
Enhancements:
- Refactor normalStyle/update/write APIs to accept a generated screenConfigId instead of a custom flag.
- Add generateScreenConfigId logic based on surface dimensions and persist lastStyleConfigId in settings.
- Stub out obsolete custom style methods and remove associated settings writes.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: itsXuSt
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
deepin pr auto review
关键摘要:
- 在
ConfigPresenter类中,customStyle和updateCustomStyle、writeCustomStyle方法被注释掉,可能需要确认这些功能是否真的不再需要。 ConfigPresenter类中新增的setLastStyleConfigId、lastStyleConfigId和hasConfigId方法,应该添加相应的注释说明其用途和功能。OrganizerConfig类中新增的setLastStyleConfigId、lastStyleConfigId和hasConfigId方法,应该添加相应的注释说明其用途和功能。NormalizedMode类中新增的generateScreenConfigId方法,应该添加相应的注释说明其用途和功能。NormalizedMode类中的layout方法中,对于validConfigId的使用,应该添加注释说明其选择逻辑。NormalizedMode类中的rebuild方法中,对于profiles的使用,应该添加注释说明其来源和用途。
是否建议立即修改: 是
- 确认注释掉的方法是否真的不再需要,如果需要,应该恢复这些方法。
- 添加必要的注释,以便其他开发者理解代码的意图和功能。
- 确保新增的方法有适当的文档说明,以便维护和扩展。
Reviewer's Guide
Introduces per-screen persistent style configuration IDs and refactors style APIs across ConfigPresenter and OrganizerConfig to use these IDs, disables legacy custom-style methods, adds fallback to the last used config when the current one is missing, and improves rebuild logic by switching to a set for relayout tracking and ensuring newly created collections are selected.
Sequence Diagram: Retrieving Normal Style with configId
sequenceDiagram
participant NM as NormalizedMode
participant CP as ConfigPresenter
participant OC as OrganizerConfig
NM->>CP: normalStyle(configId, key)
CP->>OC: collectionStyle(configId, key)
OC-->>CP: CollectionStyle
CP-->>NM: CollectionStyle
Sequence Diagram: Updating Normal Style with configId
sequenceDiagram
participant NMP as NormalizedModePrivate
participant CP as ConfigPresenter
participant OC as OrganizerConfig
NMP->>CP: updateNormalStyle(configId, style)
CP->>OC: updateCollectionStyle(configId, style)
CP->>OC: sync()
Sequence Diagram: Layout Style Configuration Logic in NormalizedMode
sequenceDiagram
participant NM as NormalizedMode
participant NMP as NormalizedModePrivate
participant CP as ConfigPresenter
NM->>NMP: generateScreenConfigId()
NMP-->>NM: currentConfigId
NM->>CP: lastStyleConfigId()
CP-->>NM: lastConfigId
NM->>CP: hasConfigId(currentConfigId)
CP-->>NM: bool hasCurrentConfig
alt hasCurrentConfig is true
NM->>NM: validConfigId = currentConfigId
else hasCurrentConfig is false
NM->>NM: validConfigId = lastConfigId
end
loop for each collection holder
NM->>CP: normalStyle(validConfigId, holderId)
CP-->>NM: CollectionStyle
end
NM->>CP: writeNormalStyle(currentConfigId, stylesToSave)
NM->>CP: setLastStyleConfigId(currentConfigId)
Entity Relationship Diagram: Style Configuration Storage
erDiagram
ConfigStorage {
string LastStyleConfigId
}
StyleProfile {
string ConfigID PK "e.g., StyleConfig_1920x1080"
}
CollectionStyleData {
string Key PK "within StyleProfile"
string Rect
int ScreenIndex
}
ConfigStorage ||--o{ StyleProfile : "has multiple"
StyleProfile ||--|{ CollectionStyleData : "contains"
Class Diagram: ConfigPresenter Changes
classDiagram
class ConfigPresenter {
+setLastStyleConfigId(QString id): void
+lastStyleConfigId(): QString
+hasConfigId(QString configId): bool
+normalStyle(QString configId, QString key): CollectionStyle
+updateNormalStyle(QString configId, CollectionStyle style): void
+writeNormalStyle(QString configId, QList<CollectionStyle> styles): void
+customStyle(QString key): CollectionStyle "stubbed"
+updateCustomStyle(CollectionStyle style): void "stubbed"
+writeCustomStyle(QList<CollectionStyle> styles): void "stubbed"
}
Class Diagram: OrganizerConfig Changes
classDiagram
class OrganizerConfig {
+setLastStyleConfigId(QString id): void
+lastStyleConfigId(): QString
+hasConfigId(QString configId): bool
+collectionStyle(QString styleId, QString key): CollectionStyle
+updateCollectionStyle(QString styleId, CollectionStyle style): void
+writeCollectionStyle(QString styleId, QList<CollectionStyle> styles): void
}
Class Diagram: NormalizedModePrivate Changes
classDiagram
class NormalizedModePrivate {
+relayoutedCollectionIDs: QSet<QString>
+generateScreenConfigId(): QString
}
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Introduce and persist screen-specific style-config IDs and refactor style APIs to use them |
|
config/configpresenter.cppconfig/configpresenter.hconfig/organizerconfig.cppconfig/organizerconfig.hmode/normalizedmode.cppmode/normalizedmode_p.h |
| Disable legacy custom-style handling |
|
config/configpresenter.cppconfig/configpresenter.h |
| Fallback to last used style-config when current ID is missing |
|
mode/normalizedmode.cpp |
| Ensure new collections are included in selection and improve relayout tracking |
|
mode/normalizedmode.cppmode/normalizedmode_p.h |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon 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 issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon 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 dismisson 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 reviewto 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
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
TAG Bot
New tag: 6.5.64 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2925
TAG Bot
New tag: 6.5.65 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2927
TAG Bot
New tag: 6.5.66 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2934
TAG Bot
New tag: 6.5.67 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2942
TAG Bot
New tag: 6.5.68 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2946
TAG Bot
New tag: 6.5.69 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2956
TAG Bot
New tag: 6.5.70 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2961
TAG Bot
New tag: 6.5.71 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2964
TAG Bot
New tag: 6.5.72 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2969
TAG Bot
New tag: 6.5.73 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2970
TAG Bot
New tag: 6.5.74 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2971
TAG Bot
New tag: 6.5.75 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2976
TAG Bot
New tag: 6.5.76 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2994
TAG Bot
New tag: 6.5.77 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3003
TAG Bot
New tag: 6.5.78 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3004
TAG Bot
New tag: 6.5.79 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3007
TAG Bot
New tag: 6.5.80 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3008
TAG Bot
New tag: 6.5.81 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3023
TAG Bot
New tag: 6.5.83 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3037
TAG Bot
New tag: 6.5.84 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3056
TAG Bot
New tag: 6.5.85 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3067
TAG Bot
New tag: 6.5.86 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3068
TAG Bot
New tag: 6.5.87 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3070
TAG Bot
New tag: 6.5.88 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3079
TAG Bot
New tag: 6.5.89 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3081
TAG Bot
New tag: 6.5.90 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3094
TAG Bot
New tag: 6.5.91 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3110