~mandel/ubuntu-download-manager/use-apparmor

« back to all changes in this revision

Viewing changes to libubuntudownloadmanager/download_factory.cpp

  • Committer: Manuel de la Pena
  • Date: 2013-09-09 16:05:49 UTC
  • Revision ID: manuel@canonical.com-20130909160549-6h8v9iza3dfeuxmq
Changed download factory to use apparmor to build the dbus paths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 public:
36
36
    explicit DownloadFactoryPrivate(DownloadFactory* parent)
37
37
        : q_ptr(parent) {
38
 
        _apparmor = new AppArmor();
39
 
        _uuidFactory = new UuidFactory();
40
 
        _networkInfo = new SystemNetworkInfo();
41
 
        _nam = new RequestFactory();
42
 
        _processFactory = new ProcessFactory();
 
38
        _apparmor = QSharedPointer<AppArmor>(new AppArmor());
 
39
        _networkInfo = QSharedPointer<SystemNetworkInfo>(
 
40
            new SystemNetworkInfo());
 
41
        _nam = QSharedPointer<RequestFactory>(
 
42
            new RequestFactory());
 
43
        _processFactory = QSharedPointer<ProcessFactory>(
 
44
            new ProcessFactory());
43
45
    }
44
46
 
45
 
    DownloadFactoryPrivate(UuidFactory* uuidFactory,
46
 
                           SystemNetworkInfo* networkInfo,
47
 
                           RequestFactory* nam,
48
 
                           ProcessFactory* processFactory,
 
47
    DownloadFactoryPrivate(QSharedPointer<SystemNetworkInfo> networkInfo,
 
48
                           QSharedPointer<RequestFactory> nam,
 
49
                           QSharedPointer<ProcessFactory> processFactory,
49
50
                           DownloadFactory* parent)
50
 
        : _uuidFactory(uuidFactory),
51
 
          _networkInfo(networkInfo),
 
51
        : _networkInfo(networkInfo),
52
52
          _nam(nam),
53
53
          _processFactory(processFactory),
54
54
          q_ptr(parent) {
97
97
    }
98
98
 
99
99
 private:
100
 
    AppArmor* _apparmor;
101
 
    UuidFactory* _uuidFactory;
102
 
    SystemNetworkInfo* _networkInfo;
103
 
    RequestFactory* _nam;
104
 
    ProcessFactory* _processFactory;
 
100
    QSharedPointer<AppArmor> _apparmor;
 
101
    QSharedPointer<SystemNetworkInfo> _networkInfo;
 
102
    QSharedPointer<RequestFactory> _nam;
 
103
    QSharedPointer<ProcessFactory> _processFactory;
105
104
    DownloadFactory* q_ptr;
106
105
};
107
106
 
114
113
      d_ptr(new DownloadFactoryPrivate(this)) {
115
114
}
116
115
 
117
 
DownloadFactory::DownloadFactory(UuidFactory* uuidFactory,
118
 
                                 SystemNetworkInfo* networkInfo,
119
 
                                 RequestFactory* nam,
120
 
                                 ProcessFactory* processFactory,
 
116
DownloadFactory::DownloadFactory(QSharedPointer<SystemNetworkInfo> networkInfo,
 
117
                                 QSharedPointer<RequestFactory> nam,
 
118
                                 QSharedPointer<ProcessFactory> processFactory,
121
119
                                 QObject* parent)
122
120
    : QObject(parent),
123
 
      d_ptr(new DownloadFactoryPrivate(uuidFactory, networkInfo, nam,
124
 
      processFactory, this)) {
 
121
     d_ptr(new DownloadFactoryPrivate(networkInfo, nam, processFactory, this)) {
125
122
}
126
123
 
127
124