Revision 1789 trunk/client/gui_qt/WidgetRepairAndUnpack.cpp

WidgetRepairAndUnpack.cpp (revision 1789)
155 155

                
156 156
    lookupCollectionAndFilename(collection_name, active_par2_filename, &collection_item, &par2_file_item);
157 157

                
158
    if (!collection_item) {
159
        qWarning("WidgetRepairAndUnpack::par2LoadProgressUpdate: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
160
        return;
161
    }
162

                
163
    if (!par2_file_item) {
164
        qWarning("WidgetRepairAndUnpack::par2LoadProgressUpdate: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
165
        return;
166
    }
167

                
158 168
    if (!(file_item = lookupFilename(par2_file_item, filename))) {
159 169
        file_item = new QTreeWidgetItem(par2_file_item);
160 170
        file_item->setText(FIELD_FILENAME, filename);
... ...
174 184

                
175 185
    lookupCollectionAndFilename(collection_name, active_par2_filename, &collection_item, &par2_file_item);
176 186

                
187
    if (!collection_item) {
188
        qWarning("WidgetRepairAndUnpack::par2RecoveryFileLoaded: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
189
        return;
190
    }
191

                
192
    if (!par2_file_item) {
193
        qWarning("WidgetRepairAndUnpack::par2RecoveryFileLoaded: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
194
        return;
195
    }
196

                
177 197
    if (!(file_item = lookupFilename(par2_file_item, filename))) {
178 198
        file_item = new QTreeWidgetItem(par2_file_item);
179 199
        file_item->setText(FIELD_FILENAME, filename);
... ...
192 212

                
193 213
    lookupCollectionAndFilename(collection_name, active_par2_filename, &collection_item, &par2_file_item);
194 214

                
215
    if (!collection_item) {
216
        qWarning("WidgetRepairAndUnpack::par2FileLoaded: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
217
        return;
218
    }
219

                
220
    if (!par2_file_item) {
221
        qWarning("WidgetRepairAndUnpack::par2FileLoaded: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
222
        return;
223
    }
224

                
195 225
    int progress = 0;
196 226
    QString msg;
197 227
    if (state == "MISSING") {
... ...
228 258

                
229 259
    lookupCollectionAndFilename(collection_name, active_par2_filename, &collection_item, &file_item);
230 260

                
261
    if (!collection_item) {
262
        qWarning("WidgetRepairAndUnpack::par2RepairProgressUpdate: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
263
        return;
264
    }
265

                
266
    if (!file_item) {
267
        qWarning("WidgetRepairAndUnpack::par2RepairProgressUpdate: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
268
        return;
269
    }
270

                
231 271
    collection_item->setText(FIELD_PROGRESS, "25");
232 272
    file_item->setText(FIELD_PROGRESS, QString("%1").arg((int) progress));
233 273
    file_item->setText(FIELD_PROGRESS_STR, tr("Repairing"));
... ...
240 280

                
241 281
    lookupCollectionAndFilename(collection_name, active_par2_filename, &collection_item, &file_item);
242 282

                
283
    if (!collection_item) {
284
        qWarning("WidgetRepairAndUnpack::par2RepairFailure: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
285
        return;
286
    }
287

                
288
    if (!file_item) {
289
        qWarning("WidgetRepairAndUnpack::par2RepairFailure: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
290
        return;
291
    }
292

                
243 293
    QString msg;
244 294
    if (num_blocks_more_required == -1) {
245 295
        msg = message;
... ...
260 310

                
261 311
    lookupCollectionAndFilename(collection_name, active_par2_filename, &collection_item, &file_item);
262 312

                
313
    if (!collection_item) {
314
        qWarning("WidgetRepairAndUnpack::par2RepairSuccess: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
315
        return;
316
    }
317

                
318
    if (!file_item) {
319
        qWarning("WidgetRepairAndUnpack::par2RepairSuccess: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
320
        return;
321
    }
322

                
263 323
    if (opts.enable_auto_unpack) {
264 324
        collection_item->setText(FIELD_PROGRESS, "50");
265 325
    } else {
... ...
277 337

                
278 338
    lookupCollectionAndFilename(collection_name, active_par2_filename, &collection_item, &file_item);
279 339

                
340
    if (!collection_item) {
341
        qWarning("WidgetRepairAndUnpack::par2NoRepairRequired: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
342
        return;
343
    }
344

                
345
    if (!file_item) {
346
        qWarning("WidgetRepairAndUnpack::par2NoRepairRequired: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), active_par2_filename.toUtf8().data());
347
        return;
348
    }
349

                
280 350
    if (opts.enable_auto_unpack) {
281 351
        collection_item->setText(FIELD_PROGRESS, "50");
282 352
    } else {
... ...
299 369

                
300 370
    lookupCollectionAndFilename(collection_name, filename, &collection_item, &file_item);
301 371

                
372
    if (!collection_item) {
373
        qWarning("WidgetRepairAndUnpack::unpackProgressUpdate: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
374
        return;
375
    }
376

                
377
    if (!file_item) {
378
        qWarning("WidgetRepairAndUnpack::unpackProgressUpdate: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
379
        return;
380
    }
381

                
302 382
    collection_item->setText(FIELD_PROGRESS, "75");
303 383
    file_item->setText(FIELD_PROGRESS, QString("%1").arg((int) (progress * 100)));
304 384
}
... ...
310 390

                
311 391
    lookupCollectionAndFilename(collection_name, filename, &collection_item, &file_item);
312 392

                
393
    if (!collection_item) {
394
        qWarning("WidgetRepairAndUnpack::unpackMessageReceived: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
395
        return;
396
    }
397

                
398
    if (!file_item) {
399
        qWarning("WidgetRepairAndUnpack::unpackMessageReceived: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
400
        return;
401
    }
402

                
313 403
    file_item->setText(FIELD_PROGRESS_STR, message);
314 404
    ui->treeWidget->scrollToBottom();
315 405
}
... ...
321 411

                
322 412
    lookupCollectionAndFilename(collection_name, filename, &collection_item, &file_item);
323 413

                
414
    if (!collection_item) {
415
        qWarning("WidgetRepairAndUnpack::unpackWorkingArchiveChanged: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
416
        return;
417
    }
418

                
419
    if (!file_item) {
420
        qWarning("WidgetRepairAndUnpack::unpackWorkingArchiveChanged: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
421
        return;
422
    }
423

                
324 424
    file_item->setText(FIELD_PROGRESS_STR, tr("Now unpacking archive '%1'").arg(working_archive));
325 425
    ui->treeWidget->scrollToBottom();
326 426
}
... ...
332 432

                
333 433
    lookupCollectionAndFilename(collection_name, filename, &collection_item, &file_item);
334 434

                
435
    if (!collection_item) {
436
        qWarning("WidgetRepairAndUnpack::unpackSuccess: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
437
        return;
438
    }
439

                
440
    if (!file_item) {
441
        qWarning("WidgetRepairAndUnpack::unpackSuccess: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
442
        return;
443
    }
444

                
335 445
    collection_item->setText(FIELD_PROGRESS, "100");
336 446
    collection_item->setText(FIELD_PROGRESS_STR, tr("Unpack completed"));
337 447
    file_item->setText(FIELD_PROGRESS, "100");
... ...
345 455

                
346 456
    lookupCollectionAndFilename(collection_name, filename, &collection_item, &file_item);
347 457

                
458
    if (!collection_item) {
459
        qWarning("WidgetRepairAndUnpack::unpackFailure: collection_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
460
        return;
461
    }
462

                
463
    if (!file_item) {
464
        qWarning("WidgetRepairAndUnpack::unpackFailure: file_item is NULL for collection_name '%s' and filename '%s'", collection_name.toUtf8().data(), filename.toUtf8().data());
465
        return;
466
    }
467

                
348 468
    collection_item->setText(FIELD_PROGRESS, "100");
349 469
    collection_item->setText(FIELD_PROGRESS_STR, tr("Unpack failed due to an error"));
350 470
    file_item->setText(FIELD_PROGRESS, "100");

Also available in: Unified diff