[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra] krita/ui: Implement missing operator== for KisOptionInfo.
From: Andrius da Costa Ribas <andriusmao () gmail ! com>
Date: 2013-11-30 19:14:36
Message-ID: E1Vmpzw-0002Dv-5W () scm ! kde ! org
[Download RAW message or body]
Git commit 4488a519104dca6fbe0013d861212ffcfa53ecf8 by Andrius da Costa Ribas.
Committed on 30/11/2013 at 18:21.
Pushed by andriusr into branch 'master'.
Implement missing operator== for KisOptionInfo.
M +10 -0 krita/ui/kis_paintop_options_model.cpp
M +2 -0 krita/ui/kis_paintop_options_model.h
http://commits.kde.org/calligra/4488a519104dca6fbe0013d861212ffcfa53ecf8
diff --git a/krita/ui/kis_paintop_options_model.cpp b/krita/ui/kis_paintop_options_model.cpp
index c4c028b..02e92b6 100644
--- a/krita/ui/kis_paintop_options_model.cpp
+++ b/krita/ui/kis_paintop_options_model.cpp
@@ -72,3 +72,13 @@ bool KisPaintOpOptionListModel::setData(const QModelIndex& idx, const QVariant&
return BaseOptionCategorizedListModel::setData(idx, value, role);
}
+
+bool operator==(const KisOptionInfo& a, const KisOptionInfo& b)
+{
+ if (a.index != b.index) return false;
+ if (a.option->label() != b.option->label()) return false;
+ if (a.option->category() != b.option->category()) return false;
+ if (a.option->isCheckable() != b.option->isCheckable()) return false;
+ if (a.option->isChecked() != b.option->isChecked()) return false;
+ return true;
+}
diff --git a/krita/ui/kis_paintop_options_model.h b/krita/ui/kis_paintop_options_model.h
index 623ba0c..259cc71 100644
--- a/krita/ui/kis_paintop_options_model.h
+++ b/krita/ui/kis_paintop_options_model.h
@@ -34,6 +34,8 @@ struct KRITAUI_EXPORT KisOptionInfo
int index;
};
+KRITAUI_EXPORT bool operator==(const KisOptionInfo& a, const KisOptionInfo& b);
+
struct KRITAUI_EXPORT OptionInfoToQStringConverter {
QString operator() (const KisOptionInfo &info) {
return info.option->label();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic