Browse Source

Few more Identity references.

Change-Id: I120bda4c85a31339180146761791fd341d6d4740
Reviewed-on: http://gerrit.dmdirc.com/2778
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.8rc1
Chris Smith 10 years ago
parent
commit
d8b3fcb15f

+ 2
- 2
src/com/dmdirc/config/ConfigManager.java View File

@@ -469,13 +469,13 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
469 469
     /** {@inheritDoc} */
470 470
     @Override
471 471
     public void configProviderAdded(final ConfigProvider configProvider) {
472
-        checkIdentity((Identity) configProvider);
472
+        checkIdentity(configProvider);
473 473
     }
474 474
 
475 475
     /** {@inheritDoc} */
476 476
     @Override
477 477
     public void configProviderRemoved(final ConfigProvider configProvider) {
478
-        removeIdentity((Identity) configProvider);
478
+        removeIdentity(configProvider);
479 479
     }
480 480
 
481 481
 }

+ 1
- 14
src/com/dmdirc/config/Identity.java View File

@@ -52,7 +52,7 @@ import lombok.extern.slf4j.Slf4j;
52 52
  * Note: this class has a natural ordering that is inconsistent with equals.
53 53
  */
54 54
 @Slf4j
55
-public class Identity extends ConfigSource implements Comparable<Identity>, ConfigProvider {
55
+public class Identity extends ConfigSource implements ConfigProvider {
56 56
 
57 57
     /** The domain used for identity settings. */
58 58
     private static final String DOMAIN = "identity";
@@ -551,17 +551,4 @@ public class Identity extends ConfigSource implements Comparable<Identity>, Conf
551 551
                 && getTarget() == ((Identity) obj).getTarget();
552 552
     }
553 553
 
554
-    /**
555
-     * Compares this identity to another config source to determine which
556
-     * is more specific.
557
-     *
558
-     * @param target The Identity to compare to
559
-     * @return -1 if this config source is less specific, 0 if they're equal,
560
-     * +1 if this config is more specific.
561
-     */
562
-    @Override
563
-    public int compareTo(final Identity target) {
564
-        return target.getTarget().compareTo(myTarget);
565
-    }
566
-
567 554
 }

+ 6
- 6
src/com/dmdirc/config/IdentityManager.java View File

@@ -87,13 +87,13 @@ public class IdentityManager implements IdentityFactory, IdentityController {
87 87
     private final MapList<String, ConfigProviderListener> listeners = new WeakMapList<>();
88 88
 
89 89
     /** The identity file used for the global config. */
90
-    private Identity config;
90
+    private ConfigProvider config;
91 91
 
92 92
     /** The identity file used for addon defaults. */
93
-    private Identity addonConfig;
93
+    private ConfigProvider addonConfig;
94 94
 
95 95
     /** The identity file bundled with the client containing version info. */
96
-    private Identity versionConfig;
96
+    private ConfigProvider versionConfig;
97 97
 
98 98
     /** The config manager used for global settings. */
99 99
     private ConfigManager globalconfig;
@@ -390,19 +390,19 @@ public class IdentityManager implements IdentityFactory, IdentityController {
390 390
 
391 391
     /** {@inheritDoc} */
392 392
     @Override
393
-    public Identity getUserSettings() {
393
+    public ConfigProvider getUserSettings() {
394 394
         return config;
395 395
     }
396 396
 
397 397
     /** {@inheritDoc} */
398 398
     @Override
399
-    public Identity getAddonSettings() {
399
+    public ConfigProvider getAddonSettings() {
400 400
         return addonConfig;
401 401
     }
402 402
 
403 403
     /** {@inheritDoc} */
404 404
     @Override
405
-    public Identity getVersionSettings() {
405
+    public ConfigProvider getVersionSettings() {
406 406
         return versionConfig;
407 407
     }
408 408
 

Loading…
Cancel
Save