Commit 71c1c87b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some clazy warning

parent 3d0b7dfd
......@@ -53,7 +53,7 @@ bool CollectionFilterModel::filterAcceptsRow(int row, const QModelIndex &parent)
if (!mContentMimeTypes.isEmpty()) {
QSet<QString> contentMimeTypes = collection.contentMimeTypes().toSet();
accepted = accepted && !(contentMimeTypes.intersect(mContentMimeTypes).isEmpty());
accepted = accepted && contentMimeTypes.intersects(mContentMimeTypes);
}
if (mRights != Akonadi::Collection::ReadOnly) {
......
......@@ -90,8 +90,7 @@ QVariant ContactCompletionModel::entityData(const Item &item, int column, int ro
}
break;
case NameAndEmailColumn: {
QString name = QStringLiteral("%1 %2").arg(contact.givenName())
.arg(contact.familyName()).simplified();
QString name = QStringLiteral("%1 %2").arg(contact.givenName(), contact.familyName()).simplified();
if (name.isEmpty()) {
name = contact.organization().simplified();
}
......
......@@ -52,6 +52,7 @@ QString AddressesLocationGrantleeFormater::formatAddresses(const KContacts::Addr
const int nbAddress(addresses.count());
addressList.reserve(nbAddress);
QList<AddressGrantleeObject *> lstAddress;
lstAddress.reserve(nbAddress);
for (int i = 0; i < nbAddress; ++i) {
AddressGrantleeObject *addressObj = new AddressGrantleeObject(addresses.at(i), i);
addressList << QVariant::fromValue(static_cast<QObject *>(addressObj));
......
......@@ -34,6 +34,7 @@ namespace Akonadi
{
class AddressTypeDialog : public QDialog
{
Q_OBJECT
public:
AddressTypeDialog(KContacts::Address::Type type, QWidget *parent);
~AddressTypeDialog();
......
......@@ -28,6 +28,7 @@
class CustomFieldsModel : public QAbstractItemModel
{
Q_OBJECT
public:
enum Role {
TypeRole = Qt::UserRole,
......
......@@ -52,6 +52,7 @@ static DisplayNameEditWidget::DisplayType guessedDisplayType(const KContacts::Ad
class DisplayNameDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
DisplayNameDelegate(QAbstractItemView *view, QObject *parent = Q_NULLPTR)
: QStyledItemDelegate(parent)
......@@ -253,3 +254,5 @@ void DisplayNameEditWidget::setComboBoxEditable(bool value)
{
mView->setEditable(value);
}
#include "displaynameeditwidget.moc"
......@@ -32,6 +32,7 @@ class KComboBox;
class DisplayNameEditWidget;
class NameEditDialog : public QDialog
{
Q_OBJECT
public:
explicit NameEditDialog(QWidget *parent = Q_NULLPTR);
......
......@@ -32,6 +32,7 @@ namespace Akonadi
*/
class PhoneTypeDialog : public QDialog
{
Q_OBJECT
public:
/**
* Creates a new phone type dialog.
......
......@@ -52,6 +52,7 @@ using namespace Akonadi;
*/
class SearchLineEdit : public QLineEdit
{
Q_OBJECT
public:
SearchLineEdit(QWidget *receiver, QWidget *parent = Q_NULLPTR)
: QLineEdit(parent)
......@@ -232,3 +233,5 @@ QTreeView *EmailAddressSelectionWidget::view() const
{
return d->mView;
}
#include "emailaddressselectionwidget.moc"
......@@ -33,13 +33,14 @@ class KJob;
*/
class WaitingOverlay : public QWidget
{
Q_OBJECT
public:
/**
* Create an overlay widget on @p baseWidget for @p job.
* @param baseWidget must not be null.
* @param parent must not be equal to baseWidget
*/
explicit WaitingOverlay(KJob *job, QWidget *baseWidget, QWidget *parent = 0);
explicit WaitingOverlay(KJob *job, QWidget *baseWidget, QWidget *parent = Q_NULLPTR);
~WaitingOverlay();
protected:
......
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