mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 16:35:21 -04:00
fixed conflicts for pr 1438
This commit is contained in:
parent
1c998e4f8e
commit
3d66d84112
2 changed files with 145 additions and 33 deletions
|
@ -1,23 +1,22 @@
|
|||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
/*******************************************************************************
|
||||
* retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp *
|
||||
* *
|
||||
* Copyright 2013 by Robert Fernie <retroshare.project@gmail.com> *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QSignalMapper>
|
||||
|
@ -33,10 +32,11 @@
|
|||
#include "gui/feeds/SubFileItem.h"
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "util/DateTime.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "util/HandleRichText.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "util/DateTime.h"
|
||||
|
||||
#define CHAN_DEFAULT_IMAGE ":/images/channels.png"
|
||||
|
||||
|
@ -278,7 +278,6 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
|
|||
ui->infoLastPost->setText(tr("Never"));
|
||||
else
|
||||
ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost));
|
||||
|
||||
QString formatDescription = QString::fromUtf8(group.mDescription.c_str());
|
||||
|
||||
unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS;
|
||||
|
@ -322,7 +321,6 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
|
|||
default:
|
||||
std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl;
|
||||
}
|
||||
|
||||
|
||||
ui->infoDistribution->setText(distrib_string);
|
||||
|
||||
|
@ -643,13 +641,13 @@ bool GxsChannelPostsWidget::navigatePostItem(const RsGxsMessageId &msgId)
|
|||
|
||||
void GxsChannelPostsWidget::subscribeGroup(bool subscribe)
|
||||
{
|
||||
if (groupId().isNull()) {
|
||||
return;
|
||||
}
|
||||
RsGxsGroupId grpId(groupId());
|
||||
if (grpId.isNull()) return;
|
||||
|
||||
uint32_t token;
|
||||
rsGxsChannels->subscribeToGroup(token, groupId(), subscribe);
|
||||
// mChannelQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE);
|
||||
RsThread::async([=]()
|
||||
{
|
||||
rsGxsChannels->subscribeToChannel(grpId, subscribe);
|
||||
} );
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::setAutoDownload(bool autoDl)
|
||||
|
@ -665,12 +663,35 @@ void GxsChannelPostsWidget::toggleAutoDownload()
|
|||
return;
|
||||
}
|
||||
|
||||
bool autoDownload ;
|
||||
if(!rsGxsChannels->getChannelAutoDownload(grpId,autoDownload) || !rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload))
|
||||
bool autoDownload;
|
||||
if(!rsGxsChannels->getChannelAutoDownload(grpId, autoDownload))
|
||||
{
|
||||
std::cerr << "GxsChannelDialog::toggleAutoDownload() Auto Download failed to set";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << __PRETTY_FUNCTION__ << " failed to get autodownload value "
|
||||
<< "for channel: " << grpId.toStdString() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
RsThread::async([this, grpId, autoDownload]()
|
||||
{
|
||||
if(!rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload))
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << " failed to set autodownload "
|
||||
<< "for channel: " << grpId.toStdString() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
RsQThreadUtils::postToObject( [=]()
|
||||
{
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
* after a blocking call to RetroShare API complete, note that
|
||||
* Qt::QueuedConnection is important!
|
||||
*/
|
||||
|
||||
std::cerr << __PRETTY_FUNCTION__ << " Has been executed on GUI "
|
||||
<< "thread but was scheduled by async thread" << std::endl;
|
||||
}, this );
|
||||
});
|
||||
}
|
||||
|
||||
bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue