Commit de940a5d authored by Matyáš Latner's avatar Matyáš Latner

#448 Small refactor

parent b1b1b655
......@@ -282,7 +282,7 @@ def getVersionNameFromGit(String relativePath) {
// get last tag in current branch
exec {
workingDir relativePath
commandLine 'git', 'describe', '--abbrev=0', '--tags'
commandLine 'git', 'describe', '--abbrev=0', '--tags', '--always'
standardOutput = stdout
}
String result = stdout.toString().trim();
......@@ -318,7 +318,7 @@ def getVersionCodeFromGit(String relativePath) {
def getBranchNameFromGit() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--contains', '--all', 'HEAD'
commandLine 'git', 'describe', '--contains', '--all', 'HEAD', '--always'
standardOutput = stdout
}
String branchString = stdout.toString().trim()
......
......@@ -221,7 +221,7 @@ public class UserMenu extends AbstractMenu {
}
@Override
protected void onWrongResponseCode(int responseCode) {
public void onWrongResponseCode(int responseCode) {
String failReason = ApplicationTextManager.ApplicationTextsAssets.SYNC_REQUEST_ERROR;
if(responseCode == DownloadUser.USER_NOT_FOUND_STATUS_CODE)
......@@ -229,6 +229,11 @@ public class UserMenu extends AbstractMenu {
showSyncFailedDialog(ApplicationTextManager.getInstance().getText(failReason));
}
@Override
public void onCancelled() {
//no action
}
});
RestSynchronizationService.doSyncWork(syncWork);
}
......
......@@ -183,18 +183,10 @@ public abstract class SyncWork implements Net.HttpResponseListener {
//////////// Response listener class
public abstract static class RestSyncListener {
public void onFailure(Throwable t) {
}
// on wrong response from the server
protected void onWrongResponseCode(int responseCode) {
}
public void onCancelled() {}
public abstract void onSuccess(User user);
public interface RestSyncListener {
void onSuccess(User user);
void onFailure(Throwable t);
void onWrongResponseCode(int responseCode);
void onCancelled();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment