[dmdirc commit] r5823 - trunk/src/com/dmdirc/plugins

1 view
Skip to first unread message

com...@dmdirc.com

unread,
Jan 23, 2010, 8:31:06 PM1/23/10
to dmd...@googlegroups.com
Author: greboid
Date: 2010-01-24 01:31:04 +0000 (Sun, 24 Jan 2010)
New Revision: 5823

Modified:
trunk/src/com/dmdirc/plugins/Plugin.java
trunk/src/com/dmdirc/plugins/PluginInfo.java
Log:
Fixes issue 3598 (http://bugs.dmdirc.com/view/3598): Add a sane way to get a plugin info for a specific plugin

Git-version: 0.6.3m2-355-g26b8e87


Modified: trunk/src/com/dmdirc/plugins/Plugin.java
===================================================================
--- trunk/src/com/dmdirc/plugins/Plugin.java 2010-01-24 01:02:04 UTC (rev 5822)
+++ trunk/src/com/dmdirc/plugins/Plugin.java 2010-01-24 01:31:04 UTC (rev 5823)
@@ -34,6 +34,8 @@
private String myDomain = "plugin-unknown";
/** Has the domain been set? */
private boolean domainSet = false;
+ /** Associated Plugin info. */
+ private PluginInfo pluginInfo;

/**
* Called when the plugin is constructed.
@@ -56,6 +58,24 @@
}

/**
+ * Sets the associated plugin info for this plugin.
+ *
+ * @param pluginInfo Associated plugin info
+ */
+ public void setPluginInfo(final PluginInfo pluginInfo) {
+ this.pluginInfo = pluginInfo;
+ }
+
+ /**
+ * Returns the plugin info associated with this plugin.
+ *
+ * @return Plugin info or null
+ */
+ public PluginInfo getPluginInfo() {
+ return pluginInfo;
+ }
+
+ /**
* Get the domain name settings for this plugin should be stored in.
*
* @return Domain name for plugin settings

Modified: trunk/src/com/dmdirc/plugins/PluginInfo.java
===================================================================
--- trunk/src/com/dmdirc/plugins/PluginInfo.java 2010-01-24 01:02:04 UTC (rev 5822)
+++ trunk/src/com/dmdirc/plugins/PluginInfo.java 2010-01-24 01:31:04 UTC (rev 5823)
@@ -117,7 +117,7 @@
*/
public PluginInfo(final URL url, final boolean load) throws PluginException {
this.url = url;
- this.filename = (new File(url.getPath())).getName();
+ this.filename = new File(url.getPath()).getName();

ResourceManager res;

@@ -895,6 +895,7 @@
plugin = (Plugin) temp;
LOGGER.finer(getName() + ": Setting domain 'plugin-" + getName() + "'");
plugin.setDomain("plugin-" + getName());
+ plugin.setPluginInfo(this);
if (!tempLoaded) {
try {
plugin.onLoad();

com...@dmdirc.com

unread,
Jan 23, 2010, 8:36:04 PM1/23/10
to dmd...@googlegroups.com

com...@dmdirc.com

unread,
Jan 23, 2010, 8:46:05 PM1/23/10
to dmd...@googlegroups.com

com...@dmdirc.com

unread,
Jan 23, 2010, 10:16:05 PM1/23/10
to dmd...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages