mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
uniformise calls to [begin/end]ResetModel() and removed calls to layoutAboutToBeChanged() as it may cause some SIGSEGV
This commit is contained in:
parent
82ba488574
commit
3b7734c934
@ -1103,15 +1103,9 @@ Qt::ItemFlags RetroshareDirModel::flags( const QModelIndex & index ) const
|
||||
/* Callback from Core*/
|
||||
void RetroshareDirModel::preMods()
|
||||
{
|
||||
emit layoutAboutToBeChanged();
|
||||
mUpdating = true ;
|
||||
#if QT_VERSION < 0x050000
|
||||
reset();
|
||||
#else
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
#endif
|
||||
|
||||
beginResetModel();
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "RetroshareDirModel::preMods()" << std::endl;
|
||||
#endif
|
||||
@ -1120,20 +1114,14 @@ void RetroshareDirModel::preMods()
|
||||
/* Callback from Core*/
|
||||
void RetroshareDirModel::postMods()
|
||||
{
|
||||
// emit layoutAboutToBeChanged();
|
||||
mUpdating = false ;
|
||||
#if QT_VERSION >= 0x040600
|
||||
beginResetModel();
|
||||
#endif
|
||||
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "RetroshareDirModel::postMods()" << std::endl;
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x040600
|
||||
endResetModel();
|
||||
#endif
|
||||
emit layoutChanged();
|
||||
|
||||
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,COLUMN_COUNT-1,(void*)NULL));
|
||||
}
|
||||
|
||||
void FlatStyle_RDM::postMods()
|
||||
|
@ -152,15 +152,13 @@ void RsFriendListModel::setDisplayGroups(bool b)
|
||||
}
|
||||
void RsFriendListModel::preMods()
|
||||
{
|
||||
emit layoutAboutToBeChanged();
|
||||
|
||||
beginResetModel();
|
||||
}
|
||||
void RsFriendListModel::postMods()
|
||||
{
|
||||
endResetModel();
|
||||
emit layoutChanged();
|
||||
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mTopLevel.size()-1,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL));
|
||||
|
||||
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL));
|
||||
}
|
||||
|
||||
int RsFriendListModel::rowCount(const QModelIndex& parent) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user