|
|
|
@ -212,24 +212,20 @@ void Reviews::activated( const QModelIndex &index ) |
|
|
|
m_document->setViewport( vp, -1, true ); |
|
|
|
m_document->setViewport( vp, -1, true ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QModelIndexList Reviews::retrieveAnnotations(const QModelIndex& idx) |
|
|
|
QList<QModelIndex> Reviews::retrieveAnnotations(const QModelIndex& idx) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
QModelIndexList ret; |
|
|
|
QList<QModelIndex> ret; |
|
|
|
if ( idx.isValid() ) |
|
|
|
if(idx.isValid() && idx.model()->hasChildren(idx)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( idx.model()->hasChildren( idx ) ) |
|
|
|
for(int i=0; i<idx.model()->rowCount(idx); i++) |
|
|
|
{ |
|
|
|
|
|
|
|
int rowCount = idx.model()->rowCount( idx ); |
|
|
|
|
|
|
|
for ( int i = 0; i < rowCount; i++ ) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
ret += retrieveAnnotations(idx.child(i, idx.column())); |
|
|
|
ret += retrieveAnnotations(idx.child(i, idx.column())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else if(idx.isValid()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ret += idx; |
|
|
|
ret += idx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -245,7 +241,7 @@ void Reviews::contextMenuRequested( const QPoint &pos ) |
|
|
|
QModelIndexList indexes = m_view->selectionModel()->selectedIndexes(); |
|
|
|
QModelIndexList indexes = m_view->selectionModel()->selectedIndexes(); |
|
|
|
Q_FOREACH ( const QModelIndex &index, indexes ) |
|
|
|
Q_FOREACH ( const QModelIndex &index, indexes ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QModelIndexList annotations = retrieveAnnotations(index); |
|
|
|
QList<QModelIndex> annotations = retrieveAnnotations(index); |
|
|
|
Q_FOREACH(const QModelIndex &idx, annotations) |
|
|
|
Q_FOREACH(const QModelIndex &idx, annotations) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const QModelIndex authorIndex = m_authorProxy->mapToSource( idx ); |
|
|
|
const QModelIndex authorIndex = m_authorProxy->mapToSource( idx ); |
|
|
|
|