Skip to content

Commit

Permalink
Merge pull request #8459 from shamim-emon/fix-issue-7556
Browse files Browse the repository at this point in the history
Disable Unified Inbox if there's only one account
  • Loading branch information
wmontwe authored Nov 7, 2024
2 parents 7e63b05 + 92b9ccc commit 616b006
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import app.k9mail.feature.account.setup.AccountSetupExternalContract
import app.k9mail.feature.account.setup.AccountSetupExternalContract.AccountCreator.AccountCreatorResult
import app.k9mail.legacy.account.Account.SpecialFolderSelection
import com.fsck.k9.Core
import com.fsck.k9.K9
import com.fsck.k9.Preferences
import com.fsck.k9.controller.MessagingController
import com.fsck.k9.logging.Timber
Expand Down Expand Up @@ -79,6 +80,11 @@ class AccountCreator(

preferences.saveAccount(newAccount)

if (preferences.getAccounts().size > 1) {
K9.isShowUnifiedInbox = true
K9.saveSettingsAsync()
}

Core.setServicesEnabled(context)

messagingController.refreshFolderListBlocking(newAccount)
Expand Down
4 changes: 2 additions & 2 deletions legacy/core/src/main/java/com/fsck/k9/K9.kt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ object K9 : KoinComponent {
var isUseVolumeKeysForNavigation = false

@JvmStatic
var isShowUnifiedInbox = true
var isShowUnifiedInbox = false

@JvmStatic
var isShowStarredCount = false
Expand Down Expand Up @@ -328,7 +328,7 @@ object K9 : KoinComponent {
isSensitiveDebugLoggingEnabled = storage.getBoolean("enableSensitiveLogging", false)
isShowAnimations = storage.getBoolean("animations", true)
isUseVolumeKeysForNavigation = storage.getBoolean("useVolumeKeysForNavigation", false)
isShowUnifiedInbox = storage.getBoolean("showUnifiedInbox", true)
isShowUnifiedInbox = storage.getBoolean("showUnifiedInbox", false)
isShowStarredCount = storage.getBoolean("showStarredCount", false)
isMessageListSenderAboveSubject = storage.getBoolean("messageListSenderAboveSubject", false)
isShowMessageListStars = storage.getBoolean("messageListStars", true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ class GeneralSettingsDescriptions {
new V(1, new BooleanSetting(true))
));
s.put("showUnifiedInbox", Settings.versions(
new V(69, new BooleanSetting(true))
new V(69, new BooleanSetting(true)),
new V(101, new BooleanSetting(false))
));
s.put("sortTypeEnum", Settings.versions(
new V(10, new EnumSetting<>(SortType.class, Account.DEFAULT_SORT_TYPE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Settings {
*
* @see SettingsExporter
*/
public static final int VERSION = 100;
public static final int VERSION = 101;

static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription<?>>> settings,
Map<String, String> importedSettings, boolean useDefaultValues) {
Expand Down

0 comments on commit 616b006

Please sign in to comment.