-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynchronizer.h
55 lines (47 loc) · 1.39 KB
/
synchronizer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef SYNCHRONIZER_H
#define SYNCHRONIZER_H
#include <QObject>
#include <QMap>
class QPixmap;
#include <QContactThumbnail>
//#include <QtContacts/QContact>
#include "qtcontacts.h"
#include <QContactManager>
#include <QThread>
QTM_USE_NAMESPACE
class FBFriendsModel;
class ContactModel;
class Synchronizer : public QThread
{
Q_OBJECT
public:
explicit Synchronizer(FBFriendsModel*,ContactModel*,QContactManager*,QObject *parent = 0);
QString serialize();
void saveLinks(QString);
void readLinks();
void syncContactImages();
QString getConnectedPhoneContact(QString fbFriendId);
int getNumberOfConnectedContacts();
void autoConnect();
void run();
signals:
void syncProgress(int);
public slots:
void connectProfile(int contactIndex,QString fbFriendId);
void setAvatar(int contactIndex,const QPixmap* pic,QString imageName);
private slots:
void gotImageName(QString,int);
void loadImage(QImage*,QString,int);
QString stripExtensionFromUrl(QString );
void downloadNextImage();
private:
QMap<QString,QString> profileMap;
int synced;
int nextptr;
QMap<int,QString> replyMap;
FBFriendsModel* fbModel;
ContactModel* contactModel;
QContactManager* cm;
QList<QString> downloadQueue;
};
#endif // SYNCHRONIZER_H