Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java
Show First 20 Lines • Show All 496 Lines • ▼ Show 20 Line(s) | 496 | public void onError(ShareInfo info, Throwable error) { | |||
---|---|---|---|---|---|
497 | Log.e("SharePlugin", "onError: " + error.getMessage()); | 497 | Log.e("SharePlugin", "onError: " + error.getMessage()); | ||
498 | 498 | | |||
499 | info.fileDocument.delete(); | 499 | info.fileDocument.delete(); | ||
500 | 500 | | |||
501 | int failedFiles = info.numberOfFiles() - (info.currentFileNumber - 1); | 501 | int failedFiles = info.numberOfFiles() - (info.currentFileNumber - 1); | ||
502 | shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_fail_title, failedFiles, failedFiles, info.numberOfFiles(), device.getName())); | 502 | shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_fail_title, failedFiles, failedFiles, info.numberOfFiles(), device.getName())); | ||
503 | shareNotification.show(); | 503 | shareNotification.show(); | ||
504 | shareNotification = null; | 504 | shareNotification = null; | ||
505 | currentShareInfo = null; | ||||
505 | } | 506 | } | ||
506 | 507 | | |||
507 | private class FinishReceivingRunnable implements Runnable { | 508 | private class FinishReceivingRunnable implements Runnable { | ||
508 | private final ShareInfo info; | 509 | private final ShareInfo info; | ||
509 | 510 | | |||
510 | private FinishReceivingRunnable(ShareInfo info) { | 511 | private FinishReceivingRunnable(ShareInfo info) { | ||
511 | this.info = info; | 512 | this.info = info; | ||
512 | } | 513 | } | ||
513 | 514 | | |||
514 | @Override | 515 | @Override | ||
515 | public void run() { | 516 | public void run() { | ||
517 | Log.i("SharePlugin", "FinishReceivingRunnable: Finishing up"); | ||||
518 | | ||||
516 | if (shareNotification != null) { | 519 | if (shareNotification != null) { | ||
517 | //Update the notification and allow to open the file from it | 520 | //Update the notification and allow to open the file from it | ||
518 | shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_title, info.numberOfFiles(), info.numberOfFiles(), device.getName())); | 521 | shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_title, info.numberOfFiles(), info.numberOfFiles(), device.getName())); | ||
519 | 522 | | |||
520 | if (info.numberOfFiles() == 1) { | 523 | if (info.numberOfFiles() == 1) { | ||
521 | shareNotification.setURI(info.fileDocument.getUri(), info.fileDocument.getType(), info.fileName); | 524 | shareNotification.setURI(info.fileDocument.getUri(), info.fileDocument.getType(), info.fileName); | ||
522 | } | 525 | } | ||
523 | 526 | | |||
524 | shareNotification.show(); | 527 | shareNotification.show(); | ||
525 | Log.i("SharePlugin", "FinishReceivingRunnable: Setting shareNotification to null"); | | |||
526 | shareNotification = null; | 528 | shareNotification = null; | ||
527 | finishReceivingRunnable = null; | | |||
528 | } | 529 | } | ||
530 | | ||||
531 | finishReceivingRunnable = null; | ||||
532 | currentShareInfo = null; | ||||
529 | } | 533 | } | ||
530 | } | 534 | } | ||
531 | } | 535 | } |