Skip to content

Commit 0fd3108

Browse files
committed
refactor(preferences): extract message list-specific visual settings into a separate MessageListPreferencesManager
1 parent 0bd1045 commit 0fd3108

File tree

36 files changed

+351
-332
lines changed

36 files changed

+351
-332
lines changed
Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
11
package net.thunderbird.core.preference.display.visualSettings
22

33
import net.thunderbird.core.preference.BodyContentType
4+
import net.thunderbird.core.preference.display.visualSettings.message.list.DisplayMessageListSettings
45

5-
const val DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CONTACT_NAME = false
6-
const val DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CONTACT_PICTURE = true
7-
const val DISPLAY_SETTINGS_DEFAULT_IS_CHANGE_CONTACT_NAME_COLOR = true
8-
const val DISPLAY_SETTINGS_DEFAULT_IS_COLORIZE_MISSING_CONTACT_PICTURE = true
9-
const val DISPLAY_SETTINGS_DEFAULT_IS_USE_BACKGROUND_AS_INDICATOR = false
106
const val DISPLAY_SETTINGS_DEFAULT_IS_USE_MESSAGE_VIEW_FIXED_WIDTH_FONT = false
117
const val DISPLAY_SETTINGS_DEFAULT_IS_AUTO_FIT_WIDTH = true
128
const val DISPLAY_SETTINGS_DEFAULT_IS_SHOW_ANIMATION = true
13-
const val DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CORRESPONDENT_NAMES = true
149
val DISPLAY_SETTINGS_DEFAULT_BODY_CONTENT_TYPE = BodyContentType.TEXT_HTML
15-
const val DISPLAY_SETTINGS_DEFAULT_MESSAGE_LIST_PREVIEW_LINES = 2
1610
const val DISPLAY_SETTINGS_DEFAULT_DRAWER_EXPAND_ALL_FOLDER = false
1711

1812
data class DisplayVisualSettings(
1913
val isShowAnimations: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_SHOW_ANIMATION,
20-
val isShowCorrespondentNames: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CORRESPONDENT_NAMES,
21-
val isShowContactName: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CONTACT_NAME,
22-
val isShowContactPicture: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CONTACT_PICTURE,
23-
val isChangeContactNameColor: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_CHANGE_CONTACT_NAME_COLOR,
24-
val isColorizeMissingContactPictures: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_COLORIZE_MISSING_CONTACT_PICTURE,
25-
val isUseBackgroundAsUnreadIndicator: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_USE_BACKGROUND_AS_INDICATOR,
2614
val isUseMessageViewFixedWidthFont: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_USE_MESSAGE_VIEW_FIXED_WIDTH_FONT,
2715
val isAutoFitWidth: Boolean = DISPLAY_SETTINGS_DEFAULT_IS_AUTO_FIT_WIDTH,
2816
val bodyContentType: BodyContentType = DISPLAY_SETTINGS_DEFAULT_BODY_CONTENT_TYPE,
29-
val messageListPreviewLines: Int = DISPLAY_SETTINGS_DEFAULT_MESSAGE_LIST_PREVIEW_LINES,
3017
val drawerExpandAllFolder: Boolean = DISPLAY_SETTINGS_DEFAULT_DRAWER_EXPAND_ALL_FOLDER,
18+
val messageListSettings: DisplayMessageListSettings = DisplayMessageListSettings(),
3119
)

core/preference/api/src/commonMain/kotlin/net/thunderbird/core/preference/display/visualSettings/DisplayVisualSettingsPreferenceManager.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@ package net.thunderbird.core.preference.display.visualSettings
22

33
import net.thunderbird.core.preference.PreferenceManager
44

5-
const val KEY_SHOW_CONTACT_NAME = "showContactName"
6-
const val KEY_SHOW_CORRESPONDENT_NAMES = "showCorrespondentNames"
75
const val KEY_ANIMATION = "animations"
8-
const val KEY_CHANGE_REGISTERED_NAME_COLOR = "changeRegisteredNameColor"
9-
const val KEY_COLORIZE_MISSING_CONTACT_PICTURE = "colorizeMissingContactPictures"
10-
const val KEY_USE_BACKGROUND_AS_UNREAD_INDICATOR = "isUseBackgroundAsUnreadIndicator"
116
const val KEY_MESSAGE_VIEW_FIXED_WIDTH_FONT = "messageViewFixedWidthFont"
127
const val KEY_AUTO_FIT_WIDTH = "autofitWidth"
13-
const val KEY_SHOW_CONTACT_PICTURE = "showContactPicture"
148
const val KEY_MESSAGE_VIEW_BODY_CONTENT_TYPE = "messageViewBodyContentType"
15-
const val KEY_MESSAGE_LIST_VIEW_PREVIEW_LINES = "messageListPreviewLines"
16-
179
const val KEY_DRAWER_EXPAND_ALL_FOLDER = "drawerExpandAllFolder"
1810

1911
interface DisplayVisualSettingsPreferenceManager : PreferenceManager<DisplayVisualSettings>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package net.thunderbird.core.preference.display.visualSettings.message.list
2+
3+
const val MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CORRESPONDENT_NAMES = true
4+
const val MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CONTACT_NAME = false
5+
const val MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CONTACT_PICTURE = true
6+
const val MESSAGE_LIST_SETTINGS_DEFAULT_IS_CHANGE_CONTACT_NAME_COLOR = true
7+
const val MESSAGE_LIST_SETTINGS_DEFAULT_IS_COLORIZE_MISSING_CONTACT_PICTURE = true
8+
const val MESSAGE_LIST_SETTINGS_DEFAULT_IS_USE_BACKGROUND_AS_INDICATOR = false
9+
const val MESSAGE_LIST_SETTINGS_DEFAULT_PREVIEW_LINES = 2
10+
11+
data class DisplayMessageListSettings(
12+
val isShowCorrespondentNames: Boolean = MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CORRESPONDENT_NAMES,
13+
val isShowContactName: Boolean = MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CONTACT_NAME,
14+
val isShowContactPicture: Boolean = MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CONTACT_PICTURE,
15+
val isChangeContactNameColor: Boolean = MESSAGE_LIST_SETTINGS_DEFAULT_IS_CHANGE_CONTACT_NAME_COLOR,
16+
val isColorizeMissingContactPictures: Boolean = MESSAGE_LIST_SETTINGS_DEFAULT_IS_COLORIZE_MISSING_CONTACT_PICTURE,
17+
val isUseBackgroundAsUnreadIndicator: Boolean = MESSAGE_LIST_SETTINGS_DEFAULT_IS_USE_BACKGROUND_AS_INDICATOR,
18+
val previewLines: Int = MESSAGE_LIST_SETTINGS_DEFAULT_PREVIEW_LINES,
19+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package net.thunderbird.core.preference.display.visualSettings.message.list
2+
3+
import net.thunderbird.core.preference.PreferenceManager
4+
5+
const val KEY_COLORIZE_MISSING_CONTACT_PICTURE = "colorizeMissingContactPictures"
6+
const val KEY_CHANGE_REGISTERED_NAME_COLOR = "changeRegisteredNameColor"
7+
const val KEY_USE_BACKGROUND_AS_UNREAD_INDICATOR = "isUseBackgroundAsUnreadIndicator"
8+
const val KEY_SHOW_CORRESPONDENT_NAMES = "showCorrespondentNames"
9+
const val KEY_SHOW_CONTACT_NAME = "showContactName"
10+
const val KEY_SHOW_CONTACT_PICTURE = "showContactPicture"
11+
const val KEY_MESSAGE_LIST_VIEW_PREVIEW_LINES = "messageListPreviewLines"
12+
const val KEY_MESSAGE_LIST_VIEW_DENSITY = "messageListDensity"
13+
14+
interface MessageListPreferencesManager : PreferenceManager<DisplayMessageListSettings>

core/preference/impl/src/commonMain/kotlin/net/thunderbird/core/preference/display/visualSettings/DefaultDisplayVisualSettingsPreferenceManager.kt

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ import kotlinx.coroutines.Dispatchers
66
import kotlinx.coroutines.SupervisorJob
77
import kotlinx.coroutines.flow.Flow
88
import kotlinx.coroutines.flow.MutableStateFlow
9+
import kotlinx.coroutines.flow.SharingStarted
10+
import kotlinx.coroutines.flow.StateFlow
11+
import kotlinx.coroutines.flow.combine
12+
import kotlinx.coroutines.flow.stateIn
913
import kotlinx.coroutines.flow.update
1014
import kotlinx.coroutines.launch
1115
import kotlinx.coroutines.sync.Mutex
1216
import kotlinx.coroutines.sync.withLock
1317
import net.thunderbird.core.logging.Logger
18+
import net.thunderbird.core.preference.display.visualSettings.message.list.MessageListPreferencesManager
1419
import net.thunderbird.core.preference.storage.Storage
1520
import net.thunderbird.core.preference.storage.StorageEditor
1621
import net.thunderbird.core.preference.storage.getEnumOrDefault
@@ -22,32 +27,26 @@ class DefaultDisplayVisualSettingsPreferenceManager(
2227
private val logger: Logger,
2328
private val storage: Storage,
2429
private val storageEditor: StorageEditor,
30+
private val messageListPreferences: MessageListPreferencesManager,
2531
private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO,
26-
private var scope: CoroutineScope = CoroutineScope(SupervisorJob()),
32+
private val scope: CoroutineScope = CoroutineScope(SupervisorJob()),
2733
) : DisplayVisualSettingsPreferenceManager {
28-
29-
private val configState: MutableStateFlow<DisplayVisualSettings> = MutableStateFlow(value = loadConfig())
34+
private val internalConfigState = MutableStateFlow(value = loadConfig())
35+
private val configState: StateFlow<DisplayVisualSettings> = combine(
36+
internalConfigState,
37+
messageListPreferences.getConfigFlow(),
38+
) { config, messageListConfig ->
39+
config.copy(messageListSettings = messageListConfig)
40+
}.stateIn(scope = scope, started = SharingStarted.Eagerly, initialValue = internalConfigState.value)
3041
private val mutex = Mutex()
3142

3243
override fun save(config: DisplayVisualSettings) {
3344
logger.debug(TAG) { "save() called with: config = $config" }
3445
writeConfig(config)
35-
configState.update { config }
46+
internalConfigState.update { config }
3647
}
3748

3849
private fun loadConfig(): DisplayVisualSettings = DisplayVisualSettings(
39-
isColorizeMissingContactPictures = storage.getBoolean(
40-
KEY_COLORIZE_MISSING_CONTACT_PICTURE,
41-
DISPLAY_SETTINGS_DEFAULT_IS_COLORIZE_MISSING_CONTACT_PICTURE,
42-
),
43-
isChangeContactNameColor = storage.getBoolean(
44-
KEY_CHANGE_REGISTERED_NAME_COLOR,
45-
DISPLAY_SETTINGS_DEFAULT_IS_CHANGE_CONTACT_NAME_COLOR,
46-
),
47-
isUseBackgroundAsUnreadIndicator = storage.getBoolean(
48-
KEY_USE_BACKGROUND_AS_UNREAD_INDICATOR,
49-
DISPLAY_SETTINGS_DEFAULT_IS_USE_BACKGROUND_AS_INDICATOR,
50-
),
5150
isUseMessageViewFixedWidthFont = storage.getBoolean(
5251
KEY_MESSAGE_VIEW_FIXED_WIDTH_FONT,
5352
DISPLAY_SETTINGS_DEFAULT_IS_USE_MESSAGE_VIEW_FIXED_WIDTH_FONT,
@@ -60,26 +59,10 @@ class DefaultDisplayVisualSettingsPreferenceManager(
6059
KEY_ANIMATION,
6160
DISPLAY_SETTINGS_DEFAULT_IS_SHOW_ANIMATION,
6261
),
63-
isShowCorrespondentNames = storage.getBoolean(
64-
KEY_SHOW_CORRESPONDENT_NAMES,
65-
DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CORRESPONDENT_NAMES,
66-
),
67-
isShowContactName = storage.getBoolean(
68-
KEY_SHOW_CONTACT_NAME,
69-
DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CONTACT_NAME,
70-
),
71-
isShowContactPicture = storage.getBoolean(
72-
KEY_SHOW_CONTACT_PICTURE,
73-
DISPLAY_SETTINGS_DEFAULT_IS_SHOW_CONTACT_PICTURE,
74-
),
7562
bodyContentType = storage.getEnumOrDefault(
7663
KEY_MESSAGE_VIEW_BODY_CONTENT_TYPE,
7764
DISPLAY_SETTINGS_DEFAULT_BODY_CONTENT_TYPE,
7865
),
79-
messageListPreviewLines = storage.getInt(
80-
KEY_MESSAGE_LIST_VIEW_PREVIEW_LINES,
81-
DISPLAY_SETTINGS_DEFAULT_MESSAGE_LIST_PREVIEW_LINES,
82-
),
8366
drawerExpandAllFolder = storage.getBoolean(
8467
KEY_DRAWER_EXPAND_ALL_FOLDER,
8568
DISPLAY_SETTINGS_DEFAULT_DRAWER_EXPAND_ALL_FOLDER,
@@ -90,39 +73,15 @@ class DefaultDisplayVisualSettingsPreferenceManager(
9073
logger.debug(TAG) { "writeConfig() called with: config = $config" }
9174
scope.launch(ioDispatcher) {
9275
mutex.withLock {
93-
storageEditor.putBoolean(
94-
KEY_CHANGE_REGISTERED_NAME_COLOR,
95-
config.isChangeContactNameColor,
96-
)
97-
storageEditor.putBoolean(
98-
KEY_COLORIZE_MISSING_CONTACT_PICTURE,
99-
config.isColorizeMissingContactPictures,
100-
)
10176
storageEditor.putBoolean(KEY_ANIMATION, config.isShowAnimations)
102-
storageEditor.putBoolean(
103-
KEY_SHOW_CONTACT_PICTURE,
104-
config.isShowContactPicture,
105-
)
106-
storageEditor.putBoolean(
107-
KEY_USE_BACKGROUND_AS_UNREAD_INDICATOR,
108-
config.isUseBackgroundAsUnreadIndicator,
109-
)
11077
storageEditor.putBoolean(
11178
KEY_MESSAGE_VIEW_FIXED_WIDTH_FONT,
11279
config.isUseMessageViewFixedWidthFont,
11380
)
11481
storageEditor.putBoolean(KEY_AUTO_FIT_WIDTH, config.isAutoFitWidth)
115-
storageEditor.putBoolean(KEY_SHOW_CONTACT_NAME, config.isShowContactName)
116-
storageEditor.putBoolean(
117-
KEY_SHOW_CORRESPONDENT_NAMES,
118-
config.isShowCorrespondentNames,
119-
)
12082
storageEditor.putEnum(KEY_MESSAGE_VIEW_BODY_CONTENT_TYPE, config.bodyContentType)
121-
storageEditor.putInt(
122-
KEY_MESSAGE_LIST_VIEW_PREVIEW_LINES,
123-
config.messageListPreviewLines,
124-
)
12583
storageEditor.putBoolean(KEY_DRAWER_EXPAND_ALL_FOLDER, config.drawerExpandAllFolder)
84+
messageListPreferences.save(config.messageListSettings)
12685
storageEditor.commit().also { commited ->
12786
logger.verbose(TAG) { "writeConfig: storageEditor.commit() resulted in: $commited" }
12887
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package net.thunderbird.core.preference.display.visualSettings.message.list
2+
3+
import kotlinx.coroutines.flow.Flow
4+
import kotlinx.coroutines.flow.MutableStateFlow
5+
import kotlinx.coroutines.flow.update
6+
import net.thunderbird.core.logging.Logger
7+
import net.thunderbird.core.preference.storage.Storage
8+
import net.thunderbird.core.preference.storage.StorageEditor
9+
10+
private const val TAG = "DefaultMessageListPreferencesManager"
11+
12+
class DefaultMessageListPreferencesManager(
13+
private val logger: Logger,
14+
private val storage: Storage,
15+
private val storageEditor: StorageEditor,
16+
) : MessageListPreferencesManager {
17+
private val preferences = MutableStateFlow(value = loadPreferences())
18+
override fun save(config: DisplayMessageListSettings) {
19+
logger.debug(TAG) { "save() called with: config = $config" }
20+
write(config)
21+
preferences.update { config }
22+
}
23+
24+
private fun loadPreferences(): DisplayMessageListSettings = DisplayMessageListSettings(
25+
isColorizeMissingContactPictures = storage.getBoolean(
26+
KEY_COLORIZE_MISSING_CONTACT_PICTURE,
27+
MESSAGE_LIST_SETTINGS_DEFAULT_IS_COLORIZE_MISSING_CONTACT_PICTURE,
28+
),
29+
isChangeContactNameColor = storage.getBoolean(
30+
KEY_CHANGE_REGISTERED_NAME_COLOR,
31+
MESSAGE_LIST_SETTINGS_DEFAULT_IS_CHANGE_CONTACT_NAME_COLOR,
32+
),
33+
isUseBackgroundAsUnreadIndicator = storage.getBoolean(
34+
KEY_USE_BACKGROUND_AS_UNREAD_INDICATOR,
35+
MESSAGE_LIST_SETTINGS_DEFAULT_IS_USE_BACKGROUND_AS_INDICATOR,
36+
),
37+
isShowCorrespondentNames = storage.getBoolean(
38+
KEY_SHOW_CORRESPONDENT_NAMES,
39+
MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CORRESPONDENT_NAMES,
40+
),
41+
isShowContactName = storage.getBoolean(
42+
KEY_SHOW_CONTACT_NAME,
43+
MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CONTACT_NAME,
44+
),
45+
isShowContactPicture = storage.getBoolean(
46+
KEY_SHOW_CONTACT_PICTURE,
47+
MESSAGE_LIST_SETTINGS_DEFAULT_IS_SHOW_CONTACT_PICTURE,
48+
),
49+
previewLines = storage.getInt(
50+
KEY_MESSAGE_LIST_VIEW_PREVIEW_LINES,
51+
MESSAGE_LIST_SETTINGS_DEFAULT_PREVIEW_LINES,
52+
),
53+
)
54+
55+
private fun write(preferences: DisplayMessageListSettings) {
56+
storageEditor.putBoolean(KEY_CHANGE_REGISTERED_NAME_COLOR, preferences.isChangeContactNameColor)
57+
storageEditor.putBoolean(KEY_COLORIZE_MISSING_CONTACT_PICTURE, preferences.isColorizeMissingContactPictures)
58+
storageEditor.putBoolean(KEY_SHOW_CONTACT_PICTURE, preferences.isShowContactPicture)
59+
storageEditor.putBoolean(KEY_USE_BACKGROUND_AS_UNREAD_INDICATOR, preferences.isUseBackgroundAsUnreadIndicator)
60+
storageEditor.putBoolean(KEY_SHOW_CONTACT_NAME, preferences.isShowContactName)
61+
storageEditor.putBoolean(KEY_SHOW_CORRESPONDENT_NAMES, preferences.isShowCorrespondentNames)
62+
storageEditor.putInt(KEY_MESSAGE_LIST_VIEW_PREVIEW_LINES, preferences.previewLines)
63+
}
64+
65+
override fun getConfig(): DisplayMessageListSettings = preferences.value
66+
override fun getConfigFlow(): Flow<DisplayMessageListSettings> = preferences
67+
}

feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/KoinModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ val featureWidgetMessageListModule = module {
88
accountManager = get(),
99
messageListRepository = get(),
1010
messageHelper = get(),
11-
generalSettingsManager = get(),
11+
messageListPreferencesManager = get(),
1212
outboxFolderManager = get(),
1313
)
1414
}

feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListItemMapper.kt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import com.fsck.k9.ui.helper.DisplayAddressHelper
88
import java.util.Calendar
99
import java.util.Locale
1010
import net.thunderbird.core.android.account.LegacyAccount
11-
import net.thunderbird.core.preference.GeneralSettingsManager
11+
import net.thunderbird.core.preference.display.visualSettings.message.list.MessageListPreferencesManager
1212
import net.thunderbird.feature.mail.folder.api.OutboxFolderManager
1313

1414
internal class MessageListItemMapper(
1515
private val messageHelper: MessageHelper,
1616
private val account: LegacyAccount,
17-
private val generalSettingsManager: GeneralSettingsManager,
17+
private val messageListPreferencesManager: MessageListPreferencesManager,
1818
private val outboxFolderManager: OutboxFolderManager,
1919
) : MessageMapper<MessageListItem> {
2020
private val calendar: Calendar = Calendar.getInstance()
@@ -28,18 +28,11 @@ internal class MessageListItemMapper(
2828
val showRecipients = DisplayAddressHelper.shouldShowRecipients(outboxFolderManager, account, message.folderId)
2929
val displayAddress = if (showRecipients) toAddresses.firstOrNull() else fromAddresses.firstOrNull()
3030
val displayName = if (showRecipients) {
31+
val settings = messageListPreferencesManager.getConfig()
3132
messageHelper.getRecipientDisplayNames(
3233
addresses = toAddresses.toTypedArray(),
33-
isShowCorrespondentNames = generalSettingsManager
34-
.getConfig()
35-
.display
36-
.visualSettings
37-
.isShowCorrespondentNames,
38-
isChangeContactNameColor = generalSettingsManager
39-
.getConfig()
40-
.display
41-
.visualSettings
42-
.isChangeContactNameColor,
34+
isShowCorrespondentNames = settings.isShowCorrespondentNames,
35+
isChangeContactNameColor = settings.isChangeContactNameColor,
4336
).toString()
4437
} else {
4538
messageHelper.getSenderDisplayName(displayAddress).toString()

feature/widget/message-list-glance/src/main/kotlin/net/thunderbird/feature/widget/message/list/MessageListLoader.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import net.thunderbird.core.android.account.LegacyAccount
88
import net.thunderbird.core.android.account.LegacyAccountManager
99
import net.thunderbird.core.android.account.SortType
1010
import net.thunderbird.core.logging.legacy.Log
11-
import net.thunderbird.core.preference.GeneralSettingsManager
11+
import net.thunderbird.core.preference.display.visualSettings.message.list.MessageListPreferencesManager
1212
import net.thunderbird.feature.mail.folder.api.OutboxFolderManager
1313
import net.thunderbird.feature.search.legacy.sql.SqlWhereClause
1414

1515
internal class MessageListLoader(
1616
private val accountManager: LegacyAccountManager,
1717
private val messageListRepository: MessageListRepository,
1818
private val messageHelper: MessageHelper,
19-
private val generalSettingsManager: GeneralSettingsManager,
19+
private val messageListPreferencesManager: MessageListPreferencesManager,
2020
private val outboxFolderManager: OutboxFolderManager,
2121
) {
2222

@@ -46,7 +46,7 @@ internal class MessageListLoader(
4646
private fun loadMessageListForAccount(account: LegacyAccount, config: MessageListConfig): List<MessageListItem> {
4747
val accountUuid = account.uuid
4848
val sortOrder = buildSortOrder(config)
49-
val mapper = MessageListItemMapper(messageHelper, account, generalSettingsManager, outboxFolderManager)
49+
val mapper = MessageListItemMapper(messageHelper, account, messageListPreferencesManager, outboxFolderManager)
5050

5151
return if (config.showingThreadedList) {
5252
val (selection, selectionArgs) = buildSelection(config)

feature/widget/message-list/src/main/kotlin/app/k9mail/feature/widget/message/list/KoinModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ val messageListWidgetModule = module {
99
accountManager = get(),
1010
messageListRepository = get(),
1111
messageHelper = get(),
12-
generalSettingsManager = get(),
12+
messageListPreferencesManager = get(),
1313
outboxFolderManager = get(),
1414
)
1515
}

0 commit comments

Comments
 (0)