View Issue Details

IDProjectCategoryView StatusLast Update
0007800CentOS-7kdelibspublic2014-10-29 14:13
ReporterColin Coles Assigned To 
PrioritynormalSeveritytrivialReproducibilityalways
Status newResolutionopen 
PlatformPCOSCe 
Product Version7.0-1406 
Summary0007800: KDE Patch missing.
DescriptionIn Konqueror (and most other kde applications) the printer settings previous selections are not automatically remembered next time printer dialogue is used nor is there a method to save the settings. This is both: time consuming when multiple pages with same settings requirements are printed
Steps To Reproduce1.Using Konqueror Browser
2.File => Print
3.Options => HTML Settings
4.Uncheck Print Images
5.Click Print
6.Then Repeat 2 and 3
Additional InformationOriginal bug report for RHEL 6: https://bugzilla.redhat.com/show_bug.cgi?id=587016
Fixed by: https://rhn.redhat.com/errata/RHBA-2012-1251.html
This bug has now reappeared in CentOS 7.
Updated patch attached.
TagsNo tags attached.
abrt_hash
URL

Activities

Colin Coles

Colin Coles

2014-10-29 12:00

reporter  

kdelibs-4.10.5-bz#587016.patch (3,236 bytes)   
diff -up kdelibs-4.10.5/khtml/khtml_printsettings.cpp.me kdelibs-4.10.5/khtml/khtml_printsettings.cpp
--- kdelibs-4.10.5/khtml/khtml_printsettings.cpp.me     2014-10-28 17:11:53.112634782 +0000
+++ kdelibs-4.10.5/khtml/khtml_printsettings.cpp        2014-10-28 17:12:22.020272168 +0000
@@ -106,5 +106,19 @@ bool KHTMLPrintSettings::printHeader()
        return m_printheader->isChecked();
 }
 
+void KHTMLPrintSettings::setprintFriendly(bool b)
+{
+   m_printfriendly->setChecked(b);
+}
+
+void KHTMLPrintSettings::setprintImages(bool b)
+{
+   m_printimages->setChecked(b);
+}
+
+void KHTMLPrintSettings::setprintHeader(bool b)
+{
+   m_printheader->setChecked(b);
+}
 
 #include "khtml_printsettings.moc"
diff -up kdelibs-4.10.5/khtml/khtml_printsettings.h.me kdelibs-4.10.5/khtml/khtml_printsettings.h
--- kdelibs-4.10.5/khtml/khtml_printsettings.h.me       2014-10-28 17:18:01.058985704 +0000
+++ kdelibs-4.10.5/khtml/khtml_printsettings.h  2014-10-28 17:18:42.384457810 +0000
@@ -35,6 +35,10 @@ public:
         bool printImages();
         bool printHeader();
 
+        void setprintFriendly(bool);
+        void setprintImages(bool);
+        void setprintHeader(bool);
+
 private:
        QCheckBox       *m_printfriendly;
        QCheckBox       *m_printimages;
diff -up kdelibs-4.10.5/khtml/khtmlview.cpp.me kdelibs-4.10.5/khtml/khtmlview.cpp
--- kdelibs-4.10.5/khtml/khtmlview.cpp.me       2013-06-28 18:03:41.256379776 +0100
+++ kdelibs-4.10.5/khtml/khtmlview.cpp  2014-10-28 18:01:40.627135964 +0000
@@ -3033,6 +3033,14 @@ void KHTMLView::print(bool quick)
     if(!root) return;
 
     QPointer<KHTMLPrintSettings> printSettings(new KHTMLPrintSettings); //XXX: doesn't save settings between prints like this
+
+    // read print settings
+    KSharedConfigPtr config = KGlobal::config();
+    KConfigGroup group(config, "KHTML Print Settings");
+    printSettings->setprintFriendly(group.readEntry("PrintFriendly", true));
+    printSettings->setprintImages(group.readEntry("PrintImages", true));
+    printSettings->setprintHeader(group.readEntry("PrintHeader", true));
+
     const QPointerDeleter settingsDeleter(printSettings); //the printdialog takes ownership of the settings widget, thus this workaround to avoid double deletion
     QPrinter printer;
     QPointer<QPrintDialog> dialog = KdePrint::createPrintDialog(&printer, KdePrint::SystemSelectsPages, QList<QWidget*>() << printSettings.data(), this);
@@ -3044,6 +3052,13 @@ void KHTMLView::print(bool quick)
         docname = KStringHandler::csqueeze(docname, 80);
 
     if(quick || (dialog->exec() && dialog)) { /*'this' and thus dialog might have been deleted while exec()!*/
+        // write HTML settings
+        KSharedConfigPtr config = KGlobal::config();
+        KConfigGroup group(config, "KHTML Print Settings");
+        group.writeEntry("PrintFriendly", printSettings->printFriendly());
+        group.writeEntry("PrintImages", printSettings->printImages());
+        group.writeEntry("PrintHeader", printSettings->printHeader());
+
         viewport()->setCursor( Qt::WaitCursor ); // only viewport(), no QApplication::, otherwise we get the busy cursor in kdeprint's dialogs
         // set up KPrinter
         printer.setFullPage(false);
kdelibs-4.10.5-bz#587016.patch (3,236 bytes)   
JohnnyHughes

JohnnyHughes

2014-10-29 14:13

administrator   ~0021452

Added as upstream bug:

https://bugzilla.redhat.com/show_bug.cgi?id=1158510

Issue History

Date Modified Username Field Change
2014-10-29 12:00 Colin Coles New Issue
2014-10-29 12:00 Colin Coles File Added: kdelibs-4.10.5-bz#587016.patch
2014-10-29 14:13 JohnnyHughes Note Added: 0021452