-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcupsbackend.cpp
48 lines (45 loc) · 1.37 KB
/
cupsbackend.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "cupsbackend.h"
#include <QApplication>
#include <QProcess>
#include <QDir>
CupsBackend::CupsBackend()
{
QStringList args;
int numCopies = 1;
QString jobName("print");
args << "-P" << printerName();
args << "-#" << QString("%1").arg(numCopies);
args << "-T" << jobName;
args << "-r";
// if(mDuplexType == DuplexAuto && !duplex){
// args << "-o sides=one-sided";
// }
QString file = QString("%1/.cache/ecp_tmp_%2-print.pdf")
.arg(QDir::homePath())
.arg(QCoreApplication::applicationPid());
// args << file.toLocal8Bit();
// QProcess proc;
// proc.startDetached("lpr",args);
}
bool CupsBackend::print( const QString &jobName, bool duplex, int numCopies) const
{
// QStringList args;
// args << "-P" << printerName();
// args << "-#" << QString("%1").arg(numCopies);
// args << "-T" << jobName;
// args << "-r";
// if(mDuplexType == DuplexAuto && !duplex){
// args << "-o sides=one-sided";
// }
// QString file = QString("%1/.cache/ecp_tmp_%2-print.pdf")
// .arg(QDir::homePath())
// .arg(QCoreApplication::applicationPid());
// args << file.toLocal8Bit();
// QProcess proc;
// proc.startDetached("lpr",args);
// return true;
}
QString CupsBackend::printerName()
{
return QString("hello");
}