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>
pull/82/head
Michele Calgaro 5 years ago
parent 66d5e21568
commit 69c2d469b8
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -272,6 +272,7 @@ TQPtrList<KMPrinter>* KMManager::printerList(bool reload)
if (defprinter) if (defprinter)
setSoftDefault(defprinter); setSoftDefault(defprinter);
} }
emit printerListUpdated();
} }
return &m_fprinters; return &m_fprinters;

@ -142,7 +142,8 @@ public:
void checkUpdatePossible(); void checkUpdatePossible();
signals: signals:
void updatePossible( bool ); void updatePossible(bool);
void printerListUpdated();
protected: protected:
// the real printer listing job is done here // the real printer listing job is done here

@ -104,6 +104,8 @@ KMJobViewer::KMJobViewer(TQWidget *parent, const char *name)
conf->setGroup( "Jobs" ); conf->setGroup( "Jobs" );
resize( conf->readSizeEntry( "Size", &defSize ) ); resize( conf->readSizeEntry( "Size", &defSize ) );
} }
connect(KMFactory::self()->manager(), TQT_SIGNAL(printerListUpdated()),TQT_SLOT(slotPrinterListUpdated()));
} }
KMJobViewer::~KMJobViewer() KMJobViewer::~KMJobViewer()
@ -532,6 +534,11 @@ void KMJobViewer::slotRightClicked(TQListViewItem*,const TQPoint& p,int)
if (m_pop) m_pop->popup(p); if (m_pop) m_pop->popup(p);
} }
void KMJobViewer::slotPrinterListUpdated()
{
loadPrinters();
}
void KMJobViewer::loadPrinters() void KMJobViewer::loadPrinters()
{ {
m_printers.clear(); m_printers.clear();

@ -87,6 +87,7 @@ protected slots:
void slotConfigure(); void slotConfigure();
void slotDropped( TQDropEvent*, TQListViewItem* ); void slotDropped( TQDropEvent*, TQListViewItem* );
void slotKeepWindowChange(bool); void slotKeepWindowChange(bool);
void slotPrinterListUpdated();
protected: protected:
void init(); void init();

Loading…
Cancel
Save