From 74d46d7135e1d1007e05768ab583c5abe06c7597 Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Mon, 12 Sep 2016 14:20:01 +0200 Subject: [PATCH] Fixed a minor issue --- app/build.gradle | 10 +++++++++ .../syncables/types/impl/NetworkInfo.java | 21 ++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e5b043e51..ee29892f9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,6 +53,15 @@ if (project.hasProperty("storeFile")) { } } +def getGitHash = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short', 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() +} + def versionPropsFile = file('version.properties') def versionBuild = 0 if (versionPropsFile.exists() && versionPropsFile.canRead()) { @@ -85,6 +94,7 @@ android { targetSdkVersion 24 versionCode versionBuild versionName rawVersionName + " Build #" + versionBuild + buildConfigField "String", "GitHash", "\"${getGitHash()}\"" } dataBinding { enabled = true diff --git a/app/src/main/java/de/kuschku/libquassel/syncables/types/impl/NetworkInfo.java b/app/src/main/java/de/kuschku/libquassel/syncables/types/impl/NetworkInfo.java index 3bc130a64..bbfd54676 100644 --- a/app/src/main/java/de/kuschku/libquassel/syncables/types/impl/NetworkInfo.java +++ b/app/src/main/java/de/kuschku/libquassel/syncables/types/impl/NetworkInfo.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Observable; import de.kuschku.libquassel.objects.types.NetworkServer; +import de.kuschku.util.backports.Objects; public class NetworkInfo extends Observable { private int networkId; @@ -308,16 +309,16 @@ public class NetworkInfo extends Observable { autoReconnectRetries == that.autoReconnectRetries && unlimitedReconnectRetries == that.unlimitedReconnectRetries && rejoinChannels == that.rejoinChannels && - (networkName != null ? networkName.equals(that.networkName) : that.networkName == null) && - (codecForServer != null ? codecForServer.equals(that.codecForServer) : that.codecForServer == null) && - (codecForEncoding != null ? codecForEncoding.equals(that.codecForEncoding) : that.codecForEncoding == null) && - (codecForDecoding != null ? codecForDecoding.equals(that.codecForDecoding) : that.codecForDecoding == null) && - (serverList != null ? serverList.equals(that.serverList) : that.serverList == null) && - (perform != null ? perform.equals(that.perform) : that.perform == null) && - (autoIdentifyService != null ? autoIdentifyService.equals(that.autoIdentifyService) : that.autoIdentifyService == null) && - (autoIdentifyPassword != null ? autoIdentifyPassword.equals(that.autoIdentifyPassword) : that.autoIdentifyPassword == null) && - (saslAccount != null ? saslAccount.equals(that.saslAccount) : that.saslAccount == null) && - (saslPassword != null ? saslPassword.equals(that.saslPassword) : that.saslPassword == null) + Objects.equals(networkName, that.networkName) && + Objects.equals(codecForServer, that.codecForServer) && + Objects.equals(codecForEncoding, that.codecForEncoding) && + Objects.equals(codecForDecoding, that.codecForDecoding) && + Objects.equals(serverList, that.serverList) && + Objects.equals(perform, that.perform) && + Objects.equals(autoIdentifyService, that.autoIdentifyService) && + Objects.equals(autoIdentifyPassword, that.autoIdentifyPassword) && + Objects.equals(saslAccount, that.saslAccount) && + Objects.equals(saslPassword, that.saslPassword) ); } -- GitLab