[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/kalarm
From: David Jarvie <djarvie () kde ! org>
Date: 2010-10-29 14:19:43
Message-ID: 20101029141943.108E3AC899 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1191054 by djarvie:
Remove #warning statements
M +6 -31 akonadimodel.cpp
M +1 -3 eventlistview.cpp
--- trunk/KDE/kdepim/kalarm/akonadimodel.cpp #1191053:1191054
@@ -121,9 +121,6 @@
connect(this, SIGNAL(rowsInserted(const QModelIndex&, int, int)), \
SLOT(slotRowsInserted(const QModelIndex&, int, int)));
connect(this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)), \
SLOT(slotRowsAboutToBeRemoved(const QModelIndex&, int, int)));
-#ifdef __GNUC__
-#warning When a calendar is disabled, its rows are not removed from the model, so no \
alarms deleted signal is emitted
-#endif
connect(monitor, SIGNAL(itemChanged(const Akonadi::Item&, const \
QSet<QByteArray>&)), SLOT(slotMonitoredItemChanged(const Akonadi::Item&, const \
QSet<QByteArray>&))); }
@@ -502,6 +499,7 @@
{
if (!index.isValid())
return false;
+ // NOTE: need to emit dataChanged() whenever something is updated (except via a \
job).
Collection collection = index.data(CollectionRole).value<Collection>();
if (collection.isValid())
{
@@ -509,15 +507,12 @@
bool updateCollection = false;
switch (role)
{
-#ifdef __GNUC__
-#warning Emit dataChanged() whenever any item is changed
-#endif
case Qt::BackgroundRole:
{
QColor colour = value.value<QColor>();
CollectionAttribute* attr = \
collection.attribute<CollectionAttribute>(Entity::AddIfMissing); if \
(attr->backgroundColor() == colour)
- return true;
+ return true; // no change
attr->setBackgroundColor(colour);
updateCollection = true;
break;
@@ -533,7 +528,7 @@
CollectionAttribute* attr = \
collection.attribute<CollectionAttribute>(Entity::AddIfMissing); if (attr) { \
kDebug()<<"Set enabled:"<<enabled<<", was="<<attr->isEnabled(); } else { \
kDebug()<<"Set enabled:"<<enabled<<", no attribute"; } if (attr->isEnabled() == \
enabled)
- return true;
+ return true; // no change
attr->setEnabled(enabled);
updateCollection = true;
break;
@@ -566,16 +561,6 @@
bool updateItem = false;
switch (role)
{
- case Qt::EditRole:
- {
-#ifdef __GNUC__
-#warning ??? update event
-#endif
- int row = index.row();
- emit dataChanged(this->index(row, 0, index.parent()), \
this->index(row, ColumnCount - 1, index.parent()));
-kDebug()<<"Item: Qt::EditRole";
- return true;
- }
case CommandErrorRole:
{
KAEvent::CmdErrType err = \
static_cast<KAEvent::CmdErrType>(value.toInt()); @@ -588,14 +573,12 @@
case KAEvent::CMD_ERROR_PRE_POST:
{
if (err == KAEvent::CMD_NO_ERROR && \
!item.hasAttribute<EventAttribute>())
- return true;
+ return true; // no change
EventAttribute* attr = \
item.attribute<EventAttribute>(Entity::AddIfMissing); if (attr->commandError() == \
err)
- return true;
+ return true; // no change
attr->setCommandError(err);
updateItem = true;
-// int row = index.row();
-// emit dataChanged(this->index(row, 0, index.parent()), \
this->index(row, ColumnCount - 1, index.parent())); kDebug()<<"Item: \
CommandErrorRole"; break;
}
@@ -615,6 +598,7 @@
}
}
}
+
return EntityTreeModel::setData(index, value, role);
}
@@ -1098,14 +1082,8 @@
emit collectionAdded(job, false);
}
else
- {
-#ifdef __GNUC__
-#warning Can the collection be retrieved?
-#endif
- //job->instance().identifier();
emit collectionAdded(job, true);
}
-}
/******************************************************************************
* Remove a collection from Akonadi. The calendar file is not removed.
@@ -1351,9 +1329,6 @@
// setData(ix, QVariant::fromValue(item), ItemRole);
queueItemModifyJob(item);
return true;
-#ifdef __GNUC__
-#warning Ensure KAlarm event list is updated correctly before and after Akonadi \
update
-#endif
}
/******************************************************************************
--- trunk/KDE/kdepim/kalarm/eventlistview.cpp #1191053:1191054
@@ -276,13 +276,11 @@
kDebug();
#ifdef USE_AKONADI
ItemListModel* itemModel = qobject_cast<ItemListModel*>(model);
-#ifdef __GNUC__
-#warning Check that this cast works
-#endif
if (!itemModel)
kError() << "Invalid cast to ItemListModel*";
else
{
+kDebug()<<"Cast works!!!!!!!!!!!!";
KAEvent event = itemModel->event(index);
edit(&event, static_cast<EventListView*>(parent()));
return true;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic