[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [akonadi/dev/binary-protocol] src: Remove Server::Tristate, use Akonadi::Tristate from private inste
From:       Dan_Vrátil <dvratil () redhat ! com>
Date:       2015-05-24 21:35:04
Message-ID: E1YwdY0-0007Xt-2G () scm ! kde ! org
[Download RAW message or body]

Git commit e1b4960501d8555766c608b77dcb3a4f52cbb37d by Dan Vrátil.
Committed on 24/05/2015 at 19:58.
Pushed by dvratil into branch 'dev/binary-protocol'.

Remove Server::Tristate, use Akonadi::Tristate from private instead

M  +1    -0    src/private/CMakeLists.txt
M  +1    -9    src/private/protocol_p.h
A  +39   -0    src/private/tristate_p.h     [License: LGPL (v2+)]
M  +4    -3    src/server/collectionscheduler.cpp
M  +2    -0    src/server/storage/entities.xsl
M  +0    -7    src/server/storage/entity.h

http://commits.kde.org/akonadi/e1b4960501d8555766c608b77dcb3a4f52cbb37d

diff --git a/src/private/CMakeLists.txt b/src/private/CMakeLists.txt
index 0a7eb8a..b3ccf44 100644
--- a/src/private/CMakeLists.txt
+++ b/src/private/CMakeLists.txt
@@ -43,5 +43,6 @@ install(FILES
     protocol_p.h
     xdgbasedirs_p.h
     capabilities_p.h
+    tristate_p.h
     DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/akonadi/private
 )
diff --git a/src/private/protocol_p.h b/src/private/protocol_p.h
index 19cc8b1..0ccbefd 100644
--- a/src/private/protocol_p.h
+++ b/src/private/protocol_p.h
@@ -24,6 +24,7 @@
 #include "akonadiprivate_export.h"
 
 #include "scope_p.h"
+#include "tristate_p.h"
 
 #include <QtCore/QFlags>
 #include <QtCore/QMap>
@@ -272,15 +273,6 @@ AKONADIPRIVATE_EXPORT QDataStream &operator>>(QDataStream \
&stream, Akonadi::Prot  namespace Akonadi
 {
 
-// TODO: Move to elswhere so we don't have to include whole protocol_p.h
-// everywhere
-enum class Tristate : qint8
-{
-    False     = 0,
-    True      = 1,
-    Undefined = 2
-};
-
 namespace Protocol
 {
 
diff --git a/src/private/tristate_p.h b/src/private/tristate_p.h
new file mode 100644
index 0000000..69664d7
--- /dev/null
+++ b/src/private/tristate_p.h
@@ -0,0 +1,39 @@
+/*
+ *    Copyright (c) 2015 Daniel Vrátil <dvratil@redhat.com>
+ *
+ *    This library is free software; you can redistribute it and/or modify it
+ *    under the terms of the GNU Library General Public License as published by
+ *    the Free Software Foundation; either version 2 of the License, or (at your
+ *    option) any later version.
+ *
+ *    This library 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 Library General Public
+ *    License for more details.
+ *
+ *    You should have received a copy of the GNU Library General Public License
+ *    along with this library; see the file COPYING.LIB.  If not, write to the
+ *    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ *    02110-1301, USA.
+ */
+
+#ifndef AKONADI_PRIVATE_TRISTATE_P_H_
+#define AKONADI_PRIVATE_TRISTATE_P_H_
+
+#include <QMetaType>
+
+namespace Akonadi
+{
+
+enum class Tristate : qint8
+{
+    False     = 0,
+    True      = 1,
+    Undefined = 2
+};
+
+}
+
+Q_DECLARE_METATYPE(Akonadi::Tristate)
+
+#endif
\ No newline at end of file
diff --git a/src/server/collectionscheduler.cpp b/src/server/collectionscheduler.cpp
index 7199c43..b77249d 100644
--- a/src/server/collectionscheduler.cpp
+++ b/src/server/collectionscheduler.cpp
@@ -20,9 +20,10 @@
 #include "collectionscheduler.h"
 #include "storage/datastore.h"
 #include "storage/selectquerybuilder.h"
-#include <shared/akdebug.h>
 #include "akonadiserver_debug.h"
 
+#include <private/tristate_p.h>
+
 #include <QDateTime>
 #include <QCoreApplication>
 
@@ -283,9 +284,9 @@ void CollectionScheduler::initScheduler()
     // about anything else
     SelectQueryBuilder<Collection> qb;
     Query::Condition orCondition(Query::Or);
-    orCondition.addValueCondition(Collection::syncPrefFullColumnName(), \
Query::Equals, Akonadi::Server::Tristate::True); +    \
orCondition.addValueCondition(Collection::syncPrefFullColumnName(), Query::Equals, \
(int)Akonadi::Tristate::True);  Query::Condition andCondition(Query::And);
-    andCondition.addValueCondition(Collection::syncPrefFullColumnName(), \
Query::Equals, Akonadi::Server::Tristate::Undefined); +    \
andCondition.addValueCondition(Collection::syncPrefFullColumnName(), Query::Equals, \
                (int)Akonadi::Tristate::Undefined);
     andCondition.addValueCondition(Collection::enabledFullColumnName(), \
Query::Equals, true);  orCondition.addCondition(andCondition);
     orCondition.addValueCondition(Collection::referencedFullColumnName(), \
                Query::Equals, true);
diff --git a/src/server/storage/entities.xsl b/src/server/storage/entities.xsl
index e02bfd9..8776715 100644
--- a/src/server/storage/entities.xsl
+++ b/src/server/storage/entities.xsl
@@ -39,6 +39,8 @@
 #define AKONADI_ENTITIES_H
 #include "storage/entity.h"
 
+#include &lt;private/tristate_p.h&gt;
+
 #include &lt;shared/akdebug.h&gt;
 #include &lt;QtCore/QDebug&gt;
 #include &lt;QtCore/QSharedDataPointer&gt;
diff --git a/src/server/storage/entity.h b/src/server/storage/entity.h
index ce4945b..7982be2 100644
--- a/src/server/storage/entity.h
+++ b/src/server/storage/entity.h
@@ -32,12 +32,6 @@ class QSqlDatabase;
 namespace Akonadi {
 namespace Server {
 
-enum Tristate {
-    False = 0,
-    True = 1,
-    Undefined = 2
-};
-
 /**
   Base class for classes representing database records. It also contains
   low-level data access and manipulation template methods.
@@ -192,6 +186,5 @@ struct ById
 } // namespace Server
 } // namespace Akonadi
 
-Q_DECLARE_METATYPE(Akonadi::Server::Tristate)
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic