summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-05-02 23:48:19 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-05-12 11:56:00 +0900
commit69c2d469b80d8cf7b99a62ebd7c2f4bd8281712b (patch)
treedeee760dfe9d6bc191f584d41db0ddafebc9d9cc
parent66d5e21568af94de26cf79a775502cb766a1de3d (diff)
downloadtdelibs-69c2d469b80d8cf7b99a62ebd7c2f4bd8281712b.tar.gz
tdelibs-69c2d469b80d8cf7b99a62ebd7c2f4bd8281712b.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>
-rw-r--r--tdeprint/kmmanager.cpp1
-rw-r--r--tdeprint/kmmanager.h3
-rw-r--r--tdeprint/management/kmjobviewer.cpp7
-rw-r--r--tdeprint/management/kmjobviewer.h1
4 files changed, 11 insertions, 1 deletions
diff --git a/tdeprint/kmmanager.cpp b/tdeprint/kmmanager.cpp
index d43239fd7..19fdbc7cc 100644
--- a/tdeprint/kmmanager.cpp
+++ b/tdeprint/kmmanager.cpp
@@ -272,6 +272,7 @@ TQPtrList<KMPrinter>* KMManager::printerList(bool reload)
if (defprinter)
setSoftDefault(defprinter);
}
+ emit printerListUpdated();
}
return &m_fprinters;
diff --git a/tdeprint/kmmanager.h b/tdeprint/kmmanager.h
index 9c5820f3a..d90a02d23 100644
--- a/tdeprint/kmmanager.h
+++ b/tdeprint/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/tdeprint/management/kmjobviewer.cpp b/tdeprint/management/kmjobviewer.cpp
index 43f027fe1..70a6c6e85 100644
--- a/tdeprint/management/kmjobviewer.cpp
+++ b/tdeprint/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/tdeprint/management/kmjobviewer.h b/tdeprint/management/kmjobviewer.h
index 5bfda8467..f9e6ffb80 100644
--- a/tdeprint/management/kmjobviewer.h
+++ b/tdeprint/management/kmjobviewer.h
@@ -87,6 +87,7 @@ protected slots:
void slotConfigure();
void slotDropped( TQDropEvent*, TQListViewItem* );
void slotKeepWindowChange(bool);
+ void slotPrinterListUpdated();
protected:
void init();