Polling of available printers in now asynchronous (#264,#256)
- Increased polling interval from 1s to 10s - Use QtConcurrent::run to initiate a poll asynchronously to main event loop - Do not initiate a poll if the previous poll has not completed - Use copies instead of references to mCurrentAvailablePrinters in public API
This commit is contained in:
@@ -48,8 +48,8 @@ namespace glabels
|
||||
|
||||
auto* printerMonitor = PrinterMonitor::instance();
|
||||
loadDestinations( printerMonitor->availablePrinters() );
|
||||
connect( printerMonitor, SIGNAL(availablePrintersChanged(const QStringList&)),
|
||||
this, SLOT(onAvailablePrintersChanged(const QStringList&)) );
|
||||
connect( printerMonitor, SIGNAL(availablePrintersChanged(QStringList)),
|
||||
this, SLOT(onAvailablePrintersChanged(QStringList)) );
|
||||
|
||||
setDestination( model::Settings::recentPrinter() );
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace glabels
|
||||
///
|
||||
/// Available printers changed handler
|
||||
///
|
||||
void PrintView::onAvailablePrintersChanged( const QStringList& printers )
|
||||
void PrintView::onAvailablePrintersChanged( QStringList printers )
|
||||
{
|
||||
auto savedSelection = destinationCombo->currentText();
|
||||
loadDestinations( printers );
|
||||
|
||||
Reference in New Issue
Block a user