[Pkg-owncloud-commits] [owncloud-client] 198/470: ActivityData: Add source file for implementation details
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:25:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 161d21904a6e8e8bcf31dcc9bbea6149fbde9862
Author: Klaas Freitag <freitag at owncloud.com>
Date: Wed Mar 23 16:47:13 2016 +0100
ActivityData: Add source file for implementation details
Add the ident() method and operators.
---
src/gui/CMakeLists.txt | 1 +
src/gui/activitydata.cpp | 35 +++++++++++++++++++++++++++++++++++
src/gui/activitydata.h | 21 +++++++--------------
3 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 92b9b50..6d9a3a2 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -63,6 +63,7 @@ set(client_SRCS
owncloudgui.cpp
owncloudsetupwizard.cpp
protocolwidget.cpp
+ activitydata.cpp
activitylistmodel.cpp
activitywidget.cpp
activityitemdelegate.cpp
diff --git a/src/gui/activitydata.cpp b/src/gui/activitydata.cpp
new file mode 100644
index 0000000..2d8001c
--- /dev/null
+++ b/src/gui/activitydata.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) by Klaas Freitag <freitag at owncloud.com>
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#include <QtCore>
+
+#include "activitydata.h"
+
+
+namespace OCC
+{
+
+bool Activity::operator<( const Activity& val ) const {
+ return _dateTime.toMSecsSinceEpoch() > val._dateTime.toMSecsSinceEpoch();
+}
+
+bool Activity::operator==( const Activity& val ) const {
+ return (_type == val._type && _id == val._id && _accName == val._accName);
+}
+
+Activity::Identifier Activity::ident() const {
+ return Identifier( _id, _accName );
+}
+
+
+}
diff --git a/src/gui/activitydata.h b/src/gui/activitydata.h
index 68067f5..f35611e 100644
--- a/src/gui/activitydata.h
+++ b/src/gui/activitydata.h
@@ -26,17 +26,6 @@ namespace OCC {
class ActivityLink
{
public:
- QVariantHash toVariantHash() const {
- QVariantHash hash;
-
- hash["label"] = _label;
- hash["link"] = _link;
- hash["verb"] = _verb;
- hash["primary"] = _isPrimary;
-
- return hash;
- }
-
QString _label;
QString _link;
QString _verb;
@@ -54,10 +43,13 @@ public:
class Activity
{
public:
+ typedef QPair<qlonglong, QString> Identifier;
+
enum Type {
ActivityType,
NotificationType
};
+
Type _type;
qlonglong _id;
QString _subject;
@@ -73,10 +65,11 @@ public:
* @param val
* @return
*/
- bool operator<( const Activity& val ) const {
- return _dateTime.toMSecsSinceEpoch() > val._dateTime.toMSecsSinceEpoch();
- }
+ bool operator<( const Activity& val ) const;
+
+ bool operator==( const Activity& val ) const;
+ Identifier ident() const;
};
/* ==================================================================== */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list