Skip to content

Commit

Permalink
Merge pull request ankidroid#26 from iniju/v2.0.1-dev
Browse files Browse the repository at this point in the history
Merge from iniju
  • Loading branch information
flerda committed Jan 20, 2013
2 parents fe831fa + c574949 commit a0d08d3
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/com/ichi2/async/DeckTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -817,15 +817,12 @@ private TaskData doInBackgroundImportAdd(TaskData... params) {
ankiDB.execute("ANALYZE");
}

// actualize counts
Object[] counts = null;
if (addedCount != -1) {
DeckTask.TaskData result = doInBackgroundLoadDeckCounts(new TaskData(col));
if (result != null) {
counts = result.getObjArray();
}
}
return new TaskData(addedCount, counts, true);
// Update the counts
DeckTask.TaskData result = doInBackgroundLoadDeckCounts(new TaskData(col));
if (result == null) {
return null;
}
return new TaskData(addedCount, result.getObjArray(), true);
} catch (RuntimeException e) {
Log.e(AnkiDroidApp.TAG,
"doInBackgroundImportAdd - RuntimeException on importing cards: "
Expand Down Expand Up @@ -902,14 +899,13 @@ private TaskData doInBackgroundImportReplace(TaskData... params) {
}
// delete tmp dir
BackupManager.removeDir(dir);

// actualize counts
Object[] counts = null;
DeckTask.TaskData result = doInBackgroundLoadDeckCounts(new TaskData(col));
if (result != null) {
counts = result.getObjArray();
}
return new TaskData(addedCount, counts, true);

// Update the counts
DeckTask.TaskData result = doInBackgroundLoadDeckCounts(new TaskData(col));
if (result == null) {
return null;
}
return new TaskData(addedCount, result.getObjArray(), true);
} catch (RuntimeException e) {
Log.e(AnkiDroidApp.TAG,
"doInBackgroundImportReplace - RuntimeException on reopening collection: "
Expand Down

0 comments on commit a0d08d3

Please sign in to comment.