Project

General

Profile

« Previous | Next » 

Revision c89c3b1b

Added by Leszek Koltunski almost 3 years ago

Make it possible to automatically re-download EXTRAS file if it previously failed to download

View differences:

src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
129 129

  
130 130
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Saving icon "+name+" to a file "+mIconSaved);
131 131
      }
132
    else
133
      {
134
      mIconSaved = true;
135
      }
132 136
    }
133 137

  
134 138
///////////////////////////////////////////////////////////////////////////////////////////////////
......
187 191
      {
188 192
      makeProgress(50,R.string.installing);
189 193
      RubikFiles files = RubikFiles.getInstance();
190
      boolean oSuccess=true, eSuccess=true;
194
      boolean oSuccess=false, eSuccess=false;
191 195

  
192 196
      if( mInfo.mObjectStream!=null )
193 197
        {
src/main/java/org/distorted/objects/RubikObjectList.java
187 187
  public static void addDownloadedObject(String shortName, int numScrambles, int objectMinor, int extrasMinor,
188 188
                                         boolean icon, boolean object, boolean extras)
189 189
    {
190
    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "New downloaded object "+shortName+" icon="+icon+" object="+object+" extras="+extras);
191

  
190 192
    for( DownloadedObject obj : mDownloadedObjects )
191 193
      {
192 194
      if( obj.shortName.equals(shortName) )
......
195 197
        obj.object|= object;
196 198
        obj.extras|= extras;
197 199

  
198
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Updating downloaded object "+shortName);
200
        if( !obj.object ) objectMinor=-1;
201
        if( !obj.extras ) extrasMinor=-1;
202

  
203
        obj.objectMinor = objectMinor;
204
        obj.extrasMinor = extrasMinor;
205

  
206
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Updating downloaded object "+shortName+" icon="+obj.icon+" object="+obj.object+" extras="+obj.extras);
199 207

  
200 208
        return;
201 209
        }
202 210
      }
203 211

  
204
    DownloadedObject extra = new DownloadedObject(shortName,numScrambles,objectMinor,extrasMinor,icon,object,extras);
205
    if ( internalAddDownloadedObject(extra) )
212
    if( !object ) objectMinor=-1;
213
    if( !extras ) extrasMinor=-1;
214

  
215
    DownloadedObject obj = new DownloadedObject(shortName,numScrambles,objectMinor,extrasMinor,icon,object,extras);
216
    if ( internalAddDownloadedObject(obj) )
206 217
      {
207
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Adding new downloaded object "+shortName);
208
      mDownloadedObjects.add(extra);
218
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Adding new downloaded object "+shortName+" icon="+obj.icon+" object="+obj.object+" extras="+obj.extras);
219
      mDownloadedObjects.add(obj);
209 220
      }
210 221
    }
211 222

  

Also available in: Unified diff