Skip to content

Commit

Permalink
Merge branch 'hotfix/0.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Coccodrillo committed Feb 20, 2017
2 parents ed95562 + 28d7c13 commit 0a47b77
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.secfirst.umbrella"
minSdkVersion 14
targetSdkVersion 24
versionCode 14
versionName "0.2.3"
versionCode 15
versionName "0.2.4"
}
buildTypes {
release {
Expand Down
48 changes: 24 additions & 24 deletions app/src/main/java/org/secfirst/umbrella/util/Global.java
Expand Up @@ -116,7 +116,7 @@ public List<FeedItem> getFeedItems() {
List<FeedItem> items = new ArrayList<>();
try {
items = daoFeedItem.queryForAll();
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
e.printStackTrace();
}
return items;
Expand All @@ -138,7 +138,7 @@ public void deleteRegistriesByName(String name) {
DeleteBuilder<Registry, String> toDelete = getDaoRegistry().deleteBuilder();
toDelete.where().eq(Registry.FIELD_NAME, name);
toDelete.delete();
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -149,7 +149,7 @@ public Registry getRegistry(String name) {
PreparedQuery<Registry> queryBuilder =
getDaoRegistry().queryBuilder().where().eq(Registry.FIELD_NAME, name).prepare();
registry = getDaoRegistry().queryForFirst(queryBuilder);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
return registry;
Expand All @@ -161,20 +161,20 @@ public void setRegistry(String name, Object value) {
PreparedQuery<Registry> queryBuilder =
getDaoRegistry().queryBuilder().where().eq(Registry.FIELD_NAME, name).prepare();
registry = getDaoRegistry().queryForFirst(queryBuilder);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
} finally {
if (registry!=null) {
try {
registry.setValue(String.valueOf(value));
getDaoRegistry().update(registry);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
} else {
try {
getDaoRegistry().create(new Registry(name, String.valueOf(value)));
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand Down Expand Up @@ -411,7 +411,7 @@ public Dao<Segment, String> getDaoSegment() {
if (daoSegment==null) {
try {
daoSegment = getOrmHelper().getDao(Segment.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -422,7 +422,7 @@ public Dao<CheckItem, String> getDaoCheckItem() {
if (daoCheckItem==null) {
try {
daoCheckItem = getOrmHelper().getDao(CheckItem.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -433,7 +433,7 @@ public Dao<Category, String> getDaoCategory() {
if (daoCategory==null) {
try {
daoCategory = getOrmHelper().getDao(Category.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -444,7 +444,7 @@ public Dao<Language, String> getDaoLanguage() {
if (daoLanguage==null) {
try {
daoLanguage = getOrmHelper().getDao(Language.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -455,7 +455,7 @@ public Dao<FeedItem, String> getDaoFeedItem() {
if (daoFeedItem==null) {
try {
daoFeedItem = getOrmHelper().getDao(FeedItem.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -474,7 +474,7 @@ public Dao<FeedSource, String> getDaoFeedSource() {
daoFeedSource.create(new FeedSource("Global Disaster and Alert Coordination System", 4));
daoFeedSource.create(new FeedSource("US State Department Country Warnings", 5));
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -485,7 +485,7 @@ public Dao<Registry, String> getDaoRegistry() {
if (daoRegistry==null) {
try {
daoRegistry = getOrmHelper().getDao(Registry.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -496,7 +496,7 @@ public Dao<Favourite, String> getDaoFavourite() {
if (daoFavourite==null) {
try {
daoFavourite = getOrmHelper().getDao(Favourite.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -507,7 +507,7 @@ public Dao<Difficulty, String> getDaoDifficulty() {
if (daoDifficulty==null) {
try {
daoDifficulty = getOrmHelper().getDao(Difficulty.class);
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -521,7 +521,7 @@ public void syncSegments(ArrayList<Segment> segments) {
for (Segment segment : segments) {
getDaoSegment().create(segment);
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -535,7 +535,7 @@ public void syncCategories(ArrayList<Category> categories) {
for (Category item : categories) {
getDaoCategory().create(item);
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -548,7 +548,7 @@ public void syncLanguages(ArrayList<Language> languages) {
for (Language item : languages) {
getDaoLanguage().create(item);
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -569,7 +569,7 @@ public void syncCheckLists(ArrayList<CheckItem> checkList) {
previousItem = checkItem;
}
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand Down Expand Up @@ -601,7 +601,7 @@ public ArrayList<Integer> getSelectedFeedSources() {
}
}
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
return selectedItems;
Expand All @@ -626,7 +626,7 @@ public String getChosenCountry() {
List<Registry> selCountry = null;
try {
selCountry = regDao.queryForEq(Registry.FIELD_NAME, "country");
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
if (selCountry != null && !selCountry.isEmpty()) {
Expand All @@ -646,7 +646,7 @@ public int getRefreshValue() {
Timber.e(nfe);
}
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
return retInterval;
Expand All @@ -661,7 +661,7 @@ public void setRefreshValue(int refreshValue) {
} else {
getDaoRegistry().create(new Registry("refresh_value", String.valueOf(refreshValue)));
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
Timber.e(e);
}
}
Expand All @@ -675,7 +675,7 @@ public long getFeedItemsRefreshed() {
if (firstFeedItem!=null) {
feedItemsRefreshed = firstFeedItem.getDate()*1000;
}
} catch (SQLException e) {
} catch (SQLiteException | SQLException e) {
e.printStackTrace();
}
return feedItemsRefreshed;
Expand Down

0 comments on commit 0a47b77

Please sign in to comment.