pidgin/quail/quail-redux

705e160c8659
Parents abe02b214c11
Children 4fb6ceff677a
Make the groups rememeber their collapsed state
--- a/src/QuailBuddyList.cpp Tue Aug 27 10:19:49 2013 +0100
+++ b/src/QuailBuddyList.cpp Tue Aug 27 10:48:39 2013 +0100
@@ -41,14 +41,14 @@
* QQuailBListItem
**************************************************************************/
QQuailBListItem::QQuailBListItem(QTreeWidget *parent, PurpleBlistNode *node)
- : QTreeWidgetItem(parent), node(node), expanded(false), dirty(true)
+ : QTreeWidgetItem(parent), node(node), dirty(true)
{
qDebug() << "QQuailBListItem::QQuailBListItem::Added to TreeWidget";
init();
}
QQuailBListItem::QQuailBListItem(QTreeWidgetItem *parent, PurpleBlistNode *node)
- : QTreeWidgetItem(parent), node(node), expanded(false), dirty(true)
+ : QTreeWidgetItem(parent), node(node), dirty(true)
{
qDebug() << "QQuailBListItem::QQuailBListItem::Added to TreeWidgetItem";
init();
@@ -223,18 +223,6 @@
}
void
-QQuailBListItem::setExpanded(bool expanded)
-{
- this->expanded = expanded;
-}
-
-bool
-QQuailBListItem::isExpanded() const
-{
- return expanded;
-}
-
-void
QQuailBListItem::init()
{
updateInfo();
@@ -655,10 +643,11 @@
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setStyleSheet("QTreeWidget#treeWidget::item { height: " + QString(BUDDY_ICON_SIZE) + "px; }");
- connect(this, SIGNAL(expanded(QTreeWidgetItem *)),
+ connect(this, SIGNAL(itemExpanded(QTreeWidgetItem *)),
this, SLOT(nodeExpandedSlot(QTreeWidgetItem *)));
- connect(this, SIGNAL(collapsed(QTreeWidgetItem *)),
+ connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem *)),
this, SLOT(nodeCollapsedSlot(QTreeWidgetItem *)));
+ //TODO: Find a replacement for this
connect(this, SIGNAL(rightButtonPressed(QTreeWidgetItem *,
const QPoint &, int)),
this, SLOT(showContextMenuSlot(QTreeWidgetItem *,
@@ -955,7 +944,7 @@
/* Auto-Join */
a = new QAction(tr("Auto-Join"), this);
- if (purple_blist_node_get_bool((PurpleBlistNode *)chat, "qpe-autojoin"))
+ if (purple_blist_node_get_bool((PurpleBlistNode *)chat, "autojoin"))
a->setChecked(true);
menu->addAction(a);
@@ -1043,6 +1032,7 @@
if (PURPLE_BLIST_NODE_IS_GROUP(node))
{
+ qDebug() << "QQuailBuddyList::nodeExpandedSlot.setNodeCollapsed:FALSE";
purple_blist_node_set_bool(node, "collapsed", FALSE);
// if (!saveTimer->isActive())
@@ -1065,6 +1055,7 @@
if (PURPLE_BLIST_NODE_IS_GROUP(node))
{
+ qDebug() << "QQuailBuddyList::nodeCollapsedSlot:collapsed::true";
purple_blist_node_set_bool(node, "collapsed", TRUE);
// if (!saveTimer->isActive())
@@ -1388,7 +1379,7 @@
if (!PURPLE_BLIST_NODE_IS_CHAT(node))
return;
- purple_blist_node_set_bool(node, "qpe-autojoin", on);
+ purple_blist_node_set_bool(node, "autojoin", on);
// purple_blist_save();
}
@@ -1469,20 +1460,18 @@
purple_prefs_get_bool("/quail/blist/show_offline_buddies") ||
purple_blist_get_group_online_count(group) > 0)
{
- qDebug() << "QQuailBuddyList::updateGroup.1";
if (item == NULL)
{
- //qDebug() << "QQuailBuddyList::updateGroup.1";
addGroup(node);
item = (QQuailBListItem *)node->ui_data;
}
-
if (!purple_blist_node_get_bool(node, "collapsed"))
+ {
item->setExpanded(true);
+ }
}
else
{
- //qDebug() << "QQuailBuddyList::updateGroup.3";
if (item != NULL)
delete item;
}
--- a/src/QuailBuddyList.h Tue Aug 27 10:19:49 2013 +0100
+++ b/src/QuailBuddyList.h Tue Aug 27 10:48:39 2013 +0100
@@ -37,8 +37,6 @@
PurpleBlistNode *getBlistNode() const;
void updateInfo();
- void setExpanded(bool expanded);
- bool isExpanded() const;
//TODO: Find out how to calculate this
bool recentSignedOnOff()
{ return false; }
@@ -54,7 +52,6 @@
private:
PurpleBlistNode *node;
- bool expanded;
bool dirty;
QString topText, bottomText;
int textY1, textY2;
--- a/src/QuailEventLoop.cpp Tue Aug 27 10:19:49 2013 +0100
+++ b/src/QuailEventLoop.cpp Tue Aug 27 10:48:39 2013 +0100
@@ -58,7 +58,7 @@
PurpleInputCondition cond,
PurpleInputFunction func,
gpointer userData)
- : QAbstractEventDispatcher(), func(func), userData(userData), readNotifier(NULL),
+ : QObject(), func(func), userData(userData), readNotifier(NULL),
writeNotifier(NULL)
{
//qDebug() << "QQuailInputNotifier::QQuailInputNotifier";
--- a/src/QuailMainWindow.cpp Tue Aug 27 10:19:49 2013 +0100
+++ b/src/QuailMainWindow.cpp Tue Aug 27 10:48:39 2013 +0100
@@ -333,6 +333,7 @@
qDebug() << tr("Initialization of the Quail core failed.\n"
"Please report this!\n");
}
+ purple_debug_set_enabled(false);
qDebug() << "QQuailMainWindow::initCore().3";
path = g_build_filename(purple_user_dir(), "plugins", NULL);
qDebug() << "QQuailMainWindow::initCore().4";