Skip to content

Latest commit

 

History

History
74 lines (58 loc) · 1.1 KB

ssuurlresolver.h

File metadata and controls

74 lines (58 loc) · 1.1 KB
 
Oct 8, 2012
Oct 8, 2012
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>
Apr 4, 2013
Apr 4, 2013
14
#include <QEventLoop>
Oct 8, 2012
Oct 8, 2012
15
16
17
18
19
#include <QFile>
#include <iostream>
#include <zypp/PluginFrame.h>
Apr 4, 2013
Apr 4, 2013
20
#include "libssu/ssu.h"
Oct 8, 2012
Oct 8, 2012
21
22
// quick hack for waiting for a signal
Oct 10, 2016
Oct 10, 2016
23
24
class SignalWait: public QObject
{
Oct 8, 2012
Oct 8, 2012
25
Q_OBJECT
Oct 10, 2016
Oct 10, 2016
26
27
28
29
public:
SignalWait()
{
needRunning = 1;
Oct 8, 2012
Oct 8, 2012
30
31
}
Oct 10, 2016
Oct 10, 2016
32
33
34
35
36
public slots:
void sleep()
{
if (needRunning == 1)
loop.exec();
Oct 8, 2012
Oct 8, 2012
37
38
}
Oct 10, 2016
Oct 10, 2016
39
40
41
42
virtual void finished()
{
needRunning = 0;
loop.exit();
Oct 8, 2012
Oct 8, 2012
43
44
}
Oct 10, 2016
Oct 10, 2016
45
private:
Oct 8, 2012
Oct 8, 2012
46
47
48
49
50
51
QEventLoop loop;
int needRunning;
};
using namespace zypp;
Oct 10, 2016
Oct 10, 2016
52
53
class SsuUrlResolver: public QObject
{
Oct 8, 2012
Oct 8, 2012
54
55
Q_OBJECT
Oct 10, 2016
Oct 10, 2016
56
public:
Oct 8, 2012
Oct 8, 2012
57
58
SsuUrlResolver();
Oct 10, 2016
Oct 10, 2016
59
private:
Oct 8, 2012
Oct 8, 2012
60
Ssu ssu;
May 24, 2017
May 24, 2017
61
void error(const QString &message);
Jul 10, 2017
Jul 10, 2017
62
63
void ack() const;
void resolve(zypp::PluginFrame &in);
May 24, 2017
May 24, 2017
64
bool writeZyppCredentialsIfNeeded(const QString &credentialsScope);
Oct 8, 2012
Oct 8, 2012
65
Oct 10, 2016
Oct 10, 2016
66
public slots:
Oct 8, 2012
Oct 8, 2012
67
68
void run();
Oct 10, 2016
Oct 10, 2016
69
signals:
Oct 8, 2012
Oct 8, 2012
70
71
72
73
74
void done();
};
#endif