mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 08:35:16 -04:00
Merged branch v0.5-gxs-b1 into trunk (from -r 5351 -> 5995)
This brings a huge amount of goodness into the trunk, but there is still a big chunk todo before it can be released. * GXS Backend. * GXS Services: - Identities. - Circles - Photos - Wiki - GxsForums - Posted. * SSH no-gui server. See branch commits for more info. To switch on GXS stuff, enable CONFIG += gxs in both libretroshare.pro and retroshare-gui.pro git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5996 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
commit
069b72e0b2
549 changed files with 111171 additions and 25579 deletions
|
@ -37,12 +37,13 @@
|
|||
#define COLUMN_COUNT 2
|
||||
#define COLUMN_DATA COLUMN_NAME
|
||||
|
||||
#define ROLE_ID Qt::UserRole
|
||||
#define ROLE_NAME Qt::UserRole + 1
|
||||
#define ROLE_DESCRIPTION Qt::UserRole + 2
|
||||
#define ROLE_POPULARITY Qt::UserRole + 3
|
||||
#define ROLE_LASTPOST Qt::UserRole + 4
|
||||
#define ROLE_SEARCH_SCORE Qt::UserRole + 5
|
||||
#define ROLE_ID Qt::UserRole
|
||||
#define ROLE_NAME Qt::UserRole + 1
|
||||
#define ROLE_DESCRIPTION Qt::UserRole + 2
|
||||
#define ROLE_POPULARITY Qt::UserRole + 3
|
||||
#define ROLE_LASTPOST Qt::UserRole + 4
|
||||
#define ROLE_SEARCH_SCORE Qt::UserRole + 5
|
||||
#define ROLE_SUBSCRIBE_FLAGS Qt::UserRole + 6
|
||||
#define ROLE_COLOR Qt::UserRole + 6
|
||||
|
||||
#define FILTER_NAME_INDEX 0
|
||||
|
@ -69,6 +70,7 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
|
|||
|
||||
connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
|
||||
connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
|
||||
connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemClicked(QTreeWidgetItem*,int)));
|
||||
|
||||
/* Add own item delegate */
|
||||
RSItemDelegate *itemDelegate = new RSItemDelegate(this);
|
||||
|
@ -232,6 +234,19 @@ void GroupTreeWidget::currentItemChanged(QTreeWidgetItem *current, QTreeWidgetIt
|
|||
emit treeCurrentItemChanged(id);
|
||||
}
|
||||
|
||||
void GroupTreeWidget::itemClicked(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
Q_UNUSED(column);
|
||||
|
||||
QString id;
|
||||
|
||||
if (item) {
|
||||
id = item->data(COLUMN_DATA, ROLE_ID).toString();
|
||||
}
|
||||
|
||||
emit treeItemClicked(id);
|
||||
}
|
||||
|
||||
QTreeWidgetItem *GroupTreeWidget::addCategoryItem(const QString &name, const QIcon &icon, bool expand)
|
||||
{
|
||||
QFont font;
|
||||
|
@ -318,6 +333,8 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
|
|||
item->setToolTip(COLUMN_NAME, tooltip);
|
||||
item->setToolTip(COLUMN_POPULARITY, tooltip);
|
||||
|
||||
item->setData(COLUMN_DATA, ROLE_SUBSCRIBE_FLAGS, itemInfo.subscribeFlags);
|
||||
|
||||
/* Set color */
|
||||
QBrush brush;
|
||||
if (itemInfo.privatekey) {
|
||||
|
@ -413,6 +430,16 @@ QTreeWidgetItem *GroupTreeWidget::activateId(const QString &id, bool focus)
|
|||
return item;
|
||||
}
|
||||
|
||||
int GroupTreeWidget::subscribeFlags(const QString &id)
|
||||
{
|
||||
QTreeWidgetItem *item = getItemFromId(id);
|
||||
if (item == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return item->data(COLUMN_DATA, ROLE_SUBSCRIBE_FLAGS).toInt();
|
||||
}
|
||||
|
||||
void GroupTreeWidget::calculateScore(QTreeWidgetItem *item, const QString &filterText)
|
||||
{
|
||||
if (item) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue