~bfiller/gallery-app/sd-card-rules

« back to all changes in this revision

Viewing changes to src/content-communicator.cpp

  • Committer: Arthur Mello
  • Date: 2014-12-17 12:20:38 UTC
  • mto: This revision was merged to the branch mainline in revision 1123.
  • Revision ID: arthur.mello@canonical.com-20141217122038-1xi00xsf3j27c398
Add some checks to make sure the file has good metadata before changing it

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
            // to show up on imported date Event
95
95
            QFileInfo destfi(destination);
96
96
            PhotoMetadata* metadata = PhotoMetadata::fromFile(destfi);
97
 
            metadata->setDateTimeDigitized(QDateTime::currentDateTime());
98
 
            metadata->save();
 
97
            if (metadata != NULL) {
 
98
                metadata->setDateTimeDigitized(QDateTime::currentDateTime());
 
99
                metadata->save();
 
100
            }
99
101
        }
100
102
    }
101
103
    // Allow content-hub to clean up temporary files in .cache/ once we've