summaryrefslogtreecommitdiffstats
path: root/src/printsupport
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2014-01-17 16:16:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-05 19:33:59 +0100
commit27c33a8f7a9469fd8b55de62b11e0b6b868636c5 (patch)
tree6b599ed8d6177c34edd73359256550730ae4bc9c /src/printsupport
parent0ee72b09fd99b756a85de78bafb03c7dee163ef5 (diff)
QPrintEngne - Fix PPK_Creator
Add support to the Mac and Windows print engines to preserve the creator name when switching between native and pdf format. Change-Id: Ie036af3140f24d8e34aa886f091384f93aa0157b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/printsupport')
-rw-r--r--src/printsupport/kernel/qprintengine_win.cpp14
-rw-r--r--src/printsupport/kernel/qprintengine_win_p.h1
2 files changed, 9 insertions, 6 deletions
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp
index d48c1a730d..958e4a0989 100644
--- a/src/printsupport/kernel/qprintengine_win.cpp
+++ b/src/printsupport/kernel/qprintengine_win.cpp
@@ -1290,9 +1290,6 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
break;
// The following keys are settings that are unsupported by the Windows PrintEngine
- case PPK_Creator:
- // TODO Add value preservation support by using local variable
- break;
case PPK_CustomBase:
break;
case PPK_Duplex:
@@ -1326,6 +1323,10 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
}
break;
+ case PPK_Creator:
+ d->m_creator = value.toString();
+ break;
+
case PPK_DocumentName:
if (isActive()) {
qWarning("QWin32PrintEngine: Cannot change document name while printing is active");
@@ -1505,9 +1506,6 @@ QVariant QWin32PrintEngine::property(PrintEnginePropertyKey key) const
// The following keys are settings that are unsupported by the Windows PrintEngine
// Return sensible default values to ensure consistent behavior across platforms
- case PPK_Creator:
- value = QString();
- break;
case PPK_Duplex:
// TODO Add support using DEVMODE.dmDuplex
value = QPrinter::DuplexNone;
@@ -1540,6 +1538,10 @@ QVariant QWin32PrintEngine::property(PrintEnginePropertyKey key) const
}
break;
+ case PPK_Creator:
+ value = d->m_creator;
+ break;
+
case PPK_DocumentName:
value = d->docName;
break;
diff --git a/src/printsupport/kernel/qprintengine_win_p.h b/src/printsupport/kernel/qprintengine_win_p.h
index 93fe993088..040140d50f 100644
--- a/src/printsupport/kernel/qprintengine_win_p.h
+++ b/src/printsupport/kernel/qprintengine_win_p.h
@@ -210,6 +210,7 @@ public:
// Document info
QString docName;
+ QString m_creator;
QString fileName;
QPrinter::PrinterState state;