/
ssuurlresolver.h
74 lines (58 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
/**
* @file ssuurlresolver.h
* @copyright 2012 Jolla Ltd.
* @author Bernd Wachter <bernd.wachter@jollamobile.com>
* @date 2012
*/
#ifndef _SsuUrlResolver_H
#define _SsuUrlResolver_H
#include <QObject>
#include <QSettings>
#include <QDebug>
14
#include <QEventLoop>
15
16
17
18
19
#include <QFile>
#include <iostream>
#include <zypp/PluginFrame.h>
20
#include "libssu/ssu.h"
21
22
// quick hack for waiting for a signal
23
24
class SignalWait: public QObject
{
25
Q_OBJECT
26
27
28
29
public:
SignalWait()
{
needRunning = 1;
30
31
}
32
33
34
35
36
public slots:
void sleep()
{
if (needRunning == 1)
loop.exec();
37
38
}
39
40
41
42
virtual void finished()
{
needRunning = 0;
loop.exit();
43
44
}
45
private:
46
47
48
49
50
51
QEventLoop loop;
int needRunning;
};
using namespace zypp;
52
53
class SsuUrlResolver: public QObject
{
54
55
Q_OBJECT
56
public:
57
58
SsuUrlResolver();
59
private:
60
Ssu ssu;
61
void error(const QString &message);
62
63
void ack() const;
void resolve(zypp::PluginFrame &in);
64
bool writeZyppCredentialsIfNeeded(const QString &credentialsScope);
65
66
public slots:
67
68
void run();
69
signals:
70
71
72
73
74
void done();
};
#endif