From fa369ef1db0e9f68fdc0145f86ce15446a750af5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 12 Apr 2016 16:13:46 +0100 Subject: Move UserProperty into its own file. --- src/lib/content.cc | 2 +- src/lib/content.h | 18 +----------------- src/lib/user_property.h | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 src/lib/user_property.h (limited to 'src/lib') diff --git a/src/lib/content.cc b/src/lib/content.cc index 724cabb6c..28103e9c0 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -278,7 +278,7 @@ Content::path_summary () const } /** @return a list of properties that might be interesting to the user */ -list +list Content::user_properties () const { list p; diff --git a/src/lib/content.h b/src/lib/content.h index d87ae13d7..d08540a9a 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -28,6 +28,7 @@ #include "signaller.h" #include "dcpomatic_time.h" #include "raw_convert.h" +#include "user_property.h" #include #include #include @@ -161,23 +162,6 @@ public: boost::shared_ptr film () const; - class UserProperty - { - public: - template - UserProperty (std::string category_, std::string key_, T value_, std::string unit_ = "") - : category (category_) - , key (key_) - , value (raw_convert (value_)) - , unit (unit_) - {} - - std::string category; - std::string key; - std::string value; - std::string unit; - }; - std::list user_properties () const; boost::signals2::signal, int, bool)> Changed; diff --git a/src/lib/user_property.h b/src/lib/user_property.h new file mode 100644 index 000000000..c57cbef3e --- /dev/null +++ b/src/lib/user_property.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2013-2016 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +class UserProperty +{ +public: + template + UserProperty (std::string category_, std::string key_, T value_, std::string unit_ = "") + : category (category_) + , key (key_) + , value (raw_convert (value_)) + , unit (unit_) + {} + + std::string category; + std::string key; + std::string value; + std::string unit; +}; -- cgit v1.2.3