Page MenuHome GnuPG

Allow passing flags to DeleteJob
ClosedPublic

Authored by TobiasFella on Thu, Nov 13, 12:52 PM.

Details

Reviewers
ikloecker
Summary
Test Plan

test with corresponding kleopatra and gpgmepp patches

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

TobiasFella created this revision.

@ikloecker would there be any ABI problems with adding the new virtual function here?

@ikloecker would there be any ABI problems with adding the new virtual function here?

Instead of adding new virtuals I have added non-virtual functions that call virtual private functions (NVI pattern). Job has a proper d-pointer since QGpgME 2.0 so this is the way you should go, i.e. add a DeleteJobPrivate. There are plenty of *JobPrivate classes to c&p from.

@ikloecker would there be any ABI problems with adding the new virtual function here?

Instead of adding new virtuals I have added non-virtual functions that call virtual private functions (NVI pattern). Job has a proper d-pointer since QGpgME 2.0 so this is the way you should go, i.e. add a DeleteJobPrivate. There are plenty of *JobPrivate classes to c&p from.

aah, thanks for the pointer!

I think you are using an outdated working copy of gpgmeqt. I have killed the old jobPrivate stuff with rGPGMEQT056567525fb9: Add d-pointer to Job class. We are using Qt macros now.

src/deletejob.cpp
2

;-)

TobiasFella updated this revision to Diff 1654.
TobiasFella marked an inline comment as done.

Except for a few minor things this looks good. Thanks!

src/deletejob.cpp
2

Somehow this is still wrong.

src/deletejob.h
40
#include <gpgme++/global.h>
69

This shouldn't be used/needed anymore.

src/deletejob_p.h
44

DeleteJobPrivate is declared as class (as it should be).

class DeleteJobPrivate : public JobPrivate
src/multideletejob.h
39
#include <gpgme++/global.h>
58

This should be move into the QGpgME namespace.

src/qgpgmedeletejob.cpp
45–46

This shouldn't be needed.

src/qgpgmedeletejob.h
47

This should be move into the QGpgME namespace.

TobiasFella marked 6 inline comments as done.
src/deletejob.h
69

are you sure? i can't get it to work without that

src/deletejob.h
69

Yes. It's even wrong because this c'tor would created a DeleteJob without private class which would inevitably crash. The problem is the line

make_job_subclass(DeleteJob)

in job.cpp. This line needs to be removed and you'll have to define the d'tor yourself in deletejob.cpp (simply as default).

src/deletejob.h
69

And the line

#include "moc_deletejob.cpp"

needs to be moved to deletejob.cpp.

TobiasFella added inline comments.
src/deletejob.h
69

I have removed the make_job_subclass(DeleteJob) line and kept this one. (and added the dtor). Is that what you meant?

src/deletejob.h
69

Removing. Yes. Keeping. No. I did this here and it build without problems with removed explicit DeleteJob(QObject *parent);

src/deletejob.h
69

oh, wait. You're telling me to remove

explicit DeleteJob(QObject *parent);

not the new ctor, right? now I understand it.

TobiasFella marked 4 inline comments as done.

Done now, sorry for the confusion around the contructor

src/deletejob.h
69

Yes. Phabricator's review tool isn't really that great.

You can also delete the `#include "deletejob.h" in job.cpp. Other than that it's ready for merge.

This revision is now accepted and ready to land.Thu, Nov 20, 2:14 PM