/*
* Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2017 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl
*
* This file is part of ConfClerk.
*
if (role != Qt::DisplayRole) {
return QVariant();
}
-
return conferences[index.row()].title();
+}
- try {
- const Conference& c = conferenceFromIndex(index);
- return c.title();
- } catch (OrmNoObjectException&) {
- return QVariant();
+const Conference& ConferenceModel::conferenceFromIndex(const QModelIndex& index) const
+{
+ if (index.parent().isValid()
+ or index.column() != 0
+ or index.row() >= conferences.size())
+ {
+ throw OrmNoObjectException();
}
-
+ return conferences[index.row()];
}
-const Conference& ConferenceModel::conferenceFromIndex(const QModelIndex& index) const
+Conference& ConferenceModel::conferenceFromIndex(const QModelIndex& index)
{
if (index.parent().isValid()
or index.column() != 0