Emit dbus captureSaved signal when saving files
New captureSaved signal contains the request ID and canonical path of the saved file. This allows a dbus listener interested in postprocessing files access to the path most recently written.
This commit is contained in:
@@ -85,9 +85,9 @@ void CaptureRequest::exportCapture(const QPixmap& p)
|
||||
{
|
||||
if ((m_tasks & ExportTask::FILESYSTEM_SAVE_TASK) != ExportTask::NO_TASK) {
|
||||
if (m_path.isEmpty()) {
|
||||
ScreenshotSaver().saveToFilesystemGUI(p);
|
||||
ScreenshotSaver(m_id).saveToFilesystemGUI(p);
|
||||
} else {
|
||||
ScreenshotSaver().saveToFilesystem(p, m_path, "");
|
||||
ScreenshotSaver(m_id).saveToFilesystem(p, m_path, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -312,6 +312,11 @@ void Controller::showRecentScreenshots()
|
||||
m_history->show();
|
||||
}
|
||||
|
||||
void Controller::sendCaptureSaved(uint id, const QString& savePath)
|
||||
{
|
||||
emit captureSaved(id, savePath);
|
||||
}
|
||||
|
||||
void Controller::startFullscreenCapture(const uint id)
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
signals:
|
||||
void captureTaken(uint id, QPixmap p, QRect selection);
|
||||
void captureFailed(uint id);
|
||||
void captureSaved(uint id, QString savePath);
|
||||
|
||||
public slots:
|
||||
void requestCapture(const CaptureRequest& request);
|
||||
@@ -68,6 +69,8 @@ public slots:
|
||||
|
||||
void showRecentScreenshots();
|
||||
|
||||
void sendCaptureSaved(uint id, const QString& savePath);
|
||||
|
||||
private slots:
|
||||
void startFullscreenCapture(const uint id = 0);
|
||||
void startVisualCapture(const uint id = 0,
|
||||
|
||||
@@ -34,6 +34,10 @@ FlameshotDBusAdapter::FlameshotDBusAdapter(QObject* parent)
|
||||
&Controller::captureTaken,
|
||||
this,
|
||||
&FlameshotDBusAdapter::handleCaptureTaken);
|
||||
connect(controller,
|
||||
&Controller::captureSaved,
|
||||
this,
|
||||
&FlameshotDBusAdapter::captureSaved);
|
||||
}
|
||||
|
||||
FlameshotDBusAdapter::~FlameshotDBusAdapter() {}
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
signals:
|
||||
void captureTaken(uint id, QByteArray rawImage, QRect selection);
|
||||
void captureFailed(uint id);
|
||||
void captureSaved(uint id, QString savePath);
|
||||
|
||||
public slots:
|
||||
Q_NOREPLY void graphicCapture(QString path, int delay, uint id);
|
||||
|
||||
Reference in New Issue
Block a user