Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit adae1b4f authored by Daniel Nicoletti's avatar Daniel Nicoletti

Finish porting to new Qt5 connect syntax

parent 89322276
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -62,8 +62,7 @@ AddPrinterAssistant::AddPrinterAssistant() :
m_busySeq->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
m_busySeq->setWidget(helpButton);
connect(finishButton(), SIGNAL(clicked()),
this, SLOT(slotFinishButtonClicked()));
connect(finishButton(), &QPushButton::clicked, this, &AddPrinterAssistant::slotFinishButtonClicked);
// Restore the dialog size
KConfigGroup configGroup(KSharedConfig::openConfig("print-manager"), "AddPrinterAssistant");
......@@ -185,16 +184,16 @@ void AddPrinterAssistant::setCurrentPage(KPageWidgetItem *page)
GenericPage *currPage = qobject_cast<GenericPage*>(currentPage()->widget());
GenericPage *nextPage = qobject_cast<GenericPage*>(page->widget());
// Disconnect the current page slots
disconnect(currPage, SIGNAL(allowProceed(bool)), this, SLOT(enableNextButton(bool)));
disconnect(currPage, SIGNAL(allowProceed(bool)), this, SLOT(enableFinishButton(bool)));
disconnect(currPage, SIGNAL(startWorking()), m_busySeq, SLOT(start()));
disconnect(currPage, SIGNAL(stopWorking()), m_busySeq, SLOT(stop()));
disconnect(currPage, SIGNAL(proceed()), this, SLOT(next()));
disconnect(currPage, &GenericPage::allowProceed, this, &AddPrinterAssistant::enableNextButton);
disconnect(currPage, &GenericPage::allowProceed, this, &AddPrinterAssistant::enableFinishButton);
disconnect(currPage, &GenericPage::proceed, this, static_cast<void(AddPrinterAssistant::*)()>(&AddPrinterAssistant::next));
disconnect(currPage, &GenericPage::startWorking, m_busySeq, &KPixmapSequenceOverlayPainter::start);
disconnect(currPage, &GenericPage::stopWorking, m_busySeq, &KPixmapSequenceOverlayPainter::stop);
// Connect next page signals
connect(currPage, SIGNAL(startWorking()), m_busySeq, SLOT(start()));
connect(currPage, SIGNAL(stopWorking()), m_busySeq, SLOT(stop()));
connect(nextPage, SIGNAL(proceed()), this, SLOT(next()));
connect(nextPage, &GenericPage::startWorking, m_busySeq, &KPixmapSequenceOverlayPainter::start);
connect(nextPage, &GenericPage::stopWorking, m_busySeq, &KPixmapSequenceOverlayPainter::stop);
connect(nextPage, &GenericPage::proceed, this, static_cast<void(AddPrinterAssistant::*)()>(&AddPrinterAssistant::next));
// check the working property
if (nextPage->isWorking()) {
......@@ -205,11 +204,11 @@ void AddPrinterAssistant::setCurrentPage(KPageWidgetItem *page)
// When ChangePPD() is called addPrinterPage is zero
if (page == m_addPrinterPage || m_addPrinterPage == 0) {
connect(nextPage, SIGNAL(allowProceed(bool)), this, SLOT(enableFinishButton(bool)));
connect(nextPage, &GenericPage::allowProceed, this, &AddPrinterAssistant::enableFinishButton);
enableNextButton(false);
enableFinishButton(nextPage->canProceed());
} else {
connect(nextPage, SIGNAL(allowProceed(bool)), this, SLOT(enableNextButton(bool)));
connect(nextPage, &GenericPage::allowProceed, this, &AddPrinterAssistant::enableNextButton);
enableNextButton(nextPage->canProceed());
}
} else {
......
/***************************************************************************
* Copyright (C) 2010-2012 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -90,8 +90,7 @@ PageDestinations::PageDestinations(const QVariantHash &args, QWidget *parent) :
m_model = new DevicesModel(this);
ui->devicesTV->setModel(m_model);
ui->devicesTV->setItemDelegate(new NoSelectionRectDelegate(this));
connect(ui->devicesTV->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(deviceChanged()));
connect(ui->devicesTV->selectionModel(), &QItemSelectionModel::selectionChanged, this, &PageDestinations::deviceChanged);
connect(m_model, &DevicesModel::errorMessage, ui->messageWidget, &KMessageWidget::setText);
connect(m_model, &DevicesModel::errorMessage, ui->messageWidget, &KMessageWidget::animatedShow);
......
/***************************************************************************
* Copyright (C) 2010-2012 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -103,7 +103,7 @@ ConfigureDialog::ConfigureDialog(const QString &destName, bool isClass, QWidget
page->setHeader(i18n("Configure"));
page->setIcon(QIcon::fromTheme("dialog-information"));
// CONNECT this signal ONLY to the first Page
connect(modifyPrinter, SIGNAL(changed(bool)), this, SLOT(enableButtonApply(bool)));
connect(modifyPrinter, &ModifyPrinter::changed, this, &ConfigureDialog::enableButtonApply);
addPage(page);
if (!isClass) {
......@@ -114,7 +114,7 @@ ConfigureDialog::ConfigureDialog(const QString &destName, bool isClass, QWidget
page->setHeader(i18n("Set the Default Printer Options"));
page->setIcon(QIcon::fromTheme("view-pim-tasks"));
addPage(page);
connect(modifyPrinter, SIGNAL(ppdChanged()), this, SLOT(ppdChanged()));
connect(modifyPrinter, &ModifyPrinter::ppdChanged, this, &ConfigureDialog::ppdChanged);
modifyPrinter->setCurrentMake(printerOptions->currentMake());
modifyPrinter->setCurrentMakeAndModel(printerOptions->currentMakeAndModel());
}
......@@ -127,13 +127,12 @@ ConfigureDialog::ConfigureDialog(const QString &destName, bool isClass, QWidget
addPage(page);
// connect this after ALL pages were added, otherwise the slot will be called
connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)),
SLOT(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)));
connect(this, &ConfigureDialog::currentPageChanged, this, &ConfigureDialog::currentPageChanged);
KConfigGroup group(KSharedConfig::openConfig("print-manager"), "ConfigureDialog");
KWindowConfig::restoreWindowSize(windowHandle(), group);
connect(buttonBox(), SIGNAL(clicked(QAbstractButton*)), this, SLOT(slotButtonClicked(QAbstractButton*)));
connect(buttonBox(), &QDialogButtonBox::clicked, this, &ConfigureDialog::slotButtonClicked);
}
void ConfigureDialog::ppdChanged()
......@@ -157,11 +156,11 @@ void ConfigureDialog::currentPageChanged(KPageWidgetItem *current, KPageWidgetIt
// Check if the before page has changes
savePage(beforePage);
if (beforePage) {
disconnect(beforePage, SIGNAL(changed(bool)), this, SLOT(enableButtonApply(bool)));
disconnect(beforePage, &PrinterPage::changed, this, &ConfigureDialog::enableButtonApply);
}
// connect the changed signal to the new page and check if it has changes
connect(currentPage, SIGNAL(changed(bool)), this, SLOT(enableButtonApply(bool)));
connect(currentPage, &PrinterPage::changed, this, &ConfigureDialog::enableButtonApply);
enableButtonApply(currentPage->hasChanges());
}
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -33,13 +33,13 @@ ConfigurePrinter::ConfigurePrinter(int & argc, char ** argv) :
void ConfigurePrinter::configurePrinter(const QString& printer)
{
m_cpInterface = new ConfigurePrinterInterface(this);
connect(m_cpInterface, SIGNAL(quit()), this, SLOT(quit()));
connect(m_cpInterface, &ConfigurePrinterInterface::quit, this, &ConfigurePrinter::quit);
if (!printer.isEmpty()) {
m_cpInterface->ConfigurePrinter(printer);
} else {
// If DBus called the ui list won't be empty
QTimer::singleShot(500, m_cpInterface, SLOT(RemovePrinter()));
QTimer::singleShot(500, m_cpInterface, &ConfigurePrinterInterface::RemovePrinter);
}
}
......
/***************************************************************************
* Copyright (C) 2010-2012 Daniel Nicoletti <dantti12@gmail.com> *
* Copyright (C) 2010-2018 Daniel Nicoletti <dantti12@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -87,10 +87,8 @@ void ConfigurePrinterInterface::ConfigurePrinter(const QString &destName)
if (found) {
ConfigureDialog *ui = new ConfigureDialog(printer.name(), printer.isClass());
connect(m_updateUi, SIGNAL(timeout()),
ui, SLOT(update()));
connect(ui, SIGNAL(finished(int)),
this, SLOT(RemovePrinter()));
connect(m_updateUi, &QTimer::timeout, ui, static_cast<void(ConfigureDialog::*)()>(&ConfigureDialog::update));
connect(ui, &ConfigureDialog::finished, this, &ConfigurePrinterInterface::RemovePrinter);
ui->show();
m_uis[printer.name()] = ui;
} else {
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -54,14 +54,11 @@ ModifyPrinter::ModifyPrinter(const QString &destName, bool isClass, QWidget *par
ui->membersLV->setPrinter(destName);
}
connect(ui->descriptionLE, SIGNAL(textChanged(QString)),
this, SLOT(textChanged(QString)));
connect(ui->locationLE, SIGNAL(textChanged(QString)),
this, SLOT(textChanged(QString)));
connect(ui->connectionLE, SIGNAL(textChanged(QString)),
this, SLOT(textChanged(QString)));
connect(ui->membersLV, SIGNAL(changed(bool)),
this, SLOT(modelChanged()));
connect(ui->descriptionLE, &QLineEdit::textChanged, this, &ModifyPrinter::textChanged);
connect(ui->locationLE, &QLineEdit::textChanged, this, &ModifyPrinter::textChanged);
connect(ui->connectionLE, &QLineEdit::textChanged, this, &ModifyPrinter::textChanged);
connect(ui->membersLV, static_cast<void(ClassListWidget::*)(bool)>(&ClassListWidget::changed),
this, &ModifyPrinter::modelChanged);
}
ModifyPrinter::~ModifyPrinter()
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -34,20 +34,18 @@ PrinterBehavior::PrinterBehavior(const QString &destName, bool isClass, QWidget
{
ui->setupUi(this);
connect(ui->errorPolicyCB, SIGNAL(currentIndexChanged(int)),
this, SLOT(currentIndexChangedCB(int)));
connect(ui->operationPolicyCB, SIGNAL(currentIndexChanged(int)),
this, SLOT(currentIndexChangedCB(int)));
connect(ui->errorPolicyCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &PrinterBehavior::currentIndexChangedCB);
connect(ui->operationPolicyCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &PrinterBehavior::currentIndexChangedCB);
connect(ui->startingBannerCB, SIGNAL(currentIndexChanged(int)),
this, SLOT(currentIndexChangedCB(int)));
connect(ui->endingBannerCB, SIGNAL(currentIndexChanged(int)),
this, SLOT(currentIndexChangedCB(int)));
connect(ui->startingBannerCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &PrinterBehavior::currentIndexChangedCB);
connect(ui->endingBannerCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &PrinterBehavior::currentIndexChangedCB);
connect(ui->usersELB, SIGNAL(changed()),
this, SLOT(userListChanged()));
connect(ui->allowRB, SIGNAL(toggled(bool)),
this, SLOT(userListChanged()));
connect(ui->usersELB, &KEditListWidget::changed, this, &PrinterBehavior::userListChanged);
connect(ui->allowRB, &QRadioButton::toggled, this, &PrinterBehavior::userListChanged);
}
PrinterBehavior::~PrinterBehavior()
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -266,8 +266,7 @@ QWidget* PrinterOptions::pickBoolean(ppd_option_t *option, const QString &keywor
// store the default choice
radioGroup->setProperty(DEFAULT_CHOICE, defChoice);
radioGroup->setProperty("Keyword", keyword);
connect(radioGroup, SIGNAL(buttonClicked(QAbstractButton*)),
this, SLOT(radioBtClicked(QAbstractButton*)));
connect(radioGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), this, &PrinterOptions::radioBtClicked);
return widget;
}
......@@ -352,8 +351,7 @@ QWidget* PrinterOptions::pickOne(ppd_option_t *option, const QString &keyword, Q
comboBox->setProperty("Keyword", keyword);
comboBox->setCurrentIndex(comboBox->findData(defChoice));
// connect the signal AFTER setCurrentIndex is called
connect(comboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(currentIndexChangedCB(int)));
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &PrinterOptions::currentIndexChangedCB);
// if we are in looking at a remote printer we can't save it
comboBox->setEnabled(!m_isRemote);
return qobject_cast<QWidget*>(comboBox);
......
/***************************************************************************
* Copyright (C) 2010-2012 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -90,49 +90,27 @@ JobModel::JobModel(QObject *parent) :
setRoleNames(roles);
// This is emitted when a job change it's state
connect(KCupsConnection::global(),
SIGNAL(jobState(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
this,
SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
connect(KCupsConnection::global(), &KCupsConnection::jobState, this, &JobModel::insertUpdateJob);
// This is emitted when a job is created
connect(KCupsConnection::global(),
SIGNAL(jobCreated(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
this,
SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
connect(KCupsConnection::global(), &KCupsConnection::jobCreated, this, &JobModel::insertUpdateJob);
// This is emitted when a job is stopped
connect(KCupsConnection::global(),
SIGNAL(jobStopped(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
this,
SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
connect(KCupsConnection::global(), &KCupsConnection::jobStopped, this, &JobModel::insertUpdateJob);
// This is emitted when a job has it's config changed
connect(KCupsConnection::global(),
SIGNAL(jobConfigChanged(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
this,
SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
connect(KCupsConnection::global(), &KCupsConnection::jobConfigChanged, this, &JobModel::insertUpdateJob);
// This is emitted when a job change it's progress
connect(KCupsConnection::global(),
SIGNAL(jobProgress(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
this,
SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
connect(KCupsConnection::global(), &KCupsConnection::jobProgress, this, &JobModel::insertUpdateJob);
// This is emitted when a printer is removed
connect(KCupsConnection::global(),
SIGNAL(jobCompleted(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
this,
SLOT(jobCompleted(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
connect(KCupsConnection::global(), SIGNAL(serverAudit(QString)),
SLOT(getJobs()));
connect(KCupsConnection::global(), SIGNAL(serverStarted(QString)),
SLOT(getJobs()));
connect(KCupsConnection::global(), SIGNAL(serverStopped(QString)),
SLOT(getJobs()));
connect(KCupsConnection::global(), SIGNAL(serverRestarted(QString)),
SLOT(getJobs()));
connect(KCupsConnection::global(), &KCupsConnection::jobCompleted, this, &JobModel::jobCompleted);
connect(KCupsConnection::global(), &KCupsConnection::serverAudit, this, &JobModel::getJobs);
connect(KCupsConnection::global(), &KCupsConnection::serverStarted, this, &JobModel::getJobs);
connect(KCupsConnection::global(), &KCupsConnection::serverStopped, this, &JobModel::getJobs);
connect(KCupsConnection::global(), &KCupsConnection::serverRestarted, this, &JobModel::getJobs);
}
void JobModel::setParentWId(WId parentId)
......@@ -195,7 +173,7 @@ void JobModel::getJobs()
}
m_jobRequest = new KCupsRequest;
connect(m_jobRequest, SIGNAL(finished()), this, SLOT(getJobFinished()));
connect(m_jobRequest, &KCupsRequest::finished, this, &JobModel::getJobFinished);
m_jobRequest->getJobs(m_destName, false, m_whichjobs, m_jobAttributes);
......
/***************************************************************************
* Copyright (C) 2010-2012 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* Copyright (C) 2012 Harald Sitter <sitter@kde.org> *
* *
......@@ -268,14 +268,16 @@ void KCupsConnection::init()
m_renewTimer = new QTimer;
m_renewTimer->setInterval(RENEW_INTERVAL*1000);
m_renewTimer->moveToThread(this);
connect(m_renewTimer, SIGNAL(timeout()), this, SLOT(renewDBusSubscription()), Qt::DirectConnection);
connect(m_renewTimer, &QTimer::timeout,
this, static_cast<void(KCupsConnection::*)()>(&KCupsConnection::renewDBusSubscription), Qt::DirectConnection);
// Creates the timer to merge updates on the DBus subscription
m_subscriptionTimer = new QTimer;
m_subscriptionTimer->setInterval(0);
m_subscriptionTimer->setSingleShot(true);
m_subscriptionTimer->moveToThread(this);
connect(m_subscriptionTimer, SIGNAL(timeout()), this, SLOT(updateSubscription()), Qt::DirectConnection);
connect(m_subscriptionTimer, &QTimer::timeout, this, &KCupsConnection::updateSubscription, Qt::DirectConnection);
// Starts this thread
start();
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -77,51 +77,35 @@ PrinterModel::PrinterModel(QObject *parent) :
setRoleNames(roles);
// This is emitted when a printer is added
connect(KCupsConnection::global(), SIGNAL(printerAdded(QString,QString,QString,uint,QString,bool)), this,
SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
connect(KCupsConnection::global(), &KCupsConnection::printerAdded, this, &PrinterModel::insertUpdatePrinter);
// This is emitted when a printer is modified
connect(KCupsConnection::global(), SIGNAL(printerModified(QString,QString,QString,uint,QString,bool)), this,
SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
connect(KCupsConnection::global(), &KCupsConnection::printerModified, this, &PrinterModel::insertUpdatePrinter);
// This is emitted when a printer has it's state changed
connect(KCupsConnection::global(), SIGNAL(printerStateChanged(QString,QString,QString,uint,QString,bool)), this,
SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
connect(KCupsConnection::global(), &KCupsConnection::printerStateChanged, this, &PrinterModel::insertUpdatePrinter);
// This is emitted when a printer is stopped
connect(KCupsConnection::global(), SIGNAL(printerStopped(QString,QString,QString,uint,QString,bool)), this,
SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
connect(KCupsConnection::global(), &KCupsConnection::printerStopped, this, &PrinterModel::insertUpdatePrinter);
// This is emitted when a printer is restarted
connect(KCupsConnection::global(), SIGNAL(printerRestarted(QString,QString,QString,uint,QString,bool)), this,
SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
connect(KCupsConnection::global(), &KCupsConnection::printerRestarted, this, &PrinterModel::insertUpdatePrinter);
// This is emitted when a printer is shutdown
connect(KCupsConnection::global(), SIGNAL(printerShutdown(QString,QString,QString,uint,QString,bool)), this,
SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
connect(KCupsConnection::global(), &KCupsConnection::printerShutdown, this, &PrinterModel::insertUpdatePrinter);
// This is emitted when a printer is removed
connect(KCupsConnection::global(), SIGNAL(printerDeleted(QString,QString,QString,uint,QString,bool)), this,
SLOT(printerRemoved(QString,QString,QString,uint,QString,bool)));
connect(KCupsConnection::global(), SIGNAL(serverAudit(QString)),
SLOT(serverChanged(QString)));
connect(KCupsConnection::global(), SIGNAL(serverStarted(QString)),
SLOT(serverChanged(QString)));
connect(KCupsConnection::global(), SIGNAL(serverStopped(QString)),
SLOT(serverChanged(QString)));
connect(KCupsConnection::global(), SIGNAL(serverRestarted(QString)),
SLOT(serverChanged(QString)));
connect(KCupsConnection::global(), &KCupsConnection::printerDeleted, this, &PrinterModel::printerRemoved);
// Deprecated stuff that works better than the above
connect(KCupsConnection::global(), SIGNAL(rhPrinterAdded(QString)),
this, SLOT(insertUpdatePrinter(QString)));
connect(KCupsConnection::global(), SIGNAL(rhPrinterRemoved(QString)),
this, SLOT(printerRemoved(QString)));
connect(KCupsConnection::global(), &KCupsConnection::serverAudit, this, &PrinterModel::serverChanged);
connect(KCupsConnection::global(), &KCupsConnection::serverStarted, this, &PrinterModel::serverChanged);
connect(KCupsConnection::global(), &KCupsConnection::serverStopped, this, &PrinterModel::serverChanged);
connect(KCupsConnection::global(), &KCupsConnection::serverRestarted, this, &PrinterModel::serverChanged);
connect(KCupsConnection::global(), SIGNAL(rhQueueChanged(QString)),
this, SLOT(insertUpdatePrinter(QString)));
// Deprecated stuff that works better than the above
connect(KCupsConnection::global(), &KCupsConnection::rhPrinterAdded, this, &PrinterModel::insertUpdatePrinterName);
connect(KCupsConnection::global(), &KCupsConnection::rhPrinterRemoved, this, &PrinterModel::printerRemovedName);
connect(KCupsConnection::global(), &KCupsConnection::rhQueueChanged, this, &PrinterModel::insertUpdatePrinterName);
connect(this, &PrinterModel::rowsInserted, this, &PrinterModel::slotCountChanged);
connect(this, &PrinterModel::rowsRemoved, this, &PrinterModel::slotCountChanged);
......@@ -425,7 +409,7 @@ Qt::ItemFlags PrinterModel::flags(const QModelIndex &index) const
}
void PrinterModel::insertUpdatePrinter(const QString &printerName)
void PrinterModel::insertUpdatePrinterName(const QString &printerName)
{
KCupsRequest *request = new KCupsRequest;
connect(request, &KCupsRequest::finished, this, &PrinterModel::insertUpdatePrinterFinished);
......@@ -448,7 +432,7 @@ void PrinterModel::insertUpdatePrinter(const QString &text,
Q_UNUSED(printerIsAcceptingJobs)
qCDebug(LIBKCUPS) << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
insertUpdatePrinter(printerName);
insertUpdatePrinterName(printerName);
}
void PrinterModel::insertUpdatePrinterFinished()
......@@ -471,7 +455,7 @@ void PrinterModel::insertUpdatePrinterFinished()
request->deleteLater();
}
void PrinterModel::printerRemoved(const QString &printerName)
void PrinterModel::printerRemovedName(const QString &printerName)
{
qCDebug(LIBKCUPS) << printerName;
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -84,7 +84,7 @@ signals:
void error(int lastError, const QString &errorTitle, const QString &errorMsg);
private slots:
void insertUpdatePrinter(const QString &printerName);
void insertUpdatePrinterName(const QString &printerName);
void insertUpdatePrinter(const QString &text,
const QString &printerUri,
const QString &printerName,
......@@ -92,7 +92,7 @@ private slots:
const QString &printerStateReasons,
bool printerIsAcceptingJobs);
void insertUpdatePrinterFinished();
void printerRemoved(const QString &printerName);
void printerRemovedName(const QString &printerName);
void printerRemoved(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
void printerStateChanged(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
void printerStopped(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -73,20 +73,19 @@ SelectMakeModel::SelectMakeModel(QWidget *parent) :
ui->makeView->setModel(m_sourceModel);
ui->makeView->setItemDelegate(new NoSelectionRectDelegate(this));
// Updates the PPD view to the selected Make
connect(ui->makeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
ui->ppdsLV, SLOT(setRootIndex(QModelIndex)));
connect(ui->makeView->selectionModel(), &QItemSelectionModel::currentChanged, ui->ppdsLV, &QListView::setRootIndex);
ui->ppdsLV->setModel(m_sourceModel);
ui->ppdsLV->setItemDelegate(new NoSelectionRectDelegate(this));
connect(m_sourceModel, &PPDModel::dataChanged, this, &SelectMakeModel::checkChanged);
// Clear the PPD view selection, so the Next/Finish button gets disabled
connect(ui->makeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
ui->ppdsLV->selectionModel(), SLOT(clearSelection()));
connect(ui->makeView->selectionModel(), &QItemSelectionModel::currentChanged,
ui->ppdsLV->selectionModel(), &QItemSelectionModel::clearSelection);
// Make sure we update the Next/Finish button if a PPD is selected
connect(ui->ppdsLV->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(checkChanged()));
connect(ui->ppdsLV->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &SelectMakeModel::checkChanged);
// When the radio button changes the signal must be emitted
connect(ui->ppdFileRB, &QRadioButton::toggled, this, &SelectMakeModel::checkChanged);
......
/***************************************************************************
* Copyright (C) 2010-2012 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -51,7 +51,7 @@ NewPrinterNotification::NewPrinterNotification()
// Make all our init code run on the thread since
// the DBus calls were made blocking
QTimer::singleShot(0, this, SLOT(init()));
QTimer::singleShot(0, this, &NewPrinterNotification::init);
m_thread = new QThread(this);
moveToThread(m_thread);
......@@ -117,7 +117,7 @@ void NewPrinterNotification::NewPrinter(int status,
}
actions << i18n("Search");
connect(notify, SIGNAL(action1Activated()), this, SLOT(setupPrinter()));
connect(notify, &KNotification::action1Activated, this, &NewPrinterNotification::setupPrinter);
} else {
// name is the name of the queue which hal_lpadmin has set up
// automatically.
......@@ -166,9 +166,9 @@ void NewPrinterNotification::NewPrinter(int status,
} else if (status == STATUS_SUCCESS) {
text = i18n("'%1' is ready for printing.", name);
actions << i18n("Print test page");
connect(notify, SIGNAL(action1Activated()), this, SLOT(printTestPage()));
connect(notify, &KNotification::action1Activated, this, &NewPrinterNotification::printTestPage);
actions << i18n("Configure");
connect(notify, SIGNAL(action2Activated()), this, SLOT(configurePrinter()));
connect(notify, &KNotification::action2Activated, this, &NewPrinterNotification::configurePrinter);
} else {
// Model mismatch
......@@ -176,13 +176,13 @@ void NewPrinterNotification::NewPrinter(int status,
if (driver.isEmpty()) {
text = i18n("'%1' has been added, please check its driver.", name);
actions << i18n("Configure");
connect(notify, SIGNAL(action1Activated()), this, SLOT(configurePrinter()));
connect(notify, &KNotification::action1Activated, this, &NewPrinterNotification::configurePrinter);
} else {
text = i18n("'%1' has been added, using the '%2' driver.", name, driver);
actions << i18n("Print test page");
connect(notify, SIGNAL(action1Activated()), this, SLOT(printTestPage()));
connect(notify, &KNotification::action1Activated, this, &NewPrinterNotification::printTestPage);
actions << i18n("Find driver");
connect(notify, SIGNAL(action2Activated()), this, SLOT(findDriver()));
connect(notify, &KNotification::action2Activated, this, &NewPrinterNotification::findDriver);
}
}
}
......@@ -208,7 +208,7 @@ void NewPrinterNotification::init()
QDBusConnection::systemBus(),
QDBusServiceWatcher::WatchForUnregistration,
this);
connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(registerService()));
connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &NewPrinterNotification::registerService);
}
}
......
/***************************************************************************
* Copyright (C) 2010-2012 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -34,7 +34,7 @@ PrintManagerKded::PrintManagerKded(QObject *parent, const QVariantList &args) :
{
Q_UNUSED(args)
QTimer::singleShot(0, this, SLOT(loadThread()));
QTimer::singleShot(0, this, &PrintManagerKded::loadThread);
}
PrintManagerKded::~PrintManagerKded()
......
/***************************************************************************
* Copyright (C) 2010 by Daniel Nicoletti *
* Copyright (C) 2010-2018 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -65,7 +65,7 @@ PrintKCM::PrintKCM(QWidget *parent, const QVariantList &args) :
ui->setupUi(this);
connect(ui->printerDesc, SIGNAL(updateNeeded()), SLOT(update()));
connect(ui->printerDesc, &PrinterDescription::updateNeeded, this, &PrintKCM::update);
// The printer list needs to increase in width according to the icon sizes
// default dialog icon size is 32, this times 6 is 192 which is roughly the original width
......@@ -73,7 +73,7 @@ PrintKCM::PrintKCM(QWidget *parent, const QVariantList &args) :
QMenu *addMenu = new QMenu(this);
addMenu->addAction(i18nc("@action:intoolbar","Add a Printer Class"),
this, SLOT(addClass()));
this, &PrintKCM::addClass);
ui->addTB->setIcon(QIcon::fromTheme("list-add"));
ui->addTB->setToolTip(i18n("Add a new printer or a printer class"));
ui->addTB->setMenu(addMenu);
......@@ -82,8 +82,8 @@ PrintKCM::PrintKCM(QWidget *parent, const QVariantList &args) :
ui->removeTB->setToolTip(i18n("Remove Printer"));
QMenu *systemMenu = new QMenu(this);
connect(systemMenu, SIGNAL(aboutToShow()), this, SLOT(getServerSettings()));
connect(systemMenu, SIGNAL(triggered(QAction*)), this, SLOT(systemPreferencesTriggered()));
connect(systemMenu, &QMenu::aboutToShow, this, &PrintKCM::getServerSettings);
connect(systemMenu, &QMenu