summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2017-06-28 08:33:24 -0400
committerKurt Hindenburg <[email protected]>2017-06-28 08:33:24 -0400
commitc6cb707fff48ef9657e519211f9ac549b6f7633c (patch)
treebbc213c18ab87f3cda1d13a7f22cad3a04936fb9
parent0d8aeaa4df425658a5a49d3c54d4112234f6777d (diff)
uncrustify using kf5 config
-rw-r--r--src/PrintOptions.cpp2
-rw-r--r--src/SessionListModel.cpp40
2 files changed, 22 insertions, 20 deletions
diff --git a/src/PrintOptions.cpp b/src/PrintOptions.cpp
index 01b35a0..5c3afb9 100644
--- a/src/PrintOptions.cpp
+++ b/src/PrintOptions.cpp
@@ -27,7 +27,7 @@
using namespace Konsole;
-PrintOptions::PrintOptions(QWidget* aParent) : QWidget(aParent)
+PrintOptions::PrintOptions(QWidget *aParent) : QWidget(aParent)
{
setupUi(this);
diff --git a/src/SessionListModel.cpp b/src/SessionListModel.cpp
index 15f5015..2bd2d9c 100644
--- a/src/SessionListModel.cpp
+++ b/src/SessionListModel.cpp
@@ -33,24 +33,25 @@
using Konsole::Session;
using Konsole::SessionListModel;
-SessionListModel::SessionListModel(QObject* parent)
- : QAbstractListModel(parent)
+SessionListModel::SessionListModel(QObject *parent) :
+ QAbstractListModel(parent)
{
}
-void SessionListModel::setSessions(const QList<Session*>& sessions)
+void SessionListModel::setSessions(const QList<Session *> &sessions)
{
beginResetModel();
_sessions = sessions;
- foreach(Session * session, sessions) {
- connect(session, &Konsole::Session::finished, this, &Konsole::SessionListModel::sessionFinished);
+ foreach (Session *session, sessions) {
+ connect(session, &Konsole::Session::finished, this,
+ &Konsole::SessionListModel::sessionFinished);
}
endResetModel();
}
-QVariant SessionListModel::data(const QModelIndex& index, int role) const
+QVariant SessionListModel::data(const QModelIndex &index, int role) const
{
Q_ASSERT(index.isValid());
@@ -78,20 +79,21 @@ QVariant SessionListModel::data(const QModelIndex& index, int role) const
}
break;
case Qt::DecorationRole:
- if (column == 1)
+ if (column == 1) {
return QIcon::fromTheme(_sessions[row]->iconName());
- else
+ } else {
return QVariant();
+ }
}
return QVariant();
}
-QVariant SessionListModel::headerData(int section, Qt::Orientation orientation,
- int role) const
+QVariant SessionListModel::headerData(int section, Qt::Orientation orientation, int role) const
{
- if (role != Qt::DisplayRole)
+ if (role != Qt::DisplayRole) {
return QVariant();
+ }
if (orientation == Qt::Vertical) {
return QVariant();
@@ -107,24 +109,24 @@ QVariant SessionListModel::headerData(int section, Qt::Orientation orientation,
}
}
-int SessionListModel::columnCount(const QModelIndex&) const
+int SessionListModel::columnCount(const QModelIndex &) const
{
return 2;
}
-int SessionListModel::rowCount(const QModelIndex&) const
+int SessionListModel::rowCount(const QModelIndex &) const
{
return _sessions.count();
}
-QModelIndex SessionListModel::parent(const QModelIndex&) const
+QModelIndex SessionListModel::parent(const QModelIndex &) const
{
return QModelIndex();
}
void SessionListModel::sessionFinished()
{
- Session* session = qobject_cast<Session*>(sender());
+ Session *session = qobject_cast<Session *>(sender());
int row = _sessions.indexOf(session);
if (row != -1) {
@@ -135,11 +137,11 @@ void SessionListModel::sessionFinished()
}
}
-QModelIndex SessionListModel::index(int row, int column, const QModelIndex& parent) const
+QModelIndex SessionListModel::index(int row, int column, const QModelIndex &parent) const
{
- if (hasIndex(row, column, parent))
+ if (hasIndex(row, column, parent)) {
return createIndex(row, column, _sessions[row]);
- else
+ } else {
return QModelIndex();
+ }
}
-