From 599d60270d726986618d5375a458837d800139f8 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 28 Apr 2012 21:42:23 +0200 Subject: [PATCH] Coding style fixes. --- src/core/EntryAttachments.h | 10 +++++----- src/core/EntryAttributes.h | 14 +++++++------- src/gui/EditEntryWidget_p.h | 2 +- src/gui/EntryAttachmentsModel.cpp | 6 +++--- src/gui/EntryAttachmentsModel.h | 6 +++--- src/gui/EntryAttributesModel.cpp | 10 +++++----- src/gui/EntryAttributesModel.h | 10 +++++----- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/core/EntryAttachments.h b/src/core/EntryAttachments.h index 675f12c76..4d36f3b0e 100644 --- a/src/core/EntryAttachments.h +++ b/src/core/EntryAttachments.h @@ -38,11 +38,11 @@ public: Q_SIGNALS: void modified(); - void keyModified(QString key); - void aboutToBeAdded(QString key); - void added(QString key); - void aboutToBeRemoved(QString key); - void removed(QString key); + void keyModified(const QString& key); + void aboutToBeAdded(const QString& key); + void added(const QString& key); + void aboutToBeRemoved(const QString& key); + void removed(const QString& key); void aboutToBeReset(); void reset(); diff --git a/src/core/EntryAttributes.h b/src/core/EntryAttributes.h index b328d792e..83316811e 100644 --- a/src/core/EntryAttributes.h +++ b/src/core/EntryAttributes.h @@ -48,13 +48,13 @@ public: Q_SIGNALS: void modified(); void defaultKeyModified(); - void customKeyModified(QString key); - void aboutToBeAdded(QString key); - void added(QString key); - void aboutToBeRemoved(QString key); - void removed(QString key); - void aboutToRename(QString oldKey, QString newKey); - void renamed(QString oldKey, QString newKey); + void customKeyModified(const QString& key); + void aboutToBeAdded(const QString& key); + void added(const QString& key); + void aboutToBeRemoved(const QString& key); + void removed(const QString& key); + void aboutToRename(const QString& oldKey, const QString& newKey); + void renamed(const QString& oldKey, const QString& newKey); void aboutToBeReset(); void reset(); diff --git a/src/gui/EditEntryWidget_p.h b/src/gui/EditEntryWidget_p.h index 3b3cb6144..c5e97bd3a 100644 --- a/src/gui/EditEntryWidget_p.h +++ b/src/gui/EditEntryWidget_p.h @@ -28,7 +28,7 @@ class CategoryListViewDelegate : public QStyledItemDelegate public: explicit CategoryListViewDelegate(QObject *parent) : QStyledItemDelegate(parent) {} - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const + QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const { QSize size = QStyledItemDelegate::sizeHint(option, index); size.setHeight(qMax(size.height(), 22)); diff --git a/src/gui/EntryAttachmentsModel.cpp b/src/gui/EntryAttachmentsModel.cpp index dc98328ba..0e94fab26 100644 --- a/src/gui/EntryAttachmentsModel.cpp +++ b/src/gui/EntryAttachmentsModel.cpp @@ -100,13 +100,13 @@ QVariant EntryAttachmentsModel::data(const QModelIndex& index, int role) const return QVariant(); } -void EntryAttachmentsModel::attachmentChange(QString key) +void EntryAttachmentsModel::attachmentChange(const QString& key) { int row = m_entryAttachments->keys().indexOf(key); Q_EMIT dataChanged(index(row, 0), index(row, columnCount()-1)); } -void EntryAttachmentsModel::attachmentAboutToAdd(QString key) +void EntryAttachmentsModel::attachmentAboutToAdd(const QString& key) { QList rows = m_entryAttachments->keys(); rows.append(key); @@ -120,7 +120,7 @@ void EntryAttachmentsModel::attachmentAdd() endInsertRows(); } -void EntryAttachmentsModel::attachmentAboutToRemove(QString key) +void EntryAttachmentsModel::attachmentAboutToRemove(const QString& key) { int row = m_entryAttachments->keys().indexOf(key); beginRemoveRows(QModelIndex(), row, row); diff --git a/src/gui/EntryAttachmentsModel.h b/src/gui/EntryAttachmentsModel.h index cff00abf3..162030a2c 100644 --- a/src/gui/EntryAttachmentsModel.h +++ b/src/gui/EntryAttachmentsModel.h @@ -35,10 +35,10 @@ public: QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; private Q_SLOTS: - void attachmentChange(QString key); - void attachmentAboutToAdd(QString key); + void attachmentChange(const QString& key); + void attachmentAboutToAdd(const QString& key); void attachmentAdd(); - void attachmentAboutToRemove(QString key); + void attachmentAboutToRemove(const QString& key); void attachmentRemove(); void aboutToReset(); void reset(); diff --git a/src/gui/EntryAttributesModel.cpp b/src/gui/EntryAttributesModel.cpp index c38f8fa0e..fa7c9a357 100644 --- a/src/gui/EntryAttributesModel.cpp +++ b/src/gui/EntryAttributesModel.cpp @@ -141,14 +141,14 @@ QString EntryAttributesModel::keyByIndex(const QModelIndex& index) const } } -void EntryAttributesModel::attributeChange(QString key) +void EntryAttributesModel::attributeChange(const QString& key) { int row = m_attributes.indexOf(key); Q_ASSERT(row != -1); Q_EMIT dataChanged(index(row, 0), index(row, columnCount()-1)); } -void EntryAttributesModel::attributeAboutToAdd(QString key) +void EntryAttributesModel::attributeAboutToAdd(const QString& key) { QList rows = m_attributes; rows.append(key); @@ -163,7 +163,7 @@ void EntryAttributesModel::attributeAdd() endInsertRows(); } -void EntryAttributesModel::attributeAboutToRemove(QString key) +void EntryAttributesModel::attributeAboutToRemove(const QString& key) { int row = m_attributes.indexOf(key); beginRemoveRows(QModelIndex(), row, row); @@ -175,7 +175,7 @@ void EntryAttributesModel::attributeRemove() endRemoveRows(); } -void EntryAttributesModel::attributeAboutToRename(QString oldKey, QString newKey) +void EntryAttributesModel::attributeAboutToRename(const QString& oldKey, const QString& newKey) { int oldRow = m_attributes.indexOf(oldKey); @@ -198,7 +198,7 @@ void EntryAttributesModel::attributeAboutToRename(QString oldKey, QString newKey } } -void EntryAttributesModel::attributeRename(QString oldKey, QString newKey) +void EntryAttributesModel::attributeRename(const QString& oldKey, const QString& newKey) { Q_UNUSED(oldKey); diff --git a/src/gui/EntryAttributesModel.h b/src/gui/EntryAttributesModel.h index 0084644fe..c8a89a3f6 100644 --- a/src/gui/EntryAttributesModel.h +++ b/src/gui/EntryAttributesModel.h @@ -39,13 +39,13 @@ public: QString keyByIndex(const QModelIndex& index) const; private Q_SLOTS: - void attributeChange(QString key); - void attributeAboutToAdd(QString key); + void attributeChange(const QString& key); + void attributeAboutToAdd(const QString& key); void attributeAdd(); - void attributeAboutToRemove(QString key); + void attributeAboutToRemove(const QString& key); void attributeRemove(); - void attributeAboutToRename(QString oldKey, QString newKey); - void attributeRename(QString oldKey, QString newKey); + void attributeAboutToRename(const QString& oldKey, const QString& newKey); + void attributeRename(const QString& oldKey, const QString& newKey); void aboutToReset(); void reset();