From 01c40d25936bdfb7cb7a0e058288dc7b4c245d8f Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 27 Dec 2018 16:56:28 +0100 Subject: [PATCH] removed some dead files and finished license cleaning --- build_scripts/Debian/debian/copyright | 7 +- build_scripts/Debian/makeSourcePackage.sh | 52 ++--- .../src/gui/qskinobject/qskinobject.h | 90 --------- .../qskinobject/qskinwidgetresizehandler.h | 115 ----------- .../src/gui/statistics/dhtgraph.cpp | 77 -------- retroshare-gui/src/gui/statistics/dhtgraph.h | 45 ++--- retroshare-gui/src/util/QtVersion.h | 39 ++-- retroshare-gui/src/util/RsUserdata.h | 39 ++-- retroshare-gui/src/util/TokenQueueVEG.cpp | 182 ------------------ retroshare-gui/src/util/TokenQueueVEG.h | 101 ---------- .../src/util/WidgetBackgroundImage.cpp | 105 +++++----- .../src/util/WidgetBackgroundImage.h | 41 ++-- retroshare-gui/src/util/dllexport.h | 39 ++-- retroshare-gui/src/util/global.h | 39 ++-- retroshare-gui/src/util/qtthreadsutils.h | 42 ++-- 15 files changed, 226 insertions(+), 787 deletions(-) delete mode 100644 retroshare-gui/src/gui/qskinobject/qskinobject.h delete mode 100644 retroshare-gui/src/gui/qskinobject/qskinwidgetresizehandler.h delete mode 100644 retroshare-gui/src/gui/statistics/dhtgraph.cpp delete mode 100644 retroshare-gui/src/util/TokenQueueVEG.cpp delete mode 100644 retroshare-gui/src/util/TokenQueueVEG.h diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright index 4de9e2074..ba2e9f6df 100644 --- a/build_scripts/Debian/debian/copyright +++ b/build_scripts/Debian/debian/copyright @@ -11,10 +11,15 @@ Files: libretroshare/* Copyright: 2007-2018, Retroshare Team License: LGPL-3+ +Files: src/retroshare-gui/src/TorControl/ +Copyright: 2014, John Brooks +License: BSD-New + Files: src/libresapi/src/api/json.h \ libresapi/src/webui-src/app/mithril.min.js \ src/rapidjson-1.1.0/* \ - retroshare-gui/src/gui/common/PictureFlow.* + retroshare-gui/src/gui/common/PictureFlow.* \ + src/retroshare-gui/src/qss/qdarkstyle.qss Copyright: 2013 Jeff Weinstein License: MIT diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh index b715124fb..73c24f25b 100755 --- a/build_scripts/Debian/makeSourcePackage.sh +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -22,7 +22,7 @@ echo This script is going to build the debian source package for RetroShare, fro if test -d "${workdir}" ; then echo Removing the ${workdir} directory... - rm -i -rf ${workdir} + rm -rf ${workdir} fi # Parse options @@ -71,29 +71,31 @@ done removeIrrelevantFiles() { echo Removing irrelevant files in directory ${workdir}... # remove unised qml code, only needed on Android - rm -i -rf ${workdir}/src/retroshare-qml-app/ - rm -i -rf ${workdir}/src/librssimulator/ - rm -i -rf ${workdir}/src/libretroshare/src/tests/ - rm -i -rf ${workdir}/src/libretroshare/src/unfinished/ - rm -i -rf ${workdir}/src/libretroshare/unused/ - rm -i -rf ${workdir}/src/retroshare-android-notify-service/ - rm -i -rf ${workdir}/src/retroshare-android-service/ - rm -i -rf ${workdir}/src/libretroshare/src/unused/ - rm -i -rf ${workdir}/src/supportlibs/ - rm -i -rf ${workdir}/src/retroshare-service/ - rm -i -rf ${workdir}/src/plugins/ - rm -i -rf ${workdir}/src/unittests/ - rm -i -rf ${workdir}/src/tests/ - rm -i -rf ${workdir}/src/build_scripts/ - rm -i -rf ${workdir}/src/libbitdht/src/tests/ - rm -i -rf ${workdir}/src/libbitdht/src/example/ - rm -i -f ${workdir}/debian/*~ - rm -i -f ${workdir}/debian/.*.sw? - rm -i -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble_Compact/private/images.sh - rm -i -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/src/images.sh - rm -i -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/public/images.sh - rm -i -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/"history"/images.sh - rm -i -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/private/images.sh + rm -rf ${workdir}/src/retroshare-qml-app/ + rm -rf ${workdir}/src/librssimulator/ + rm -rf ${workdir}/src/libretroshare/src/tests/ + rm -rf ${workdir}/src/libretroshare/src/unfinished/ + rm -rf ${workdir}/src/libretroshare/unused/ + rm -rf ${workdir}/src/retroshare-android-notify-service/ + rm -rf ${workdir}/src/retroshare-android-service/ + rm -rf ${workdir}/src/libretroshare/src/unused/ + rm -rf ${workdir}/src/supportlibs/ + rm -rf ${workdir}/src/retroshare-service/ + rm -rf ${workdir}/src/plugins/ + rm -rf ${workdir}/src/unittests/ + rm -rf ${workdir}/src/tests/ + rm -rf ${workdir}/src/build_scripts/ + rm -rf ${workdir}/src/libbitdht/src/tests/ + rm -rf ${workdir}/src/libbitdht/src/example/ + rm -rf ${workdir}/src/retroshare-gui/src/gui/WikiPoos/ + rm -rf ${workdir}/src/retroshare-gui/src/Unused/ + rm -f ${workdir}/debian/*~ + rm -f ${workdir}/debian/.*.sw? + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble_Compact/private/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/src/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/public/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/"history"/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/private/images.sh } echo Attempting to get revision number... @@ -163,7 +165,7 @@ if ! test "${nodl}" = "yes"; then # Various cleaning echo Cleaning... - \rm -i -rf src/.git + \rm -rf src/.git if test "${makeorig}" = "yes" ; then echo making orig archive diff --git a/retroshare-gui/src/gui/qskinobject/qskinobject.h b/retroshare-gui/src/gui/qskinobject/qskinobject.h deleted file mode 100644 index 1f65bdba1..000000000 --- a/retroshare-gui/src/gui/qskinobject/qskinobject.h +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************************************** - * PROGRAM : childform - * DATE - TIME : Samstag 30 Dezember 2006 - 12h04 - * AUTHOR : ( ) - * FILENAME : QSkinMainWindow.h - * LICENSE : - * COMMENTARY : - ********************************************************************************************************/ -#ifndef QSkinObject_H -#define QSkinObject_H -#include "qskinwidgetresizehandler.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef WIN32 -#define _WIN32_WINNT 0x0500 -#define WINVER 0x0500 -#include -#endif -class QSkinWidgetResizeHandler; -class QSkinObject : public QObject -{ - Q_OBJECT - friend class QSkinWidgetResizeHandler; -public: - QSkinObject(QWidget* wgtParent); - ~QSkinObject(){} - void setSkinPath(const QString & skinpath); - QString getSkinPath(); - int customFrameWidth(); -public slots: - void updateStyle(); - void updateButtons(); - void startSkinning(); - void stopSkinning(); -protected: - bool eventFilter(QObject *o, QEvent *e); - //Events to filter - //void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - //void mouseReleaseEvent(QMouseEvent *mouseEvent); - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *e); - //void closeEvent(QCloseEvent *e); - - void loadSkinIni(); - void manageRegions(); - QPixmap drawCtrl(QWidget * widget); - QRegion childRegion; - void timerEvent ( QTimerEvent * event ); -private: - QRect saveRect; - QRect skinGeometry; - QPixmap widgetMask;//the pixmap, in which the ready frame is stored on pressed? - QString skinPath; - QFont titleFont; - QColor titleColor; - bool milchglas; - bool gotMousePress; - QRegion quitButton; - QRegion maxButton; - QRegion minButton; - QRect contentsRect; - QSkinWidgetResizeHandler * resizeHandler; - bool mousePress; - QBasicTimer *skinTimer; - QWidget *skinWidget; - void fastbluralpha(QImage &img, int radius); - Qt::WindowFlags flags; - int wlong; -#ifdef WIN32 -public slots: - void setLayered(); - void updateAlpha(); -private: - double alpha; -#endif -}; -#endif - diff --git a/retroshare-gui/src/gui/qskinobject/qskinwidgetresizehandler.h b/retroshare-gui/src/gui/qskinobject/qskinwidgetresizehandler.h deleted file mode 100644 index 45ba0788e..000000000 --- a/retroshare-gui/src/gui/qskinobject/qskinwidgetresizehandler.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************** - * RShare is distributed under the following license: - * - * Copyright (C) 2006, The RetroShare Team - * - * 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. - ****************************************************************/ - -#ifndef QSKINWIDGETRESIZEHANDLER_P_H -#define QSKINWIDGETRESIZEHANDLER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// - -#include -#include -#include "qskinobject.h" -class QSkinObject; -class QMouseEvent; -class QKeyEvent; - -class QSkinWidgetResizeHandler : public QObject -{ - Q_OBJECT - friend class QSkinObject; -public: - enum Action { - Move = 0x01, - Resize = 0x02, - Any = Move|Resize - }; - - explicit QSkinWidgetResizeHandler(QSkinObject * skobj, QWidget *parent, QWidget *cw = 0); - void setActive(bool b) { setActive(Any, b); } - void setActive(Action ac, bool b); - bool isActive() const { return isActive(Any); } - bool isActive(Action ac) const; - void setMovingEnabled(bool b) { movingEnabled = b; } - bool isMovingEnabled() const { return movingEnabled; } - - bool isButtonDown() const { return buttonDown; } - - void setExtraHeight(int h) { extrahei = h; } - void setSizeProtection(bool b) { sizeprotect = b; } - - void setFrameWidth(int w) { fw = w; } - - void doResize(); - void doMove(); - -Q_SIGNALS: - void activate(); - -protected: - bool eventFilter(QObject *o, QEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *e); - -private: - Q_DISABLE_COPY(QSkinWidgetResizeHandler) - QSkinObject *obj; - enum MousePosition { - Nowhere, - TopLeft, BottomRight, BottomLeft, TopRight, - Top, Bottom, Left, Right, - Center - }; - - QWidget *widget; - QWidget *childWidget; - QPoint moveOffset; - QPoint invertedMoveOffset; - MousePosition mode; - int fw; - int extrahei; - int range; - uint buttonDown :1; - uint moveResizeMode :1; - uint activeForResize :1; - uint sizeprotect :1; - uint movingEnabled :1; - uint activeForMove :1; - uint widgetType; - void setMouseCursor(MousePosition m); - bool isMove() const { - return moveResizeMode && mode == Center; - } - bool isResize() const { - return moveResizeMode && !isMove(); - } -}; - - -#endif // QSkinWidgetResizeHandler_P_H diff --git a/retroshare-gui/src/gui/statistics/dhtgraph.cpp b/retroshare-gui/src/gui/statistics/dhtgraph.cpp deleted file mode 100644 index 1daa906d3..000000000 --- a/retroshare-gui/src/gui/statistics/dhtgraph.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * Copyright (c) 2006-2007, crypton - * Copyright (c) 2006, Matt Edman, Justin Hipple - * - * 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. - ****************************************************************/ - - -#include - -#include -#include -#include "dhtgraph.h" - -class DHTGraphSource: public RSGraphSource -{ -public: - virtual int n_values() const - { - return 1 ; - } - virtual void getValues(std::map& values) const - { - RsConfigNetStatus config; - rsConfig->getConfigNetStatus(config); - - if (config.DHTActive && config.netDhtOk) - { - values.insert(std::make_pair(std::string("RS Net size"),(float)config.netDhtRsNetSize)) ; - //values.insert(std::make_pair(std::string("GLobal Net size"),(float)config.netDhtNetSize)) ; - } - else - { - values.insert(std::make_pair(std::string("RS Net size"),0.0f)) ; - //values.insert(std::make_pair(std::string("GLobal Net size"),0.0f)) ; - } - } - - virtual QString unitName() const { return tr("users"); } -}; - -/** Default contructor */ -DhtGraph::DhtGraph(QWidget *parent) -: RSGraphWidget(parent) -{ - DHTGraphSource *src = new DHTGraphSource() ; - - src->setCollectionTimeLimit(30*60*1000) ; // 30 mins - src->setCollectionTimePeriod(1000) ; // collect every second - src->start() ; - - addSource(src) ; - - setTimeScale(1.0f) ; // 1 pixels per second of time. - setScaleParams(0) ; - - resetFlags(RSGRAPH_FLAGS_LOG_SCALE_Y) ; - setFlags(RSGRAPH_FLAGS_PAINT_STYLE_PLAIN) ; -} - - diff --git a/retroshare-gui/src/gui/statistics/dhtgraph.h b/retroshare-gui/src/gui/statistics/dhtgraph.h index 2ebc2e2ec..b908d8e59 100644 --- a/retroshare-gui/src/gui/statistics/dhtgraph.h +++ b/retroshare-gui/src/gui/statistics/dhtgraph.h @@ -1,25 +1,26 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * Copyright (c) 2006-2007, crypton - * Copyright (c) 2006, Matt Edman, Justin Hipple - * - * 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/statistics/dhtgraph.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2014 RetroShare Team * + * Copyright (c) 2006-2007, crypton * + * Copyright (c) 2006, Matt Edman, Justin Hipple * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once diff --git a/retroshare-gui/src/util/QtVersion.h b/retroshare-gui/src/util/QtVersion.h index a7d347a96..d04d226ae 100644 --- a/retroshare-gui/src/util/QtVersion.h +++ b/retroshare-gui/src/util/QtVersion.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 RetroShare Team - * - * 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. - ****************************************************************/ +/******************************************************************************* + * util/qthreadutils.h * + * * + * Copyright (C) 2013 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef QTVERSION_H #define QTVERSION_H diff --git a/retroshare-gui/src/util/RsUserdata.h b/retroshare-gui/src/util/RsUserdata.h index 204c0ebeb..6ee3baa05 100644 --- a/retroshare-gui/src/util/RsUserdata.h +++ b/retroshare-gui/src/util/RsUserdata.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2014, RetroShare Team - * - * 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. - ****************************************************************/ +/******************************************************************************* + * util/RsUserdata.h * + * * + * Copyright (C) 2013 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef _RSUSERDATA_H #define _RSUSERDATA_H diff --git a/retroshare-gui/src/util/TokenQueueVEG.cpp b/retroshare-gui/src/util/TokenQueueVEG.cpp deleted file mode 100644 index 5c11dca31..000000000 --- a/retroshare-gui/src/util/TokenQueueVEG.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Token Queue. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - -#include "util/TokenQueueVEG.h" -#include - -#include - -/****** - * #define ID_DEBUG 1 - *****/ - -/** Constructor */ -TokenQueueVEG::TokenQueueVEG(RsTokenServiceVEG *service, TokenResponseVEG *resp) -:QWidget(NULL), mService(service), mResponder(resp) -{ - return; -} - -bool TokenQueueVEG::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, std::list ids, uint32_t usertype) -{ - uint32_t basictype = TOKENREQ_GROUPINFO; - mService->requestGroupInfo(token, anstype, opts, ids); - queueRequest(token, basictype, anstype, usertype); - - return true; -} - - -bool TokenQueueVEG::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, std::list ids, uint32_t usertype) -{ - uint32_t basictype = TOKENREQ_MSGINFO; - mService->requestMsgInfo(token, anstype, opts, ids); - queueRequest(token, basictype, anstype, usertype); - - return true; -} - - -bool TokenQueueVEG::requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, std::list ids, uint32_t usertype) -{ - uint32_t basictype = TOKENREQ_MSGRELATEDINFO; - mService->requestMsgRelatedInfo(token, anstype, opts, ids); - queueRequest(token, basictype, anstype, usertype); - - return true; -} - - -void TokenQueueVEG::queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype) -{ - std::cerr << "TokenQueueVEG::queueRequest() Token: " << token << " Type: " << basictype; - std::cerr << " AnsType: " << anstype << " UserType: " << usertype; - std::cerr << std::endl; - - TokenRequestVEG req; - req.mToken = token; - req.mType = basictype; - req.mAnsType = anstype; - req.mUserType = usertype; - - gettimeofday(&req.mRequestTs, NULL); - req.mPollTs = req.mRequestTs; - - mRequests.push_back(req); - - if (mRequests.size() == 1) - { - /* start the timer */ - doPoll(0.1); - } -} - -void TokenQueueVEG::doPoll(float dt) -{ - /* single shot poll */ - //mTrigger->singlesshot(dt * 1000); - QTimer::singleShot((int) (dt * 1000.0), this, SLOT(pollRequests())); -} - - -void TokenQueueVEG::pollRequests() -{ - std::list::iterator it; - - double pollPeriod = 1.0; // max poll period. - for(it = mRequests.begin(); it != mRequests.end();) - { - if (checkForRequest(it->mToken)) - { - /* clean it up and handle */ - loadRequest(*it); - it = mRequests.erase(it); - } - else - { - /* calculate desired poll period */ - - /* if less then current poll period, adjust */ - - it++; - } - } - - if (mRequests.size() > 0) - { - doPoll(pollPeriod); - } -} - - -bool TokenQueueVEG::checkForRequest(uint32_t token) -{ - /* check token */ - return (COMPLETED_REQUEST == mService->requestStatus(token)); -} - - -void TokenQueueVEG::loadRequest(const TokenRequestVEG &req) -{ - std::cerr << "TokenQueueVEG::loadRequest(): "; - std::cerr << "Token: " << req.mToken << " Type: " << req.mType; - std::cerr << " AnsType: " << req.mAnsType << " UserType: " << req.mUserType; - std::cerr << std::endl; - - mResponder->loadRequest(this, req); - - return; -} - - -bool TokenQueueVEG::cancelRequest(const uint32_t token) -{ - /* cancel at lower level first */ - mService->cancelRequest(token); - - std::list::iterator it; - - for(it = mRequests.begin(); it != mRequests.end(); it++) - { - if (it->mToken == token) - { - mRequests.erase(it); - - std::cerr << "TokenQueueVEG::cancelRequest() Cleared Request: " << token; - std::cerr << std::endl; - - return true; - } - } - - std::cerr << "TokenQueueVEG::cancelRequest() Failed to Find Request: " << token; - std::cerr << std::endl; - - return false; -} - - - - - - diff --git a/retroshare-gui/src/util/TokenQueueVEG.h b/retroshare-gui/src/util/TokenQueueVEG.h deleted file mode 100644 index eca5a431a..000000000 --- a/retroshare-gui/src/util/TokenQueueVEG.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Token Queue. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - -#ifndef MRK_VEG_TOKEN_QUEUE_H -#define MRK_VEG_TOKEN_QUEUE_H - -#include -#include -#include -#include -#include -#include -#include - -#define COMPLETED_REQUEST 4 - -#define TOKENREQ_GROUPINFO 1 -#define TOKENREQ_MSGINFO 2 -#define TOKENREQ_MSGRELATEDINFO 3 - -class TokenQueueVEG; - -class TokenRequestVEG -{ - public: - uint32_t mToken; - uint32_t mType; - uint32_t mAnsType; - uint32_t mUserType; - struct timeval mRequestTs; - struct timeval mPollTs; -}; - -class TokenResponseVEG -{ - public: - //virtual ~TokenResponse() { return; } - // These Functions are overloaded to get results out. - virtual void loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req) = 0; -}; - - -class TokenQueueVEG: public QWidget -{ - Q_OBJECT - -public: - TokenQueueVEG(RsTokenServiceVEG *service, TokenResponseVEG *resp); - - /* generic handling of token / response update behaviour */ - bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, - std::list ids, uint32_t usertype); - bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, - std::list ids, uint32_t usertype); - bool requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, - std::list ids, uint32_t usertype); - bool cancelRequest(const uint32_t token); - - void queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype); - bool checkForRequest(uint32_t token); - void loadRequest(const TokenRequestVEG &req); - -protected: - void doPoll(float dt); - -private slots: - void pollRequests(); - -private: - /* Info for Data Requests */ - std::list mRequests; - - RsTokenServiceVEG *mService; - TokenResponseVEG *mResponder; - - QTimer *mTrigger; -}; - -#endif - - diff --git a/retroshare-gui/src/util/WidgetBackgroundImage.cpp b/retroshare-gui/src/util/WidgetBackgroundImage.cpp index 2295987f6..e82e96c26 100644 --- a/retroshare-gui/src/util/WidgetBackgroundImage.cpp +++ b/retroshare-gui/src/util/WidgetBackgroundImage.cpp @@ -1,53 +1,52 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006, 2007 crypton - * - * 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. - ****************************************************************/ - -#include - -#include -#include -#include -#include -#include - -void WidgetBackgroundImage::setBackgroundImage(QWidget * widget, const char * imageFile, WidgetBackgroundImage::AdjustMode adjustMode) { - widget->setAutoFillBackground(true); - - QPixmap pixmap(imageFile); - - switch (adjustMode) { - case AdjustNone: - break; - case AdjustWidth: - widget->setMinimumWidth(pixmap.width()); - break; - case AdjustHeight: - widget->setMinimumHeight(pixmap.height()); - break; - case AdjustSize: - widget->resize(pixmap.size()); - widget->setMinimumSize(pixmap.size()); - break; - } - - QPalette palette = widget->palette(); - palette.setBrush(widget->backgroundRole(), QBrush(pixmap)); - widget->setPalette(palette); -} +/******************************************************************************* + * util/WidgetBackgroundImage.cpp * + * * + * Copyright (c) 2006 Crypton * + * * + * 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 . * + * * + *******************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +void WidgetBackgroundImage::setBackgroundImage(QWidget * widget, const char * imageFile, WidgetBackgroundImage::AdjustMode adjustMode) { + widget->setAutoFillBackground(true); + + QPixmap pixmap(imageFile); + + switch (adjustMode) { + case AdjustNone: + break; + case AdjustWidth: + widget->setMinimumWidth(pixmap.width()); + break; + case AdjustHeight: + widget->setMinimumHeight(pixmap.height()); + break; + case AdjustSize: + widget->resize(pixmap.size()); + widget->setMinimumSize(pixmap.size()); + break; + } + + QPalette palette = widget->palette(); + palette.setBrush(widget->backgroundRole(), QBrush(pixmap)); + widget->setPalette(palette); +} diff --git a/retroshare-gui/src/util/WidgetBackgroundImage.h b/retroshare-gui/src/util/WidgetBackgroundImage.h index 6d15bf96c..9790d9a80 100644 --- a/retroshare-gui/src/util/WidgetBackgroundImage.h +++ b/retroshare-gui/src/util/WidgetBackgroundImage.h @@ -1,24 +1,23 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * 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. - ****************************************************************/ - +/******************************************************************************* + * util/WidgetBackgroundImage.h * + * * + * Copyright (c) 2006 Crypton * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef WIDGETBACKGROUNDIMAGE_H #define WIDGETBACKGROUNDIMAGE_H diff --git a/retroshare-gui/src/util/dllexport.h b/retroshare-gui/src/util/dllexport.h index 3d0c2cad8..18283750d 100644 --- a/retroshare-gui/src/util/dllexport.h +++ b/retroshare-gui/src/util/dllexport.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * 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. - ****************************************************************/ +/******************************************************************************* + * util/dllexport.h * + * * + * Copyright (c) 2007 Crypton * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef DLLEXPORT_H #define DLLEXPORT_H diff --git a/retroshare-gui/src/util/global.h b/retroshare-gui/src/util/global.h index 891ff8b58..a9a447a3b 100644 --- a/retroshare-gui/src/util/global.h +++ b/retroshare-gui/src/util/global.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * 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. - ****************************************************************/ +/******************************************************************************* + * util/global.h * + * * + * Copyright (c) 2007 Crypton * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSGLOBAL_H #define RSGLOBAL_H diff --git a/retroshare-gui/src/util/qtthreadsutils.h b/retroshare-gui/src/util/qtthreadsutils.h index f7dce65dc..155b71b7e 100644 --- a/retroshare-gui/src/util/qtthreadsutils.h +++ b/retroshare-gui/src/util/qtthreadsutils.h @@ -1,26 +1,28 @@ -/* - * RetroShare - * Copyright (C) 2018 Gioacchino Mazzurco - * - * 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 . - */ +/******************************************************************************* + * util/qthreadutils.h * + * * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ + #pragma once /* Thanks to KubaO which realeased original C++14 versions of this functions - * under public domain license - * https://github.com/KubaO/stackoverflown/blob/master/questions/metacall-21646467/main.cpp - * https://github.com/KubaO/stackoverflown/blob/master/LICENSE + * https://github.com/KubaO/stackoverflown/blob/master/questions/metacall-21646467/main.cpp + * https://github.com/KubaO/stackoverflown/blob/master/LICENSE */ #include