void TreeWidget::onPartTriggered()
{
    QAction* action = qobject_cast<QAction*>(sender());
    if (action) {
        TreeItem* item = action->data().value<TreeItem*>();
        IrcChannel* channel = item->buffer()->toChannel();
        if (channel && channel->isActive())
            channel->part(qApp->property("description").toString());
    }
}
void tst_IrcChannel::testDefaults()
{
    IrcChannel channel;
    QVERIFY(channel.title().isEmpty());
    QVERIFY(channel.name().isEmpty());
    QVERIFY(channel.prefix().isEmpty());
    QVERIFY(channel.isChannel());
    QVERIFY(channel.toChannel());
    QVERIFY(!channel.connection());
    QVERIFY(!channel.network());
    QVERIFY(!channel.model());
    QVERIFY(!channel.isActive());
    QVERIFY(!channel.isSticky());
    QVERIFY(!channel.isPersistent());
    QVERIFY(channel.mode().isEmpty());
    QVERIFY(channel.topic().isEmpty());
}