ssuurlresolver.h 951 Bytes
Newer Older
Aard's avatar
Aard committed
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 56 57 58 59 60 61 62 63 64 65 66
/**
 * @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>
#include <QFile>

#include <iostream>
#include <zypp/PluginFrame.h>

#include <ssu.h>

// quick hack for waiting for a signal
class SignalWait: public QObject {
    Q_OBJECT
  public:
    SignalWait(){
      needRunning=1;
    }

  public slots:
    void sleep(){
      if (needRunning==1)
        loop.exec();
    }

    virtual void finished(){
      needRunning=0;
      loop.exit();
    }

  private:
    QEventLoop loop;
    int needRunning;
};

using namespace zypp;

class SsuUrlResolver: public QObject {
    Q_OBJECT

  public:
    SsuUrlResolver();

  private:
    Ssu ssu;
    QFile logfile;
    QTextStream logstream;

  public slots:
    void run();

  signals:
    void done();

};

#endif