Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleCore.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 30 | { | |||
---|---|---|---|---|---|
44 | explicit SpectacleCore(StartMode startMode, ImageGrabber::GrabMode grabMode, QString &saveFileName, | 44 | explicit SpectacleCore(StartMode startMode, ImageGrabber::GrabMode grabMode, QString &saveFileName, | ||
45 | qint64 delayMsec, bool notifyOnGrab, QObject *parent = 0); | 45 | qint64 delayMsec, bool notifyOnGrab, QObject *parent = 0); | ||
46 | ~SpectacleCore(); | 46 | ~SpectacleCore(); | ||
47 | 47 | | |||
48 | QString filename() const; | 48 | QString filename() const; | ||
49 | void setFilename(const QString &filename); | 49 | void setFilename(const QString &filename); | ||
50 | ImageGrabber::GrabMode grabMode() const; | 50 | ImageGrabber::GrabMode grabMode() const; | ||
51 | void setGrabMode(const ImageGrabber::GrabMode &grabMode); | 51 | void setGrabMode(const ImageGrabber::GrabMode &grabMode); | ||
52 | 52 | | |||
rkflx: Is there any reason you need to introduce a new method here? AFAIK Spectacle could be called… | |||||
I can merge SpectacleCore::takeNewScreenshotDBus() back into SpectacleCore::takeNewScreenshot() but i think that it will only make a small difference in SpectacleCore::takeNewScreenshot(), which is: if(mStartMode != DBusMode) { ... } else { ... } kapillamba4: I can merge SpectacleCore::takeNewScreenshotDBus() back into SpectacleCore::takeNewScreenshot()… | |||||
Also we would have to add another parameter shouldSave to SpectacleCore::takeNewScreenshot() and make appropriate changes everywhere for SpectacleCore::takeNewScreenshot() kapillamba4: Also we would have to add another parameter shouldSave to SpectacleCore::takeNewScreenshot()… | |||||
That's preferable to simply copying the code around. Also, default parameters can help. Perhaps it would look similar to what I proposed in D9117#inline-50329. rkflx: That's preferable to simply copying the code around. Also, default parameters can help. Perhaps… | |||||
53 | signals: | 53 | signals: | ||
54 | 54 | | |||
55 | void errorMessage(const QString errString); | 55 | void errorMessage(const QString errString); | ||
56 | void allDone(); | 56 | void allDone(); | ||
57 | void filenameChanged(QString filename); | 57 | void filenameChanged(QString filename); | ||
58 | void grabModeChanged(ImageGrabber::GrabMode mode); | 58 | void grabModeChanged(ImageGrabber::GrabMode mode); | ||
59 | void grabFailed(); | 59 | void grabFailed(); | ||
60 | 60 | | |||
61 | public slots: | 61 | public slots: | ||
62 | 62 | | |||
63 | void takeNewScreenshot(const ImageGrabber::GrabMode &mode, const int &timeout, const bool &includePointer, const bool &includeDecorations); | 63 | void takeNewScreenshot(const ImageGrabber::GrabMode &mode, const int &timeout, const bool &includePointer, | ||
64 | const bool &includeDecorations, const bool &shouldCopy = false, const bool &shouldSave = true); | ||||
64 | void showErrorMessage(const QString &errString); | 65 | void showErrorMessage(const QString &errString); | ||
65 | void screenshotUpdated(const QPixmap &pixmap); | 66 | void screenshotUpdated(const QPixmap &pixmap); | ||
66 | void screenshotFailed(); | 67 | void screenshotFailed(); | ||
67 | void dbusStartAgent(); | 68 | void dbusStartAgent(); | ||
68 | void doStartDragAndDrop(); | 69 | void doStartDragAndDrop(); | ||
69 | void doNotify(const QUrl &savedAt); | 70 | void doNotify(const QUrl &savedAt); | ||
70 | void doCopyPath(const QUrl &savedAt); | 71 | void doCopyPath(const QUrl &savedAt); | ||
71 | 72 | | |||
Show All 15 Lines |
Is there any reason you need to introduce a new method here? AFAIK Spectacle could be called from DBus before and you only a some new variants to this.
In general I feel because of this change you have to move a lot of things around, potentially introducing many bugs (did not look into this too much yet, though, so take this comment with a grain of salt).