Fixed bug that causes application to ask for new login even if
[situare] / src / facebookservice / facebookcredentials.cpp
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Ville Tiensuu - ville.tiensuu@ixonos.com
6
7    Situare is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License
9    version 2 as published by the Free Software Foundation.
10
11    Situare is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with Situare; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19    USA.
20 */
21
22 #include <QtGlobal>
23 #include "facebookcredentials.h"
24
25 FacebookCredentials::FacebookCredentials()
26 {
27 }
28
29 void FacebookCredentials::setSessionKey(const QString & sessionKeyParameter)
30 {
31     m_sessionKey = sessionKeyParameter;
32 }
33
34 void FacebookCredentials::setSessionSecret(const QString & sessionSecretParameter)
35 {
36     m_sessionSecret = sessionSecretParameter;
37 }
38
39
40 void FacebookCredentials::setExpires (const QString & expiresParameter)
41 {
42     m_expires = expiresParameter;
43 }
44
45 void FacebookCredentials::setUserID (const QString & userIDParameter)
46 {
47     m_userID = userIDParameter;
48 }
49
50 void FacebookCredentials::setSig(const QString & sigParameter)
51 {
52     m_sig = sigParameter;
53 }
54
55 QString FacebookCredentials::sessionKey() const
56 {
57     return m_sessionKey;
58 }
59
60 QString FacebookCredentials::sessionSecret() const
61 {
62     return m_sessionSecret;
63 }
64
65 QString FacebookCredentials::expires() const
66 {
67     return m_expires;
68 }
69
70 QString FacebookCredentials::userID() const
71 {
72     return m_userID;
73 }
74
75 QString FacebookCredentials::sig() const
76 {
77     return m_sig;
78 }
79
80 bool FacebookCredentials::operator==(const FacebookCredentials &credentials)
81 {
82     bool expireBool = (m_expires == credentials.expires());
83     bool sessionKeyBool = (m_sessionKey == credentials.sessionKey());
84     bool sessionSecretBool = (m_sessionSecret == credentials.sessionSecret());
85     bool sigBool = (m_sig == credentials.sig());
86     bool userIdBool = (m_userID == credentials.userID());
87
88     return expireBool && sessionKeyBool && sessionSecretBool && sigBool && userIdBool;
89 }