Minor changes to make things work

This commit is contained in:
maskara 2018-03-03 00:30:44 +05:30
parent 280d00e42e
commit 123c4adbfd
4 changed files with 6 additions and 8 deletions

View file

@ -12,7 +12,6 @@ import fr.free.nrw.commons.auth.LoginActivity;
import fr.free.nrw.commons.contributions.ContributionsSyncAdapter;
import fr.free.nrw.commons.modifications.ModificationsSyncAdapter;
import fr.free.nrw.commons.settings.SettingsFragment;
import fr.free.nrw.commons.nearby.DirectUpload;
import fr.free.nrw.commons.nearby.PlaceRenderer;
@Singleton
@ -40,7 +39,6 @@ public interface CommonsApplicationComponent extends AndroidInjector<Application
@Override
void inject(ApplicationlessInjection instance);
void inject(DirectUpload directUpload);
void inject(PlaceRenderer placeRenderer);
@Component.Builder

View file

@ -33,7 +33,6 @@ public class CommonsApplicationModule {
public static final String CATEGORY_AUTHORITY = "fr.free.nrw.commons.categories.contentprovider";
public static final long OK_HTTP_CACHE_SIZE = 10 * 1024 * 1024;
private CommonsApplication application;
private Context applicationContext;
public CommonsApplicationModule(Context applicationContext) {
@ -88,13 +87,13 @@ public class CommonsApplicationModule {
@Provides
@Named("direct_nearby_upload_prefs")
public SharedPreferences providesDirectNearbyUploadPreferences() {
return application.getSharedPreferences("direct_nearby_upload_prefs", MODE_PRIVATE);
public SharedPreferences providesDirectNearbyUploadPreferences(Context context) {
return context.getSharedPreferences("direct_nearby_upload_prefs", MODE_PRIVATE);
}
@Provides
public UploadController providesUploadController(SessionManager sessionManager, @Named("default_preferences") SharedPreferences sharedPreferences) {
return new UploadController(sessionManager, application, sharedPreferences);
public UploadController providesUploadController(SessionManager sessionManager, @Named("default_preferences") SharedPreferences sharedPreferences, Context context) {
return new UploadController(sessionManager, context, sharedPreferences);
}
@Provides