Changeset View
Changeset View
Standalone View
Standalone View
src/category.cpp
Show All 18 Lines | 1 | /* | |||
---|---|---|---|---|---|
19 | You should have received a copy of the GNU Lesser General Public | 19 | You should have received a copy of the GNU Lesser General Public | ||
20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
21 | 21 | | |||
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | #include "category.h" | 24 | #include "category.h" | ||
25 | 25 | | |||
26 | #include <QtCore/QString> | 26 | #include <QtCore/QString> | ||
27 | #include <QtCore/QDebug> | ||||
27 | 28 | | |||
28 | using namespace Attica; | 29 | using namespace Attica; | ||
29 | 30 | | |||
31 | QDebug operator<<(QDebug s, const Attica::Category& cat) | ||||
32 | { | ||||
33 | const QString name = cat.isValid() ? cat.name() : QStringLiteral("Invalid"); | ||||
34 | s.nospace() << "Category(" << name << ')'; | ||||
35 | return s.space(); | ||||
36 | } | ||||
37 | | ||||
30 | class Category::Private : public QSharedData | 38 | class Category::Private : public QSharedData | ||
31 | { | 39 | { | ||
32 | public: | 40 | public: | ||
33 | QString m_id; | 41 | QString m_id; | ||
34 | QString m_name; | 42 | QString m_name; | ||
35 | }; | 43 | }; | ||
36 | 44 | | |||
37 | Category::Category() : d(new Private) | 45 | Category::Category() : d(new Private) | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |