Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added KeeWeb in default app exclusion #147

Closed
wants to merge 2 commits into from
Closed

Conversation

seupedro
Copy link
Contributor

@seupedro seupedro commented Aug 10, 2020

KeeWeb is very popular. It deserves to be also in the exclusion list

https://github.com/keeweb/keeweb

image

@@ -88,7 +88,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
"de.petermaurer.TransientPasteboardType",
"com.typeit4me.clipping",
"Pasteboard generator type",
"com.agilebits.onepassword"
"com.agilebits.onepassword",
"net.antelle.keeweb"
Copy link
Owner

@p0deje p0deje Aug 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add KeeWeb, you need to create a brand new migration with a separate key (2020-08-11-add-keeweb-to-ignored-types.) Otherwise, it won't be added to any user who has the migration already run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you mean

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that there is this guard to make sure we don't run migration more than once:

if UserDefaults.standard.migrations["2020-04-25-allow-custom-ignored-types"] != true {
  # migration code
  UserDefaults.standard.migrations["2020-04-25-allow-custom-ignored-types"] = true
}

Anyone who has upgraded Maccy since April already has this migration run, so it won't be applied. It's easy to check what migrations are run with this following command:

$ defaults read org.p0deje.Maccy migrations
{
    "2020-02-22-history-item-add-copied-at" = 1;
    "2020-02-22-history-item-add-number-of-copies" = 1;
    "2020-04-18-switch-storage-to-core-data" = 1;
    "2020-04-25-allow-custom-ignored-types" = 1;
    "2020-06-19-use-keyboardshortcuts" = 1;
}

So if we want to add KeeWeb to all users when they upgrade Maccy in the next version, we need a new migration. Something like this should do the trick:

if UserDefaults.standard.migrations["2020-08-11-add-keeweb-to-ignored-types"] != true {
  UserDefaults.standard.ignoredPasteboardTypes =
    UserDefaults.standard.ignoredPasteboardTypes.union(["2020-04-25-allow-custom-ignored-types"])
  UserDefaults.standard.migrations["2020-08-11-add-keeweb-to-ignored-types"] = true
}

p0deje added a commit that referenced this pull request Sep 2, 2020
Co-Authored-By: Seu Pedro <seupedro@users.noreply.github.com>
@p0deje
Copy link
Owner

p0deje commented Sep 2, 2020

Merged in cd60574, thank you!

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.

None yet

2 participants