fixed conflicts for pr 1438

This commit is contained in:
defnax 2018-12-23 18:45:07 +01:00
parent 1c998e4f8e
commit 3d66d84112
2 changed files with 145 additions and 33 deletions

91
.gitignore vendored
View file

@ -12,3 +12,94 @@ Thumbs.db
*.pro.user *.pro.user
.kdev4 .kdev4
*.kdev4 *.kdev4
*.a
*.Release
*.Debug
*.txt
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/config/banlist.cfg.sgn
*.sgn
*.tmp
*.gpg
*.png
*.dll
*.acs
*.types
*.qss
*.wav
*.sh
*.qm
*.qm
*.cfg
*.bin
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxschannels_db
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxscircles_db
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxsforums_db
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxsid_db
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxstrans_db
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/posted_db
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/help.dta
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/ssl_passphrase.pgp
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/user_cert.pem
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/user_pk.pem
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/lock
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/retro.log
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/retro.log-save
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/RetroShare.conf
retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/RSPeers.conf
retroshare-gui/src/release/Data/pgp/lock
retroshare-gui/src/release/portable
retroshare-gui/src/release/retroshare.exe
retroshare-gui/src/release/stylesheets/Bubble/history/hincoming.htm
retroshare-gui/src/release/stylesheets/Bubble/history/houtgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/history/incoming.htm
retroshare-gui/src/release/stylesheets/Bubble/history/info.xml
retroshare-gui/src/release/stylesheets/Bubble/history/main.css
retroshare-gui/src/release/stylesheets/Bubble/history/ooutgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/history/outgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/history/system.htm
retroshare-gui/src/release/stylesheets/Bubble/history/variants/color.css
retroshare-gui/src/release/stylesheets/Bubble/history/variants/standard.css
retroshare-gui/src/release/stylesheets/Bubble/private/hincoming.htm
retroshare-gui/src/release/stylesheets/Bubble/private/houtgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/private/incoming.htm
retroshare-gui/src/release/stylesheets/Bubble/private/info.xml
retroshare-gui/src/release/stylesheets/Bubble/private/main.css
retroshare-gui/src/release/stylesheets/Bubble/private/ooutgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/private/outgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/private/system.htm
retroshare-gui/src/release/stylesheets/Bubble/private/variants/color.css
retroshare-gui/src/release/stylesheets/Bubble/private/variants/standard.css
retroshare-gui/src/release/stylesheets/Bubble/public/hincoming.htm
retroshare-gui/src/release/stylesheets/Bubble/public/houtgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/public/incoming.htm
retroshare-gui/src/release/stylesheets/Bubble/public/info.xml
retroshare-gui/src/release/stylesheets/Bubble/public/main.css
retroshare-gui/src/release/stylesheets/Bubble/public/ooutgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/public/outgoing.htm
retroshare-gui/src/release/stylesheets/Bubble/public/system.htm
retroshare-gui/src/release/stylesheets/Bubble/public/variants/color.css
retroshare-gui/src/release/stylesheets/Bubble/public/variants/standard.css
retroshare-gui/src/release/stylesheets/Bubble/src/img.svg
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/hincoming.htm
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/houtgoing.htm
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/incoming.htm
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/info.xml
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/Kopie von incoming.htm
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/main.css
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/ooutgoing.htm
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/outgoing.htm
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/system.htm
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/variants/color.css
retroshare-gui/src/release/stylesheets/Bubble_Compact/private/variants/standard.css
retroshare-gui/src/release/webui/app.css
retroshare-gui/src/release/webui/app.css.map
retroshare-gui/src/release/webui/app.js
retroshare-gui/src/release/webui/app.js.map
retroshare-gui/src/release/webui/index.html
retroshare-gui/src/temp/moc/moc_predefs.h
retroshare-gui/src/temp/moc/Settings.moc
retroshare-gui/src/temp/moc/TorControl.moc
retroshare-gui/src/temp/moc/TorManager.moc
retroshare-nogui/src/release/retroshare-nogui.exe
sh.exe.stackdump
*.stash

View file

@ -1,23 +1,22 @@
/**************************************************************** /*******************************************************************************
* RetroShare is distributed under the following license: * retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp *
* * *
* Copyright (C) 2008 Robert Fernie * Copyright 2013 by Robert Fernie <retroshare.project@gmail.com> *
* * *
* This program is free software; you can redistribute it and/or * This program is free software: you can redistribute it and/or modify *
* modify it under the terms of the GNU General Public License * it under the terms of the GNU Affero General Public License as *
* as published by the Free Software Foundation; either version 2 * published by the Free Software Foundation, either version 3 of the *
* of the License, or (at your option) any later version. * License, or (at your option) any later version. *
* * *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * GNU Affero General Public License for more details. *
* * *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU Affero General Public License *
* along with this program; if not, write to the Free Software * along with this program. If not, see <https://www.gnu.org/licenses/>. *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * *
* Boston, MA 02110-1301, USA. *******************************************************************************/
****************************************************************/
#include <QDateTime> #include <QDateTime>
#include <QSignalMapper> #include <QSignalMapper>
@ -33,10 +32,11 @@
#include "gui/feeds/SubFileItem.h" #include "gui/feeds/SubFileItem.h"
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "gui/RetroShareLink.h" #include "gui/RetroShareLink.h"
#include "util/DateTime.h"
#include "util/qtthreadsutils.h"
#include "util/HandleRichText.h" #include "util/HandleRichText.h"
#include <algorithm> #include <algorithm>
#include "util/DateTime.h"
#define CHAN_DEFAULT_IMAGE ":/images/channels.png" #define CHAN_DEFAULT_IMAGE ":/images/channels.png"
@ -278,7 +278,6 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
ui->infoLastPost->setText(tr("Never")); ui->infoLastPost->setText(tr("Never"));
else else
ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost)); ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost));
QString formatDescription = QString::fromUtf8(group.mDescription.c_str()); QString formatDescription = QString::fromUtf8(group.mDescription.c_str());
unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS; unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS;
@ -323,7 +322,6 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl; std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl;
} }
ui->infoDistribution->setText(distrib_string); ui->infoDistribution->setText(distrib_string);
ui->infoWidget->show(); ui->infoWidget->show();
@ -643,13 +641,13 @@ bool GxsChannelPostsWidget::navigatePostItem(const RsGxsMessageId &msgId)
void GxsChannelPostsWidget::subscribeGroup(bool subscribe) void GxsChannelPostsWidget::subscribeGroup(bool subscribe)
{ {
if (groupId().isNull()) { RsGxsGroupId grpId(groupId());
return; if (grpId.isNull()) return;
}
uint32_t token; RsThread::async([=]()
rsGxsChannels->subscribeToGroup(token, groupId(), subscribe); {
// mChannelQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE); rsGxsChannels->subscribeToChannel(grpId, subscribe);
} );
} }
void GxsChannelPostsWidget::setAutoDownload(bool autoDl) void GxsChannelPostsWidget::setAutoDownload(bool autoDl)
@ -666,11 +664,34 @@ void GxsChannelPostsWidget::toggleAutoDownload()
} }
bool autoDownload; bool autoDownload;
if(!rsGxsChannels->getChannelAutoDownload(grpId,autoDownload) || !rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload)) if(!rsGxsChannels->getChannelAutoDownload(grpId, autoDownload))
{ {
std::cerr << "GxsChannelDialog::toggleAutoDownload() Auto Download failed to set"; std::cerr << __PRETTY_FUNCTION__ << " failed to get autodownload value "
std::cerr << std::endl; << "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) bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData)