Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76df04e9 authored by Thialfihar's avatar Thialfihar
Browse files

make shortcuts honour the account setting for the startup folder even if...

make shortcuts honour the account setting for the startup folder even if changed after shortcut creation, based on cketti's patch, refs issue 1025
parent 00a8f948
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -151,10 +151,6 @@
        <activity
            android:name="com.fsck.k9.activity.MessageList"
            android:launchMode="singleTask">
            <intent-filter>
                <!-- This action is only to allow an entry point for launcher shortcuts -->
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.fsck.k9.activity.MessageView"
+19 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ public class FolderList extends K9ListActivity

    private static final String EXTRA_INITIAL_FOLDER = "initialFolder";
    private static final String EXTRA_FROM_NOTIFICATION = "fromNotification";
    private static final String EXTRA_FROM_SHORTCUT = "fromShortcut";

    private static final boolean REFRESH_REMOTE = true;

@@ -210,10 +211,15 @@ public class FolderList extends K9ListActivity

    public static Intent actionHandleAccountIntent(Context context, Account account)
    {
        return actionHandleAccountIntent(context, account, null);
        return actionHandleAccountIntent(context, account, null, false);
    }

    public static Intent actionHandleAccountIntent(Context context, Account account, String initialFolder)
    {
        return actionHandleAccountIntent(context, account, initialFolder, false);
    }

    public static Intent actionHandleAccountIntent(Context context, Account account, String initialFolder, boolean fromShortcut)
    {
        Intent intent = new Intent(context, FolderList.class);
        intent.putExtra(EXTRA_ACCOUNT, account.getUuid());
@@ -222,6 +228,12 @@ public class FolderList extends K9ListActivity
        {
            intent.putExtra(EXTRA_INITIAL_FOLDER, initialFolder);
        }

        if (fromShortcut)
        {
            intent.putExtra(EXTRA_FROM_SHORTCUT, true);
        }

        return intent;
    }

@@ -306,6 +318,12 @@ public class FolderList extends K9ListActivity
            onOpenFolder(initialFolder);
            finish();
        }
        else if (intent.getBooleanExtra(EXTRA_FROM_SHORTCUT, false) &&
                !K9.FOLDER_NONE.equals(mAccount.getAutoExpandFolderName()))
        {
            onOpenFolder(mAccount.getAutoExpandFolderName());
            finish();
        }
        else
        {

+1 −11
Original line number Diff line number Diff line
@@ -57,17 +57,7 @@ public class LauncherShortcuts extends K9ListActivity implements OnItemClickList

    private void setupShortcut(Account account)
    {
        Intent shortcutIntent = null;
        if (K9.FOLDER_NONE.equals(account.getAutoExpandFolderName()))
        {
            shortcutIntent = FolderList.actionHandleAccountIntent(this, account);
        }
        else
        {
            shortcutIntent =
                    MessageList.actionHandleFolderIntent(this, account,
                                                         account.getAutoExpandFolderName());
        }
        final Intent shortcutIntent = FolderList.actionHandleAccountIntent(this, account, null, true);

        Intent intent = new Intent();
        intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);