Commit bda3c2b9 authored by Laurent Montel's avatar Laurent Montel 😁

Add function to debug agent

parent fcb67119
......@@ -118,5 +118,10 @@ void FollowUpReminderAgent::reload()
}
}
QString FollowUpReminderAgent::printDebugInfo()
{
return mManager->printDebugInfo();
}
AKONADI_AGENT_MAIN( FollowUpReminderAgent )
......@@ -34,6 +34,8 @@ public:
void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection);
QString printDebugInfo();
public Q_SLOTS:
void configure( WId windowId );
......
......@@ -82,7 +82,7 @@ void FollowUpReminderInfoWidget::setInfo(const QList<FollowUpReminder::FollowUpR
item->setText(To, info->to());
item->setText(MessageId, info->messageId());
//TODO customize it.
item->setText(Date, info->followUpReminderDate().toString());
item->setText(DeadLine, info->followUpReminderDate().toString());
}
}
......
......@@ -60,7 +60,7 @@ private:
To = 0,
Subject,
MessageId,
Date
DeadLine
};
QTreeWidget *mTreeWidget;
};
......
......@@ -103,4 +103,21 @@ void FollowUpReminderManager::answerReceived(const QString &from)
}
QString FollowUpReminderManager::printDebugInfo()
{
QString infoStr;
Q_FOREACH (FollowUpReminder::FollowUpReminderInfo *info, mFollowUpReminderInfoList) {
if (!infoStr.isEmpty())
infoStr += QLatin1Char('\n');
infoStr += infoToStr(info);
}
return infoStr;
}
QString FollowUpReminderManager::infoToStr(FollowUpReminder::FollowUpReminderInfo *info)
{
QString infoStr;
//TODO
return infoStr;
}
......@@ -36,11 +36,14 @@ public:
void load();
void checkFollowUp(const Akonadi::Item &item, const Akonadi::Collection &col);
QString printDebugInfo();
private slots:
void slotCheckFollowUpFinished(const QString &messageId);
private:
void answerReceived(const QString &from);
QString infoToStr(FollowUpReminder::FollowUpReminderInfo *info);
KSharedConfig::Ptr mConfig;
QList<FollowUpReminder::FollowUpReminderInfo*> mFollowUpReminderInfoList;
QPointer<FollowUpReminderNoAnswerDialog> mNoAnswerDialog;
......
......@@ -10,5 +10,8 @@
<method name="enabledAgent" >
<arg type="b" direction="out"/>
</method>
<method name="printDebugInfo" >
<arg type="s" direction="out"/>
</method>
</interface>
</node>
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