From 0b74dfc67ab40b243d8048008289a8e1d08fc4ae Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Fri, 18 Oct 2013 17:41:32 -0700 Subject: [PATCH] Remove unnecessary lines --- spec/theme-manager-spec.coffee | 4 ++-- src/package-manager.coffee | 3 --- src/theme-manager.coffee | 14 +++----------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/spec/theme-manager-spec.coffee b/spec/theme-manager-spec.coffee index 59ab435ee..b6c0a3f91 100644 --- a/spec/theme-manager-spec.coffee +++ b/spec/theme-manager-spec.coffee @@ -4,7 +4,7 @@ path = require 'path' ThemeManager = require '../src/theme-manager' AtomPackage = require '../src/atom-package' -describe "ThemeManager", -> +fdescribe "ThemeManager", -> themeManager = null beforeEach -> @@ -74,7 +74,7 @@ describe "ThemeManager", -> describe "when a theme fails to load", -> it "logs a warning", -> spyOn(console, 'warn') - expect(-> themeManager.activateTheme('a-theme-that-will-not-be-found')).toThrow() + expect(-> atom.packages.activatePackage('a-theme-that-will-not-be-found')).toThrow() describe "requireStylesheet(path)", -> it "synchronously loads css at the given path and installs a style tag for it in the head", -> diff --git a/src/package-manager.coffee b/src/package-manager.coffee index c18032b4e..20b45eae8 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -90,9 +90,6 @@ class PackageManager if @isPackageDisabled(name) return console.warn("Tried to load disabled package '#{name}'") - pack = @getLoadedPackage(name) - return pack if pack - if packagePath = @resolvePackagePath(name) return pack if pack = @getLoadedPackage(name) diff --git a/src/theme-manager.coffee b/src/theme-manager.coffee index 7fc5fb163..0730ee8ca 100644 --- a/src/theme-manager.coffee +++ b/src/theme-manager.coffee @@ -42,32 +42,24 @@ class ThemeManager activateThemes: -> # atom.config.observe runs the callback once, then on subsequent changes. atom.config.observe 'core.themes', (themeNames) => - @deactivateThemes() + @packageManager.deactivatePackages() themeNames = [themeNames] unless _.isArray(themeNames) # Reverse so the first (top) theme is loaded after the others. We want # the first/top theme to override later themes in the stack. themeNames = _.clone(themeNames).reverse() - @activateTheme(themeName) for themeName in themeNames + @packageManager.activatePackage(themeName) for themeName in themeNames @loadUserStylesheet() @reloadBaseStylesheets() @emit('reloaded') - # Internal-only: - activateTheme: (themeName) -> - @packageManager.activatePackage(themeName) - # Internal-only: deactivateThemes: -> @removeStylesheet(@userStylesheetPath) if @userStylesheetPath? - @deactivateTheme(pack.name) for pack in @getActiveThemes() + @packageManager.deactivatePackage(pack.name) for pack in @getActiveThemes() null - # Internal-only: - deactivateTheme: (themeName) -> - @packageManager.deactivatePackage(themeName) - # Public: getImportPaths: -> activeThemes = @getActiveThemes()