Index: kdeui/CMakeLists.txt
===================================================================
--- kdeui/CMakeLists.txt	(wersja 829263)
+++ kdeui/CMakeLists.txt	(kopia robocza)
@@ -65,9 +65,6 @@
  dialogs/kassistantdialog.cpp
  dialogs/kconfigdialog.cpp
  dialogs/kconfigdialogmanager.cpp
- dialogs/kcupsoptionswidget_p.cpp
- dialogs/kcupsoptionsjobwidget_p.cpp
- dialogs/kcupsoptionspageswidget_p.cpp
  dialogs/kbugreport.cpp
  dialogs/kdeprintdialog.cpp
  dialogs/kdialog.cpp
@@ -236,7 +233,10 @@
 )
 
 if (Q_WS_X11)
-    set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kkeyserver_x11.cpp )
+    set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kkeyserver_x11.cpp
+                                         dialogs/kcupsoptionswidget_p.cpp
+                                         dialogs/kcupsoptionsjobwidget_p.cpp
+                                         dialogs/kcupsoptionspageswidget_p.cpp )
 endif (Q_WS_X11)
 if (Q_WS_MAC)
     set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kkeyserver_mac.cpp )
@@ -267,8 +267,6 @@
 endif(MINGW)
 
 set( kdeui_UI
-   dialogs/kcupsoptionspageswidget.ui
-   dialogs/kcupsoptionsjobwidget.ui
    dialogs/kpassworddialog.ui
    dialogs/knewpassworddialog.ui
    dialogs/kshortcutsdialog.ui
@@ -277,6 +275,12 @@
    sonnet/configui.ui
    )
 
+if (Q_WS_X11)
+    set( kdeui_UI ${kdeui_UI} dialogs/kcupsoptionspageswidget.ui
+                              dialogs/kcupsoptionsjobwidget.ui
+    )
+endif (Q_WS_X11)
+
 kde4_add_ui_files(kdeui_LIB_SRCS ${kdeui_UI} )
 
 
Index: kdeui/dialogs/kdeprintdialog.cpp
===================================================================
--- kdeui/dialogs/kdeprintdialog.cpp	(wersja 829263)
+++ kdeui/dialogs/kdeprintdialog.cpp	(kopia robocza)
@@ -21,8 +21,11 @@
  **/
 
 #include "kdeprintdialog.h"
+#ifdef Q_WS_X11
 #include "kcupsoptionspageswidget_p.h"
 #include "kcupsoptionsjobwidget_p.h"
+#endif
+
 #include "kdebug.h"
 #include "kdialog.h"
 #include "klocale.h"
@@ -31,25 +34,25 @@
 #include <QPrintDialog>
 
 QPrintDialog *KdePrint::createPrintDialog(QPrinter *printer,
-                                               const QList<QWidget*> &customTabs,
-                                               QWidget *parent)
+                                          const QList<QWidget*> &customTabs,
+                                          QWidget *parent)
 {
     QPrintDialog *dialog = new QPrintDialog( printer, parent );
+#ifdef Q_WS_X11
     KCupsOptionsPagesWidget *cupsOptionsPagesTab = new KCupsOptionsPagesWidget( dialog );
     KCupsOptionsJobWidget *cupsOptionsJobTab = new KCupsOptionsJobWidget( dialog );
     dialog->setOptionTabs( QList<QWidget*>() << cupsOptionsPagesTab << cupsOptionsJobTab << customTabs );
+#else
+    foreach( QWidget* w, customTabs ) // reparent to avoid leaks
+        w->setParent( dialog );
+#endif
     dialog->setWindowTitle( KDialog::makeStandardCaption( i18nc( "@title:window", "Print" ) ) );
     return dialog;
 }
 
 
 QPrintDialog *KdePrint::createPrintDialog(QPrinter *printer,
-                                               QWidget *parent)
+                                          QWidget *parent)
 {
-    QPrintDialog *dialog = new QPrintDialog( printer, parent );
-    KCupsOptionsPagesWidget *cupsOptionsPagesTab = new KCupsOptionsPagesWidget( dialog );
-    KCupsOptionsJobWidget *cupsOptionsJobTab = new KCupsOptionsJobWidget( dialog );
-    dialog->setOptionTabs( QList<QWidget*>() << cupsOptionsPagesTab << cupsOptionsJobTab );
-    dialog->setWindowTitle( KDialog::makeStandardCaption( i18nc( "@title:window", "Print" ) ) );
-    return dialog;
+    return KdePrint::createPrintDialog(printer, QList<QWidget*>(), parent);
 }
Index: kdeui/dialogs/kdeprintdialog.h
===================================================================
--- kdeui/dialogs/kdeprintdialog.h	(wersja 829263)
+++ kdeui/dialogs/kdeprintdialog.h	(kopia robocza)
@@ -37,9 +37,13 @@
     /**
      * Creates a printer dialog for a QPrinter with the given custom widgets.
      *
-     * Note that the custom widgets will @b not be shown on Qt versions prior to
-     * 4.3.2.
+     * Note that the custom widgets are only supported on X11
+     * and will @b not be shown on Qt versions prior to 4.3.2.
+     * On non-X11 systems it is prederred to provide the widgets 
+     * within configuration dialog of the application.
      *
+     * Setting the widgets will transfer their ownership to the print dialog
+     * even on non-X11 systems.
      * The caller takes ownership of the dialog and is responsible
      * for deleting it.
      *
@@ -48,10 +52,11 @@
      * @param customTabs a list of custom widgets to show as tabs, the name printed on the tab will
      *      be taken from the widgets windowTitle().
      * @see QWidget::setWindowTitle()
+     * @see QAbstractPrintDialog::setOptionTabs()
      */
     KDEUI_EXPORT QPrintDialog *createPrintDialog(QPrinter *printer,
-                                                      const QList<QWidget*> &customTabs,
-                                                      QWidget *parent = 0);
+                                                 const QList<QWidget*> &customTabs,
+                                                 QWidget *parent = 0);
 
     /**
      * Creates a printer dialog for a QPrinter
@@ -63,7 +68,7 @@
      * @param parent the parent for the dialog
      */
     KDEUI_EXPORT QPrintDialog *createPrintDialog(QPrinter *printer,
-                                                      QWidget *parent = 0);
+                                                 QWidget *parent = 0);
 }
 
 
