Commit 9ba3c190 authored by Nikita Melnichenko's avatar Nikita Melnichenko

fixed copy constructors in the FilterSettings and nested classes

parent 392a471b
......@@ -29,6 +29,10 @@
#include <KCodecs/KCharsets>
FilterSettings::FileSize::FileSize(const FileSize& other)
= default;
FilterSettings::FileSize& FilterSettings::FileSize::operator=(const FileSize &other)
= default;
......@@ -50,6 +54,9 @@ KIO::filesize_t FilterSettings::FileSize::size() const
}
FilterSettings::TimeSpan::TimeSpan(const TimeSpan& other)
= default;
FilterSettings::TimeSpan& FilterSettings::TimeSpan::operator=(const TimeSpan &other)
= default;
......@@ -92,45 +99,11 @@ FilterSettings::FilterSettings() :
{
}
FilterSettings::FilterSettings(const FilterSettings& other)
= default;
FilterSettings& FilterSettings::operator=(const FilterSettings& other)
{
#define COPY(var) { var = other.var; }
COPY(valid);
COPY(searchFor);
COPY(searchForCase);
COPY(mimeType);
COPY(searchInArchives);
COPY(recursive);
COPY(followLinks);
COPY(searchIn);
COPY(dontSearchIn);
COPY(excludeFolderNames);
COPY(contentEncoding);
COPY(containsText);
COPY(containsTextCase);
COPY(containsWholeWord);
COPY(containsRegExp);
COPY(minSizeEnabled);
COPY(minSize);
COPY(maxSizeEnabled);
COPY(maxSize);
COPY(modifiedBetweenEnabled);
COPY(modifiedBetween1);
COPY(modifiedBetween2);
COPY(notModifiedAfterEnabled);
COPY(notModifiedAfter);
COPY(modifiedInTheLastEnabled);
COPY(modifiedInTheLast);
COPY(notModifiedInTheLast);
COPY(ownerEnabled);
COPY(owner);
COPY(groupEnabled);
COPY(group);
COPY(permissionsEnabled);
COPY(permissions);
#undef COPY
return *this;
}
= default;
void FilterSettings::load(const KConfigGroup& cfg) {
*this = FilterSettings();
......
......@@ -34,6 +34,7 @@ class FilterSettings
public:
FilterSettings();
FilterSettings(const FilterSettings& other);
FilterSettings& operator=(const FilterSettings& other);
bool isValid() const {
......@@ -56,6 +57,7 @@ private:
{
public:
FileSize() : amount(0), unit(Byte) {}
FileSize(const FileSize &other);
FileSize& operator=(const FileSize &other);
KIO::filesize_t size() const;
......@@ -68,6 +70,7 @@ private:
{
public:
TimeSpan() : amount(0), unit(Day) {}
TimeSpan(const TimeSpan &other);
TimeSpan& operator=(const TimeSpan &other);
int days() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment