diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 25391fcbe..73a70d0c5 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1193,7 +1193,7 @@ int RsServer::StartupRetroShare() std::cerr << "(EE) Cannot create extensions directory " << extensions_dir << ". This is not mandatory, but you probably have a permission problem." << std::endl; -#ifdef DEBUG_PLUGIN_SYSTEM +#ifndef DEBUG_PLUGIN_SYSTEM plugins_directories.push_back(".") ; // this list should be saved/set to some correct value. // possible entries include: /usr/lib/retroshare, ~/.retroshare/extensions/, etc. #endif diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp index 06225843b..1eb52356a 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp @@ -185,7 +185,7 @@ void GxsMessageFramePostWidget::loadGroupData() RsThread::async([this]() { - RsGxsGenericGroupData *data; + RsGxsGenericGroupData *data = nullptr; getGroupData(data); if(!data) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index 36c0d8188..11ba70ccb 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -515,7 +515,7 @@ void GxsChannelPostsWidget::createPostItem(const RsGxsChannelPost& post, bool re if(item) { - std::set older_versions(item->olderVersions()); + std::set older_versions(item->olderVersions()); // we make a copy because the item will be deleted ui->feedWidget->removeFeedItem(item) ; older_versions.insert(meta.mMsgId); @@ -792,9 +792,16 @@ void GxsChannelPostsWidget::toggleAutoDownload() bool GxsChannelPostsWidget::insertGroupData(const RsGxsGenericGroupData *data) { - insertChannelDetails(*dynamic_cast(data)); - return true; + const RsGxsChannelGroup *d = dynamic_cast(data); + if(!d) + { + RsErr() << __PRETTY_FUNCTION__ << " Cannot dynamic cast input data (" << (void*)data << " to RsGxsGenericGroupData. Something bad happenned." << std::endl; + return false; + } + + insertChannelDetails(*d); + return true; } void GxsChannelPostsWidget::getMsgData(const std::set& msgIds,std::vector& psts) @@ -825,6 +832,11 @@ void GxsChannelPostsWidget::getAllMsgData(std::vector& pst bool GxsChannelPostsWidget::getGroupData(RsGxsGenericGroupData *& data) { + if(groupId().isNull()) + { + RsErr() << __PRETTY_FUNCTION__ << " Trying to get data about null group!!" << std::endl; + return false; + } std::vector groups; if(rsGxsChannels->getChannelsInfo(std::list({groupId()}),groups) && groups.size()==1) @@ -851,7 +863,7 @@ void GxsChannelPostsWidget::insertAllPosts(const std::vector cposts; - for(auto post: posts) // This is not so nice but we have somehow to convert to RsGxsChannelPost at some timer, and the cposts list is being modified in the insert method. + for(auto post: posts) // This is not so nice but we have somehow to convert to RsGxsChannelPost at some time, and the cposts list is being modified in the insert method. cposts.push_back(*static_cast(post)); insertChannelPosts(cposts, thread, false); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 37b479e6a..c3d1ca70b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -817,7 +817,10 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate(); if(setToReadOnActive) + { + saveExpandedItems(mSavedExpandedMessages); mThreadModel->setMsgReadStatus(src_index, true,false); + } } void GxsForumThreadWidget::clickedThread(QModelIndex index) @@ -837,6 +840,7 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) if (index.column() == RsGxsForumModel::COLUMN_THREAD_READ) { + saveExpandedItems(mSavedExpandedMessages); ForumModelPostEntry fmpe; QModelIndex src_index = mThreadProxyModel->mapToSource(index); @@ -845,6 +849,7 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) #ifdef DEBUG_FORUMS std::cerr << "Setting message read status to false" << std::endl; #endif + mThreadModel->setMsgReadStatus(src_index, IS_MSG_UNREAD(fmpe.mMsgStatus),false); } #ifdef DEBUG_FORUMS @@ -1266,6 +1271,7 @@ void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool f if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) { return; } + saveExpandedItems(mSavedExpandedMessages); if(forum) mThreadModel->setMsgReadStatus(mThreadModel->root(),read,children);