Changeset View
Changeset View
Standalone View
Standalone View
Exif/Database.cpp
| Show First 20 Lines • Show All 644 Lines • ▼ Show 20 Line(s) | 638 | { | |||
|---|---|---|---|---|---|
| 645 | 645 | | |||
| 646 | QDir().remove(origBackup); | 646 | QDir().remove(origBackup); | ||
| 647 | QDir().rename(exifDBFile(), origBackup); | 647 | QDir().rename(exifDBFile(), origBackup); | ||
| 648 | init(); | 648 | init(); | ||
| 649 | 649 | | |||
| 650 | const DB::FileNameList allImages = DB::ImageDB::instance()->images(); | 650 | const DB::FileNameList allImages = DB::ImageDB::instance()->images(); | ||
| 651 | QProgressDialog dialog; | 651 | QProgressDialog dialog; | ||
| 652 | dialog.setModal(true); | 652 | dialog.setModal(true); | ||
| 653 | dialog.setLabelText(i18n("Rereading EXIF information from all images")); | 653 | dialog.setLabelText(i18n("Rereading Exif information from all images")); | ||
| 654 | dialog.setMaximum(allImages.size()); | 654 | dialog.setMaximum(allImages.size()); | ||
| 655 | // using a transaction here removes a *huge* overhead on the insert statements | 655 | // using a transaction here removes a *huge* overhead on the insert statements | ||
| 656 | startInsertTransaction(); | 656 | startInsertTransaction(); | ||
| 657 | int i = 0; | 657 | int i = 0; | ||
| 658 | for (const DB::FileName& fileName : allImages) { | 658 | for (const DB::FileName& fileName : allImages) { | ||
| 659 | const DB::ImageInfoPtr info = fileName.info(); | 659 | const DB::ImageInfoPtr info = fileName.info(); | ||
| 660 | dialog.setValue(i++); | 660 | dialog.setValue(i++); | ||
| 661 | if (info->mediaType() == DB::Image) { | 661 | if (info->mediaType() == DB::Image) { | ||
| Show All 23 Lines | |||||