2
* Copyright (C) 2017 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#include "printersignalhandler.h"
19
PrinterSignalHandler::PrinterSignalHandler(int triggerEventDelay,
23
m_timer.setInterval(triggerEventDelay);
24
connect(&m_timer, SIGNAL(timeout()), this, SLOT(process()));
27
PrinterSignalHandler::~PrinterSignalHandler()
31
void PrinterSignalHandler::process()
33
Q_FOREACH(auto printer, m_unprocessed) {
34
Q_EMIT printerModified(printer);
36
m_unprocessed.clear();
40
void PrinterSignalHandler::onPrinterModified(
41
const QString &text, const QString &printerUri,
42
const QString &printerName, uint printerState,
43
const QString &printerStateReason, bool acceptingJobs)
48
Q_UNUSED(printerState);
49
Q_UNUSED(printerStateReason);
50
Q_UNUSED(acceptingJobs);
52
m_unprocessed << printerName;
56
void PrinterSignalHandler::onPrinterStateChanged(
57
const QString &text, const QString &printerUri,
58
const QString &printerName, uint printerState,
59
const QString &printerStateReason, bool acceptingJobs)
63
Q_UNUSED(printerState);
64
Q_UNUSED(printerStateReason);
65
Q_UNUSED(acceptingJobs);
67
m_unprocessed << printerName;