MCPcopy Create free account
hub / github.com/buggins/coolreader / loadItemList

Method loadItemList

android/src/org/coolreader/crengine/CRDB.java:425–460  ·  view source on GitHub ↗
(ArrayList<FileInfo> list, String sql, String groupPrefixTag)

Source from the content-addressed store, hash-verified

423 }
424
425 private boolean loadItemList(ArrayList<FileInfo> list, String sql, String groupPrefixTag) {
426 boolean found = false;
427 Cursor rs = null;
428 try {
429 rs = mDB.rawQuery(sql, null);
430 if ( rs.moveToFirst() ) {
431 // read DB
432 do {
433 long id = rs.getLong(0);
434 String name = rs.getString(1);
435 if (FileInfo.AUTHOR_PREFIX.equals(groupPrefixTag))
436 name = Utils.authorNameFileAs(name);
437 Integer bookCount = rs.getInt(2);
438
439 FileInfo item = new FileInfo();
440 item.isDirectory = true;
441 item.pathname = groupPrefixTag + id;
442 item.filename = name;
443 item.isListed = true;
444 item.isScanned = true;
445 item.id = id;
446 item.tag = bookCount;
447
448 list.add(item);
449 found = true;
450 } while (rs.moveToNext());
451 }
452 } catch (Exception e) {
453 Log.e("cr3", "exception while loading list of authors", e);
454 } finally {
455 if ( rs!=null )
456 rs.close();
457 }
458 sortItems(list, new ItemGroupFilenameExtractor());
459 return found;
460 }
461
462 public boolean loadAuthorsList(FileInfo parent) {
463 Log.i("cr3", "loadAuthorsList()");

Callers 2

loadAuthorsListMethod · 0.95
loadSeriesListMethod · 0.95

Calls 8

authorNameFileAsMethod · 0.95
sortItemsMethod · 0.95
eMethod · 0.65
getStringMethod · 0.45
equalsMethod · 0.45
getIntMethod · 0.45
addMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected