diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-05-02 23:48:19 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-02-03 21:52:51 +0100 |
commit | b34eba61471c1138f1be8770163c8d25b5c66946 (patch) | |
tree | 887bfe6825157ee01f00a96b06b9db7022aed780 | |
parent | df6c90134707ff6f575537214148439c01235bc7 (diff) | |
download | tdelibs-b34eba61471c1138f1be8770163c8d25b5c66946.tar.gz tdelibs-b34eba61471c1138f1be8770163c8d25b5c66946.zip |
KJobViewer: make sure the printer lists is correctly updated when printers are added or removed. This relates to bug 1362.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 69c2d469b80d8cf7b99a62ebd7c2f4bd8281712b)
-rw-r--r-- | kdeprint/kmmanager.cpp | 1 | ||||
-rw-r--r-- | kdeprint/kmmanager.h | 3 | ||||
-rw-r--r-- | kdeprint/management/kmjobviewer.cpp | 7 | ||||
-rw-r--r-- | kdeprint/management/kmjobviewer.h | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/kdeprint/kmmanager.cpp b/kdeprint/kmmanager.cpp index bee42fe2a..38554d64a 100644 --- a/kdeprint/kmmanager.cpp +++ b/kdeprint/kmmanager.cpp @@ -272,6 +272,7 @@ TQPtrList<KMPrinter>* KMManager::printerList(bool reload) if (defprinter) setSoftDefault(defprinter); } + emit printerListUpdated(); } return &m_fprinters; diff --git a/kdeprint/kmmanager.h b/kdeprint/kmmanager.h index ecdacba06..1a8473ed1 100644 --- a/kdeprint/kmmanager.h +++ b/kdeprint/kmmanager.h @@ -142,7 +142,8 @@ public: void checkUpdatePossible(); signals: - void updatePossible( bool ); + void updatePossible(bool); + void printerListUpdated(); protected: // the real printer listing job is done here diff --git a/kdeprint/management/kmjobviewer.cpp b/kdeprint/management/kmjobviewer.cpp index a58554082..aec1339b8 100644 --- a/kdeprint/management/kmjobviewer.cpp +++ b/kdeprint/management/kmjobviewer.cpp @@ -104,6 +104,8 @@ KMJobViewer::KMJobViewer(TQWidget *parent, const char *name) conf->setGroup( "Jobs" ); resize( conf->readSizeEntry( "Size", &defSize ) ); } + + connect(KMFactory::self()->manager(), TQT_SIGNAL(printerListUpdated()),TQT_SLOT(slotPrinterListUpdated())); } KMJobViewer::~KMJobViewer() @@ -532,6 +534,11 @@ void KMJobViewer::slotRightClicked(TQListViewItem*,const TQPoint& p,int) if (m_pop) m_pop->popup(p); } +void KMJobViewer::slotPrinterListUpdated() +{ + loadPrinters(); +} + void KMJobViewer::loadPrinters() { m_printers.clear(); diff --git a/kdeprint/management/kmjobviewer.h b/kdeprint/management/kmjobviewer.h index ae7fb4f89..66150e8d6 100644 --- a/kdeprint/management/kmjobviewer.h +++ b/kdeprint/management/kmjobviewer.h @@ -87,6 +87,7 @@ protected slots: void slotConfigure(); void slotDropped( TQDropEvent*, TQListViewItem* ); void slotKeepWindowChange(bool); + void slotPrinterListUpdated(); protected: void init(); |