summaryrefslogtreecommitdiffstats
path: root/tdeprint/kprinter.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-03-05 22:17:41 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-03-05 22:41:23 +0900
commit9cff750d6cdda3d0fc24671b2c98d12102915505 (patch)
tree3515bd2b5a20346294fcedb731c25e1bc7cb0fda /tdeprint/kprinter.cpp
parentea10b6290dd14c79fd3192a2f772093310b94f22 (diff)
downloadtdelibs-9cff750d6cdda3d0fc24671b2c98d12102915505.tar.gz
tdelibs-9cff750d6cdda3d0fc24671b2c98d12102915505.zip
tdeprint: make KPrinter::setOrientation and KPrinter::setPageSize non locking by default and add ability to specify their locking behavior.
This is a backward compatible API change and a non compatible ABI change. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeprint/kprinter.cpp')
-rw-r--r--tdeprint/kprinter.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tdeprint/kprinter.cpp b/tdeprint/kprinter.cpp
index 010297e5a..740bac293 100644
--- a/tdeprint/kprinter.cpp
+++ b/tdeprint/kprinter.cpp
@@ -597,12 +597,15 @@ int KPrinter::metric(int m) const
return val;
}
-void KPrinter::setOrientation(Orientation o)
+void KPrinter::setOrientation(Orientation o, bool locking)
{
KMFactory::self()->settings()->orientation = o;
setOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait"));
d->m_impl->broadcastOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait"));
- d->m_impl->broadcastOption( "kde-orientation-fixed", "1" );
+ if (locking)
+ {
+ d->m_impl->broadcastOption( "kde-orientation-fixed", "1" );
+ }
}
void KPrinter::setOption( const TQString& key, const TQString& value, bool broadcast )
@@ -612,11 +615,14 @@ void KPrinter::setOption( const TQString& key, const TQString& value, bool broad
d->m_impl->broadcastOption( key, value );
}
-void KPrinter::setPageSize(PageSize s)
+void KPrinter::setPageSize(PageSize s, bool locking)
{
KMFactory::self()->settings()->pageSize = s;
setOption("kde-pagesize",TQString::number((int)s),true);
- d->m_impl->broadcastOption( "kde-pagesize-fixed", "1" );
+ if (locking)
+ {
+ d->m_impl->broadcastOption( "kde-pagesize-fixed", "1" );
+ }
}
void KPrinter::setOptions(const TQMap<TQString,TQString>& opts)