get rid of Key() move operations

Because of Impl, there's no way this can work properly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 2 years ago
parent a3baf7d3e9
commit 9a1f37ecbe

@ -624,12 +624,9 @@ int Rename::run(const std::string& path) {
std::cerr << path << ": " << _("No Exif data found in the file\n");
return -3;
}
Exiv2::ExifKey key("Exif.Photo.DateTimeOriginal");
auto md = exifData.findKey(key);
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.Image.DateTime");
md = exifData.findKey(key);
}
auto md = exifData.findKey(Exiv2::ExifKey("Exif.Photo.DateTimeOriginal"));
if (md == exifData.end())
md = exifData.findKey(Exiv2::ExifKey("Exif.Image.DateTime"));
if (md == exifData.end()) {
std::cerr << _("Neither tag") << " `Exif.Photo.DateTimeOriginal' " << _("nor") << " `Exif.Image.DateTime' "
<< _("found in the file") << " " << path << "\n";

@ -33,6 +33,8 @@ class EXIV2API Key {
//! Destructor
virtual ~Key() = default;
//@}
Key(Key&&) = delete;
Key& operator=(Key&&) = delete;
//! @name Accessors
//@{
/*!
@ -74,8 +76,6 @@ class EXIV2API Key {
protected:
Key() = default;
Key(const Key&) = default;
Key(Key&&) = default;
Key& operator=(Key&&) = default;
//! @name Manipulators
//@{
/*!

@ -308,9 +308,6 @@ class EXIV2API ExifKey : public Key {
~ExifKey() override;
//@}
ExifKey(ExifKey&& rhs);
ExifKey& operator=(ExifKey&& rhs);
//! @name Manipulators
//@{
/*!

@ -5149,7 +5149,7 @@ XmpKey::XmpKey(const std::string& prefix, const std::string& property) : p_(std:
XmpKey::~XmpKey() = default;
XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
XmpKey::XmpKey(const XmpKey& rhs) : Key(rhs), p_(std::make_unique<Impl>(*rhs.p_)) {
}
XmpKey& XmpKey::operator=(const XmpKey& rhs) {

@ -264,9 +264,6 @@ ExifKey::ExifKey(const std::string& key) : p_(std::make_unique<Impl>()) {
ExifKey::ExifKey(const ExifKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
}
ExifKey::ExifKey(ExifKey&& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
}
ExifKey::~ExifKey() = default;
ExifKey& ExifKey::operator=(const ExifKey& rhs) {
@ -277,14 +274,6 @@ ExifKey& ExifKey::operator=(const ExifKey& rhs) {
return *this;
}
ExifKey& ExifKey::operator=(ExifKey&& rhs) {
if (this == &rhs)
return *this;
*p_ = *rhs.p_;
Key::operator=(std::move(rhs));
return *this;
}
void ExifKey::setIdx(int idx) {
p_->idx_ = idx;
}

Loading…
Cancel
Save