Skip to content

Commit

Permalink
Merge pull request #5 from garyttierney/bugfix/message-bus-deprecation
Browse files Browse the repository at this point in the history
Use project-level MessageBus instead of module
  • Loading branch information
garyttierney authored Nov 23, 2021
2 parents 0138dea + d4eccaa commit 83d2248
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
### Added

### Changed
- Re-based the repository on top of the IntelliJ Platform Plugin Template and integrated CI.
- Re-based the repository on top of the IntelliJ Platform Plugin Template and integrated CI (#6).

### Fixed
- Use project-level MessageBus instead of deprecated module-level (#4).

### Removed
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package com.codingmates.ghidra.intellij.ide.facet


import com.intellij.ProjectTopics
import com.intellij.facet.Facet
import com.intellij.facet.FacetManager
import com.intellij.facet.FacetManagerAdapter
import com.intellij.facet.FacetType
import com.intellij.facet.*
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.application.runWriteAction
import com.intellij.openapi.module.Module
Expand All @@ -23,13 +20,13 @@ class GhidraFacet(
configuration: GhidraFacetConfiguration,
underlyingFacet: Facet<*>?
) : Facet<GhidraFacetConfiguration>(facetType, module, name, configuration, underlyingFacet) {
val connection: MessageBusConnection = module.messageBus.connect()
private val connection: MessageBusConnection = module.project.messageBus.connect()

val installationPath
get() = configuration.ghidraState.installationPath

init {
connection.subscribe(FacetManager.FACETS_TOPIC, object : FacetManagerAdapter() {
connection.subscribe(FacetManager.FACETS_TOPIC, object : FacetManagerListener {
override fun beforeFacetRemoved(facet: Facet<*>) {
removeLibrary()
}
Expand Down

0 comments on commit 83d2248

Please sign in to comment.