~ubuntu-branches/ubuntu/trusty/kdepimlibs/trusty

« back to all changes in this revision

Viewing changes to akonadi/tests/testrunner/setup.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-11-23 17:36:44 UTC
  • mfrom: (1.1.102)
  • Revision ID: package-import@ubuntu.com-20131123173644-p5ow94192ezsny8g
Tags: 4:4.11.80-0ubuntu1
[ Rohan Garg ]
* New upstream beta release
  - Bump akonadi requirement to 1.10.45
  - Update install files
  - Update symbols

[ Philip Muškovac ]
* kdepimlibs-dev/-dbg breaks/replaces kdepim-runtime/-dbg (<< 4:4.11.80)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#ifndef SETUP_H
19
19
#define SETUP_H
20
20
 
21
 
#include <QtCore/QMap>
 
21
#include <akonadi/servermanager.h>
 
22
 
22
23
#include <QtCore/QObject>
23
24
#include <QStringList>
24
25
#include <QDBusConnection>
 
26
#include <QVector>
 
27
#include <QPair>
25
28
 
26
29
class QIODevice;
27
30
class KProcess;
28
31
class QSignalMapper;
 
32
class KJob;
29
33
 
30
34
class SetupTest : public QObject
31
35
{
35
39
  public:
36
40
    SetupTest();
37
41
    ~SetupTest();
 
42
 
 
43
    /**
 
44
      Sets the instance identifier for the Akonadi session.
 
45
      Call this before using any other Akonadi API!
 
46
    */
 
47
    void setupInstanceId();
38
48
    bool startAkonadiDaemon();
39
49
    void stopAkonadiDaemon();
40
50
    QString basePath() const;
41
51
 
 
52
    /// Identifier used for the Akonadi session
 
53
    QString instanceId() const;
 
54
 
 
55
    /// set an environment variable
 
56
    void setEnvironmentVariable( const QByteArray &name, const QString &value );
 
57
 
 
58
    /// retrieve all modified environment variables, for writing the shell script
 
59
    typedef QPair<QByteArray, QByteArray> EnvVar;
 
60
    QVector<EnvVar> environmentVariables() const;
 
61
 
42
62
  public Q_SLOTS:
43
63
    Q_SCRIPTABLE void shutdown();
44
64
    Q_SCRIPTABLE void shutdownHarder();
51
71
    void serverExited(int exitCode);
52
72
 
53
73
  private Q_SLOTS:
54
 
    void dbusNameOwnerChanged( const QString &name, const QString &oldOwner, const QString &newOwner );
55
 
    void resourceSynchronized( const QString &agentId );
 
74
    void serverStateChanged( Akonadi::ServerManager::State state );
56
75
    void slotAkonadiDaemonProcessFinished( int exitCode );
 
76
    void agentCreationResult(KJob* job);
 
77
    void synchronizationResult(KJob* job);
57
78
 
58
79
  private:
59
 
    bool clearEnvironment();
60
 
    QMap<QString, QString> environment() const;
61
 
    int addDBusToEnvironment( QIODevice &device );
62
 
    void generateDBusConfigFile( const QString& path );
63
 
    int startDBusDaemon();
64
 
    void stopDBusDaemon( int dbusPid );
65
 
    void registerWithInternalDBus( const QString &address );
66
80
    void setupAgents();
 
81
    void copyXdgDirectory( const QString &src, const QString &dst );
 
82
    void copyKdeHomeDirectory( const QString &src, const QString &dst );
67
83
    void copyDirectory( const QString &src, const QString &dst );
68
84
    void createTempEnvironment();
69
85
    void deleteDirectory( const QString &dirName );
70
86
    void cleanTempEnvironment();
71
 
    void shutdownKde();
72
 
 
73
 
  private slots:
74
 
    void synchronizeResources();
 
87
    bool isSetupDone() const;
 
88
    void setupFailed();
75
89
 
76
90
  private:
77
91
    KProcess *mAkonadiDaemonProcess;
78
 
    int mDBusDaemonPid;
79
 
    QDBusConnection mInternalBus;
80
 
    QStringList mPendingAgents;
81
 
    QStringList mPendingResources;
82
 
    QStringList mPendingSyncs;
83
92
    bool mShuttingDown;
84
 
    QSignalMapper *mSyncMapper;
85
93
    bool mAgentsCreated;
86
94
    bool mTrackAkonadiProcess;
 
95
    int mSetupJobCount;
 
96
    int mExitCode;
 
97
    QVector<EnvVar> mEnvVars;
87
98
};
88
99
 
89
100
#endif