Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
qt4-gui: Add missing function for floaties proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
flynd committed Dec 30, 2012
1 parent 340290d commit 12c8f4b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion qt4-gui/src/contactlist/singlecontactproxy.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Licq, an instant messaging client for UNIX.
* Copyright (C) 2007-2010 Licq developers
* Copyright (C) 2007-2012 Licq developers <licq-dev@googlegroups.com>
*
* Licq is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -73,6 +73,11 @@ QModelIndex SingleContactProxy::parent(const QModelIndex& /* index */) const
return QModelIndex();
}

bool SingleContactProxy::hasChildren(const QModelIndex& parent) const
{
return !parent.isValid();
}

int SingleContactProxy::rowCount(const QModelIndex& parent) const
{
if (!parent.isValid())
Expand Down
10 changes: 9 additions & 1 deletion qt4-gui/src/contactlist/singlecontactproxy.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Licq, an instant messaging client for UNIX.
* Copyright (C) 2007-2010 Licq developers
* Copyright (C) 2007-2012 Licq developers <licq-dev@googlegroups.com>
*
* Licq is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -71,6 +71,14 @@ class SingleContactProxy : public QAbstractProxyModel
*/
virtual QModelIndex parent(const QModelIndex& index) const;

/**
* Check if index has any children
*
* @param parent An index for the contact or an invalid index
* @return True if the index invalid (e.g. the root index)
*/
virtual bool hasChildren(const QModelIndex& parent = QModelIndex()) const;

/**
* Get the number of rows in the view
*
Expand Down

0 comments on commit 12c8f4b

Please sign in to comment.