Commit 4546b9e5 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_EMIT

parent 06eb2d55
......@@ -149,17 +149,17 @@ void ContactEditor::Private::parentCollectionFetchDone(KJob *job)
void ContactEditor::Private::storeDone(KJob *job)
{
if (job->error() != KJob::NoError) {
emit mParent->error(job->errorString());
emit mParent->finished();
Q_EMIT mParent->error(job->errorString());
Q_EMIT mParent->finished();
return;
}
if (mMode == EditMode) {
emit mParent->contactStored(mItem);
Q_EMIT mParent->contactStored(mItem);
} else if (mMode == CreateMode) {
emit mParent->contactStored(static_cast<Akonadi::ItemCreateJob *>(job)->item());
Q_EMIT mParent->contactStored(static_cast<Akonadi::ItemCreateJob *>(job)->item());
}
emit mParent->finished();
Q_EMIT mParent->finished();
}
void ContactEditor::Private::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &)
......@@ -252,7 +252,7 @@ void ContactEditor::saveContactInAddressBook()
{
if (d->mMode == EditMode) {
if (!d->mItem.isValid() || d->mReadOnly) {
emit finished();
Q_EMIT finished();
return;
}
......
......@@ -156,7 +156,7 @@ public Q_SLOTS:
/**
* Save the contact from the editor back to the storage. And return error.
* Need to connect to finished() signal, to keep time to emit signal.
* Need to connect to finished() signal, to keep time to Q_EMIT signal.
* @since 4.11
*/
void saveContactInAddressBook();
......
......@@ -128,14 +128,14 @@ void ContactGroupEditor::Private::parentCollectionFetchDone(KJob *job)
void ContactGroupEditor::Private::storeDone(KJob *job)
{
if (job->error()) {
emit mParent->error(job->errorString());
Q_EMIT mParent->error(job->errorString());
return;
}
if (mMode == EditMode) {
emit mParent->contactGroupStored(mItem);
Q_EMIT mParent->contactGroupStored(mItem);
} else if (mMode == CreateMode) {
emit mParent->contactGroupStored(static_cast<ItemCreateJob *>(job)->item());
Q_EMIT mParent->contactGroupStored(static_cast<ItemCreateJob *>(job)->item());
}
}
......
......@@ -102,7 +102,7 @@ void ContactLineEdit::completed(const QModelIndex &index)
mIsReference = false;
}
emit completed(this);
Q_EMIT completed(this);
}
void ContactLineEdit::slotTextEdited()
......@@ -299,8 +299,8 @@ bool ContactGroupEditorDelegate::editorEvent(QEvent *event, QAbstractItemModel *
void ContactGroupEditorDelegate::completed(QWidget *widget)
{
emit commitData(widget);
emit closeEditor(widget);
Q_EMIT commitData(widget);
Q_EMIT closeEditor(widget);
}
void ContactGroupEditorDelegate::setFirstColumnAsCurrent()
......
......@@ -75,7 +75,7 @@ public:
if (job->error()) {
mMembers[row].loadingError = true;
emit mParent->dataChanged(mParent->index(row, 0, QModelIndex()), mParent->index(row, 1, QModelIndex()));
Q_EMIT mParent->dataChanged(mParent->index(row, 0, QModelIndex()), mParent->index(row, 1, QModelIndex()));
return;
}
......@@ -83,7 +83,7 @@ public:
if (fetchJob->items().count() != 1) {
mMembers[row].loadingError = true;
emit mParent->dataChanged(mParent->index(row, 0, QModelIndex()), mParent->index(row, 1, QModelIndex()));
Q_EMIT mParent->dataChanged(mParent->index(row, 0, QModelIndex()), mParent->index(row, 1, QModelIndex()));
return;
}
......@@ -92,7 +92,7 @@ public:
GroupMember &member = mMembers[row];
member.referencedContact = contact;
emit mParent->dataChanged(mParent->index(row, 0, QModelIndex()), mParent->index(row, 1, QModelIndex()));
Q_EMIT mParent->dataChanged(mParent->index(row, 0, QModelIndex()), mParent->index(row, 1, QModelIndex()));
}
void normalizeMemberList()
......@@ -169,7 +169,7 @@ ContactGroupModel::~ContactGroupModel()
void ContactGroupModel::loadContactGroup(const KContacts::ContactGroup &contactGroup)
{
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
d->mMembers.clear();
d->mGroup = contactGroup;
......@@ -196,7 +196,7 @@ void ContactGroupModel::loadContactGroup(const KContacts::ContactGroup &contactG
d->normalizeMemberList();
emit layoutChanged();
Q_EMIT layoutChanged();
}
bool ContactGroupModel::storeContactGroup(KContacts::ContactGroup &group) const
......
......@@ -100,7 +100,7 @@ public:
// remove the 'mailto:' and split into name and email address
KContacts::Addressee::parseEmailAddress(email.path(), name, address);
emit mParent->emailClicked(name, address);
Q_EMIT mParent->emailClicked(name, address);
}
void _k_expandResult(KJob *job)
......
......@@ -60,9 +60,9 @@ ContactsTreeModel::~ContactsTreeModel()
void ContactsTreeModel::setColumns(const Columns &columns)
{
emit beginResetModel();
Q_EMIT beginResetModel();
d->mColumns = columns;
emit endResetModel();
Q_EMIT endResetModel();
}
ContactsTreeModel::Columns ContactsTreeModel::columns() const
......
......@@ -200,7 +200,7 @@ public:
// remove the 'mailto:' and split into name and email address
KContacts::Addressee::parseEmailAddress(email.mid(7), name, address);
emit mParent->emailClicked(name, address);
Q_EMIT mParent->emailClicked(name, address);
}
void slotUrlClicked(const QUrl &url)
......@@ -208,27 +208,27 @@ public:
const QString urlScheme(url.scheme());
if (urlScheme == QLatin1String("http") ||
urlScheme == QLatin1String("https")) {
emit mParent->urlClicked(url);
Q_EMIT mParent->urlClicked(url);
} else if (urlScheme == QLatin1String("phone")) {
const int pos = url.queryItemValue(QStringLiteral("index")).toInt();
const KContacts::PhoneNumber::List numbers = mCurrentContact.phoneNumbers();
if (pos < numbers.count()) {
emit mParent->phoneNumberClicked(numbers.at(pos));
Q_EMIT mParent->phoneNumberClicked(numbers.at(pos));
}
} else if (urlScheme == QLatin1String("sms")) {
const int pos = url.queryItemValue(QStringLiteral("index")).toInt();
const KContacts::PhoneNumber::List numbers = mCurrentContact.phoneNumbers();
if (pos < numbers.count()) {
emit mParent->smsClicked(numbers.at(pos));
Q_EMIT mParent->smsClicked(numbers.at(pos));
}
} else if (urlScheme == QLatin1String("address")) {
const int pos = url.queryItemValue(QStringLiteral("index")).toInt();
const KContacts::Address::List addresses = mCurrentContact.addresses();
if (pos < addresses.count()) {
emit mParent->addressClicked(addresses.at(pos));
Q_EMIT mParent->addressClicked(addresses.at(pos));
}
} else if (urlScheme == QLatin1String("mailto")) {
QString name, address;
......@@ -236,7 +236,7 @@ public:
// remove the 'mailto:' and split into name and email address
KContacts::Addressee::parseEmailAddress(url.path(), name, address);
emit mParent->emailClicked(name, address);
Q_EMIT mParent->emailClicked(name, address);
}
}
......
......@@ -39,11 +39,11 @@ CustomFieldsModel::~CustomFieldsModel()
void CustomFieldsModel::setCustomFields(const CustomField::List &customFields)
{
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
mCustomFields = customFields;
emit layoutChanged();
Q_EMIT layoutChanged();
}
CustomField::List CustomFieldsModel::customFields() const
......@@ -168,7 +168,7 @@ bool CustomFieldsModel::setData(const QModelIndex &index, const QVariant &value,
customField.setKey(value.toString());
}
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
return true;
}
......@@ -177,7 +177,7 @@ bool CustomFieldsModel::setData(const QModelIndex &index, const QVariant &value,
if (customField.type() == CustomField::BooleanType) {
customField.setValue(static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked ?
QStringLiteral("true") : QStringLiteral("false"));
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
return true;
}
}
......@@ -185,13 +185,13 @@ bool CustomFieldsModel::setData(const QModelIndex &index, const QVariant &value,
if (role == TypeRole) {
customField.setType((CustomField::Type)value.toInt());
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
return true;
}
if (role == ScopeRole) {
customField.setScope((CustomField::Scope)value.toInt());
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
return true;
}
......
......@@ -55,7 +55,7 @@ void DateView::contextMenuEvent(QContextMenuEvent *event)
void DateView::emitSignal()
{
emit resetDate();
Q_EMIT resetDate();
}
DateEditWidget::DateEditWidget(Type type, QWidget *parent)
......
......@@ -125,34 +125,34 @@ void KDatePickerPopup::setItems(int items)
void KDatePickerPopup::slotDateChanged(const QDate &date)
{
if (date != mDate) {
emit dateChanged(date);
Q_EMIT dateChanged(date);
}
hide();
}
void KDatePickerPopup::slotToday()
{
emit dateChanged(QDate::currentDate());
Q_EMIT dateChanged(QDate::currentDate());
}
void KDatePickerPopup::slotTomorrow()
{
emit dateChanged(QDate::currentDate().addDays(1));
Q_EMIT dateChanged(QDate::currentDate().addDays(1));
}
void KDatePickerPopup::slotNoDate()
{
emit dateChanged(QDate());
Q_EMIT dateChanged(QDate());
}
void KDatePickerPopup::slotNextWeek()
{
emit dateChanged(QDate::currentDate().addDays(7));
Q_EMIT dateChanged(QDate::currentDate().addDays(7));
}
void KDatePickerPopup::slotNextMonth()
{
emit dateChanged(QDate::currentDate().addMonths(1));
Q_EMIT dateChanged(QDate::currentDate().addMonths(1));
}
#include "moc_kdatepickerpopup_p.cpp"
......@@ -86,7 +86,7 @@ void KCMAkonadiContactActions::slotShowAddressActionChanged(int value)
} else {
ui.stackedWidget->setCurrentIndex(2);
}
emit changed(true);
Q_EMIT changed(true);
}
void KCMAkonadiContactActions::slotSmsPhoneNumberActionChanged(int value)
......@@ -97,7 +97,7 @@ void KCMAkonadiContactActions::slotSmsPhoneNumberActionChanged(int value)
} else {
ui.stackedWidget_3->setCurrentIndex(0);
}
emit changed(true);
Q_EMIT changed(true);
}
void KCMAkonadiContactActions::slotDialPhoneNumberActionChanged(int value)
......@@ -108,7 +108,7 @@ void KCMAkonadiContactActions::slotDialPhoneNumberActionChanged(int value)
} else {
ui.stackedWidget_2->setCurrentIndex(0);
}
emit changed(true);
Q_EMIT changed(true);
}
void KCMAkonadiContactActions::load()
......
......@@ -425,7 +425,7 @@ public:
mActions.value(StandardContactActionManager::EditItem)->setEnabled(canEditItem);
}
emit mParent->actionStateUpdated();
Q_EMIT mParent->actionStateUpdated();
}
Collection selectedCollection() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment