Skip to content

Commit

Permalink
Remove tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
my-flow committed May 10, 2018
1 parent ca8f281 commit cb8f051
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 278 deletions.
9 changes: 2 additions & 7 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Import List is released under the GNU General Public License, Version 3.0.

--

Apache Commons Configuration, Apache Commons IO, Apache Commons Lang,
Apache Commons Logging, HttpComponents Core, Apache HttpComponents Client
Apache Commons Configuration, Apache Commons IO, Apache Commons Lang,
Apache Commons Logging
Copyright 2001-2015 The Apache Software Foundation

This product includes software developed by
Expand Down Expand Up @@ -237,11 +237,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

--

Java API for Google Analytics Measurement Protocol (part of Universal Analytics).
This library is released under liberal Apache Open source License 2.0

--

SLF4J
Copyright (c) 2004-2013 QOS.ch
All rights reserved.
Expand Down
6 changes: 0 additions & 6 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ apply plugin: 'com.github.johnrengelman.shadow'

dependencies {
compile(':moneydance:')
compile('com.brsanthu:google-analytics-java:1.1.2')
compile('commons-io:commons-io:2.5')
compile('org.apache.commons:commons-lang3:3.6')
compile('commons-configuration:commons-configuration:1.10')
Expand Down Expand Up @@ -49,14 +48,10 @@ shadowJar {
include dependency('org.apache.commons:commons-lang3:3.6')
include dependency('commons-io:commons-io:2.5')
include dependency('commons-configuration:commons-configuration:1.10')
include dependency('org.apache.httpcomponents:httpcore:4.3')
include dependency('org.apache.httpcomponents:httpclient:4.3')
include dependency('commons-logging:commons-logging:1.2')
include dependency('com.brsanthu:google-analytics-java:1.1.2')
include dependency('org.slf4j:slf4j-api:1.7.25')
include dependency('org.slf4j:slf4j-nop:1.7.25')
}
relocate 'org.apache.http', 'com.moneydance.modules.features.importlist.apache.http'
}

task proguard(type: ProGuardTask, dependsOn: 'shadowJar') {
Expand All @@ -82,7 +77,6 @@ javadoc {
options.links = [
'https://docs.oracle.com/javase/7/docs/api/',
'http://moneydance.com/dev/apidoc/',
'https://brsanthu.github.io/google-analytics-java/javadocs/',
'http://www.slf4j.org/apidocs/',
'https://commons.apache.org/proper/commons-configuration/javadocs/v1.10/apidocs/',
'https://commons.apache.org/proper/commons-io/javadocs/api-2.5/',
Expand Down
2 changes: 0 additions & 2 deletions core/config/proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
-dontwarn org.apache.**
-dontnote org.apache.**
-dontwarn org.slf4j.**
-dontwarn com.moneydance.modules.features.importlist.apache.http.**
-dontnote com.moneydance.modules.features.importlist.apache.http.**
-dontwarn javax.annotation.*

-dontoptimize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.moneydance.modules.features.importlist.util.Helper;
import com.moneydance.modules.features.importlist.util.Preferences;
import com.moneydance.modules.features.importlist.util.Settings;
import com.moneydance.modules.features.importlist.util.Tracker;

import javax.annotation.Nullable;
import java.awt.Image;
Expand All @@ -45,7 +44,6 @@ public final class Main extends FeatureModule implements Observer {

private final Preferences prefs;
private final Settings settings;
@Nullable private Tracker tracker;
@Nullable private String baseDirectory;
@Nullable private ViewController viewController;

Expand All @@ -65,18 +63,15 @@ public Main() {
@Override
public void init() {
Helper.INSTANCE.addObserver(this);
this.tracker = Helper.INSTANCE.getTracker(this.getBuild());

if (this.prefs.isFirstRun()) {
this.prefs.setFirstRun(false);
LOG.config("Install");
this.tracker.track(Tracker.EventName.INSTALL);
}

this.viewController = new ViewController(
this.baseDirectory,
this.getContext(),
this.tracker);
this.getContext());

// register this module's homepage view
LOG.config("Registering homepage view");
Expand Down Expand Up @@ -117,7 +112,6 @@ public void update(final Observable observable, final Object updateAll) {
@Override
public void unload() {
LOG.info("Unloading extension."); //$NON-NLS-1$
this.tracker.track(Tracker.EventName.UNINSTALL);
this.viewController.setActive(false);
this.cleanup();
this.prefs.setAllWritablePreferencesToNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.moneydance.modules.features.importlist.util.Localizable;
import com.moneydance.modules.features.importlist.util.Preferences;
import com.moneydance.modules.features.importlist.util.Settings;
import com.moneydance.modules.features.importlist.util.Tracker;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
Expand All @@ -55,7 +54,6 @@ public final class ViewController implements HomePageView {
private final Settings settings;
private final Localizable localizable;
private final FileAdmin fileAdmin;
private final Tracker tracker;
private boolean initialized;
private final ColumnFactory columnFactory;
private final JViewport viewport;
Expand All @@ -68,13 +66,11 @@ public final class ViewController implements HomePageView {

public ViewController(
final String baseDirectory,
final FeatureModuleContext argContext,
final Tracker argTracker) {
final FeatureModuleContext argContext) {
this.settings = Helper.INSTANCE.getSettings();
this.localizable = Helper.INSTANCE.getLocalizable();
this.fileAdmin = new FileAdmin(baseDirectory, argContext);
this.fileAdmin.addObserver(new ViewControllerObserver());
this.tracker = argTracker;

this.viewport = new JViewport();
this.viewport.setOpaque(false);
Expand All @@ -100,7 +96,6 @@ private void init() {
this.setDirty(true);
this.refresh();
this.fileAdmin.startMonitor();
this.tracker.track(Tracker.EventName.DISPLAY);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public enum Helper {
private final Settings settings;
@Nullable private Preferences prefs;
@Nullable private Localizable localizable;
@Nullable private Tracker tracker;

Helper() {
this.observable = new HelperObservable();
Expand Down Expand Up @@ -76,19 +75,6 @@ public Localizable getLocalizable() {
return this.localizable;
}

public Tracker getTracker(final int build) {
synchronized (Helper.class) {
if (this.tracker == null) {
this.tracker = new Tracker(
build,
this.settings.getExtensionName(),
this.prefs.getFullVersion(),
this.settings.getTrackingCode());
}
}
return this.tracker;
}

public void addObserver(final Observer observer) {
this.observable.addObserver(observer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ public boolean isFirstRun() {
true);
}

public String getFullVersion() {
return this.getUserPreferences().getSetting("current_version", "0");
}

public Locale getLocale() {
return this.getUserPreferences().getLocale();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,34 +297,6 @@ public String getKeyboardShortcutDelete() {
return this.config.getString("keyboard_shortcut_delete"); //$NON-NLS-1$
}

/**
* @return Tracking code for Google Analytics (aka "utmac").
*/
public String getTrackingCode() {
return this.config.getString("tracking_code"); //$NON-NLS-1$
}

/**
* @return Event action for installation
*/
public String getEventActionInstall() {
return this.config.getString("event_action_install"); //$NON-NLS-1$
}

/**
* @return Event action for display
*/
public String getEventActionDisplay() {
return this.config.getString("event_action_display"); //$NON-NLS-1$
}

/**
* @return Event action for removal
*/
public String getEventActionUninstall() {
return this.config.getString("event_action_uninstall"); //$NON-NLS-1$
}

private static Image getImage(final String resource) {
try {
InputStream inputStream = Helper.getInputStreamFromResource(
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions core/src/main/resources/settings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,3 @@ keyboard_shortcut_import = alt I

# Keyboard shortcut to delete files
keyboard_shortcut_delete = alt D

# Tracking code for Google Analytics (aka "utmac")
tracking_code = UA-661182-7

# Event action for installation
event_action_install = Install

# Event action for display
event_action_display = Display

# Event action for removal
event_action_uninstall = Uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public void setUp() {
new StubContextFactory();
this.viewController = new ViewController(
null,
new StubContextFactory().getContext(),
Helper.INSTANCE.getTracker(0));
new StubContextFactory().getContext());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
SettingsTest.class,
LocalizableTest.class,
LogFormatterTest.class,
HelperTest.class,
TrackerTest.class
HelperTest.class
})
public final class AllTests {
// no test cases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ public void testGetLocalizable() {
assertThat(Helper.INSTANCE.getLocalizable(), notNullValue());
}

@Test
public void testGetTracker() {
assertThat(Helper.INSTANCE.getTracker(0), notNullValue());
}

@Test
public void testGetInputStreamFromResource() {
assertThat(Helper.getInputStreamFromResource(
Expand Down
Loading

0 comments on commit cb8f051

Please sign in to comment.