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"); std::cerr << path << ": " << _("No Exif data found in the file\n");
return -3; return -3;
} }
Exiv2::ExifKey key("Exif.Photo.DateTimeOriginal"); auto md = exifData.findKey(Exiv2::ExifKey("Exif.Photo.DateTimeOriginal"));
auto md = exifData.findKey(key); if (md == exifData.end())
if (md == exifData.end()) { md = exifData.findKey(Exiv2::ExifKey("Exif.Image.DateTime"));
key = Exiv2::ExifKey("Exif.Image.DateTime");
md = exifData.findKey(key);
}
if (md == exifData.end()) { if (md == exifData.end()) {
std::cerr << _("Neither tag") << " `Exif.Photo.DateTimeOriginal' " << _("nor") << " `Exif.Image.DateTime' " std::cerr << _("Neither tag") << " `Exif.Photo.DateTimeOriginal' " << _("nor") << " `Exif.Image.DateTime' "
<< _("found in the file") << " " << path << "\n"; << _("found in the file") << " " << path << "\n";

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

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

@ -5149,7 +5149,7 @@ XmpKey::XmpKey(const std::string& prefix, const std::string& property) : p_(std:
XmpKey::~XmpKey() = default; 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) { 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(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() = default;
ExifKey& ExifKey::operator=(const ExifKey& rhs) { ExifKey& ExifKey::operator=(const ExifKey& rhs) {
@ -277,14 +274,6 @@ ExifKey& ExifKey::operator=(const ExifKey& rhs) {
return *this; 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) { void ExifKey::setIdx(int idx) {
p_->idx_ = idx; p_->idx_ = idx;
} }

Loading…
Cancel
Save