aboutsummaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2010-09-23 10:30:07 +0000
committerYana Stamcheva <yana@jitsi.org>2010-09-23 10:30:07 +0000
commit834e076de628733a26e6105e0ce400e1f26c0b1b (patch)
tree4449338b23210d91c0cc10d9b432d6861b5210f5 /src/net
parent5cbc7e86b4eb28b90333e871f9e7cd393ef63ea5 (diff)
downloadjitsi-834e076de628733a26e6105e0ce400e1f26c0b1b.zip
jitsi-834e076de628733a26e6105e0ce400e1f26c0b1b.tar.gz
jitsi-834e076de628733a26e6105e0ce400e1f26c0b1b.tar.bz2
Fix options panel.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/account/Account.java12
-rw-r--r--src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java7
-rw-r--r--src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java6
-rw-r--r--src/net/java/sip/communicator/service/protocol/AccountID.java7
4 files changed, 23 insertions, 9 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/account/Account.java b/src/net/java/sip/communicator/impl/gui/main/account/Account.java
index 9e63738..c750e19 100644
--- a/src/net/java/sip/communicator/impl/gui/main/account/Account.java
+++ b/src/net/java/sip/communicator/impl/gui/main/account/Account.java
@@ -82,9 +82,11 @@ public class Account
this.name = accountID.getDisplayName();
- this.icon = ImageLoader.getImageForPath(
- accountID.getAccountPropertyString(
- ProtocolProviderFactory.ACCOUNT_ICON_PATH));
+ String iconPath = accountID.getAccountPropertyString(
+ ProtocolProviderFactory.ACCOUNT_ICON_PATH);
+
+ if (iconPath != null)
+ this.icon = ImageLoader.getImageForPath(iconPath);
this.isEnabled = accountID.isEnabled();
}
@@ -131,10 +133,6 @@ public class Account
*/
public Icon getIcon()
{
- icon = ImageLoader.getImageForPath(
- accountID.getAccountPropertyString(
- ProtocolProviderFactory.ACCOUNT_ICON_PATH));
-
return icon;
}
diff --git a/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java b/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java
index 2d8d5ad..6a4c0e8 100644
--- a/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java
+++ b/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java
@@ -1403,7 +1403,12 @@ public class ImageLoader
if(is == null)
is = GuiActivator.getResources()
- .getImageInputStreamForPath(imagePath);
+ .getImageInputStreamForPath(imagePath);
+
+ // If we didn't find the icon corresponding to the given path, we have
+ // nothing more to do here.
+ if (is == null)
+ return null;
byte[] icon = null;
try
diff --git a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java
index 2b6a890..8299b21 100644
--- a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java
@@ -498,7 +498,11 @@ public class ResourceManagementServiceImpl
}
}
- return imagePack.getClass().getClassLoader().getResourceAsStream(path);
+ if (path != null)
+ return imagePack.getClass().getClassLoader()
+ .getResourceAsStream(path);
+
+ return null;
}
/**
diff --git a/src/net/java/sip/communicator/service/protocol/AccountID.java b/src/net/java/sip/communicator/service/protocol/AccountID.java
index 7fe4267..b68b800 100644
--- a/src/net/java/sip/communicator/service/protocol/AccountID.java
+++ b/src/net/java/sip/communicator/service/protocol/AccountID.java
@@ -269,6 +269,13 @@ public abstract class AccountID
return intValue;
}
+ /**
+ * Returns the account property string corresponding to the given key.
+ *
+ * @param key the key, corresponding to the property string we're looking
+ * for
+ * @return the account property string corresponding to the given key
+ */
public String getAccountPropertyString(Object key)
{
Object value = getAccountProperty(key);