mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 11:00:14 -05:00
Merge branch 'master' into android
This commit is contained in:
commit
8ab3c7de26
40
.travis.yml
40
.travis.yml
@ -1,13 +1,36 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
language: cpp
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
compiler: gcc
|
||||
- os: osx
|
||||
osx_image: xcode6.2
|
||||
compiler: clang
|
||||
sudo: false
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install -y build-essential checkinstall cmake libavutil-dev libavcodec-dev libavformat-dev libbz2-dev libcurl4-openssl-dev libcv-dev libopencv-highgui-dev libhighgui-dev libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libprotobuf-dev libqt4-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libssl-dev libswscale-dev libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev pkg-config protobuf-compiler python-dev qtmobility-dev
|
||||
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi
|
||||
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential checkinstall cmake libavutil-dev libavcodec-dev libavformat-dev libbz2-dev libcurl4-openssl-dev libcv-dev libopencv-highgui-dev libhighgui-dev libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libprotobuf-dev libqt4-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libssl-dev libswscale-dev libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev pkg-config protobuf-compiler python-dev qtmobility-dev; fi
|
||||
|
||||
|
||||
# - if [ $TRAVIS_OS_NAME == osx ]; then xcode-select --install ; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew update ; fi
|
||||
# - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt55 openssl miniupnpc libmicrohttpd speex homebrew/science/opencv ffmpeg sqlcipher ; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew install qt55 openssl miniupnpc libmicrohttpd speex ffmpeg sqlcipher ; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt55 ; fi
|
||||
#Fix for opencv and numpy already installed by system
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then rm '/usr/local/bin/f2py'; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then rm -r '/usr/local/lib/python2.7/site-packages/numpy'; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew install homebrew/science/opencv; fi
|
||||
|
||||
# FIX: Now openssl is not linked in /usr/local/include and lib
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then ln -s /usr/local/opt/openssl/include/* /usr/local/include/; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then ln -s /usr/local/opt/openssl/lib/*.a /usr/local/lib/; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then ln -s /usr/local/opt/openssl/lib/*.dylib /usr/local/lib/; fi
|
||||
|
||||
# - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update && sudo apt-get install -y llvm-3.4 llvm-3.4-dev; fi
|
||||
# - rvm use $RVM --install --binary --fuzzy
|
||||
# - gem update --system
|
||||
@ -31,8 +54,9 @@ addons:
|
||||
before_script:
|
||||
- qmake QMAKE_CC=$CC QMAKE_CXX=$CXX CONFIG+=no_sqlcipher CONFIG+=tests
|
||||
|
||||
#script: make
|
||||
script: if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make && tests/unittests/unittests >/dev/null 2>&1 ; fi
|
||||
script:
|
||||
- if [ $TRAVIS_OS_NAME == linux ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make && tests/unittests/unittests >/dev/null 2>&1 ; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j 4 ; fi
|
||||
|
||||
|
||||
#after_success:
|
||||
|
@ -1,65 +1,83 @@
|
||||
##Compilation on MacOS
|
||||
# Compilation on MacOS
|
||||
|
||||
### Qt Installation
|
||||
## Qt Installation
|
||||
|
||||
Install Qt via: [Qt Download](http://www.qt.io/download/)
|
||||
Install Qt via: [Qt Download](http://www.qt.io/download/)
|
||||
|
||||
Use default options.
|
||||
Add to the PATH environment variable with this temporary solution.
|
||||
Use default options. And add Qt Script support.
|
||||
|
||||
export PATH=/users/$USER/Qt/5.5/clang_64/bin:$PATH
|
||||
Add to the PATH environment variable by editing your *~/.profile* file.
|
||||
|
||||
export PATH="/users/$USER/Qt/5.5/clang_64/bin:$PATH"
|
||||
|
||||
Depends on wich version of Qt you use.
|
||||
|
||||
###MacPort Installation
|
||||
## ***Choose if you use MacPort or HomeBrew***
|
||||
|
||||
### MacPort Installation
|
||||
|
||||
Install MacPort and XCode following this guide: [MacPort and XCode](http://guide.macports.org/#installing.xcode)
|
||||
|
||||
Start XCode to get it updated and to able C compiler to create executables.
|
||||
Start XCode to get it updated and to able C compiler to create executables.
|
||||
|
||||
###Install libraries
|
||||
#### Install libraries
|
||||
|
||||
$sudo port -v selfupdate
|
||||
$sudo port install openssl
|
||||
$sudo port install miniupnpc
|
||||
$sudo port install libmicrohttpd
|
||||
|
||||
For VOIP Plugin:
|
||||
|
||||
$sudo port install speex-devel
|
||||
$sudo port install opencv
|
||||
|
||||
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
|
||||
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
|
||||
|
||||
###Last Settings
|
||||
### HOMEBREW Installation
|
||||
|
||||
In QtCreator Option Git add its path:
|
||||
Install HomeBrew following this guide: [HomeBrew](http://brew.sh/)
|
||||
|
||||
C:\Program Files\Git\bin
|
||||
Install XCode command line developer tools:
|
||||
|
||||
$xcode-select --install
|
||||
|
||||
Start XCode to get it updated and to able C compiler to create executables.
|
||||
|
||||
#### Install libraries
|
||||
|
||||
$brew install openssl
|
||||
$brew install miniupnpc
|
||||
$brew install libmicrohttpd
|
||||
|
||||
and select "Pull" with "Rebase"
|
||||
If you have error in linking, run this:
|
||||
|
||||
###Compil missing libraries
|
||||
####SQLCipher
|
||||
$sudo chown -R $(whoami) /usr/local/lib/pkgconfig
|
||||
|
||||
For VOIP Plugin:
|
||||
|
||||
$brew install speex
|
||||
$brew install homebrew/science/opencv
|
||||
$brew install ffmpeg
|
||||
|
||||
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
|
||||
|
||||
## Last Settings
|
||||
|
||||
In QtCreator Option Git select "Pull" with "Rebase"
|
||||
|
||||
## Compil missing libraries
|
||||
### SQLCipher
|
||||
|
||||
cd <your development directory>
|
||||
git clone https://github.com/sqlcipher/sqlcipher.git
|
||||
cd sqlcipher
|
||||
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
|
||||
./configure --disable-shared --disable-tcl --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I/opt/local/include" LDFLAGS="-lcrypto"
|
||||
make
|
||||
sudo make install
|
||||
|
||||
NOTE, might be necessary to *chmod 000 /usr/local/ssl* temporarily during *./configure* if
|
||||
homebrew uses newer, non-stock ssl dependencies found there. configure might get confused.
|
||||
|
||||
####libMicroHTTPD
|
||||
The one with port don't have good support.
|
||||
|
||||
cd <your development directory>
|
||||
wget http://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-0.9.46.tar.gz
|
||||
tar zxvf libmicrohttpd-0.9.46.tar.gz
|
||||
cd libmicrohttpd-0.9.46
|
||||
bash ./configure
|
||||
sudo make install
|
||||
homebrew uses newer, non-stock ssl dependencies found there. Configure might get confused.
|
||||
|
||||
You can now compile RS into Qt Creator or with terminal
|
||||
|
||||
@ -68,4 +86,6 @@ You can now compile RS into Qt Creator or with terminal
|
||||
cd retroshare
|
||||
qmake; make
|
||||
|
||||
You can change Target and SDK in *./retroshare.pri:82* changing value of QMAKE_MACOSX_DEPLOYMENT_TARGET and QMAKE_MAC_SDK
|
||||
|
||||
You can find compiled application on *./retroshare/retroshare-gui/src/RetroShare06.app*
|
||||
|
@ -1,5 +1,95 @@
|
||||
retroshare06 (0.6.1-1.XXXXXX~YYYYYY) YYYYYY; urgency=low
|
||||
|
||||
e4e3667 csoler Sat, 5 Nov 2016 17:32:40 +0100 fixed bug that caused hierarchies that contain files being hashed to not send updates when the hash is finished
|
||||
390bdfe csoler Sat, 5 Nov 2016 17:03:31 +0100 added request for sync on double click item for shared file lists
|
||||
a97fa1e csoler Sat, 5 Nov 2016 16:07:30 +0100 fixed generation of pseudo-random request ids in p3filelists
|
||||
1e919a1 csoler Sat, 5 Nov 2016 15:30:07 +0100 set delay between directory sweep to 60 secs and a-synced sweeps for different friends. Set drop time to 600 for un-answered dir sync requests
|
||||
ffcf44b csoler Fri, 4 Nov 2016 21:54:28 +0100 removing call to drand48(). RSRandom is safer
|
||||
2ef51ed csoler Fri, 4 Nov 2016 21:51:18 +0100 fixed wrong comment about RS_FILE_HINT_SEARCHABLE flag
|
||||
79632ed csoler Fri, 4 Nov 2016 21:48:58 +0100 fixed compilation on windows
|
||||
f39272a csoler Thu, 3 Nov 2016 21:44:40 +0100 fixed compilation in debug mode for p3filelists.cc
|
||||
8c1a653 csoler Fri, 4 Nov 2016 20:02:14 +0100 Merge pull request #557 from mr-alice/v0.6-FTEncryption
|
||||
2bb9a87 mr-alice Fri, 4 Nov 2016 13:52:11 +0100 merged and fixed conflict with upstream/master
|
||||
30860b8 mr-alice Fri, 4 Nov 2016 13:46:20 +0100 removed ^M that polluted unittests.pro
|
||||
45cb442 csoler Fri, 4 Nov 2016 09:47:49 +0100 Merge pull request #558 from csoler/v0.6-FileListsOptim
|
||||
2bf2465 csoler Fri, 4 Nov 2016 09:18:34 +0100 Merge pull request #498 from PhenomRetroShare/Fix_ElCapitanCompil
|
||||
8dacb22 csoler Thu, 3 Nov 2016 22:32:27 +0100 reducing linear cost of allocateNewIndex to constant. Should improve huge lags when receiving big file lists for the first time
|
||||
e324d7d mr-alice Thu, 3 Nov 2016 20:31:47 +0100 removed warning in ftserver for rejected non encrypted tunnels
|
||||
8653649 mr-alice Thu, 3 Nov 2016 20:26:35 +0100 fixed two bugs in ShareManager popup menu
|
||||
29b5bfe mr-alice Thu, 3 Nov 2016 08:50:13 +0100 attempt to fixed leading tabs
|
||||
2db8dbd Phenom Sat, 16 Jul 2016 23:10:00 +0200 Fix El Capitan OSX 10.11 Compil
|
||||
1c2cfb2 mr-alice Wed, 2 Nov 2016 21:32:14 +0100 removed debug info in ftServer
|
||||
5aef67d mr-alice Wed, 2 Nov 2016 21:31:14 +0100 fixed tooltips in ShareManager, and fixed anonymous search mechanism
|
||||
d2118c5 mr-alice Wed, 2 Nov 2016 20:51:42 +0100 supressed deadlock in ftController due to calling ftServer from ftcontroller itself
|
||||
46dd5be csoler Tue, 1 Nov 2016 16:30:46 +0100 Merge pull request #554 from hunbernd/feature/paste-RS-link
|
||||
02f442a mr-alice Tue, 1 Nov 2016 14:28:00 +0100 changed naming for files visibility
|
||||
8c7c764 mr-alice Tue, 1 Nov 2016 14:23:13 +0100 fixed conflicts in merging upstream/master to v0.6-FTEncryption
|
||||
6a3610e mr-alice Tue, 1 Nov 2016 14:13:43 +0100 disallow double tunnels (encrypted+clear) in Accepted mode, since it is not needed
|
||||
ffdac64 mr-alice Tue, 1 Nov 2016 11:57:25 +0100 fixed swarming with encrypted end-to-end tunnels
|
||||
c6df59a mr-alice Tue, 1 Nov 2016 11:11:28 +0100 fixed bug in duplication of virtual dir names
|
||||
761d595 mr-alice Tue, 1 Nov 2016 10:46:29 +0100 fixed layout and names in ShareManager and SharedFilesDialog
|
||||
3430eec mr-alice Tue, 1 Nov 2016 10:30:36 +0100 fixed display of share flags as a proper nice icon set
|
||||
8fe85b9 mr-alice Mon, 31 Oct 2016 23:24:35 +0100 improved ShareManager a little bit more
|
||||
9d586bc mr-alice Mon, 31 Oct 2016 16:28:26 +0100 made a drastic simplification pass on the ShareManager, which now only needs a single window except for selecting files using a QFileDialog
|
||||
e8e054e mr-alice Mon, 31 Oct 2016 14:26:01 +0100 addednew flag for anonymous search. Merged the two browsable flags in one single flag.
|
||||
f934e88 csoler Mon, 31 Oct 2016 12:12:40 +0100 Merge pull request #555 from hunbernd/fix/random-emoji-order
|
||||
36dc532 hunbernd Mon, 31 Oct 2016 00:23:39 +0100 Automatically detect retroshare links when pasting text
|
||||
05b5c08 hunbernd Sat, 10 Sep 2016 21:59:45 +0200 Fixed emoticon order
|
||||
5b9ef04 mr-alice Sun, 30 Oct 2016 15:33:05 +0100 improved debug output in ftserver
|
||||
def20a3 mr-alice Sun, 30 Oct 2016 15:11:22 +0100 encrypted FT works. Fixed last bugs in ftServer
|
||||
34dcb41 mr-alice Sun, 30 Oct 2016 11:36:00 +0100 fixed a few bugs in ftServer for encrypted tunnel management
|
||||
9a88161 mr-alice Sat, 29 Oct 2016 18:35:48 +0200 added record for H(H(F)) in LocalDirectoryStorage
|
||||
d843c1c mr-alice Sat, 29 Oct 2016 18:18:02 +0200 put consts behind serial_size() and serialise() in turtle items and ft items
|
||||
babc126 mr-alice Sat, 29 Oct 2016 17:59:03 +0200 added default encryption policy variable and GUI to change it
|
||||
8486346 mr-alice Wed, 26 Oct 2016 22:05:56 +0200 added new encryption/authentication format AEAD_chacha20_sha256
|
||||
c87ca67 mr-alice Wed, 26 Oct 2016 18:15:47 +0200 improved efficiency of AEAD
|
||||
88298b9 mr-alice Wed, 26 Oct 2016 14:45:21 +0200 added check for cleartext in AEAD test vector #1
|
||||
42f6f26 mr-alice Wed, 26 Oct 2016 14:36:35 +0200 fixed bug in AEAD
|
||||
7e536ef csoler Wed, 26 Oct 2016 11:35:30 +0200 Merge pull request #549 from PhenomRetroShare/Fix_PR#536
|
||||
177752e mr-alice Tue, 25 Oct 2016 23:16:36 +0200 fixed a few bugs in AEAD construction based on test results
|
||||
32e54e5 Phenom Tue, 25 Oct 2016 14:58:06 +0200 Fix PR#536 revealing of bad factor management in StyledElidedLabel.
|
||||
0570427 mr-alice Tue, 25 Oct 2016 14:09:39 +0200 added google test for chacha20 code
|
||||
0387a28 mr-alice Tue, 25 Oct 2016 00:08:27 +0200 added methods to get files from hash(hash) in directory_storage and ftServer
|
||||
5f5b0d4 csoler Mon, 24 Oct 2016 20:16:21 +0200 Merge pull request #548 from PhenomRetroShare/Fix_PR#540
|
||||
fd5a5cc Phenom Mon, 24 Oct 2016 20:11:47 +0200 Fix PR#540
|
||||
2d72b88 mr-alice Mon, 24 Oct 2016 15:59:34 +0200 added code for AEAD construction
|
||||
bd4c252 csoler Sun, 23 Oct 2016 23:30:56 +0200 Merge pull request #539 from RetroShare/md-fix
|
||||
f3bebc0 csoler Sun, 23 Oct 2016 23:29:06 +0200 Merge pull request #540 from PhenomRetroShare/Fix_EmbedInHtmlAhref
|
||||
c77d052 csoler Sun, 23 Oct 2016 23:25:53 +0200 Merge pull request #536 from PhenomRetroShare/Add_ElidedLabelToGroupTreeWidget
|
||||
04992c9 csoler Sun, 23 Oct 2016 23:15:32 +0200 Merge pull request #543 from PhenomRetroShare/Add_TooltipOnComments
|
||||
e525461 csoler Sun, 23 Oct 2016 23:14:29 +0200 Merge pull request #542 from PhenomRetroShare/Add_PasteRsLinkInTextFields
|
||||
07564c7 csoler Sun, 23 Oct 2016 23:12:22 +0200 Merge pull request #541 from PhenomRetroShare/Fix_RsLinkCopyToClipBoard
|
||||
5ccdc28 csoler Sun, 23 Oct 2016 22:51:32 +0200 Merge pull request #547 from hunbernd/fix/upload
|
||||
54ba617 hunbernd Sun, 23 Oct 2016 20:42:59 +0200 Fix: unable to upload files on Windows Caused by multiple unneeded / character in file path.
|
||||
46cf25d Phenom Sat, 22 Oct 2016 15:17:49 +0200 Fix Copy RsLink in Clipboard.
|
||||
a67cf92 Phenom Sat, 22 Oct 2016 16:15:29 +0200 Add Tooltip on comments column to see too long text.
|
||||
9eafdd3 Phenom Sat, 22 Oct 2016 16:02:38 +0200 Add ability to past RsLink in some more text fields.
|
||||
58a4d39 Phenom Sat, 22 Oct 2016 14:48:23 +0200 Fix handle of url in EmbedInHtmlAhref.
|
||||
f20ee21 cave Fri, 21 Oct 2016 19:56:02 +0200 Update README.md
|
||||
9d32406 mr-alice Wed, 19 Oct 2016 22:49:51 +0200 added ft decryption routine
|
||||
3ad0a81 mr-alice Wed, 19 Oct 2016 21:30:37 +0200 added encryption routine for FT
|
||||
b8b78dd csoler Wed, 19 Oct 2016 15:50:22 +0200 Merge pull request #538 from Hopetech/master
|
||||
ecaea05 hopetech Wed, 19 Oct 2016 15:41:25 +0200 Fix some compilation warnings
|
||||
8483c0d Phenom Sun, 16 Oct 2016 15:48:50 +0200 Add ElidedLabel to GroupTreeWidget
|
||||
997154f mr-alice Thu, 13 Oct 2016 15:13:56 +0200 added preliminary implementation of chacha20/poly1305
|
||||
0e1fad0 csoler Thu, 13 Oct 2016 13:48:32 +0200 Merge pull request #533 from PhenomRetroShare/Fix_MissingDesktopFileShow
|
||||
4db6d6b Phenom Thu, 13 Oct 2016 13:26:44 +0200 Fix the "Desktop file is missing" shown in option page.
|
||||
64129a7 csoler Thu, 13 Oct 2016 10:05:14 +0200 Merge pull request #532 from G10h4ck/less_warning
|
||||
8de0548 Gio Thu, 13 Oct 2016 00:09:53 +0200 Merge branch 'master' into less_warning
|
||||
633a6cf Gio Wed, 12 Oct 2016 20:43:38 +0200 Fixed a bunch of warnings in safe ways
|
||||
10c269e csoler Wed, 12 Oct 2016 23:31:32 +0200 removed warning when friend directory list cannot be found
|
||||
bd9a464 csoler Wed, 12 Oct 2016 23:20:38 +0200 added deterministic but unredictable hash generation for dir hashes, which should be preserved accross reboots. Should fix the msg from friends sending requests for the "wrong" dir hashes.
|
||||
3c5e12a csoler Mon, 10 Oct 2016 11:29:03 +0200 fixed compilation on windows
|
||||
4e48005 csoler Sun, 9 Oct 2016 21:43:00 +0200 replaced explicit old code in cleanupDirectory() by new code based on FolderIterator
|
||||
957d48b csoler Sun, 9 Oct 2016 21:03:01 +0200 removed folderIterator::d_name() because it duplicates file_name()
|
||||
32816ed csoler Sun, 9 Oct 2016 18:23:25 +0200 Merge pull request #531 from PhenomRetroShare/Fix_AvatarOnEditCircle
|
||||
6e8e5d0 csoler Sun, 9 Oct 2016 18:20:00 +0200 Merge pull request #529 from cavebeat/rus_patch
|
||||
3d9fb60 Phenom Sun, 9 Oct 2016 12:37:09 +0200 Fix Missing ID-Avatars in Create Circle Menu
|
||||
|
||||
-- Cyril Soler <csoler@users.sourceforge.net> Sat, 5 Nov 2016 21:00:00 +0100
|
||||
|
||||
retroshare06 (0.6.1-1.20161008.9e1f21b9~xenial) xenial; urgency=low
|
||||
|
||||
9a3eb1c csoler Sat, 8 Oct 2016 14:30:58 +0200 Merge pull request #528 from sehraf/pr-drop-ssh-protobuf
|
||||
c55fb0d csoler Sat, 8 Oct 2016 14:11:43 +0200 Merge pull request #524 from cavebeat/compile
|
||||
97f2589 csoler Sat, 8 Oct 2016 14:09:34 +0200 Merge pull request #513 from grennvyper/patch-1
|
||||
|
44
build_scripts/Debian+Ubuntu/control.yakkety
Normal file
44
build_scripts/Debian+Ubuntu/control.yakkety
Normal file
@ -0,0 +1,44 @@
|
||||
Source: retroshare06
|
||||
Section: devel
|
||||
Priority: standard
|
||||
Maintainer: Cyril Soler <csoler@users.sourceforge.net>
|
||||
Build-Depends: debhelper (>= 7), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: http://retroshare.sourceforge.net
|
||||
|
||||
Package: retroshare06-voip-plugin
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare06, libspeex1, libspeexdsp1, libqt5multimedia5
|
||||
Description: RetroShare VOIP plugin
|
||||
This package provides a plugin for RetroShare, a secured Friend-to-Friend communication
|
||||
plateform. The plugin adds voice-over-IP functionality to the private chat window. Both
|
||||
friends chatting together need the plugin installed to be able to talk together.
|
||||
|
||||
Package: retroshare06-feedreader-plugin
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare06
|
||||
Description: RetroShare FeedReader plugin
|
||||
This package provides a plugin for RetroShare, a secured Friend-to-Friend communication
|
||||
plateform. The plugin adds a RSS feed reader tab to retroshare.
|
||||
|
||||
Package: retroshare06-nogui
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring
|
||||
Conflicts: retroshare06
|
||||
Description: Secure communication with friends
|
||||
This is the command-line client for RetroShare network. This client
|
||||
can be contacted and talked-to using SSL. Clients exist for portable
|
||||
devices running e.g. Android.
|
||||
|
||||
Package: retroshare06
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring
|
||||
Conflicts: retroshare06-nogui
|
||||
Description: Secure communication with friends
|
||||
RetroShare is a Open Source cross-platform, private and secure decentralised
|
||||
commmunication platform. It lets you to securely chat and share files with your
|
||||
friends and family, using a web-of-trust to authenticate peers and OpenSSL to
|
||||
encrypt all communication. RetroShare provides filesharing, chat, messages,
|
||||
forums and channels.
|
||||
|
||||
|
@ -135,6 +135,8 @@ for i in ${dist}; do
|
||||
cp ../control.precise debian/control
|
||||
elif test "${i}" = "xenial" ; then
|
||||
cp ../control.xenial debian/control
|
||||
elif test "${i}" = "yakkety" ; then
|
||||
cp ../control.yakkety debian/control
|
||||
elif test "${i}" = "stretch" ; then
|
||||
cp ../control.${i} debian/control
|
||||
elif test "${i}" = "jessie" ; then
|
||||
|
@ -25,13 +25,13 @@ if errorlevel 1 goto error_env
|
||||
|
||||
:: Check MSYS environment
|
||||
set MSYSSH=%EnvMSYSPath%\msys\1.0\bin\sh.exe
|
||||
if not exist "%MSYSSH%" echo Please install MSYS first.& exit /B 1
|
||||
if not exist "%MSYSSH%" %cecho% error "Please install MSYS first." & exit /B 1
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
call "%ToolsPath%\msys-path.bat" "%CurPath%" MSYSCurPath
|
||||
call "%ToolsPath%\msys-path.bat" "%~dp0" MSYSCurPath
|
||||
call "%ToolsPath%\msys-path.bat" "%BuildLibsPath%" MSYSBuildLibsPath
|
||||
|
||||
if not exist "%BuildLibsPath%" mkdir "%BuildLibsPath%"
|
@ -1,13 +1,11 @@
|
||||
set CurPath=%~dp0
|
||||
|
||||
:: Check MinGW environment
|
||||
set MinGWPath=
|
||||
call "%ToolsPath%\find-in-path.bat" MinGWPath gcc.exe
|
||||
if "%MinGWPath%"=="" echo Please run command in the Qt Command Prompt or add the path to MinGW bin folder to PATH variable.& exit /B 1
|
||||
if "%MinGWPath%"=="" %cecho% error "Please run command in the Qt Command Prompt or add the path to MinGW bin folder to PATH variable." & exit /B 1
|
||||
|
||||
:: Get gcc versions
|
||||
call "%ToolsPath%\get-gcc-version.bat" GCCVersion
|
||||
if "%GCCVersion%"=="" echo Cannot get gcc version.& exit /B 1
|
||||
if "%GCCVersion%"=="" %cecho% error "Cannot get gcc version." & exit /B 1
|
||||
|
||||
set BuildLibsPath=%EnvRootPath%\build-libs\gcc-%GCCVersion%
|
||||
|
31
build_scripts/Windows/build.bat
Normal file
31
build_scripts/Windows/build.bat
Normal file
@ -0,0 +1,31 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
%cecho% info "Build libraries"
|
||||
call "%~dp0build-libs\build-libs.bat" auto-copy
|
||||
if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build %SourceName%"
|
||||
call "%~dp0build\build.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Pack %SourceName%"
|
||||
call "%~dp0build\pack.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL%
|
||||
|
||||
%cecho% info "Build installer"
|
||||
call "%~dp0build\build-installer.bat"
|
||||
if errorlevel 1 %cecho% error "Failed to build installer." & exit /B %ERRORLEVEL%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
@ -1,4 +1,3 @@
|
||||
set CurPath=%~dp0
|
||||
set BuildPath=%EnvRootPath%\builds
|
||||
set DeployPath=%EnvRootPath%\deploy
|
||||
|
||||
|
@ -169,7 +169,7 @@ if exist "%SourcePath%\libresapi\src\webui" (
|
||||
rem pack files
|
||||
title Pack - %SourceName%-%RsBuildConfig% [pack files]
|
||||
|
||||
"%SevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*"
|
||||
"%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*"
|
||||
|
||||
title %COMSPEC%
|
||||
|
||||
|
3
build_scripts/Windows/env/env-msys.bat
vendored
3
build_scripts/Windows/env/env-msys.bat
vendored
@ -1,5 +1,5 @@
|
||||
:: Usage:
|
||||
:: call find-in-path.bat [reinstall|clean]
|
||||
:: call env-msys.bat [reinstall|clean]
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
@ -12,5 +12,4 @@ exit /B %ERRORLEVEL%
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
endlocal
|
||||
exit /B 1
|
||||
|
23
build_scripts/Windows/env/env-qt.bat
vendored
Normal file
23
build_scripts/Windows/env/env-qt.bat
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
:: Usage:
|
||||
:: call env-qt4.bat version [reinstall|clean]
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
set EnvQtBasePath=%EnvRootPath%\qt
|
||||
|
||||
:: Create folders
|
||||
if not exist "%EnvQtBasePath%" mkdir "%EnvQtBasePath%"
|
||||
|
||||
call "%~dp0tools\prepare-qt.bat" %1 %2
|
||||
if errorlevel 1 exit /B %ERRORLEVEL%
|
||||
|
||||
if "%MinGWDir%" NEQ "" set PATH=%MinGWDir%\bin;%PATH%
|
||||
if "%QtDir%" NEQ "" set PATH=%QtDir%\bin;%PATH%
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
exit /B 1
|
6
build_scripts/Windows/env/env.bat
vendored
6
build_scripts/Windows/env/env.bat
vendored
@ -7,13 +7,16 @@ set EnvToolsPath=%EnvRootPath%\tools
|
||||
set EnvTempPath=%EnvRootPath%\tmp
|
||||
set EnvDownloadPath=%EnvRootPath%\download
|
||||
|
||||
set EnvCurlExe=%EnvToolsPath%\curl.exe
|
||||
::set EnvCurlExe=%EnvToolsPath%\curl.exe
|
||||
set EnvWgetExe=%EnvToolsPath%\wget.exe
|
||||
set EnvSevenZipExe=%EnvToolsPath%\7z.exe
|
||||
set EnvJomExe=%EnvToolsPath%\jom.exe
|
||||
set EnvSedExe=%EnvToolsPath%\sed.exe
|
||||
set EnvCutExe=%EnvToolsPath%\cut.exe
|
||||
set EnvDependsExe=%EnvToolsPath%\depends.exe
|
||||
set EnvMakeNSISExe=%EnvToolsPath%\NSIS\makensis.exe
|
||||
set EnvCEchoExe=%EnvToolsPath%\cecho.exe
|
||||
set cecho=call "%ToolsPath%\cecho.bat"
|
||||
|
||||
:: Create folders
|
||||
if not exist "%EnvRootPath%" mkdir "%EnvRootPath%"
|
||||
@ -25,5 +28,4 @@ exit /B %ERRORLEVEL%
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
endlocal
|
||||
exit /B 1
|
||||
|
33
build_scripts/Windows/env/tools/prepare-msys.bat
vendored
33
build_scripts/Windows/env/tools/prepare-msys.bat
vendored
@ -9,7 +9,7 @@ if not exist "%EnvRootPath%"=="" exit /B 1
|
||||
copy "%~dp0root\update-msys.bat" "%EnvRootPath%" >nul
|
||||
|
||||
if "%~1"=="clean" (
|
||||
echo Clean MSYS
|
||||
%cecho% info "Clean MSYS"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvMSYSPath%"
|
||||
goto exit
|
||||
)
|
||||
@ -24,23 +24,25 @@ if exist "%EnvMSYSPath%\bin\mingw-get.exe" (
|
||||
)
|
||||
|
||||
set MSYSInstall=mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip
|
||||
set MSYSUrl=http://sourceforge.net/projects/mingw/files/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/%MSYSInstall%/download
|
||||
set CMakeInstall=cmake-3.1.0-win32-x86.zip
|
||||
set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall%
|
||||
set CMakeUnpackPath=%EnvMSYSPath%\msys\1.0
|
||||
|
||||
echo Remove previous MSYS version
|
||||
%cecho% info "Remove previous MSYS version"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvMSYSPath%"
|
||||
|
||||
echo Download installation files
|
||||
if not exist "%EnvDownloadPath%\%MSYSInstall%" "%EnvCurlExe%" -L -k http://sourceforge.net/projects/mingw/files/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/%MSYSInstall%/download -o "%EnvDownloadPath%\%MSYSInstall%"
|
||||
if not exist "%EnvDownloadPath%%\MSYSInstall%" echo Cannot download MSYS& goto error
|
||||
%cecho% info "Download installation files"
|
||||
if not exist "%EnvDownloadPath%\%MSYSInstall%" call "%ToolsPath%\download-file.bat" "%MSYSUrl%" "%EnvDownloadPath%\%MSYSInstall%"
|
||||
if not exist "%EnvDownloadPath%\%MSYSInstall%" %cecho% error "Cannot download MSYS" & goto error
|
||||
|
||||
if not exist "%EnvDownloadPath%\%CMakeInstall%" "%EnvCurlExe%" -L -k http://www.cmake.org/files/v3.1/cmake-3.1.0-win32-x86.zip -o "%EnvDownloadPath%\%CMakeInstall%"
|
||||
if not exist "%EnvDownloadPath%\%CMakeInstall%" echo Cannot download CMake& goto error
|
||||
if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\download-file.bat" "%CMakeUrl%" "%EnvDownloadPath%\%CMakeInstall%"
|
||||
if not exist "%EnvDownloadPath%\%CMakeInstall%" %cecho% error "Cannot download CMake" & goto error
|
||||
|
||||
echo Unpack MSYS
|
||||
%cecho% info "Unpack MSYS"
|
||||
"%EnvSevenZipExe%" x -o"%EnvMSYSPath%" "%EnvDownloadPath%\%MSYSInstall%"
|
||||
|
||||
echo Install MSYS
|
||||
%cecho% info "Install MSYS"
|
||||
if not exist "%EnvMSYSPath%\var\lib\mingw-get\data\profile.xml" copy "%EnvMSYSPath%\var\lib\mingw-get\data\defaults.xml" "%EnvMSYSPath%\var\lib\mingw-get\data\profile.xml"
|
||||
pushd "%EnvMSYSPath%\bin"
|
||||
mingw-get.exe install mingw32-mingw-get
|
||||
@ -53,14 +55,14 @@ mingw-get.exe install msys-mktemp
|
||||
mingw-get.exe install msys-wget
|
||||
popd
|
||||
|
||||
echo Unpack CMake
|
||||
%cecho% info "Unpack CMake"
|
||||
"%EnvSevenZipExe%" x -o"%CMakeUnpackPath%" "%EnvDownloadPath%\%CMakeInstall%"
|
||||
|
||||
echo Install CMake
|
||||
%cecho% info "Install CMake"
|
||||
set CMakeVersion=
|
||||
for /D %%F in (%CMakeUnpackPath%\cmake*) do set CMakeVersion=%%~nxF
|
||||
if "%CMakeVersion%"=="" echo CMake version not found.& goto :exit
|
||||
echo Found CMake version %CMakeVersion%
|
||||
if "%CMakeVersion%"=="" %cecho% error "CMake version not found." & goto :exit
|
||||
%cecho% info "Found CMake version %CMakeVersion%"
|
||||
|
||||
set FoundProfile=
|
||||
for /f "tokens=3" %%F in ('find /c /i "%CMakeVersion%" "%EnvMSYSPath%\msys\1.0\etc\profile"') do set FoundProfile=%%F
|
||||
@ -76,8 +78,3 @@ exit /B 0
|
||||
:error
|
||||
endlocal
|
||||
exit /B 1
|
||||
|
||||
:error_vars
|
||||
echo Failed to initialize variables.
|
||||
endlocal
|
||||
exit /B 1
|
||||
|
204
build_scripts/Windows/env/tools/prepare-qt.bat
vendored
Normal file
204
build_scripts/Windows/env/tools/prepare-qt.bat
vendored
Normal file
@ -0,0 +1,204 @@
|
||||
:: Usage:
|
||||
:: call prepare-qt.bat version [reinstall|clean]
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
if "%EnvQtBasePath%"=="" exit /B 1
|
||||
if not exist "%EnvRootPath%"=="" exit /B 1
|
||||
|
||||
set EnvQtVersion=%~1
|
||||
if "%EnvQtVersion%"=="" (
|
||||
%cecho% error "Please specify Qt version"
|
||||
goto error
|
||||
)
|
||||
|
||||
for /f "tokens=1,2 delims=." %%A in ("%EnvQtVersion%") do set EnvQtMainVersion=%%A& set EnvQtBaseVersion=%%A.%%B
|
||||
set EnvQtPath=%EnvQtBasePath%\%EnvQtVersion%
|
||||
|
||||
if "%~2"=="clean" (
|
||||
%cecho% info "Clean Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%"
|
||||
goto exit
|
||||
)
|
||||
|
||||
set CheckQmakeExe=
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
set CheckQmakeExe=%EnvQtPath%\Qt\bin\qmake.exe
|
||||
) else (
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%"
|
||||
if "!EnvQtMinGWVersion!" NEQ "" (
|
||||
set CheckQmakeExe=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion!\bin\qmake.exe
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if "%CheckQmakeExe%" NEQ "" (
|
||||
if exist "%CheckQmakeExe%" (
|
||||
if "%~2"=="reinstall" (
|
||||
choice /M "Found existing Qt %EnvQtVersion% version. Do you want to proceed?"
|
||||
if !ERRORLEVEL!==2 goto exit
|
||||
) else (
|
||||
goto exit
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
set QtInstall=qt-opensource-windows-x86-mingw-%EnvQtVersion%.exe
|
||||
set QtInstallWildcard=qt-opensource-windows-x86-mingw*-%EnvQtVersion%.exe
|
||||
set QtUrl=http://download.qt.io/official_releases/qt/%EnvQtBaseVersion%/%EnvQtVersion%
|
||||
|
||||
%cecho% info "Remove previous Qt %EnvQtVersion% version"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%"
|
||||
|
||||
%cecho% info "Download Qt installation files"
|
||||
if not exist "%EnvDownloadPath%\%QtInstall%" (
|
||||
call "%ToolsPath%\download-file-wildcard.bat" "%QtUrl%" "%QtInstallWildcard%" "%EnvDownloadPath%" QtInstallDownload
|
||||
if "!QtInstallDownload!"=="" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error
|
||||
ren "%EnvDownloadPath%\!QtInstallDownload!" "%QtInstall%"
|
||||
)
|
||||
if not exist "%EnvDownloadPath%\%QtInstall%" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error
|
||||
|
||||
mkdir "%EnvQtPath%"
|
||||
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
rem Qt 4
|
||||
goto install_qt4
|
||||
)
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
rem Qt >= 5
|
||||
goto install_qt5
|
||||
)
|
||||
|
||||
%cecho% error "Unknown Qt version %EnvQtVersion%"
|
||||
|
||||
:error
|
||||
endlocal & set QtDir=& set MinGWDir=
|
||||
exit /B 1
|
||||
|
||||
:exit
|
||||
set QtDir=
|
||||
set MinGWDir=
|
||||
|
||||
if "%EnvQtMainVersion%"=="4" (
|
||||
rem Qt 4
|
||||
set QtDir=%EnvQtBasePath%\%EnvQtVersion%\Qt
|
||||
set MinGWDir=%EnvQtBasePath%\%EnvQtVersion%\mingw32
|
||||
) else (
|
||||
if "%EnvQtMainVersion%" GEQ "5" (
|
||||
call :get_mingw_version EnvQtToolsMinGWVersion "%EnvQtPath%\Tools"
|
||||
|
||||
set QtDir=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion!
|
||||
set MinGWDir=%EnvQtPath%\Tools\!EnvQtToolsMinGWVersion!
|
||||
)
|
||||
)
|
||||
|
||||
endlocal & set QtDir=%QtDir%& set MinGWDir=%MinGWDir%
|
||||
exit /B 0
|
||||
|
||||
:get_mingw_version
|
||||
setlocal enabledelayedexpansion
|
||||
set Variable=%~1
|
||||
set Result=
|
||||
|
||||
for /D %%A in (%~2\*) do set Name=%%~nA& if "!Name:~0,5!"=="mingw" set Result=!Name!
|
||||
endlocal & set %Variable%=%Result%
|
||||
goto :EOF
|
||||
|
||||
:replace
|
||||
set InFile=%~1
|
||||
set InFileName=%~nx1
|
||||
set OutFile=%~1.tmp
|
||||
set SearchText=%~2
|
||||
set ReplaceText=%~3
|
||||
|
||||
if exist "%OutFile%" del /Q "%OutFile%"
|
||||
|
||||
for /f "tokens=1* delims=]" %%A in ('find /n /v ""^<%InFile%') do (
|
||||
set string=%%B
|
||||
|
||||
if "!string!"=="" (
|
||||
echo.>>%OutFile%
|
||||
) else (
|
||||
set modified=!string:%SearchText%=%ReplaceText%!
|
||||
echo !modified!>> %OutFile%
|
||||
)
|
||||
)
|
||||
del "%InFile%"
|
||||
rename "%OutFile%" "%InFileName%"
|
||||
goto :EOF
|
||||
|
||||
:install_qt4
|
||||
set MinGWInstall=i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z
|
||||
set MinGWUrl=http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/4.8.2/threads-posix/dwarf/%MinGWInstall%/download
|
||||
|
||||
%cecho% info "Download MinGW installation files"
|
||||
if not exist "%EnvDownloadPath%\%MinGWInstall%" call "%ToolsPath%\download-file.bat" "%MinGWUrl%" "%EnvDownloadPath%\%MinGWInstall%"
|
||||
if not exist "%EnvDownloadPath%\%MinGWInstall%" %cecho% error "Cannot download MinGW" & goto error
|
||||
|
||||
%cecho% info "Unpack Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstall%" $_14_
|
||||
move "%EnvTempPath%\$_14_" "%EnvQtPath%\Qt"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
%cecho% info "Unpack MinGW"
|
||||
"%EnvSevenZipExe%" x -o"%EnvQtPath%" "%EnvDownloadPath%\%MinGWInstall%"
|
||||
|
||||
echo Prepare Qt %EnvQtVersion%
|
||||
echo [Paths]>"%EnvQtPath%\Qt\bin\qt.conf"
|
||||
echo Prefix=..>>"%EnvQtPath%\Qt\bin\qt.conf"
|
||||
|
||||
goto exit
|
||||
|
||||
:install_qt5
|
||||
set EnvQtInstallerFrameworkVersion=2.0.3
|
||||
|
||||
set QtInstallerFrameworkInstall=QtInstallerFramework-%EnvQtInstallerFrameworkVersion%-win-x86.exe
|
||||
set QtInstallerFrameworkUrl=http://download.qt.io/official_releases/qt-installer-framework/%EnvQtInstallerFrameworkVersion%/QtInstallerFramework-win-x86.exe
|
||||
|
||||
%cecho% info "Download QtInstallerFramework installation files"
|
||||
if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" call "%ToolsPath%\download-file.bat" "%QtInstallerFrameworkUrl%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%"
|
||||
if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" %cecho% error "Cannot download Qt Installer Framework %EnvQtInstallerFrameworkVersion%" & goto error
|
||||
|
||||
%cecho% info "Unpack Qt Installer Framework"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" bin\devtool.exe
|
||||
move "%EnvTempPath%\bin\devtool.exe" "%EnvQtPath%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
%cecho% info "Unpack Qt %EnvQtVersion%"
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
"%EnvQtPath%\devtool.exe" "%EnvDownloadPath%\%QtInstall%" --dump "%EnvTempPath%"
|
||||
|
||||
pushd "%EnvTempPath%"
|
||||
del /S *vcredist*.7z
|
||||
del /S *qtcreator*.7z
|
||||
del /S *1installer-changelog.7z
|
||||
for /R %%F in (*.7z) do "%EnvSevenZipExe%" x -y -o"%EnvQtPath%" "%%F"
|
||||
popd
|
||||
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%"
|
||||
|
||||
%cecho% info "Prepare Qt %EnvQtVersion%"
|
||||
echo [Paths]>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Documentation=../../Docs/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Examples=../../Examples/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
echo Prefix=..>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf"
|
||||
|
||||
call :replace "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\mkspecs\qconfig.pri" "Enterprise" "OpenSource"
|
||||
|
||||
for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.pc) do (
|
||||
call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%"
|
||||
call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%"
|
||||
)
|
||||
for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.prl) do (
|
||||
call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%"
|
||||
call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%"
|
||||
)
|
||||
goto exit
|
@ -2,10 +2,14 @@ setlocal
|
||||
|
||||
if "%EnvRootPath%"=="" exit /B 1
|
||||
|
||||
set CEchoUrl=https://github.com/lordmulder/cecho/releases/download/2015-10-10/cecho.2015-10-10.zip
|
||||
set CEchoInstall=cecho.2015-10-10.zip
|
||||
set SevenZipUrl=http://7-zip.org/a/7z1602.msi
|
||||
set SevenZipInstall=7z1602.msi
|
||||
set CurlUrl=https://bintray.com/artifact/download/vszakats/generic/curl-7.50.1-win32-mingw.7z
|
||||
set CurlInstall=curl-7.50.1-win32-mingw.7z
|
||||
::set CurlUrl=https://bintray.com/artifact/download/vszakats/generic/curl-7.50.1-win32-mingw.7z
|
||||
::set CurlInstall=curl-7.50.1-win32-mingw.7z
|
||||
set WgetUrl=https://eternallybored.org/misc/wget/current/wget.exe
|
||||
set WgetInstall=wget.exe
|
||||
set JomUrl=http://download.qt.io/official_releases/jom/jom.zip
|
||||
set JomInstall=jom.zip
|
||||
set DependsUrl=http://www.dependencywalker.com/depends22_x86.zip
|
||||
@ -33,32 +37,58 @@ if not exist "%EnvToolsPath%\7z.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
)
|
||||
|
||||
if not exist "%EnvToolsPath%\curl.exe" (
|
||||
if not exist "%EnvToolsPath%\cecho.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
echo Download Curl installation
|
||||
echo Download cecho installation
|
||||
|
||||
if not exist "%EnvDownloadPath%\%CurlInstall%" call "%ToolsPath%\winhttpjs.bat" %CurlUrl% -saveTo "%EnvDownloadPath%\%CurlInstall%"
|
||||
if not exist "%EnvDownloadPath%\%CurlInstall%" echo Cannot download Curl installation& goto error
|
||||
if not exist "%EnvDownloadPath%\%CEchoInstall%" call "%ToolsPath%\winhttpjs.bat" "%CEchoUrl%" -saveTo "%EnvDownloadPath%\%CEchoInstall%"
|
||||
if not exist "%EnvDownloadPath%\%cCEhoInstall%" echo Cannot download cecho installation& goto error
|
||||
|
||||
echo Unpack Curl
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CurlInstall%"
|
||||
copy "%EnvTempPath%\curl-7.50.1-win32-mingw\bin\curl.exe" "%EnvToolsPath%"
|
||||
echo Unpack cecho
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CEchoInstall%"
|
||||
copy "%EnvTempPath%\cecho.exe" "%EnvToolsPath%"
|
||||
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
)
|
||||
|
||||
::if not exist "%EnvToolsPath%\curl.exe" (
|
||||
:: call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
:: mkdir "%EnvTempPath%"
|
||||
::
|
||||
:: echo Download Curl installation
|
||||
::
|
||||
:: if not exist "%EnvDownloadPath%\%CurlInstall%" call "%ToolsPath%\winhttpjs.bat" %CurlUrl% -saveTo "%EnvDownloadPath%\%CurlInstall%"
|
||||
:: if not exist "%EnvDownloadPath%\%CurlInstall%" echo Cannot download Curl installation& goto error
|
||||
::
|
||||
:: echo Unpack Curl
|
||||
:: "%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CurlInstall%"
|
||||
:: copy "%EnvTempPath%\curl-7.50.1-win32-mingw\bin\curl.exe" "%EnvToolsPath%"
|
||||
::
|
||||
:: call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
::)
|
||||
|
||||
if not exist "%EnvToolsPath%\wget.exe" (
|
||||
%cecho% info "Download Wget installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%WgetInstall%" call "%ToolsPath%\winhttpjs.bat" %WgetUrl% -saveTo "%EnvDownloadPath%\%WgetInstall%"
|
||||
if not exist "%EnvDownloadPath%\%WgetInstall%" %cecho% error "Cannot download Wget installation" & goto error
|
||||
|
||||
%cecho% info "Copy Wget"
|
||||
copy "%EnvDownloadPath%\wget.exe" "%EnvToolsPath%"
|
||||
)
|
||||
|
||||
if not exist "%EnvToolsPath%\jom.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
echo Download jom installation
|
||||
%cecho% info "Download jom installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%JomInstall%" call "%ToolsPath%\winhttpjs.bat" %JomUrl% -saveTo "%EnvDownloadPath%\%JomInstall%"
|
||||
if not exist "%EnvDownloadPath%\%JomInstall%" echo Cannot download jom installation& goto error
|
||||
if not exist "%EnvDownloadPath%\%JomInstall%" %cecho% error "Cannot download jom installation" & goto error
|
||||
|
||||
echo Unpack jom
|
||||
%cecho% info "Unpack jom"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%JomInstall%"
|
||||
copy "%EnvTempPath%\jom.exe" "%EnvToolsPath%"
|
||||
|
||||
@ -69,12 +99,12 @@ if not exist "%EnvToolsPath%\depends.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
echo Download Dependency Walker installation
|
||||
%cecho% info "Download Dependency Walker installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%DependsInstall%" call "%ToolsPath%\winhttpjs.bat" %DependsUrl% -saveTo "%EnvDownloadPath%\%DependsInstall%"
|
||||
if not exist "%EnvDownloadPath%\%DependsInstall%" echo Cannot download Dependendy Walker installation& goto error
|
||||
if not exist "%EnvDownloadPath%\%DependsInstall%" %cecho% error "Cannot download Dependendy Walker installation" & goto error
|
||||
|
||||
echo Unpack Dependency Walker
|
||||
%cecho% info "Unpack Dependency Walker"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%DependsInstall%"
|
||||
copy "%EnvTempPath%\*" "%EnvToolsPath%"
|
||||
|
||||
@ -85,12 +115,12 @@ if not exist "%EnvToolsPath%\cut.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
echo Download Unix Tools installation
|
||||
%cecho% info "Download Unix Tools installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\winhttpjs.bat" %UnixToolsUrl% -saveTo "%EnvDownloadPath%\%UnixToolsInstall%"
|
||||
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" echo Cannot download unix Tools installation& goto error
|
||||
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error ""Cannot download Unix Tools installation" & goto error
|
||||
|
||||
echo Unpack Unix Tools
|
||||
%cecho% info "Unpack Unix Tools"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%"
|
||||
copy "%EnvTempPath%\cut.exe" "%EnvToolsPath%"
|
||||
|
||||
@ -101,12 +131,12 @@ if not exist "%EnvToolsPath%\sed.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
echo Download Unix Tools installation
|
||||
%cecho% info "Download Unix Tools installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\winhttpjs.bat" %UnixToolsUrl% -saveTo "%EnvDownloadPath%\%UnixToolsInstall%"
|
||||
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" echo Cannot download Unix Tools installation& goto error
|
||||
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error ""Cannot download Unix Tools installation" & goto error
|
||||
|
||||
echo Unpack Unix Tools
|
||||
%cecho% info "Unpack Unix Tools"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%"
|
||||
copy "%EnvTempPath%\sed.exe" "%EnvToolsPath%"
|
||||
|
||||
@ -117,12 +147,12 @@ if not exist "%EnvToolsPath%\NSIS\nsis.exe" (
|
||||
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
echo Download NSIS installation
|
||||
%cecho% info "Download NSIS installation"
|
||||
|
||||
if not exist "%EnvDownloadPath%\%NSISInstall%" "%EnvCurlExe%" -L -k %NSISUrl% -o "%EnvDownloadPath%\%NSISInstall%"
|
||||
if not exist "%EnvDownloadPath%\%NSISInstall%" echo Cannot download NSIS installation& goto error
|
||||
if not exist "%EnvDownloadPath%\%NSISInstall%" call "%ToolsPath%\download-file.bat" "%NSISUrl%" "%EnvDownloadPath%\%NSISInstall%"
|
||||
if not exist "%EnvDownloadPath%\%NSISInstall%" %cecho% error "Cannot download NSIS installation" & goto error
|
||||
|
||||
echo Unpack NSIS
|
||||
%cecho% info "Unpack NSIS"
|
||||
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%NSISInstall%"
|
||||
if not exist "%NSISInstallPath%" mkdir "%NSISInstallPath%"
|
||||
xcopy /s "%EnvTempPath%" "%NSISInstallPath%"
|
||||
|
27
build_scripts/Windows/qt-cmd.bat
Normal file
27
build_scripts/Windows/qt-cmd.bat
Normal file
@ -0,0 +1,27 @@
|
||||
:: Usage:
|
||||
:: call qt-cmd.bat <Qt version> [command]
|
||||
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
set QtVersion=%~1
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env-qt.bat" %QtVersion%
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
if "%~2"=="" (
|
||||
"%ComSpec%"
|
||||
) else (
|
||||
"%ComSpec%" /c %2 %3 %4 %5 %6 %7 %8 %9
|
||||
)
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
endlocal
|
||||
exit /B 1
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
if [ $# -le 0 ]
|
||||
then
|
||||
echo usage $0 directory
|
||||
exit
|
||||
fi
|
||||
|
||||
echo find $1 -name .svn
|
||||
rm -vrf `find $1 -name .svn`
|
||||
|
6
build_scripts/Windows/tools/cecho.bat
Normal file
6
build_scripts/Windows/tools/cecho.bat
Normal file
@ -0,0 +1,6 @@
|
||||
:: Usage:
|
||||
:: call cecho.bat [info|error|std] "text"
|
||||
|
||||
if "%~1"=="std" echo %~2
|
||||
if "%~1"=="info" "%EnvCEchoExe%" green "%~2"
|
||||
if "%~1"=="error" "%EnvCEchoExe%" red "%~2"
|
46
build_scripts/Windows/tools/download-file-wildcard.bat.bat
Normal file
46
build_scripts/Windows/tools/download-file-wildcard.bat.bat
Normal file
@ -0,0 +1,46 @@
|
||||
:: Usage:
|
||||
:: call download-file-wildcard.bat url file-wildcard download-path variable
|
||||
|
||||
if "%~4"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if "%EnvTempPath%"=="" (
|
||||
echo.
|
||||
echo Environment error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
setlocal
|
||||
|
||||
set Url=%~1
|
||||
set FileWildcard=%~2
|
||||
set DownloadPath=%~3
|
||||
set Var=%~4
|
||||
set File=
|
||||
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
mkdir "%EnvTempPath%"
|
||||
|
||||
"%EnvWgetExe%" --recursive --continue --no-directories --no-parent -A "%FileWildcard%" --directory-prefix="%EnvTempPath%" "%Url%"
|
||||
|
||||
if errorlevel 1 (
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
endlocal & set %Var%=
|
||||
exit /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
for %%A in (%EnvTempPath%\%FileWildcard%) do set File=%%~nxA
|
||||
if "%File%"=="" (
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
endlocal & set %Var%=
|
||||
exit /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
move "%EnvTempPath%\%File%" "%DownloadPath%"
|
||||
call "%~dp0remove-dir.bat" "%EnvTempPath%"
|
||||
|
||||
endlocal & set %Var%=%File%
|
||||
exit /B 0
|
13
build_scripts/Windows/tools/download-file.bat
Normal file
13
build_scripts/Windows/tools/download-file.bat
Normal file
@ -0,0 +1,13 @@
|
||||
:: Usage:
|
||||
:: call download-file.bat url file
|
||||
|
||||
if "%~2"=="" (
|
||||
echo.
|
||||
echo Parameter error.
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
::"%EnvCurlExe%" -L -k "%~1" -o "%~2"
|
||||
"%EnvWgetExe%" --continue "%~1" --output-document="%~2"
|
||||
|
||||
exit /B %ERRORLEVEL%
|
@ -113,7 +113,8 @@ libresapihttpserver {
|
||||
} else {
|
||||
mac {
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
for(lib, LIB_DIR):exists($$lib/libmicrohttpd.a){ LIBS *= $$lib/libmicrohttpd.a}
|
||||
#for(lib, LIB_DIR):exists($$lib/libmicrohttpd.a){ LIBS *= $$lib/libmicrohttpd.a}
|
||||
LIBS *= -lmicrohttpd
|
||||
} else {
|
||||
LIBS *= -lmicrohttpd
|
||||
}
|
||||
|
1242
libretroshare/src/crypto/chacha20.cpp
Normal file
1242
libretroshare/src/crypto/chacha20.cpp
Normal file
File diff suppressed because it is too large
Load Diff
116
libretroshare/src/crypto/chacha20.h
Normal file
116
libretroshare/src/crypto/chacha20.h
Normal file
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* RetroShare C++ File sharing default variables
|
||||
*
|
||||
* crypto/chacha20.h
|
||||
*
|
||||
* Copyright 2016 by Mr.Alice
|
||||
*
|
||||
* 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 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.project@gmail.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace librs
|
||||
{
|
||||
namespace crypto
|
||||
{
|
||||
/*!
|
||||
* \brief chacha20_encrypt
|
||||
* Performs in place encryption/decryption of the supplied data, using chacha20, using the supplied key and nonce.
|
||||
*
|
||||
* \param key secret encryption key. *Should never* be re-used.
|
||||
* \param block_counter any integer. 0 is fine.
|
||||
* \param nonce acts as an initialzation vector. /!\ it is extremely important to make sure that this nounce *is* everytime different. Using a purely random value is fine.
|
||||
* \param data data that gets encrypted/decrypted in place
|
||||
* \param size size of the data.
|
||||
*/
|
||||
void chacha20_encrypt(uint8_t key[32], uint32_t block_counter, uint8_t nonce[12], uint8_t *data, uint32_t size) ;
|
||||
|
||||
/*!
|
||||
* \brief poly1305_tag
|
||||
* Computes an authentication tag for the supplied data, using the given secret key.
|
||||
* \param key secret key. *Should not* be used multiple times.
|
||||
* \param message message to generate a tag for
|
||||
* \param size size of the message
|
||||
* \param tag place where the tag is stored.
|
||||
*/
|
||||
|
||||
void poly1305_tag(uint8_t key[32],uint8_t *message,uint32_t size,uint8_t tag[16]);
|
||||
|
||||
/*!
|
||||
* \brief AEAD_chacha20_poly1305
|
||||
* Provides in-place authenticated encryption using the AEAD construction as described in RFC7539.
|
||||
* The data is first encrypted in place then 16-padded and concatenated to its size, than concatenated to the
|
||||
* 16-padded AAD (additional authenticated data) and its size, authenticated using poly1305.
|
||||
*
|
||||
* \param key key that is used to derive a one time secret key for poly1305 and that is also used to encrypt the data
|
||||
* \param nonce nonce. *Should be unique* in order to make the chacha20 stream cipher unique.
|
||||
* \param data data that is encrypted/decrypted in place.
|
||||
* \param size size of the data
|
||||
* \param aad additional authenticated data. Can be used to authenticate the nonce.
|
||||
* \param aad_size
|
||||
* \param tag generated poly1305 tag.
|
||||
* \param encrypt true to encrypt, false to decrypt and check the tag.
|
||||
* \return
|
||||
* always true for encryption.
|
||||
* authentication result for decryption. data is *always* xored to the cipher stream whatever the authentication result is.
|
||||
*/
|
||||
bool AEAD_chacha20_poly1305(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint32_t data_size,uint8_t *aad,uint32_t aad_size,uint8_t tag[16],bool encrypt_or_decrypt) ;
|
||||
|
||||
/*!
|
||||
* \brief AEAD_chacha20_sha256
|
||||
* Provides authenticated encryption using a simple construction that associates chacha20 encryption with HMAC authentication using
|
||||
* the same 32 bytes key. The authenticated tag is the 16 first bytes of the sha256 HMAC.
|
||||
*
|
||||
* \param key encryption/authentication key
|
||||
* \param nonce nonce. *Should be unique* in order to make chacha20 stream cipher unique.
|
||||
* \param data data that is encrypted/decrypted in place
|
||||
* \param data_size size of data to encrypt/authenticate
|
||||
* \param aad additional authenticated data. Can be used to authenticate the nonce.
|
||||
* \param aad_size
|
||||
* \param tag 16 bytes authentication tag result
|
||||
* \param encrypt true to encrypt, false to decrypt and check the tag.
|
||||
* \return
|
||||
* always true for encryption.
|
||||
* authentication result for decryption. data is *always* xored to the cipher stream whatever the authentication result is.
|
||||
*/
|
||||
bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint32_t data_size,uint8_t *aad,uint32_t aad_size,uint8_t tag[16],bool encrypt_or_decrypt) ;
|
||||
|
||||
/*!
|
||||
* \brief constant_time_memcmp
|
||||
* Provides a constant time comparison of two memory chunks. Calls CRYPTO_memcmp.
|
||||
*
|
||||
* \param m1 memory block 1
|
||||
* \param m2 memory block 2
|
||||
* \param size common size of m1 and m2
|
||||
* \return
|
||||
* false if the two chunks are different
|
||||
* true if the two chunks are identical
|
||||
*/
|
||||
bool constant_time_memory_compare(const uint8_t *m1,const uint8_t *m2,uint32_t size) ;
|
||||
|
||||
/*!
|
||||
* \brief perform_tests
|
||||
* Tests all methods in this class, using the tests supplied in RFC7539
|
||||
* \return
|
||||
* true is all tests pass
|
||||
*/
|
||||
|
||||
bool perform_tests() ;
|
||||
}
|
||||
}
|
@ -299,8 +299,7 @@ bool InternalFileHierarchyStorage::updateSubFilesList(const DirectoryStorage::En
|
||||
std::cerr << "[directory storage] removing non existing file " << f.file_name << " at index " << d.subfiles[i] << std::endl;
|
||||
#endif
|
||||
|
||||
delete mNodes[d.subfiles[i]] ;
|
||||
mNodes[d.subfiles[i]] = NULL ;
|
||||
deleteNode(d.subfiles[i]) ;
|
||||
|
||||
d.subfiles[i] = d.subfiles[d.subfiles.size()-1] ;
|
||||
d.subfiles.pop_back();
|
||||
@ -374,23 +373,29 @@ bool InternalFileHierarchyStorage::updateFile(const DirectoryStorage::EntryIndex
|
||||
return true;
|
||||
}
|
||||
|
||||
void InternalFileHierarchyStorage::deleteNode(uint32_t index)
|
||||
{
|
||||
if(mNodes[index] != NULL)
|
||||
{
|
||||
delete mNodes[index] ;
|
||||
mFreeNodes.push_back(index) ;
|
||||
mNodes[index] = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
DirectoryStorage::EntryIndex InternalFileHierarchyStorage::allocateNewIndex()
|
||||
{
|
||||
int found = -1;
|
||||
for(uint32_t j=0;j<mNodes.size();++j)
|
||||
if(mNodes[j] == NULL)
|
||||
{
|
||||
found = j;
|
||||
break;
|
||||
}
|
||||
|
||||
if(found < 0)
|
||||
while(!mFreeNodes.empty())
|
||||
{
|
||||
mNodes.push_back(NULL) ;
|
||||
return mNodes.size()-1 ;
|
||||
uint32_t index = mFreeNodes.front();
|
||||
mFreeNodes.pop_front();
|
||||
|
||||
if(mNodes[index] == NULL)
|
||||
return DirectoryStorage::EntryIndex(index) ;
|
||||
}
|
||||
else
|
||||
return found ;
|
||||
|
||||
mNodes.push_back(NULL) ;
|
||||
return mNodes.size()-1 ;
|
||||
}
|
||||
|
||||
bool InternalFileHierarchyStorage::updateDirEntry(const DirectoryStorage::EntryIndex& indx,const std::string& dir_name,time_t most_recent_time,time_t dir_modtime,const std::vector<RsFileHash>& subdirs_hash,const std::vector<FileEntry>& subfiles_array)
|
||||
@ -534,8 +539,7 @@ bool InternalFileHierarchyStorage::updateDirEntry(const DirectoryStorage::EntryI
|
||||
std::cerr << "(EE) Cannot delete node of index " << it->second << " because it is not a file. Inconsistency error!" << std::endl;
|
||||
continue ;
|
||||
}
|
||||
delete mNodes[it->second] ;
|
||||
mNodes[it->second] = NULL ;
|
||||
deleteNode(it->second) ;
|
||||
}
|
||||
|
||||
// now update row and parent index for all subnodes
|
||||
@ -590,12 +594,12 @@ bool InternalFileHierarchyStorage::setTS(const DirectoryStorage::EntryIndex& ind
|
||||
|
||||
// Do a complete recursive sweep over sub-directories and files, and update the lst modf TS. This could be also performed by a cleanup method.
|
||||
|
||||
time_t InternalFileHierarchyStorage::recursUpdateLastModfTime(const DirectoryStorage::EntryIndex& dir_index)
|
||||
time_t InternalFileHierarchyStorage::recursUpdateLastModfTime(const DirectoryStorage::EntryIndex& dir_index,bool& unfinished_files_present)
|
||||
{
|
||||
DirEntry& d(*static_cast<DirEntry*>(mNodes[dir_index])) ;
|
||||
|
||||
time_t largest_modf_time = d.dir_modtime ;
|
||||
bool unfinished_files_present = false ;
|
||||
unfinished_files_present = false ;
|
||||
|
||||
for(uint32_t i=0;i<d.subfiles.size();++i)
|
||||
{
|
||||
@ -608,7 +612,12 @@ time_t InternalFileHierarchyStorage::recursUpdateLastModfTime(const DirectorySto
|
||||
}
|
||||
|
||||
for(uint32_t i=0;i<d.subdirs.size();++i)
|
||||
largest_modf_time = std::max(largest_modf_time,recursUpdateLastModfTime(d.subdirs[i])) ;
|
||||
{
|
||||
bool unfinished_files_below = false ;
|
||||
largest_modf_time = std::max(largest_modf_time,recursUpdateLastModfTime(d.subdirs[i],unfinished_files_below)) ;
|
||||
|
||||
unfinished_files_present = unfinished_files_present || unfinished_files_below ;
|
||||
}
|
||||
|
||||
// now if some files are not hashed in this directory, reduce the recurs time by 1, so that the TS wil be updated when all hashes are ready.
|
||||
|
||||
@ -673,18 +682,9 @@ DirectoryStorage::EntryIndex InternalFileHierarchyStorage::getSubDirIndex(Direct
|
||||
return static_cast<DirEntry*>(mNodes[parent_index])->subdirs[dir_tab_index];
|
||||
}
|
||||
|
||||
bool InternalFileHierarchyStorage::searchHash(const RsFileHash& hash,std::list<DirectoryStorage::EntryIndex>& results)
|
||||
bool InternalFileHierarchyStorage::searchHash(const RsFileHash& hash,DirectoryStorage::EntryIndex& result)
|
||||
{
|
||||
DirectoryStorage::EntryIndex indx ;
|
||||
|
||||
if(getIndexFromFileHash(hash,indx))
|
||||
{
|
||||
results.clear();
|
||||
results.push_back(indx) ;
|
||||
return true ;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return getIndexFromFileHash(hash,result);
|
||||
}
|
||||
|
||||
class DirectoryStorageExprFileEntry: public RsRegularExpression::ExpFileEntry
|
||||
@ -749,6 +749,8 @@ bool InternalFileHierarchyStorage::check(std::string& error_string) // checks co
|
||||
std::vector<uint32_t> hits(mNodes.size(),0) ; // count hits of children. Should be 1 for all in the end. Otherwise there's an error.
|
||||
hits[0] = 1 ; // because 0 is never the child of anyone
|
||||
|
||||
mFreeNodes.clear();
|
||||
|
||||
for(uint32_t i=0;i<mNodes.size();++i)
|
||||
if(mNodes[i] != NULL && mNodes[i]->type() == FileStorageNode::TYPE_DIR)
|
||||
{
|
||||
@ -796,13 +798,15 @@ bool InternalFileHierarchyStorage::check(std::string& error_string) // checks co
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(mNodes[i] == NULL)
|
||||
mFreeNodes.push_back(i) ;
|
||||
|
||||
for(uint32_t i=0;i<hits.size();++i)
|
||||
if(hits[i] == 0 && mNodes[i] != NULL)
|
||||
{
|
||||
error_string += " - Orphean node!" ;
|
||||
delete mNodes[i] ;
|
||||
mNodes[i] = NULL ;
|
||||
|
||||
deleteNode(i) ;
|
||||
}
|
||||
|
||||
return error_string.empty();;
|
||||
@ -896,12 +900,9 @@ bool InternalFileHierarchyStorage::recursRemoveDirectory(DirectoryStorage::Entry
|
||||
recursRemoveDirectory(d.subdirs[i]);
|
||||
|
||||
for(uint32_t i=0;i<d.subfiles.size();++i)
|
||||
{
|
||||
delete mNodes[d.subfiles[i]] ;
|
||||
mNodes[d.subfiles[i]] = NULL ;
|
||||
}
|
||||
delete mNodes[dir] ;
|
||||
mNodes[dir] = NULL ;
|
||||
deleteNode(d.subfiles[i]);
|
||||
|
||||
deleteNode(dir) ;
|
||||
|
||||
mDirHashes.erase(hash) ;
|
||||
|
||||
@ -1014,6 +1015,8 @@ bool InternalFileHierarchyStorage::load(const std::string& fname)
|
||||
uint32_t buffer_size = 0 ;
|
||||
uint32_t buffer_offset = 0 ;
|
||||
|
||||
mFreeNodes.clear();
|
||||
|
||||
try
|
||||
{
|
||||
if(!FileListIO::loadEncryptedDataFromFile(fname,buffer,buffer_size) )
|
||||
|
@ -110,7 +110,7 @@ public:
|
||||
|
||||
// Do a complete recursive sweep over sub-directories and files, and update the lst modf TS. This could be also performed by a cleanup method.
|
||||
|
||||
time_t recursUpdateLastModfTime(const DirectoryStorage::EntryIndex& dir_index);
|
||||
time_t recursUpdateLastModfTime(const DirectoryStorage::EntryIndex& dir_index, bool &unfinished_files_present);
|
||||
|
||||
// hash stuff
|
||||
|
||||
@ -122,6 +122,7 @@ public:
|
||||
bool findSubDirectory(DirectoryStorage::EntryIndex e,const std::string& s) const ; // returns true when s is the name of a sub-directory in the given entry e
|
||||
|
||||
uint32_t mRoot ;
|
||||
std::list<uint32_t > mFreeNodes ; // keeps a list of free nodes in order to make insert effcieint
|
||||
std::vector<FileStorageNode*> mNodes;// uses pointers to keep information about valid/invalid objects.
|
||||
|
||||
void compress() ; // use empty space in the vector, mostly due to deleted entries. This is a complicated operation, mostly due to
|
||||
@ -142,7 +143,7 @@ public:
|
||||
|
||||
// search. SearchHash is logarithmic. The other two are linear.
|
||||
|
||||
bool searchHash(const RsFileHash& hash,std::list<DirectoryStorage::EntryIndex>& results);
|
||||
bool searchHash(const RsFileHash& hash, DirectoryStorage::EntryIndex &result);
|
||||
int searchBoolExp(RsRegularExpression::Expression * exp, std::list<DirectoryStorage::EntryIndex> &results) const ;
|
||||
int searchTerms(const std::list<std::string>& terms, std::list<DirectoryStorage::EntryIndex> &results) const ; // does a logical OR between items of the list of terms
|
||||
|
||||
@ -159,6 +160,10 @@ private:
|
||||
|
||||
DirectoryStorage::EntryIndex allocateNewIndex();
|
||||
|
||||
// Deletes an existing entry in mNodes, and keeps record of the indices that get freed.
|
||||
|
||||
void deleteNode(DirectoryStorage::EntryIndex);
|
||||
|
||||
// Removes the given subdirectory from the parent node and all its pendign subdirs. Files are kept, and will go during the cleaning
|
||||
// phase. That allows to keep file information when moving them around.
|
||||
|
||||
|
@ -168,12 +168,6 @@ bool DirectoryStorage::updateHash(const EntryIndex& index,const RsFileHash& hash
|
||||
return mFileHierarchy->updateHash(index,hash);
|
||||
}
|
||||
|
||||
int DirectoryStorage::searchHash(const RsFileHash& hash, std::list<EntryIndex> &results) const
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
return mFileHierarchy->searchHash(hash,results);
|
||||
}
|
||||
|
||||
bool DirectoryStorage::load(const std::string& local_file_name)
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
@ -295,6 +289,36 @@ bool DirectoryStorage::getIndexFromDirHash(const RsFileHash& hash,EntryIndex& in
|
||||
/* Local Directory Storage */
|
||||
/******************************************************************************************************************/
|
||||
|
||||
RsFileHash LocalDirectoryStorage::makeEncryptedHash(const RsFileHash& hash)
|
||||
{
|
||||
return RsDirUtil::sha1sum(hash.toByteArray(),hash.SIZE_IN_BYTES);
|
||||
}
|
||||
bool LocalDirectoryStorage::locked_findRealHash(const RsFileHash& hash, RsFileHash& real_hash) const
|
||||
{
|
||||
std::map<RsFileHash,RsFileHash>::const_iterator it = mEncryptedHashes.find(hash) ;
|
||||
|
||||
if(it == mEncryptedHashes.end())
|
||||
return false ;
|
||||
|
||||
real_hash = it->second ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
int LocalDirectoryStorage::searchHash(const RsFileHash& hash, RsFileHash& real_hash, EntryIndex& result) const
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
|
||||
if(locked_findRealHash(hash,real_hash) && mFileHierarchy->searchHash(real_hash,result))
|
||||
return true ;
|
||||
|
||||
if(mFileHierarchy->searchHash(hash,result))
|
||||
{
|
||||
real_hash.clear();
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
void LocalDirectoryStorage::setSharedDirectoryList(const std::list<SharedDirInfo>& lst)
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
@ -422,11 +446,13 @@ void LocalDirectoryStorage::updateTimeStamps()
|
||||
std::cerr << "Updating recursive TS for local shared dirs..." << std::endl;
|
||||
#endif
|
||||
|
||||
time_t last_modf_time = mFileHierarchy->recursUpdateLastModfTime(EntryIndex(0)) ;
|
||||
bool unfinished_files_below ;
|
||||
|
||||
time_t last_modf_time = mFileHierarchy->recursUpdateLastModfTime(EntryIndex(0),unfinished_files_below) ;
|
||||
mTSChanged = false ;
|
||||
|
||||
#ifdef DEBUG_LOCAL_DIRECTORY_STORAGE
|
||||
std::cerr << "LocalDirectoryStorage: global last modf time is " << last_modf_time << " (which is " << time(NULL) - last_modf_time << " secs ago)" << std::endl;
|
||||
std::cerr << "LocalDirectoryStorage: global last modf time is " << last_modf_time << " (which is " << time(NULL) - last_modf_time << " secs ago), unfinished files below=" << unfinished_files_below << std::endl;
|
||||
#else
|
||||
// remove unused variable warning
|
||||
// variable is only used for debugging
|
||||
@ -434,7 +460,15 @@ void LocalDirectoryStorage::updateTimeStamps()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
bool LocalDirectoryStorage::updateHash(const EntryIndex& index,const RsFileHash& hash)
|
||||
{
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
|
||||
mEncryptedHashes[makeEncryptedHash(hash)] = hash ;
|
||||
}
|
||||
return mFileHierarchy->updateHash(index,hash);
|
||||
}
|
||||
std::string LocalDirectoryStorage::locked_findRealRootFromVirtualFilename(const std::string& virtual_rootdir) const
|
||||
{
|
||||
/**** MUST ALREADY BE LOCKED ****/
|
||||
@ -724,7 +758,9 @@ RemoteDirectoryStorage::RemoteDirectoryStorage(const RsPeerId& pid,const std::st
|
||||
{
|
||||
load(fname) ;
|
||||
|
||||
std::cerr << "Loaded remote directory for peer " << pid << std::endl;
|
||||
mLastSweepTime = time(NULL) - (RSRandom::random_u32() % DELAY_BETWEEN_REMOTE_DIRECTORIES_SWEEP) ;
|
||||
|
||||
std::cerr << "Loaded remote directory for peer " << pid << ", inited last sweep time to " << time(NULL) - mLastSweepTime << " secs ago." << std::endl;
|
||||
#ifdef DEBUG_REMOTE_DIRECTORY_STORAGE
|
||||
mFileHierarchy->print();
|
||||
#endif
|
||||
|
@ -53,7 +53,6 @@ class DirectoryStorage
|
||||
|
||||
virtual int searchTerms(const std::list<std::string>& terms, std::list<EntryIndex> &results) const ;
|
||||
virtual int searchBoolExp(RsRegularExpression::Expression * exp, std::list<EntryIndex> &results) const ;
|
||||
virtual int searchHash(const RsFileHash& hash, std::list<EntryIndex> &results) const ;
|
||||
|
||||
// gets/sets the various time stamps:
|
||||
//
|
||||
@ -140,7 +139,9 @@ class DirectoryStorage
|
||||
// Updates relevant information for the file at the given index.
|
||||
|
||||
bool updateFile(const EntryIndex& index,const RsFileHash& hash, const std::string& fname, uint64_t size, time_t modf_time) ;
|
||||
bool updateHash(const EntryIndex& index,const RsFileHash& hash);
|
||||
|
||||
// This is derived in LocalDirectoryStorage in order to also store H(H(F))
|
||||
virtual bool updateHash(const EntryIndex& index,const RsFileHash& hash);
|
||||
|
||||
// Returns the hash of the directory at the given index and reverse. This hash is set as random the first time it is used (when updating directories). It will be
|
||||
// used by the sync system to designate the directory without referring to index (index could be used to figure out the existance of hidden directories)
|
||||
@ -193,8 +194,15 @@ public:
|
||||
*/
|
||||
void checkSave() ;
|
||||
|
||||
/*!
|
||||
* \brief lastSweepTime
|
||||
* returns the last time a sweep has been done over the directory in order to check update TS.
|
||||
* \return
|
||||
*/
|
||||
time_t& lastSweepTime() { return mLastSweepTime ; }
|
||||
private:
|
||||
time_t mLastSavedTime ;
|
||||
time_t mLastSweepTime ;
|
||||
bool mChanged ;
|
||||
std::string mFileName;
|
||||
};
|
||||
@ -216,6 +224,20 @@ public:
|
||||
void updateShareFlags(const SharedDirInfo& info) ;
|
||||
bool convertSharedFilePath(const std::string& path_with_virtual_name,std::string& fullpath) ;
|
||||
|
||||
virtual bool updateHash(const EntryIndex& index,const RsFileHash& hash);
|
||||
/*!
|
||||
* \brief searchHash
|
||||
* Looks into local database of shared files for the given hash. Also looks for files such that the hash of the hash
|
||||
* matches the given hash, and returns the real hash.
|
||||
* \param hash hash to look for
|
||||
* \param real_hash hash such that H(real_hash) = hash, or null hash if not found.
|
||||
* \param results Entry index of the file that is found
|
||||
* \return
|
||||
* true is a file is found
|
||||
* false otherwise.
|
||||
*/
|
||||
virtual int searchHash(const RsFileHash& hash, RsFileHash &real_hash, EntryIndex &results) const ;
|
||||
|
||||
/*!
|
||||
* \brief updateTimeStamps
|
||||
* Checks recursive TS and update the if needed.
|
||||
@ -261,6 +283,8 @@ public:
|
||||
bool serialiseDirEntry(const EntryIndex& indx, RsTlvBinaryData& bindata, const RsPeerId &client_id) ;
|
||||
|
||||
private:
|
||||
static RsFileHash makeEncryptedHash(const RsFileHash& hash);
|
||||
bool locked_findRealHash(const RsFileHash& hash, RsFileHash& real_hash) const;
|
||||
std::string locked_getVirtualPath(EntryIndex indx) const ;
|
||||
std::string locked_getVirtualDirName(EntryIndex indx) const ;
|
||||
|
||||
@ -268,6 +292,7 @@ private:
|
||||
std::string locked_findRealRootFromVirtualFilename(const std::string& virtual_rootdir) const;
|
||||
|
||||
std::map<std::string,SharedDirInfo> mLocalDirs ; // map is better for search. it->first=it->second.filename
|
||||
std::map<RsFileHash,RsFileHash> mEncryptedHashes; // map such that hash(it->second) = it->first
|
||||
std::string mFileName;
|
||||
|
||||
bool mTSChanged ;
|
||||
|
@ -54,10 +54,10 @@ void LocalDirectoryUpdater::setEnabled(bool b)
|
||||
if(mIsEnabled == b)
|
||||
return ;
|
||||
|
||||
if(b)
|
||||
start("fs dir updater") ;
|
||||
else
|
||||
if(!b)
|
||||
shutdown();
|
||||
else if(!isRunning())
|
||||
start("fs dir updater") ;
|
||||
|
||||
mIsEnabled = b ;
|
||||
}
|
||||
|
@ -28,7 +28,8 @@
|
||||
|
||||
static const uint32_t DELAY_BETWEEN_DIRECTORY_UPDATES = 600 ; // 10 minutes
|
||||
static const uint32_t DELAY_BETWEEN_REMOTE_DIRECTORY_SYNC_REQ = 120 ; // 2 minutes
|
||||
static const uint32_t DELAY_BETWEEN_LOCAL_DIRECTORIES_TS_UPDATE = 20 ; // 20 sec. Buy we only update for real if something has changed.
|
||||
static const uint32_t DELAY_BETWEEN_LOCAL_DIRECTORIES_TS_UPDATE = 20 ; // 20 sec. But we only update for real if something has changed.
|
||||
static const uint32_t DELAY_BETWEEN_REMOTE_DIRECTORIES_SWEEP = 60 ; // 60 sec.
|
||||
|
||||
static const std::string HASH_CACHE_DURATION_SS = "HASH_CACHE_DURATION" ; // key string to store hash remembering time
|
||||
static const std::string WATCH_FILE_DURATION_SS = "WATCH_FILES_DELAY" ; // key to store delay before re-checking for new files
|
||||
@ -43,3 +44,8 @@ static const uint32_t MIN_INTERVAL_BETWEEN_REMOTE_DIRECTORY_SAVE = 23 ; //
|
||||
|
||||
static const uint32_t MAX_DIR_SYNC_RESPONSE_DATA_SIZE = 20000 ; // Maximum RsItem data size in bytes for serialised directory transmission
|
||||
static const uint32_t DEFAULT_HASH_STORAGE_DURATION_DAYS = 30 ; // remember deleted/inaccessible files for 30 days
|
||||
|
||||
static const uint32_t NB_FRIEND_INDEX_BITS = 10 ; // Do not change this!
|
||||
static const uint32_t NB_ENTRY_INDEX_BITS = 22 ; // Do not change this!
|
||||
static const uint32_t ENTRY_INDEX_BIT_MASK = 0x003fffff ; // used for storing (EntryIndex,Friend) couples into a 32bits pointer. Depends on the two values just before. Dont change!
|
||||
static const uint32_t DELAY_BEFORE_DROP_REQUEST = 600; // every 10 min
|
||||
|
@ -46,11 +46,6 @@ static const uint32_t P3FILELISTS_UPDATE_FLAG_REMOTE_MAP_CHANGED = 0x0001 ;
|
||||
static const uint32_t P3FILELISTS_UPDATE_FLAG_LOCAL_DIRS_CHANGED = 0x0002 ;
|
||||
static const uint32_t P3FILELISTS_UPDATE_FLAG_REMOTE_DIRS_CHANGED = 0x0004 ;
|
||||
|
||||
static const uint32_t NB_FRIEND_INDEX_BITS = 10 ;
|
||||
static const uint32_t NB_ENTRY_INDEX_BITS = 22 ;
|
||||
static const uint32_t ENTRY_INDEX_BIT_MASK = 0x003fffff ; // used for storing (EntryIndex,Friend) couples into a 32bits pointer.
|
||||
static const uint32_t DELAY_BEFORE_DROP_REQUEST = 55 ; // every 55 secs, for debugging. Should be evey 10 minutes or so.
|
||||
|
||||
p3FileDatabase::p3FileDatabase(p3ServiceControl *mpeers)
|
||||
: mServCtrl(mpeers), mFLSMtx("p3FileLists")
|
||||
{
|
||||
@ -209,7 +204,7 @@ int p3FileDatabase::tick()
|
||||
for(uint32_t i=0;i<mRemoteDirectories.size();++i)
|
||||
if(mRemoteDirectories[i] != NULL)
|
||||
{
|
||||
if(online_peers.find(mRemoteDirectories[i]->peerId()) != online_peers.end())
|
||||
if(online_peers.find(mRemoteDirectories[i]->peerId()) != online_peers.end() && mRemoteDirectories[i]->lastSweepTime() + DELAY_BETWEEN_REMOTE_DIRECTORIES_SWEEP < now)
|
||||
{
|
||||
#ifdef DEBUG_FILE_HIERARCHY
|
||||
P3FILELISTS_DEBUG() << "Launching recurs sweep of friend directory " << mRemoteDirectories[i]->peerId() << ". Content currently is:" << std::endl;
|
||||
@ -217,6 +212,7 @@ int p3FileDatabase::tick()
|
||||
#endif
|
||||
|
||||
locked_recursSweepRemoteDirectory(mRemoteDirectories[i],mRemoteDirectories[i]->root(),0) ;
|
||||
mRemoteDirectories[i]->lastSweepTime() = now ;
|
||||
}
|
||||
|
||||
mRemoteDirectories[i]->checkSave() ;
|
||||
@ -345,7 +341,7 @@ bool p3FileDatabase::loadList(std::list<RsItem *>& load)
|
||||
/* for each item, check it exists ....
|
||||
* - remove any that are dead (or flag?)
|
||||
*/
|
||||
static const FileStorageFlags PERMISSION_MASK = DIR_FLAGS_BROWSABLE_OTHERS | DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_GROUPS | DIR_FLAGS_NETWORK_WIDE_GROUPS ;
|
||||
static const FileStorageFlags PERMISSION_MASK = DIR_FLAGS_PERMISSIONS_MASK;
|
||||
|
||||
#ifdef DEBUG_FILE_HIERARCHY
|
||||
P3FILELISTS_DEBUG() << "Load list" << std::endl;
|
||||
@ -400,7 +396,6 @@ bool p3FileDatabase::loadList(std::list<RsItem *>& load)
|
||||
info.virtualname = fi->file.name;
|
||||
info.shareflags = FileStorageFlags(fi->flags) ;
|
||||
info.shareflags &= PERMISSION_MASK ;
|
||||
info.shareflags &= ~DIR_FLAGS_NETWORK_WIDE_GROUPS ; // disabling this flag for know, for consistency reasons
|
||||
|
||||
for(std::set<RsNodeGroupId>::const_iterator itt(fi->parent_groups.ids.begin());itt!=fi->parent_groups.ids.end();++itt)
|
||||
info.parent_groups.push_back(*itt) ;
|
||||
@ -498,7 +493,6 @@ void p3FileDatabase::cleanup()
|
||||
#ifdef DEBUG_P3FILELISTS
|
||||
P3FILELISTS_DEBUG() << " removing pending request " << std::hex << it->first << std::dec << " for peer " << it->second.peer_id << ", because peer is offline or request is too old." << std::endl;
|
||||
#endif
|
||||
|
||||
std::map<DirSyncRequestId,DirSyncRequestData>::iterator tmp(it);
|
||||
++tmp;
|
||||
mPendingSyncRequests.erase(it) ;
|
||||
@ -543,7 +537,7 @@ uint32_t p3FileDatabase::locked_getFriendIndex(const RsPeerId& pid)
|
||||
mUpdateFlags |= P3FILELISTS_UPDATE_FLAG_REMOTE_MAP_CHANGED ;
|
||||
|
||||
#ifdef DEBUG_P3FILELISTS
|
||||
P3FILELISTS_DEBUG() << " adding missing remote dir entry for friend " << *it << ", with index " << friend_index << std::endl;
|
||||
P3FILELISTS_DEBUG() << " adding missing remote dir entry for friend " << pid << ", with index " << it->second << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -570,7 +564,7 @@ uint32_t p3FileDatabase::locked_getFriendIndex(const RsPeerId& pid)
|
||||
mUpdateFlags |= P3FILELISTS_UPDATE_FLAG_REMOTE_MAP_CHANGED ;
|
||||
|
||||
#ifdef DEBUG_P3FILELISTS
|
||||
P3FILELISTS_DEBUG() << " adding missing remote dir entry for friend " << *it << ", with index " << friend_index << std::endl;
|
||||
P3FILELISTS_DEBUG() << " adding missing remote dir entry for friend " << pid << ", with index " << it->second << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -644,26 +638,25 @@ void p3FileDatabase::requestDirUpdate(void *ref)
|
||||
bool p3FileDatabase::findChildPointer( void *ref, int row, void *& result,
|
||||
FileSearchFlags flags ) const
|
||||
{
|
||||
RS_STACK_MUTEX(mFLSMtx);
|
||||
if (ref == NULL)
|
||||
{
|
||||
if(flags & RS_FILE_HINTS_LOCAL)
|
||||
{
|
||||
if(row != 0)
|
||||
return false ;
|
||||
|
||||
result = NULL;
|
||||
convertEntryIndexToPointer(0,0,result);
|
||||
|
||||
if (ref == NULL)
|
||||
{
|
||||
if(flags & RS_FILE_HINTS_LOCAL)
|
||||
{
|
||||
if(row != 0) return false;
|
||||
|
||||
convertEntryIndexToPointer(0,0,result);
|
||||
return true;
|
||||
}
|
||||
else if((uint32_t)row < mRemoteDirectories.size())
|
||||
{
|
||||
convertEntryIndexToPointer(mRemoteDirectories[row]->root(), row+1, result);
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
else if((uint32_t)row < mRemoteDirectories.size())
|
||||
{
|
||||
convertEntryIndexToPointer(mRemoteDirectories[row]->root(),row+1,result);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t fi;
|
||||
DirectoryStorage::EntryIndex e ;
|
||||
@ -999,16 +992,20 @@ bool p3FileDatabase::search(const RsFileHash &hash, FileSearchFlags hintflags, F
|
||||
|
||||
if(hintflags & RS_FILE_HINTS_LOCAL)
|
||||
{
|
||||
std::list<EntryIndex> res;
|
||||
mLocalSharedDirs->searchHash(hash,res) ;
|
||||
RsFileHash real_hash ;
|
||||
EntryIndex indx;
|
||||
|
||||
if(res.empty())
|
||||
if(!mLocalSharedDirs->searchHash(hash,real_hash,indx))
|
||||
return false;
|
||||
|
||||
EntryIndex indx = *res.begin() ; // no need to report duplicates
|
||||
|
||||
mLocalSharedDirs->getFileInfo(indx,info) ;
|
||||
|
||||
if(!real_hash.isNull())
|
||||
{
|
||||
info.hash = real_hash ;
|
||||
info.transfer_info_flags |= RS_FILE_REQ_ENCRYPTED ;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1457,25 +1454,23 @@ void p3FileDatabase::locked_recursSweepRemoteDirectory(RemoteDirectoryStorage *r
|
||||
p3FileDatabase::DirSyncRequestId p3FileDatabase::makeDirSyncReqId(const RsPeerId& peer_id,const RsFileHash& hash)
|
||||
{
|
||||
static uint64_t random_bias = RSRandom::random_u64();
|
||||
uint64_t r = 0 ;
|
||||
|
||||
uint8_t mem[RsPeerId::SIZE_IN_BYTES + RsFileHash::SIZE_IN_BYTES];
|
||||
memcpy(mem,peer_id.toByteArray(),RsPeerId::SIZE_IN_BYTES) ;
|
||||
memcpy(&mem[RsPeerId::SIZE_IN_BYTES],hash.toByteArray(),RsFileHash::SIZE_IN_BYTES) ;
|
||||
|
||||
RsFileHash tmp = RsDirUtil::sha1sum(mem,RsPeerId::SIZE_IN_BYTES + RsFileHash::SIZE_IN_BYTES) ;
|
||||
|
||||
// This is kind of arbitrary. The important thing is that the same ID needs to be generated every time for a given (peer_id,entry index) pair, in a way
|
||||
// that cannot be brute-forced or reverse-engineered, which explains the random bias and the usage of the hash, that is itself random.
|
||||
|
||||
for(uint32_t i=0;i<RsPeerId::SIZE_IN_BYTES;++i)
|
||||
{
|
||||
r ^= (0x011933ff92892a94 + peer_id.toByteArray()[i] * 0x1001fff92ee640f9) ;
|
||||
r <<= 8 ;
|
||||
r += 0xf392843890321808;
|
||||
}
|
||||
for(uint32_t i=0;i<RsFileHash::SIZE_IN_BYTES;++i)
|
||||
{
|
||||
r ^= (0x011933ff92892a94 + hash.toByteArray()[i] * 0x1001fff92ee640f9) ;
|
||||
r <<= 8 ;
|
||||
r += 0xf392843890321808;
|
||||
}
|
||||
uint64_t r = random_bias ^ *((uint64_t*)tmp.toByteArray()) ;
|
||||
|
||||
return r ^ random_bias;
|
||||
#ifdef DEBUG_P3FILELISTS
|
||||
std::cerr << "Creating ID " << std::hex << r << std::dec << " from peer id " << peer_id << " and hash " << hash << std::endl;
|
||||
#endif
|
||||
|
||||
return r ;
|
||||
}
|
||||
|
||||
bool p3FileDatabase::locked_generateAndSendSyncRequest(RemoteDirectoryStorage *rds,const DirectoryStorage::EntryIndex& e)
|
||||
@ -1525,7 +1520,7 @@ bool p3FileDatabase::locked_generateAndSendSyncRequest(RemoteDirectoryStorage *r
|
||||
data.flags = item->flags;
|
||||
|
||||
#ifdef DEBUG_P3FILELISTS
|
||||
P3FILELISTS_DEBUG() << " Pushing req in pending list with peer id " << data.peer_id << std::endl;
|
||||
P3FILELISTS_DEBUG() << " Pushing req " << std::hex << sync_req_id << std::dec << " in pending list with peer id " << data.peer_id << std::endl;
|
||||
#endif
|
||||
|
||||
mPendingSyncRequests[sync_req_id] = data ;
|
||||
|
@ -94,7 +94,7 @@ ftFileControl::ftFileControl(std::string fname,
|
||||
mTransfer(tm), mCreator(fc), mState(DOWNLOADING), mHash(hash),
|
||||
mSize(size), mFlags(flags), mCreateTime(0), mQueuePriority(0), mQueuePosition(0)
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
ftController::ftController(ftDataMultiplex *dm, p3ServiceControl *sc, uint32_t ftServiceId)
|
||||
@ -113,7 +113,8 @@ ftController::ftController(ftDataMultiplex *dm, p3ServiceControl *sc, uint32_t f
|
||||
{
|
||||
_max_active_downloads = 5 ; // default queue size
|
||||
_min_prioritized_transfers = 3 ;
|
||||
/* TODO */
|
||||
mDefaultEncryptionPolicy = RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE;
|
||||
/* TODO */
|
||||
cnt = 0 ;
|
||||
}
|
||||
|
||||
@ -580,7 +581,7 @@ void ftController::locked_checkQueueElement(uint32_t pos)
|
||||
_queue[pos]->mState = ftFileControl::DOWNLOADING ;
|
||||
|
||||
if(_queue[pos]->mFlags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->monitorTunnels(_queue[pos]->mHash,mFtServer,true) ;
|
||||
mFtServer->activateTunnels(_queue[pos]->mHash,mDefaultEncryptionPolicy,_queue[pos]->mFlags,true);
|
||||
}
|
||||
|
||||
if(pos >= _max_active_downloads && _queue[pos]->mState != ftFileControl::QUEUED && _queue[pos]->mState != ftFileControl::PAUSED)
|
||||
@ -589,8 +590,8 @@ void ftController::locked_checkQueueElement(uint32_t pos)
|
||||
_queue[pos]->mCreator->closeFile() ;
|
||||
|
||||
if(_queue[pos]->mFlags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->stopMonitoringTunnels(_queue[pos]->mHash) ;
|
||||
}
|
||||
mFtServer->activateTunnels(_queue[pos]->mHash,mDefaultEncryptionPolicy,_queue[pos]->mFlags,false);
|
||||
}
|
||||
}
|
||||
|
||||
bool ftController::FlagFileComplete(const RsFileHash& hash)
|
||||
@ -833,7 +834,7 @@ bool ftController::completeFile(const RsFileHash& hash)
|
||||
mDownloads.erase(it);
|
||||
|
||||
if(flags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->stopMonitoringTunnels(hash_to_suppress) ;
|
||||
mFtServer->activateTunnels(hash_to_suppress,mDefaultEncryptionPolicy,flags,false);
|
||||
|
||||
} // UNLOCK: RS_STACK_MUTEX(ctrlMutex);
|
||||
|
||||
@ -976,6 +977,21 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
|
||||
if(alreadyHaveFile(hash, info))
|
||||
return false ;
|
||||
|
||||
// the strategy for requesting encryption is the following:
|
||||
//
|
||||
// if policy is STRICT
|
||||
// - disable clear, enforce encryption
|
||||
// else
|
||||
// - if not specified, use clear
|
||||
//
|
||||
if(mDefaultEncryptionPolicy == RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT)
|
||||
{
|
||||
flags |= RS_FILE_REQ_ENCRYPTED ;
|
||||
flags &= ~RS_FILE_REQ_UNENCRYPTED ;
|
||||
}
|
||||
else if(!(flags & ( RS_FILE_REQ_ENCRYPTED | RS_FILE_REQ_UNENCRYPTED )))
|
||||
flags |= RS_FILE_REQ_UNENCRYPTED ;
|
||||
|
||||
if(size == 0) // we treat this special case because
|
||||
{
|
||||
/* if no destpath - send to download directory */
|
||||
@ -1172,7 +1188,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
|
||||
// We check that flags are consistent.
|
||||
|
||||
if(flags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->monitorTunnels(hash,mFtServer,true) ;
|
||||
mFtServer->activateTunnels(hash,mDefaultEncryptionPolicy,flags,true);
|
||||
|
||||
bool assume_availability = false;
|
||||
|
||||
@ -1273,7 +1289,7 @@ bool ftController::setChunkStrategy(const RsFileHash& hash,FileChunksInfo::Chunk
|
||||
|
||||
bool ftController::FileCancel(const RsFileHash& hash)
|
||||
{
|
||||
rsTurtle->stopMonitoringTunnels(hash) ;
|
||||
mFtServer->activateTunnels(hash,mDefaultEncryptionPolicy,TransferRequestFlags(0),false);
|
||||
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::FileCancel" << std::endl;
|
||||
@ -1597,7 +1613,7 @@ bool ftController::FileDetails(const RsFileHash &hash, FileInfo &info)
|
||||
info.queue_position = it->second->mQueuePosition ;
|
||||
|
||||
if(it->second->mFlags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
info.storage_permission_flags |= DIR_FLAGS_NETWORK_WIDE_OTHERS ; // file being downloaded anonymously are always anonymously available.
|
||||
info.storage_permission_flags |= DIR_FLAGS_ANONYMOUS_DOWNLOAD ; // file being downloaded anonymously are always anonymously available.
|
||||
|
||||
/* get list of sources from transferModule */
|
||||
std::list<RsPeerId> peerIds;
|
||||
@ -1811,6 +1827,7 @@ const std::string download_dir_ss("DOWN_DIR");
|
||||
const std::string partial_dir_ss("PART_DIR");
|
||||
const std::string default_chunk_strategy_ss("DEFAULT_CHUNK_STRATEGY");
|
||||
const std::string free_space_limit_ss("FREE_SPACE_LIMIT");
|
||||
const std::string default_encryption_policy_ss("DEFAULT_ENCRYPTION_POLICY");
|
||||
|
||||
|
||||
/* p3Config Interface */
|
||||
@ -1858,6 +1875,8 @@ bool ftController::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
||||
break ;
|
||||
}
|
||||
|
||||
configMap[default_encryption_policy_ss] = (mDefaultEncryptionPolicy==RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE)?"PERMISSIVE":"STRICT" ;
|
||||
|
||||
rs_sprintf(s, "%lu", RsDiscSpace::freeSpaceLimit());
|
||||
configMap[free_space_limit_ss] = s ;
|
||||
|
||||
@ -2100,7 +2119,26 @@ bool ftController::loadConfigMap(std::map<std::string, std::string> &configMap)
|
||||
setPartialsDirectory(mit->second);
|
||||
}
|
||||
|
||||
if (configMap.end() != (mit = configMap.find(default_chunk_strategy_ss)))
|
||||
if (configMap.end() != (mit = configMap.find(default_encryption_policy_ss)))
|
||||
{
|
||||
if(mit->second == "STRICT")
|
||||
{
|
||||
mDefaultEncryptionPolicy = RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT ;
|
||||
std::cerr << "Note: loading default value for encryption policy: STRICT" << std::endl;
|
||||
}
|
||||
else if(mit->second == "PERMISSIVE")
|
||||
{
|
||||
mDefaultEncryptionPolicy = RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE ;
|
||||
std::cerr << "Note: loading default value for encryption policy: PERMISSIVE" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "(EE) encryption policy not recognized: \"" << mit->second << "\"" << std::endl;
|
||||
mDefaultEncryptionPolicy = RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE ;
|
||||
}
|
||||
}
|
||||
|
||||
if (configMap.end() != (mit = configMap.find(default_chunk_strategy_ss)))
|
||||
{
|
||||
if(mit->second == "STREAMING")
|
||||
{
|
||||
@ -2133,7 +2171,18 @@ bool ftController::loadConfigMap(std::map<std::string, std::string> &configMap)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ftController::setFreeDiskSpaceLimit(uint32_t size_in_mb)
|
||||
void ftController::setDefaultEncryptionPolicy(uint32_t p)
|
||||
{
|
||||
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
||||
mDefaultEncryptionPolicy = p ;
|
||||
IndicateConfigChanged();
|
||||
}
|
||||
uint32_t ftController::defaultEncryptionPolicy()
|
||||
{
|
||||
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
||||
return mDefaultEncryptionPolicy ;
|
||||
}
|
||||
void ftController::setFreeDiskSpaceLimit(uint32_t size_in_mb)
|
||||
{
|
||||
RsDiscSpace::setFreeSpaceLimit(size_in_mb) ;
|
||||
|
||||
|
@ -140,9 +140,11 @@ class ftController: public RsTickingThread, public pqiServiceMonitor, public p3C
|
||||
|
||||
bool setChunkStrategy(const RsFileHash& hash,FileChunksInfo::ChunkStrategy s);
|
||||
void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy s);
|
||||
FileChunksInfo::ChunkStrategy defaultChunkStrategy();
|
||||
void setDefaultEncryptionPolicy(uint32_t s);
|
||||
FileChunksInfo::ChunkStrategy defaultChunkStrategy();
|
||||
uint32_t freeDiskSpaceLimit() const ;
|
||||
void setFreeDiskSpaceLimit(uint32_t size_in_mb) ;
|
||||
uint32_t defaultEncryptionPolicy();
|
||||
|
||||
bool FileCancel(const RsFileHash& hash);
|
||||
bool FileControl(const RsFileHash& hash, uint32_t flags);
|
||||
@ -237,6 +239,7 @@ class ftController: public RsTickingThread, public pqiServiceMonitor, public p3C
|
||||
ftServer *mFtServer ;
|
||||
p3ServiceControl *mServiceCtrl;
|
||||
uint32_t mFtServiceId;
|
||||
uint32_t mDefaultEncryptionPolicy ;
|
||||
|
||||
uint32_t cnt ;
|
||||
RsMutex ctrlMutex;
|
||||
|
@ -350,9 +350,10 @@ bool ftExtraList::search(const RsFileHash &hash, FileSearchFlags /*hintflags*
|
||||
|
||||
// Now setup the file storage flags so that the client can know how to handle permissions
|
||||
//
|
||||
info.storage_permission_flags = DIR_FLAGS_BROWSABLE_OTHERS ;
|
||||
#warning make sure this is right
|
||||
info.storage_permission_flags = FileStorageFlags(0) ;//DIR_FLAGS_BROWSABLE_OTHERS ;
|
||||
|
||||
if(info.transfer_info_flags & RS_FILE_REQ_ANONYMOUS_ROUTING) info.storage_permission_flags |= DIR_FLAGS_NETWORK_WIDE_OTHERS ;
|
||||
if(info.transfer_info_flags & RS_FILE_REQ_ANONYMOUS_ROUTING) info.storage_permission_flags |= DIR_FLAGS_ANONYMOUS_DOWNLOAD ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -135,7 +135,8 @@ public:
|
||||
virtual FileChunksInfo::ChunkStrategy defaultChunkStrategy() ;
|
||||
virtual uint32_t freeDiskSpaceLimit() const ;
|
||||
virtual void setFreeDiskSpaceLimit(uint32_t size_in_mb) ;
|
||||
|
||||
virtual void setDefaultEncryptionPolicy(uint32_t policy) ; // RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT/PERMISSIVE
|
||||
virtual uint32_t defaultEncryptionPolicy() ;
|
||||
|
||||
/***
|
||||
* Control of Downloads Priority.
|
||||
@ -156,6 +157,7 @@ public:
|
||||
virtual bool FileDetails(const RsFileHash &hash, FileSearchFlags hintflags, FileInfo &info);
|
||||
virtual bool FileDownloadChunksDetails(const RsFileHash& hash,FileChunksInfo& info) ;
|
||||
virtual bool FileUploadChunksDetails(const RsFileHash& hash,const RsPeerId& peer_id,CompressedChunkMap& map) ;
|
||||
virtual bool isEncryptedSource(const RsPeerId& virtual_peer_id) ;
|
||||
|
||||
|
||||
/***
|
||||
@ -200,7 +202,7 @@ public:
|
||||
virtual std::string getPartialsDirectory();
|
||||
|
||||
virtual bool getSharedDirectories(std::list<SharedDirInfo> &dirs);
|
||||
virtual bool setSharedDirectories(std::list<SharedDirInfo> &dirs);
|
||||
virtual bool setSharedDirectories(const std::list<SharedDirInfo> &dirs);
|
||||
virtual bool addSharedDirectory(const SharedDirInfo& dir);
|
||||
virtual bool updateShareFlags(const SharedDirInfo& dir); // updates the flags. The directory should already exist !
|
||||
virtual bool removeSharedDirectory(std::string dir);
|
||||
@ -217,6 +219,8 @@ public:
|
||||
/*************** Data Transfer Interface ***********************/
|
||||
/***************************************************************/
|
||||
public:
|
||||
virtual bool activateTunnels(const RsFileHash& hash,uint32_t default_encryption_policy,TransferRequestFlags flags,bool onoff);
|
||||
|
||||
virtual bool sendData(const RsPeerId& peerId, const RsFileHash& hash, uint64_t size, uint64_t offset, uint32_t chunksize, void *data);
|
||||
virtual bool sendDataRequest(const RsPeerId& peerId, const RsFileHash& hash, uint64_t size, uint64_t offset, uint32_t chunksize);
|
||||
virtual bool sendChunkMapRequest(const RsPeerId& peer_id,const RsFileHash& hash,bool is_client) ;
|
||||
@ -224,6 +228,11 @@ public:
|
||||
virtual bool sendSingleChunkCRCRequest(const RsPeerId& peer_id,const RsFileHash& hash,uint32_t chunk_number) ;
|
||||
virtual bool sendSingleChunkCRC(const RsPeerId& peer_id,const RsFileHash& hash,uint32_t chunk_number,const Sha1CheckSum& crc) ;
|
||||
|
||||
static void deriveEncryptionKey(const RsFileHash& hash, uint8_t *key);
|
||||
|
||||
bool encryptItem(RsTurtleGenericTunnelItem *clear_item,const RsFileHash& hash,RsTurtleGenericDataItem *& encrypted_item);
|
||||
bool decryptItem(RsTurtleGenericDataItem *encrypted_item, const RsFileHash& hash, RsTurtleGenericTunnelItem *&decrypted_item);
|
||||
|
||||
/*************** Internal Transfer Fns *************************/
|
||||
virtual int tick();
|
||||
|
||||
@ -237,6 +246,22 @@ protected:
|
||||
int handleIncoming() ;
|
||||
bool handleCacheData() ;
|
||||
|
||||
/*!
|
||||
* \brief sendTurtleItem
|
||||
* Sends the given item into a turtle tunnel, possibly encrypting it if the type of tunnel requires it, which is known from the hash itself.
|
||||
* \param peerId Peer id to send to (this is a virtual peer id from turtle service)
|
||||
* \param hash hash of the file. If the item needs to be encrypted
|
||||
* \param item item to send.
|
||||
* \return
|
||||
* true if everything goes right
|
||||
*/
|
||||
bool sendTurtleItem(const RsPeerId& peerId,const RsFileHash& hash,RsTurtleGenericTunnelItem *item);
|
||||
|
||||
// fnds out what is the real hash of encrypted hash hash
|
||||
bool findRealHash(const RsFileHash& hash, RsFileHash& real_hash);
|
||||
bool findEncryptedHash(const RsPeerId& virtual_peer_id, RsFileHash& encrypted_hash);
|
||||
bool encryptHash(const RsFileHash& hash, RsFileHash& hash_of_hash);
|
||||
|
||||
private:
|
||||
|
||||
/**** INTERNAL FUNCTIONS ***/
|
||||
@ -261,6 +286,9 @@ private:
|
||||
std::string mConfigPath;
|
||||
std::string mDownloadPath;
|
||||
std::string mPartialsPath;
|
||||
|
||||
std::map<RsFileHash,RsFileHash> mEncryptedHashes ; // This map is such that sha1(it->second) = it->first
|
||||
std::map<RsPeerId,RsFileHash> mEncryptedPeerIds ; // This map holds the hash to be used with each peer id
|
||||
};
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <serialiser/itempriorities.h>
|
||||
#include <ft/ftturtlefiletransferitem.h>
|
||||
|
||||
uint32_t RsTurtleFileRequestItem::serial_size()
|
||||
uint32_t RsTurtleFileRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -42,7 +42,7 @@ uint32_t RsTurtleFileRequestItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleFileDataItem::serial_size()
|
||||
uint32_t RsTurtleFileDataItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -55,7 +55,7 @@ uint32_t RsTurtleFileDataItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleFileMapRequestItem::serial_size()
|
||||
uint32_t RsTurtleFileMapRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -66,7 +66,7 @@ uint32_t RsTurtleFileMapRequestItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleFileMapItem::serial_size()
|
||||
uint32_t RsTurtleFileMapItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -80,7 +80,7 @@ uint32_t RsTurtleFileMapItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleChunkCrcItem::serial_size()
|
||||
uint32_t RsTurtleChunkCrcItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -91,7 +91,7 @@ uint32_t RsTurtleChunkCrcItem::serial_size()
|
||||
|
||||
return s ;
|
||||
}
|
||||
uint32_t RsTurtleChunkCrcRequestItem::serial_size()
|
||||
uint32_t RsTurtleChunkCrcRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -101,7 +101,7 @@ uint32_t RsTurtleChunkCrcRequestItem::serial_size()
|
||||
|
||||
return s ;
|
||||
}
|
||||
bool RsTurtleFileMapRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleFileMapRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -134,7 +134,7 @@ bool RsTurtleFileMapRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RsTurtleFileMapItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleFileMapItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -171,7 +171,7 @@ bool RsTurtleFileMapItem::serialize(void *data,uint32_t& pktsize)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RsTurtleChunkCrcRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleChunkCrcRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << "RsTurtleChunkCrcRequestItem::serialize(): serializing packet:" << std::endl ;
|
||||
@ -206,7 +206,7 @@ bool RsTurtleChunkCrcRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RsTurtleChunkCrcItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleChunkCrcItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << "RsTurtleChunkCrcRequestItem::serialize(): serializing packet:" << std::endl ;
|
||||
@ -345,7 +345,7 @@ RsTurtleChunkCrcRequestItem::RsTurtleChunkCrcRequestItem(void *data,uint32_t pkt
|
||||
throw std::runtime_error("Unknown error while deserializing.") ;
|
||||
#endif
|
||||
}
|
||||
bool RsTurtleFileRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleFileRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -459,7 +459,7 @@ RsTurtleFileDataItem::RsTurtleFileDataItem(void *data,uint32_t pktsize)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsTurtleFileDataItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleFileDataItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
@ -44,8 +44,8 @@ class RsTurtleFileRequestItem: public RsTurtleGenericTunnelItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
protected:
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const;
|
||||
virtual uint32_t serial_size() const;
|
||||
};
|
||||
|
||||
class RsTurtleFileDataItem: public RsTurtleGenericTunnelItem
|
||||
@ -64,8 +64,8 @@ class RsTurtleFileDataItem: public RsTurtleGenericTunnelItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const;
|
||||
virtual uint32_t serial_size() const;
|
||||
};
|
||||
|
||||
class RsTurtleFileMapRequestItem: public RsTurtleGenericTunnelItem
|
||||
@ -78,8 +78,8 @@ class RsTurtleFileMapRequestItem: public RsTurtleGenericTunnelItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const;
|
||||
virtual uint32_t serial_size() const;
|
||||
};
|
||||
|
||||
class RsTurtleFileMapItem: public RsTurtleGenericTunnelItem
|
||||
@ -96,8 +96,8 @@ class RsTurtleFileMapItem: public RsTurtleGenericTunnelItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const;
|
||||
virtual uint32_t serial_size() const;
|
||||
};
|
||||
|
||||
class RsTurtleChunkCrcRequestItem: public RsTurtleGenericTunnelItem
|
||||
@ -113,8 +113,8 @@ class RsTurtleChunkCrcRequestItem: public RsTurtleGenericTunnelItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const;
|
||||
virtual uint32_t serial_size() const;
|
||||
};
|
||||
|
||||
class RsTurtleChunkCrcItem: public RsTurtleGenericTunnelItem
|
||||
@ -130,6 +130,6 @@ class RsTurtleChunkCrcItem: public RsTurtleGenericTunnelItem
|
||||
Sha1CheckSum check_sum ;
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const;
|
||||
virtual uint32_t serial_size() const;
|
||||
};
|
||||
|
@ -294,7 +294,7 @@ mac {
|
||||
OBJECTS_DIR = temp/obj
|
||||
MOC_DIR = temp/moc
|
||||
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
||||
DEFINES *= MINIUPNPC_VERSION=13
|
||||
#DEFINES *= MINIUPNPC_VERSION=13
|
||||
|
||||
CONFIG += upnp_miniupnpc
|
||||
CONFIG += c++11
|
||||
@ -304,7 +304,7 @@ mac {
|
||||
#CONFIG += zcnatassist
|
||||
|
||||
# Beautiful Hack to fix 64bit file access.
|
||||
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs
|
||||
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs
|
||||
|
||||
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||
#GPGME_DIR = ../../../../gpgme-1.1.8
|
||||
@ -314,6 +314,7 @@ mac {
|
||||
|
||||
DEPENDPATH += . $$INC_DIR
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
INCLUDEPATH += ../../../.
|
||||
|
||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||
LIBS += /usr/local/lib/libsqlcipher.a
|
||||
@ -379,6 +380,8 @@ HEADERS += ft/ftchunkmap.h \
|
||||
ft/fttransfermodule.h \
|
||||
ft/ftturtlefiletransferitem.h
|
||||
|
||||
HEADERS += crypto/chacha20.h
|
||||
|
||||
HEADERS += directory_updater.h \
|
||||
directory_list.h \
|
||||
p3filelists.h
|
||||
@ -537,6 +540,8 @@ SOURCES += ft/ftchunkmap.cc \
|
||||
ft/fttransfermodule.cc \
|
||||
ft/ftturtlefiletransferitem.cc
|
||||
|
||||
SOURCES += crypto/chacha20.cpp
|
||||
|
||||
SOURCES += chat/distantchat.cc \
|
||||
chat/p3chatservice.cc \
|
||||
chat/distributedchat.cc \
|
||||
|
@ -64,6 +64,10 @@ static const int PQISTREAM_PACKET_SLICING_PROBE_DELAY = 60; // send every 6
|
||||
|
||||
static uint8_t PACKET_SLICING_PROBE_BYTES[8] = { 0x02, 0xaa, 0xbb, 0xcc, 0x00, 0x00, 0x00, 0x08 } ;
|
||||
|
||||
/* Change to true to disable packet slicing and/or packet grouping, if needed */
|
||||
#define DISABLE_PACKET_SLICING false
|
||||
#define DISABLE_PACKET_GROUPING false
|
||||
|
||||
/* This removes the print statements (which hammer pqidebug) */
|
||||
/***
|
||||
#define RSITEM_DEBUG 1
|
||||
@ -629,7 +633,7 @@ int pqistreamer::handleoutgoing_locked()
|
||||
++k ;
|
||||
}
|
||||
}
|
||||
while(mPkt_wpending_size < (uint32_t)maxbytes && mPkt_wpending_size < PQISTREAM_OPTIMAL_PACKET_SIZE ) ;
|
||||
while(mPkt_wpending_size < (uint32_t)maxbytes && mPkt_wpending_size < PQISTREAM_OPTIMAL_PACKET_SIZE && !DISABLE_PACKET_GROUPING) ;
|
||||
|
||||
#ifdef DEBUG_PQISTREAMER
|
||||
if(k > 1)
|
||||
@ -787,7 +791,7 @@ start_packet_read:
|
||||
|
||||
if(!memcmp(block,PACKET_SLICING_PROBE_BYTES,8))
|
||||
{
|
||||
mAcceptsPacketSlicing = true ;
|
||||
mAcceptsPacketSlicing = !DISABLE_PACKET_SLICING;
|
||||
#ifdef DEBUG_PACKET_SLICING
|
||||
std::cerr << "(II) Enabling packet slicing!" << std::endl;
|
||||
#endif
|
||||
@ -815,7 +819,7 @@ continue_packet:
|
||||
#endif
|
||||
is_partial_packet = true ;
|
||||
|
||||
mAcceptsPacketSlicing = true ; // this is needed
|
||||
mAcceptsPacketSlicing = !DISABLE_PACKET_SLICING; // this is needed
|
||||
}
|
||||
else
|
||||
extralen = getRsItemSize(block) - blen; // old style packet type
|
||||
|
@ -43,6 +43,9 @@ const uint32_t RS_FILE_CTRL_PAUSE = 0x00000100;
|
||||
const uint32_t RS_FILE_CTRL_START = 0x00000200;
|
||||
const uint32_t RS_FILE_CTRL_FORCE_CHECK = 0x00000400;
|
||||
|
||||
const uint32_t RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT = 0x00000001 ;
|
||||
const uint32_t RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE = 0x00000002 ;
|
||||
|
||||
const uint32_t RS_FILE_RATE_TRICKLE = 0x00000001;
|
||||
const uint32_t RS_FILE_RATE_SLOW = 0x00000002;
|
||||
const uint32_t RS_FILE_RATE_STANDARD = 0x00000003;
|
||||
@ -63,29 +66,32 @@ const uint32_t RS_FILE_PEER_OFFLINE = 0x00002000;
|
||||
|
||||
// Flags used when requesting info about transfers, mostly to filter out the result.
|
||||
//
|
||||
const FileSearchFlags RS_FILE_HINTS_CACHE_deprecated ( 0x00000001 );
|
||||
const FileSearchFlags RS_FILE_HINTS_EXTRA ( 0x00000002 );
|
||||
const FileSearchFlags RS_FILE_HINTS_LOCAL ( 0x00000004 );
|
||||
const FileSearchFlags RS_FILE_HINTS_REMOTE ( 0x00000008 );
|
||||
const FileSearchFlags RS_FILE_HINTS_DOWNLOAD ( 0x00000010 );
|
||||
const FileSearchFlags RS_FILE_HINTS_UPLOAD ( 0x00000020 );
|
||||
const FileSearchFlags RS_FILE_HINTS_SPEC_ONLY ( 0x01000000 );
|
||||
const FileSearchFlags RS_FILE_HINTS_CACHE_deprecated ( 0x00000001 );
|
||||
const FileSearchFlags RS_FILE_HINTS_EXTRA ( 0x00000002 );
|
||||
const FileSearchFlags RS_FILE_HINTS_LOCAL ( 0x00000004 );
|
||||
const FileSearchFlags RS_FILE_HINTS_REMOTE ( 0x00000008 );
|
||||
const FileSearchFlags RS_FILE_HINTS_DOWNLOAD ( 0x00000010 );
|
||||
const FileSearchFlags RS_FILE_HINTS_UPLOAD ( 0x00000020 );
|
||||
const FileSearchFlags RS_FILE_HINTS_SPEC_ONLY ( 0x01000000 );
|
||||
|
||||
const FileSearchFlags RS_FILE_HINTS_NETWORK_WIDE ( 0x00000080 );// anonymously shared over network
|
||||
const FileSearchFlags RS_FILE_HINTS_BROWSABLE ( 0x00000100 );// browsable by friends
|
||||
const FileSearchFlags RS_FILE_HINTS_PERMISSION_MASK ( 0x00000180 );// OR of the last two flags. Used to filter out.
|
||||
const FileSearchFlags RS_FILE_HINTS_NETWORK_WIDE ( 0x00000080 );// can be downloaded anonymously
|
||||
const FileSearchFlags RS_FILE_HINTS_BROWSABLE ( 0x00000100 );// browsable by friends
|
||||
const FileSearchFlags RS_FILE_HINTS_SEARCHABLE ( 0x00000200 );// can be searched anonymously
|
||||
const FileSearchFlags RS_FILE_HINTS_PERMISSION_MASK ( 0x00000380 );// OR of the last tree flags. Used to filter out.
|
||||
|
||||
// Flags used when requesting a transfer
|
||||
//
|
||||
const TransferRequestFlags RS_FILE_REQ_ANONYMOUS_ROUTING ( 0x00000040 ); // Use to ask turtle router to download the file.
|
||||
const TransferRequestFlags RS_FILE_REQ_ENCRYPTED ( 0x00000080 ); // Asks for end-to-end encryption of file at the level of ftServer
|
||||
const TransferRequestFlags RS_FILE_REQ_UNENCRYPTED ( 0x00000100 ); // Asks for no end-to-end encryption of file at the level of ftServer
|
||||
const TransferRequestFlags RS_FILE_REQ_ASSUME_AVAILABILITY ( 0x00000200 ); // Assume full source availability. Used for cache files.
|
||||
const TransferRequestFlags RS_FILE_REQ_CACHE_deprecated ( 0x00000400 ); // Assume full source availability. Used for cache files.
|
||||
const TransferRequestFlags RS_FILE_REQ_CACHE_deprecated ( 0x00000400 ); // Old stuff used for cache files. Not used anymore.
|
||||
const TransferRequestFlags RS_FILE_REQ_EXTRA ( 0x00000800 );
|
||||
const TransferRequestFlags RS_FILE_REQ_MEDIA ( 0x00001000 );
|
||||
const TransferRequestFlags RS_FILE_REQ_BACKGROUND ( 0x00002000 ); // To download slowly.
|
||||
const TransferRequestFlags RS_FILE_REQ_MEDIA ( 0x00001000 );
|
||||
const TransferRequestFlags RS_FILE_REQ_BACKGROUND ( 0x00002000 ); // To download slowly.
|
||||
const TransferRequestFlags RS_FILE_REQ_NO_SEARCH ( 0x02000000 ); // disable searching for potential direct sources.
|
||||
|
||||
// const uint32_t RS_FILE_HINTS_SHARE_FLAGS_MASK = RS_FILE_HINTS_NETWORK_WIDE_OTHERS | RS_FILE_HINTS_BROWSABLE_OTHERS
|
||||
// const uint32_t RS_FILE_HINTS_SHARE_FLAGS_MASK = RS_FILE_HINTS_NETWORK_WIDE_OTHERS | RS_FILE_HINTS_BROWSABLE_OTHERS
|
||||
// | RS_FILE_HINTS_NETWORK_WIDE_GROUPS | RS_FILE_HINTS_BROWSABLE_GROUPS ;
|
||||
|
||||
/* Callback Codes */
|
||||
@ -96,7 +102,7 @@ struct SharedDirInfo
|
||||
{
|
||||
std::string filename ;
|
||||
std::string virtualname ;
|
||||
FileStorageFlags shareflags ; // DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_GROUPS | ...
|
||||
FileStorageFlags shareflags ; // combnation of DIR_FLAGS_ANONYMOUS_DOWNLOAD | DIR_FLAGS_BROWSABLE | ...
|
||||
std::list<RsNodeGroupId> parent_groups ;
|
||||
};
|
||||
|
||||
@ -141,6 +147,8 @@ class RsFiles
|
||||
virtual void setFreeDiskSpaceLimit(uint32_t size_in_mb) =0;
|
||||
virtual bool FileControl(const RsFileHash& hash, uint32_t flags) = 0;
|
||||
virtual bool FileClearCompleted() = 0;
|
||||
virtual void setDefaultEncryptionPolicy(uint32_t policy)=0 ; // RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT/PERMISSIVE
|
||||
virtual uint32_t defaultEncryptionPolicy()=0 ;
|
||||
|
||||
/***
|
||||
* Control of Downloads Priority.
|
||||
@ -159,6 +167,7 @@ class RsFiles
|
||||
virtual void FileDownloads(std::list<RsFileHash> &hashs) = 0;
|
||||
virtual bool FileUploads(std::list<RsFileHash> &hashs) = 0;
|
||||
virtual bool FileDetails(const RsFileHash &hash, FileSearchFlags hintflags, FileInfo &info) = 0;
|
||||
virtual bool isEncryptedSource(const RsPeerId& virtual_peer_id) =0;
|
||||
|
||||
/// Gives chunk details about the downloaded file with given hash.
|
||||
virtual bool FileDownloadChunksDetails(const RsFileHash& hash,FileChunksInfo& info) = 0 ;
|
||||
@ -209,8 +218,9 @@ class RsFiles
|
||||
virtual std::string getDownloadDirectory() = 0;
|
||||
virtual std::string getPartialsDirectory() = 0;
|
||||
|
||||
virtual bool getSharedDirectories(std::list<SharedDirInfo> &dirs) = 0;
|
||||
virtual bool addSharedDirectory(const SharedDirInfo& dir) = 0;
|
||||
virtual bool getSharedDirectories(std::list<SharedDirInfo>& dirs) = 0;
|
||||
virtual bool setSharedDirectories(const std::list<SharedDirInfo>& dirs) = 0;
|
||||
virtual bool addSharedDirectory(const SharedDirInfo& dir) = 0;
|
||||
virtual bool updateShareFlags(const SharedDirInfo& dir) = 0; // updates the flags. The directory should already exist !
|
||||
virtual bool removeSharedDirectory(std::string dir) = 0;
|
||||
|
||||
|
@ -155,12 +155,13 @@ const FileStorageFlags DIR_FLAGS_PARENT ( 0x0001 );
|
||||
const FileStorageFlags DIR_FLAGS_DETAILS ( 0x0002 ); // apparently unused
|
||||
const FileStorageFlags DIR_FLAGS_CHILDREN ( 0x0004 ); // apparently unused
|
||||
|
||||
const FileStorageFlags DIR_FLAGS_NETWORK_WIDE_OTHERS ( 0x0080 ); // Flags for directory sharing permissions. The last
|
||||
const FileStorageFlags DIR_FLAGS_BROWSABLE_OTHERS ( 0x0100 ); // one should be the OR of the all four flags.
|
||||
const FileStorageFlags DIR_FLAGS_NETWORK_WIDE_GROUPS ( 0x0200 );
|
||||
const FileStorageFlags DIR_FLAGS_BROWSABLE_GROUPS ( 0x0400 );
|
||||
const FileStorageFlags DIR_FLAGS_PERMISSIONS_MASK ( DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_OTHERS
|
||||
| DIR_FLAGS_NETWORK_WIDE_GROUPS | DIR_FLAGS_BROWSABLE_GROUPS );
|
||||
const FileStorageFlags DIR_FLAGS_ANONYMOUS_DOWNLOAD ( 0x0080 ); // Flags for directory sharing permissions. The last
|
||||
//const FileStorageFlags DIR_FLAGS_BROWSABLE_OTHERS ( 0x0100 ); // one should be the OR of the all four flags.
|
||||
//const FileStorageFlags DIR_FLAGS_NETWORK_WIDE_GROUPS ( 0x0200 );
|
||||
const FileStorageFlags DIR_FLAGS_BROWSABLE ( 0x0400 );
|
||||
const FileStorageFlags DIR_FLAGS_ANONYMOUS_SEARCH ( 0x0800 );
|
||||
const FileStorageFlags DIR_FLAGS_PERMISSIONS_MASK ( DIR_FLAGS_ANONYMOUS_DOWNLOAD | /*DIR_FLAGS_BROWSABLE_OTHERS
|
||||
DIR_FLAGS_NETWORK_WIDE_GROUPS*/ DIR_FLAGS_BROWSABLE | DIR_FLAGS_ANONYMOUS_SEARCH);
|
||||
|
||||
const FileStorageFlags DIR_FLAGS_LOCAL ( 0x1000 );
|
||||
const FileStorageFlags DIR_FLAGS_REMOTE ( 0x2000 );
|
||||
|
@ -1359,7 +1359,7 @@ FileSearchFlags p3Peers::computePeerPermissionFlags(const RsPeerId& peer_ssl_id,
|
||||
// very simple algorithm.
|
||||
//
|
||||
|
||||
bool found = false ;
|
||||
bool found = directory_parent_groups.empty() ; // by default, empty list means browsable by everyone.
|
||||
RsPgpId pgp_id = getGPGId(peer_ssl_id) ;
|
||||
|
||||
for(std::list<RsNodeGroupId>::const_iterator it(directory_parent_groups.begin());it!=directory_parent_groups.end() && !found;++it)
|
||||
@ -1378,13 +1378,15 @@ FileSearchFlags p3Peers::computePeerPermissionFlags(const RsPeerId& peer_ssl_id,
|
||||
// found = true ;
|
||||
}
|
||||
|
||||
bool network_wide = (share_flags & DIR_FLAGS_NETWORK_WIDE_OTHERS) ;//|| ( (share_flags & DIR_FLAGS_NETWORK_WIDE_GROUPS) && found) ;
|
||||
bool browsable = (share_flags & DIR_FLAGS_BROWSABLE_OTHERS) || ( (share_flags & DIR_FLAGS_BROWSABLE_GROUPS) && found) ;
|
||||
bool network_wide = (share_flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) ;//|| ( (share_flags & DIR_FLAGS_NETWORK_WIDE_GROUPS) && found) ;
|
||||
bool browsable = (share_flags & DIR_FLAGS_BROWSABLE) && found ;
|
||||
bool searchable = (share_flags & DIR_FLAGS_ANONYMOUS_SEARCH) ;
|
||||
|
||||
FileSearchFlags final_flags ;
|
||||
|
||||
if(network_wide) final_flags |= RS_FILE_HINTS_NETWORK_WIDE ;
|
||||
if(browsable ) final_flags |= RS_FILE_HINTS_BROWSABLE ;
|
||||
if(searchable ) final_flags |= RS_FILE_HINTS_SEARCHABLE ;
|
||||
|
||||
return final_flags ;
|
||||
}
|
||||
|
@ -1729,7 +1729,7 @@ void RsTurtleStringSearchRequestItem::performLocalSearch(std::list<TurtleFileInf
|
||||
std::cerr << "Performing rsFiles->search()" << std::endl ;
|
||||
#endif
|
||||
// now, search!
|
||||
rsFiles->SearchKeywords(words, initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_NETWORK_WIDE,PeerId());
|
||||
rsFiles->SearchKeywords(words, initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SEARCHABLE,PeerId());
|
||||
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << initialResults.size() << " matches found." << std::endl ;
|
||||
@ -1767,7 +1767,7 @@ void RsTurtleRegExpSearchRequestItem::performLocalSearch(std::list<TurtleFileInf
|
||||
return ;
|
||||
|
||||
// now, search!
|
||||
rsFiles->SearchBoolExp(exp,initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_NETWORK_WIDE,PeerId());
|
||||
rsFiles->SearchBoolExp(exp,initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SEARCHABLE,PeerId());
|
||||
|
||||
result.clear() ;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
// ---------------------------------- Packet sizes -----------------------------------//
|
||||
//
|
||||
|
||||
uint32_t RsTurtleStringSearchRequestItem::serial_size()
|
||||
uint32_t RsTurtleStringSearchRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -27,7 +27,7 @@ uint32_t RsTurtleStringSearchRequestItem::serial_size()
|
||||
|
||||
return s ;
|
||||
}
|
||||
uint32_t RsTurtleRegExpSearchRequestItem::serial_size()
|
||||
uint32_t RsTurtleRegExpSearchRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -48,7 +48,7 @@ uint32_t RsTurtleRegExpSearchRequestItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleSearchResultItem::serial_size()
|
||||
uint32_t RsTurtleSearchResultItem::serial_size()const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -67,7 +67,7 @@ uint32_t RsTurtleSearchResultItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleOpenTunnelItem::serial_size()
|
||||
uint32_t RsTurtleOpenTunnelItem::serial_size()const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -80,7 +80,7 @@ uint32_t RsTurtleOpenTunnelItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleTunnelOkItem::serial_size()
|
||||
uint32_t RsTurtleTunnelOkItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -91,7 +91,7 @@ uint32_t RsTurtleTunnelOkItem::serial_size()
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleGenericDataItem::serial_size()
|
||||
uint32_t RsTurtleGenericDataItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
@ -159,7 +159,7 @@ RsItem *RsTurtleSerialiser::deserialise(void *data, uint32_t *size)
|
||||
|
||||
}
|
||||
|
||||
bool RsTurtleStringSearchRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleStringSearchRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -193,7 +193,7 @@ bool RsTurtleStringSearchRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RsTurtleRegExpSearchRequestItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleRegExpSearchRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -313,7 +313,7 @@ RsTurtleRegExpSearchRequestItem::RsTurtleRegExpSearchRequestItem(void *data,uint
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsTurtleSearchResultItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleSearchResultItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -398,7 +398,7 @@ RsTurtleSearchResultItem::RsTurtleSearchResultItem(void *data,uint32_t pktsize)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsTurtleOpenTunnelItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleOpenTunnelItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -464,7 +464,7 @@ RsTurtleOpenTunnelItem::RsTurtleOpenTunnelItem(void *data,uint32_t pktsize)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsTurtleTunnelOkItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleTunnelOkItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
@ -572,7 +572,7 @@ RsTurtleGenericDataItem::RsTurtleGenericDataItem(void *data,uint32_t pktsize)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsTurtleGenericDataItem::serialize(void *data,uint32_t& pktsize)
|
||||
bool RsTurtleGenericDataItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
@ -35,8 +35,8 @@ class RsTurtleItem: public RsItem
|
||||
public:
|
||||
RsTurtleItem(uint8_t turtle_subtype) : RsItem(RS_PKT_VERSION_SERVICE,RS_SERVICE_TYPE_TURTLE,turtle_subtype) {}
|
||||
|
||||
virtual bool serialize(void *data,uint32_t& size) = 0 ; // Isn't it better that items can serialize themselves ?
|
||||
virtual uint32_t serial_size() = 0 ; // deserialise is handled using a constructor
|
||||
virtual bool serialize(void *data,uint32_t& size) const = 0 ; // Isn't it better that items can serialize themselves ?
|
||||
virtual uint32_t serial_size() const = 0 ; // deserialise is handled using a constructor
|
||||
|
||||
virtual void clear() {}
|
||||
};
|
||||
@ -63,8 +63,8 @@ class RsTurtleSearchResultItem: public RsTurtleItem
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
|
||||
protected:
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const ;
|
||||
virtual uint32_t serial_size() const ;
|
||||
};
|
||||
|
||||
class RsTurtleSearchRequestItem: public RsTurtleItem
|
||||
@ -92,8 +92,8 @@ class RsTurtleStringSearchRequestItem: public RsTurtleSearchRequestItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
protected:
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const ;
|
||||
virtual uint32_t serial_size() const ;
|
||||
};
|
||||
|
||||
class RsTurtleRegExpSearchRequestItem: public RsTurtleSearchRequestItem
|
||||
@ -109,8 +109,8 @@ class RsTurtleRegExpSearchRequestItem: public RsTurtleSearchRequestItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
protected:
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const ;
|
||||
virtual uint32_t serial_size() const ;
|
||||
};
|
||||
|
||||
/***********************************************************************************/
|
||||
@ -131,8 +131,8 @@ class RsTurtleOpenTunnelItem: public RsTurtleItem
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
|
||||
protected:
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const ;
|
||||
virtual uint32_t serial_size() const ;
|
||||
};
|
||||
|
||||
class RsTurtleTunnelOkItem: public RsTurtleItem
|
||||
@ -147,8 +147,8 @@ class RsTurtleTunnelOkItem: public RsTurtleItem
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
|
||||
protected:
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const ;
|
||||
virtual uint32_t serial_size() const ;
|
||||
};
|
||||
|
||||
/***********************************************************************************/
|
||||
@ -208,8 +208,8 @@ class RsTurtleGenericDataItem: public RsTurtleGenericTunnelItem
|
||||
|
||||
virtual std::ostream& print(std::ostream& o, uint16_t) ;
|
||||
protected:
|
||||
virtual bool serialize(void *data,uint32_t& size) ;
|
||||
virtual uint32_t serial_size() ;
|
||||
virtual bool serialize(void *data,uint32_t& size) const ;
|
||||
virtual uint32_t serial_size() const ;
|
||||
};
|
||||
|
||||
/***********************************************************************************/
|
||||
|
@ -30,7 +30,17 @@
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
int __attribute__((weak)) pthread_setname_np(const char *__buf) ;
|
||||
int RS_pthread_setname_np(pthread_t /*__target_thread*/, const char *__buf) {
|
||||
return pthread_setname_np(__buf);
|
||||
}
|
||||
#else
|
||||
int __attribute__((weak)) pthread_setname_np(pthread_t __target_thread, const char *__buf) ;
|
||||
int RS_pthread_setname_np(pthread_t __target_thread, const char *__buf) {
|
||||
return pthread_setname_np(__target_thread, __buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RSMUTEX_DEBUG
|
||||
#include <stdio.h>
|
||||
@ -147,6 +157,11 @@ void RsTickingThread::fullstop()
|
||||
|
||||
void RsThread::start(const std::string &threadName)
|
||||
{
|
||||
if(isRunning())
|
||||
{
|
||||
std::cerr << "(EE) RsThread \"" << threadName << "\" is already running. Will not start twice!" << std::endl;
|
||||
return ;
|
||||
}
|
||||
pthread_t tid;
|
||||
void *data = (void *)this ;
|
||||
|
||||
@ -167,19 +182,21 @@ void RsThread::start(const std::string &threadName)
|
||||
// set name
|
||||
|
||||
if(pthread_setname_np)
|
||||
if(!threadName.empty())
|
||||
{
|
||||
// thread names are restricted to 16 characters including the terminating null byte
|
||||
if(threadName.length() > 15)
|
||||
{
|
||||
{
|
||||
if(!threadName.empty())
|
||||
{
|
||||
// thread names are restricted to 16 characters including the terminating null byte
|
||||
if(threadName.length() > 15)
|
||||
{
|
||||
#ifdef DEBUG_THREADS
|
||||
THREAD_DEBUG << "RsThread::start called with to long name '" << name << "' truncating..." << std::endl;
|
||||
THREAD_DEBUG << "RsThread::start called with to long name '" << name << "' truncating..." << std::endl;
|
||||
#endif
|
||||
pthread_setname_np(mTid, threadName.substr(0, 15).c_str());
|
||||
} else {
|
||||
pthread_setname_np(mTid, threadName.c_str());
|
||||
}
|
||||
}
|
||||
RS_pthread_setname_np(mTid, threadName.substr(0, 15).c_str());
|
||||
} else {
|
||||
RS_pthread_setname_np(mTid, threadName.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,11 +1,7 @@
|
||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||
|
||||
TEMPLATE = lib
|
||||
macx {
|
||||
CONFIG = staticlib
|
||||
} else {
|
||||
CONFIG += staticlib
|
||||
}
|
||||
CONFIG += staticlib
|
||||
|
||||
DEFINES *= OPENSSL_NO_IDEA
|
||||
|
||||
@ -13,8 +9,8 @@ QMAKE_CXXFLAGS *= -Wall -Werror -W
|
||||
|
||||
TARGET = ops
|
||||
DESTDIR = lib
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
DEPENDPATH += . $$INC_DIR
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
|
||||
#################################### Windows #####################################
|
||||
|
||||
@ -34,9 +30,13 @@ win32 {
|
||||
# Switch on optimization for debug version
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||
#QMAKE_CFLAGS_DEBUG += -O2
|
||||
}
|
||||
|
||||
DEPENDPATH += $$INC_DIR
|
||||
INCLUDEPATH += $$INC_DIR
|
||||
|
||||
macx {
|
||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
||||
DEFINES += OPENSSL_NO_CAMELLIA
|
||||
}
|
||||
|
||||
# Input
|
||||
@ -73,8 +73,10 @@ HEADERS += openpgpsdk/writer.h \
|
||||
openpgpsdk/armour.h \
|
||||
openpgpsdk/parse_local.h \
|
||||
openpgpsdk/keyring_local.h \
|
||||
openpgpsdk/opsdir.h \
|
||||
openpgpsdk/opsstring.h
|
||||
openpgpsdk/opsdir.h
|
||||
win32{
|
||||
HEADERS += openpgpsdk/opsstring.h
|
||||
}
|
||||
|
||||
SOURCES += openpgpsdk/accumulate.c \
|
||||
openpgpsdk/compress.c \
|
||||
@ -113,8 +115,10 @@ SOURCES += openpgpsdk/accumulate.c \
|
||||
openpgpsdk/writer_memory.c \
|
||||
openpgpsdk/writer_skey_checksum.c \
|
||||
openpgpsdk/writer_stream_encrypt_se_ip.c \
|
||||
openpgpsdk/opsdir.c \
|
||||
openpgpsdk/opsstring.c
|
||||
openpgpsdk/opsdir.c
|
||||
win32{
|
||||
SOURCES += openpgpsdk/opsstring.c
|
||||
}
|
||||
|
||||
################################# Android #####################################
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "opsdir.h"
|
||||
#ifdef WIN32
|
||||
#include "opsstring.h"
|
||||
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
||||
int ops_open(const char* filename, int flag, int pmode)
|
||||
|
@ -1387,7 +1387,12 @@ QString TransfersDialog::getPeerName(const RsPeerId& id) const
|
||||
// connect mgr). In such a case their id can suitably hold for a name.
|
||||
//
|
||||
if(res == "")
|
||||
{
|
||||
if(rsFiles->isEncryptedSource(id))
|
||||
return tr("Anonymous end-to-end encrypted tunnel 0x")+QString::fromStdString(id.toStdString()).left(8) ;
|
||||
else
|
||||
return tr("Anonymous tunnel 0x")+QString::fromStdString(id.toStdString()).left(8) ;
|
||||
}
|
||||
else
|
||||
return res ;
|
||||
}
|
||||
|
@ -584,10 +584,13 @@ void GenCertDialog::genPerson()
|
||||
|
||||
QCoreApplication::processEvents();
|
||||
QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance();
|
||||
std::cout << "Waiting ed->processEvents()" << std::endl;
|
||||
time_t waitEnd = time(NULL) + 10;//Wait no more than 10 sec to processEvents
|
||||
if (ed->hasPendingEvents())
|
||||
while(ed->processEvents(QEventLoop::AllEvents));
|
||||
while(ed->processEvents(QEventLoop::AllEvents) && (time(NULL) < waitEnd));
|
||||
|
||||
std::string email_str = "" ;
|
||||
std::cout << "RsAccounts::GeneratePGPCertificate" << std::endl;
|
||||
RsAccounts::GeneratePGPCertificate(
|
||||
ui.name_input->text().toUtf8().constData(),
|
||||
email_str.c_str(),
|
||||
@ -609,6 +612,7 @@ void GenCertDialog::genPerson()
|
||||
std::cerr << "GenCertDialog::genPerson() Generating SSL cert with gpg id : " << PGPId << std::endl;
|
||||
std::string err;
|
||||
this->hide();//To show dialog asking password PGP Key.
|
||||
std::cout << "RsAccounts::GenerateSSLCertificate" << std::endl;
|
||||
bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err);
|
||||
|
||||
if (okGen)
|
||||
|
@ -235,7 +235,7 @@ void QuickStartWizard::on_pushButtonSharesAdd_clicked()
|
||||
{
|
||||
SharedDirInfo sdi ;
|
||||
sdi.filename = dir ;
|
||||
sdi.shareflags = DIR_FLAGS_BROWSABLE_OTHERS | DIR_FLAGS_NETWORK_WIDE_OTHERS ;
|
||||
sdi.shareflags = DIR_FLAGS_BROWSABLE | DIR_FLAGS_ANONYMOUS_DOWNLOAD ;
|
||||
|
||||
rsFiles->addSharedDirectory(sdi);
|
||||
|
||||
@ -331,8 +331,8 @@ void QuickStartWizard::loadShare()
|
||||
QCheckBox *cb1 = new QCheckBox ;
|
||||
QCheckBox *cb2 = new QCheckBox ;
|
||||
|
||||
cb1->setChecked( (*it).shareflags & DIR_FLAGS_NETWORK_WIDE_OTHERS ) ;
|
||||
cb2->setChecked( (*it).shareflags & DIR_FLAGS_BROWSABLE_OTHERS ) ;
|
||||
cb1->setChecked( (*it).shareflags & DIR_FLAGS_ANONYMOUS_DOWNLOAD ) ;
|
||||
cb2->setChecked( (*it).shareflags & DIR_FLAGS_BROWSABLE ) ;
|
||||
|
||||
cb1->setToolTip(tr("If checked, the share is anonymously shared to anybody.")) ;
|
||||
cb2->setToolTip(tr("If checked, the share is browsable by your friends.")) ;
|
||||
@ -364,8 +364,8 @@ void QuickStartWizard::updateFlags(bool b)
|
||||
{
|
||||
std::cerr << "Looking for row=" << row << ", file=" << (*it).filename << ", flags=" << (*it).shareflags << std::endl ;
|
||||
FileStorageFlags current_flags(0u) ;
|
||||
current_flags |= (dynamic_cast<QCheckBox*>(ui.shareddirList->cellWidget(row,1)))->isChecked()? DIR_FLAGS_NETWORK_WIDE_OTHERS:(FileStorageFlags)0u ;
|
||||
current_flags |= (dynamic_cast<QCheckBox*>(ui.shareddirList->cellWidget(row,2)))->isChecked()? DIR_FLAGS_BROWSABLE_OTHERS :(FileStorageFlags)0u ;
|
||||
current_flags |= (dynamic_cast<QCheckBox*>(ui.shareddirList->cellWidget(row,1)))->isChecked()? DIR_FLAGS_ANONYMOUS_DOWNLOAD:(FileStorageFlags)0u ;
|
||||
current_flags |= (dynamic_cast<QCheckBox*>(ui.shareddirList->cellWidget(row,2)))->isChecked()? DIR_FLAGS_BROWSABLE :(FileStorageFlags)0u ;
|
||||
|
||||
if( ((*it).shareflags ^ current_flags).toUInt32() )
|
||||
{
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <gui/common/RsUrlHandler.h>
|
||||
#include <gui/common/FilesDefs.h>
|
||||
#include <gui/common/GroupDefs.h>
|
||||
#include <gui/gxs/GxsIdDetails.h>
|
||||
#include "RemoteDirModel.h"
|
||||
#include <retroshare/rsfiles.h>
|
||||
#include <retroshare/rstypes.h>
|
||||
@ -216,16 +217,21 @@ QString RetroshareDirModel::getFlagsString(FileStorageFlags flags)
|
||||
{
|
||||
char str[11] = "- - -" ;
|
||||
|
||||
if(flags & DIR_FLAGS_BROWSABLE_GROUPS) str[0] = 'B' ;
|
||||
//if(flags & DIR_FLAGS_NETWORK_WIDE_GROUPS) str[3] = 'N' ;
|
||||
if(flags & DIR_FLAGS_BROWSABLE_OTHERS) str[3] = 'B' ;
|
||||
if(flags & DIR_FLAGS_NETWORK_WIDE_OTHERS) str[6] = 'N' ;
|
||||
if(flags & DIR_FLAGS_BROWSABLE) str[0] = 'B' ;
|
||||
if(flags & DIR_FLAGS_ANONYMOUS_SEARCH) str[3] = 'S' ;
|
||||
if(flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) str[6] = 'N' ;
|
||||
|
||||
return QString(str) ;
|
||||
}
|
||||
QString RetroshareDirModel::getGroupsString(const std::list<RsNodeGroupId>& group_ids)
|
||||
QString RetroshareDirModel::getGroupsString(FileStorageFlags flags,const std::list<RsNodeGroupId>& group_ids)
|
||||
{
|
||||
QString groups_str ;
|
||||
if(!(flags & DIR_FLAGS_BROWSABLE))
|
||||
return QString();
|
||||
|
||||
if(group_ids.empty())
|
||||
return tr("[All friend nodes]") ;
|
||||
|
||||
QString groups_str = tr("Only ");
|
||||
RsGroupInfo group_info ;
|
||||
|
||||
for(std::list<RsNodeGroupId>::const_iterator it(group_ids.begin());it!=group_ids.end();)
|
||||
@ -271,8 +277,55 @@ QString RetroshareDirModel::getAgeIndicatorString(const DirDetails &details) con
|
||||
return ret;
|
||||
}
|
||||
|
||||
const QIcon& RetroshareDirModel::getFlagsIcon(FileStorageFlags flags)
|
||||
{
|
||||
static QIcon *static_icons[8] = {NULL};
|
||||
|
||||
int n=0;
|
||||
if(flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) n += 1 ;
|
||||
if(flags & DIR_FLAGS_ANONYMOUS_SEARCH ) n += 2 ;
|
||||
if(flags & DIR_FLAGS_BROWSABLE ) n += 4 ;
|
||||
n-= 1;
|
||||
|
||||
if(static_icons[n] == NULL)
|
||||
{
|
||||
QList<QIcon> icons ;
|
||||
|
||||
if(flags & DIR_FLAGS_ANONYMOUS_SEARCH)
|
||||
icons.push_back(QIcon(":icons/search_red_128.png")) ;
|
||||
else
|
||||
icons.push_back(QIcon(":icons/void_128.png")) ;
|
||||
|
||||
if(flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD)
|
||||
icons.push_back(QIcon(":icons/anonymous_blue_128.png")) ;
|
||||
else
|
||||
icons.push_back(QIcon(":icons/void_128.png")) ;
|
||||
|
||||
if(flags & DIR_FLAGS_BROWSABLE)
|
||||
icons.push_back(QIcon(":icons/browsable_green_128.png")) ;
|
||||
else
|
||||
icons.push_back(QIcon(":icons/void_128.png")) ;
|
||||
|
||||
QPixmap pix ;
|
||||
GxsIdDetails::GenerateCombinedPixmap(pix, icons, 128);
|
||||
|
||||
static_icons[n] = new QIcon(pix);
|
||||
|
||||
std::cerr << "Generated icon for flags " << std::hex << flags << std::endl;
|
||||
}
|
||||
return *static_icons[n] ;
|
||||
}
|
||||
|
||||
QVariant RetroshareDirModel::decorationRole(const DirDetails& details,int coln) const
|
||||
{
|
||||
if(coln == 3)
|
||||
{
|
||||
if(details.type == DIR_TYPE_PERSON) return QVariant() ;
|
||||
|
||||
return getFlagsIcon(details.flags) ;
|
||||
}
|
||||
|
||||
|
||||
if(coln > 0)
|
||||
return QVariant() ;
|
||||
|
||||
@ -352,16 +405,9 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
||||
case 2:
|
||||
return misc::userFriendlyDuration(details.min_age);
|
||||
case 3:
|
||||
return getFlagsString(details.flags);
|
||||
// case 4:
|
||||
// {
|
||||
// QString ind("");
|
||||
// if (ageIndicator != IND_ALWAYS)
|
||||
// ind = getAgeIndicatorString(details);
|
||||
// return ind;
|
||||
// }
|
||||
return QVariant();
|
||||
case 4:
|
||||
return getGroupsString(details.parent_groups) ;
|
||||
return getGroupsString(details.flags,details.parent_groups) ;
|
||||
|
||||
default:
|
||||
return tr("FILE");
|
||||
@ -383,9 +429,9 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
||||
case 2:
|
||||
return misc::userFriendlyDuration(details.min_age);
|
||||
case 3:
|
||||
return getFlagsString(details.flags);
|
||||
return QVariant();
|
||||
case 4:
|
||||
return getGroupsString(details.parent_groups) ;
|
||||
return getGroupsString(details.flags,details.parent_groups) ;
|
||||
|
||||
default:
|
||||
return tr("DIR");
|
||||
@ -663,12 +709,12 @@ QVariant TreeStyle_RDM::headerData(int section, Qt::Orientation orientation, int
|
||||
if (RemoteMode)
|
||||
return tr("Friend");
|
||||
else
|
||||
return tr("Share Flags");
|
||||
return tr("Access");
|
||||
case 4:
|
||||
if (RemoteMode)
|
||||
return tr("What's new");
|
||||
else
|
||||
return tr("Groups");
|
||||
return tr("Visibility");
|
||||
}
|
||||
return QString("Column %1").arg(section);
|
||||
}
|
||||
|
@ -94,9 +94,10 @@ class RetroshareDirModel : public QAbstractItemModel
|
||||
void treeStyle();
|
||||
void downloadDirectory(const DirDetails & details, int prefixLen);
|
||||
static QString getFlagsString(FileStorageFlags f) ;
|
||||
static QString getGroupsString(const std::list<RsNodeGroupId> &) ;
|
||||
static QString getGroupsString(FileStorageFlags flags, const std::list<RsNodeGroupId> &) ;
|
||||
QString getAgeIndicatorString(const DirDetails &) const;
|
||||
// void getAgeIndicatorRec(const DirDetails &details, QString &ret) const;
|
||||
static const QIcon& getFlagsIcon(FileStorageFlags flags) ;
|
||||
|
||||
virtual QVariant displayRole(const DirDetails&,int) const = 0 ;
|
||||
virtual QVariant sortRole(const QModelIndex&,const DirDetails&,int) const =0;
|
||||
|
@ -1587,46 +1587,8 @@ void RSLinkClipboard::parseClipboard(QList<RetroShareLink> &links)
|
||||
{
|
||||
// parse clipboard for links.
|
||||
//
|
||||
links.clear();
|
||||
QString text = QApplication::clipboard()->text() ;
|
||||
|
||||
std::cerr << "Parsing clipboard:" << text.toStdString() << std::endl ;
|
||||
|
||||
QRegExp rx(QString("retroshare://(%1)[^\r\n]+").arg(HOST_REGEXP));
|
||||
|
||||
int pos = 0;
|
||||
|
||||
while((pos = rx.indexIn(text, pos)) != -1)
|
||||
{
|
||||
QString url(text.mid(pos, rx.matchedLength()));
|
||||
RetroShareLink link(url);
|
||||
|
||||
if(link.valid())
|
||||
{
|
||||
// check that the link is not already in the list:
|
||||
bool already = false ;
|
||||
for (int i = 0; i <links.size(); ++i)
|
||||
if(links[i] == link)
|
||||
{
|
||||
already = true ;
|
||||
break ;
|
||||
}
|
||||
|
||||
if(!already)
|
||||
{
|
||||
links.push_back(link) ;
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << "captured link: " << link.toString().toStdString() << std::endl ;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_RSLINK
|
||||
else
|
||||
std::cerr << "invalid link" << std::endl ;
|
||||
#endif
|
||||
|
||||
pos += rx.matchedLength();
|
||||
}
|
||||
parseText(text, links);
|
||||
}
|
||||
|
||||
QString RSLinkClipboard::toString()
|
||||
@ -1690,3 +1652,46 @@ bool RSLinkClipboard::empty(RetroShareLink::enumType type /* = RetroShareLink::T
|
||||
return RetroShareLink::process(linksToProcess, flag);
|
||||
}
|
||||
|
||||
void RSLinkClipboard::parseText(QString text, QList<RetroShareLink> &links)
|
||||
{
|
||||
links.clear();
|
||||
|
||||
std::cerr << "Parsing text:" << text.toStdString() << std::endl ;
|
||||
|
||||
QRegExp rx(QString("retroshare://(%1)[^\r\n]+").arg(HOST_REGEXP));
|
||||
|
||||
int pos = 0;
|
||||
|
||||
while((pos = rx.indexIn(text, pos)) != -1)
|
||||
{
|
||||
QString url(text.mid(pos, rx.matchedLength()));
|
||||
RetroShareLink link(url);
|
||||
|
||||
if(link.valid())
|
||||
{
|
||||
// check that the link is not already in the list:
|
||||
bool already = false ;
|
||||
for (int i = 0; i <links.size(); ++i)
|
||||
if(links[i] == link)
|
||||
{
|
||||
already = true ;
|
||||
break ;
|
||||
}
|
||||
|
||||
if(!already)
|
||||
{
|
||||
links.push_back(link) ;
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << "captured link: " << link.toString().toStdString() << std::endl ;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_RSLINK
|
||||
else
|
||||
std::cerr << "invalid link" << std::endl ;
|
||||
#endif
|
||||
|
||||
pos += rx.matchedLength();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -208,6 +208,8 @@ class RSLinkClipboard
|
||||
//
|
||||
static int process(RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
|
||||
|
||||
static void parseText(QString text, QList<RetroShareLink> &links) ;
|
||||
|
||||
private:
|
||||
static void parseClipboard(QList<RetroShareLink> &links) ;
|
||||
};
|
||||
|
@ -57,7 +57,7 @@ ShareDialog::ShareDialog(std::string filename, QWidget *parent)
|
||||
hb2->addWidget(new QLabel(tr("Share flags and groups:")+" ")) ;
|
||||
|
||||
groupflagsbox = new GroupFlagsWidget(ui.shareflags_GB) ;
|
||||
groupflagsbox->setFlags(DIR_FLAGS_NETWORK_WIDE_OTHERS) ; // default value
|
||||
groupflagsbox->setFlags(DIR_FLAGS_ANONYMOUS_DOWNLOAD) ; // default value
|
||||
|
||||
messageBox = new QTextEdit(ui.shareflags_GB) ;
|
||||
messageBox->setReadOnly(true) ;
|
||||
|
@ -34,7 +34,8 @@
|
||||
#include "ShareManager.h"
|
||||
#include "ShareDialog.h"
|
||||
#include "settings/rsharesettings.h"
|
||||
#include <gui/common/GroupFlagsWidget.h>
|
||||
#include "gui/common/GroupFlagsWidget.h"
|
||||
#include "gui/common/GroupSelectionBox.h"
|
||||
#include "gui/common/GroupDefs.h"
|
||||
#include "gui/notifyqt.h"
|
||||
#include "util/QtVersion.h"
|
||||
@ -61,33 +62,83 @@ ShareManager::ShareManager()
|
||||
ui.headerFrame->setHeaderText(tr("Share Manager"));
|
||||
|
||||
isLoading = false;
|
||||
load();
|
||||
|
||||
Settings->loadWidgetInformation(this);
|
||||
|
||||
connect(ui.addButton, SIGNAL(clicked( bool ) ), this , SLOT( showShareDialog() ) );
|
||||
connect(ui.editButton, SIGNAL(clicked( bool ) ), this , SLOT( editShareDirectory() ) );
|
||||
connect(ui.removeButton, SIGNAL(clicked( bool ) ), this , SLOT( removeShareDirectory() ) );
|
||||
connect(ui.addButton, SIGNAL(clicked( bool ) ), this , SLOT( addShare() ) );
|
||||
connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(applyAndClose()));
|
||||
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
|
||||
|
||||
connect(ui.shareddirList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(shareddirListCostumPopupMenu(QPoint)));
|
||||
connect(ui.shareddirList, SIGNAL(currentCellChanged(int,int,int,int)), this, SLOT(shareddirListCurrentCellChanged(int,int,int,int)));
|
||||
connect(ui.shareddirList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(shareddirListCustomPopupMenu(QPoint)));
|
||||
connect(ui.shareddirList, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(doubleClickedCell(int,int)));
|
||||
connect(ui.shareddirList, SIGNAL(cellChanged(int,int)), this, SLOT(handleCellChange(int,int)));
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(updateGroups()));
|
||||
|
||||
ui.editButton->setEnabled(false);
|
||||
ui.removeButton->setEnabled(false);
|
||||
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(reload()));
|
||||
|
||||
QHeaderView* header = ui.shareddirList->horizontalHeader();
|
||||
QHeaderView_setSectionResizeModeColumn(header, COLUMN_PATH, QHeaderView::Stretch);
|
||||
|
||||
//header->setResizeMode(COLUMN_NETWORKWIDE, QHeaderView::Fixed);
|
||||
//header->setResizeMode(COLUMN_BROWSABLE, QHeaderView::Fixed);
|
||||
|
||||
header->setHighlightSections(false);
|
||||
|
||||
setAcceptDrops(true);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
reload();
|
||||
}
|
||||
|
||||
void ShareManager::handleCellChange(int row,int column)
|
||||
{
|
||||
if(isLoading)
|
||||
return ;
|
||||
|
||||
if(column == COLUMN_VIRTUALNAME)
|
||||
{
|
||||
// check if the thing already exists
|
||||
|
||||
for(uint32_t i=0;i<mDirInfos.size();++i)
|
||||
if(i != (uint32_t)row && (mDirInfos[row].virtualname == std::string(ui.shareddirList->item(i,COLUMN_VIRTUALNAME)->text().toUtf8())))
|
||||
{
|
||||
ui.shareddirList->item(row,COLUMN_VIRTUALNAME)->setText(QString::fromUtf8(mDirInfos[row].virtualname.c_str())) ;
|
||||
return ;
|
||||
}
|
||||
|
||||
mDirInfos[row].virtualname = std::string(ui.shareddirList->item(row,COLUMN_VIRTUALNAME)->text().toUtf8()) ;
|
||||
}
|
||||
}
|
||||
|
||||
void ShareManager::editShareDirectory()
|
||||
{
|
||||
QTableWidget *listWidget = ui.shareddirList;
|
||||
int row = listWidget -> currentRow();
|
||||
|
||||
doubleClickedCell(row,COLUMN_PATH) ;
|
||||
}
|
||||
|
||||
void ShareManager::doubleClickedCell(int row,int column)
|
||||
{
|
||||
if(column == COLUMN_PATH)
|
||||
{
|
||||
QString dirname = QFileDialog::getExistingDirectory(NULL,tr("Choose directory"),QString(),QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly);
|
||||
|
||||
if(!dirname.isNull())
|
||||
{
|
||||
std::string new_name( dirname.toUtf8() );
|
||||
|
||||
for(uint32_t i=0;i<mDirInfos.size();++i)
|
||||
if(mDirInfos[row].filename == new_name)
|
||||
return ;
|
||||
|
||||
mDirInfos[row].filename = new_name ;
|
||||
load();
|
||||
}
|
||||
}
|
||||
else if(column == COLUMN_GROUPS)
|
||||
{
|
||||
std::list<RsNodeGroupId> selected_groups = GroupSelectionDialog::selectGroups(mDirInfos[row].parent_groups) ;
|
||||
|
||||
mDirInfos[row].parent_groups = selected_groups ;
|
||||
load();
|
||||
}
|
||||
}
|
||||
|
||||
ShareManager::~ShareManager()
|
||||
@ -97,15 +148,25 @@ ShareManager::~ShareManager()
|
||||
Settings->saveWidgetInformation(this);
|
||||
}
|
||||
|
||||
void ShareManager::cancel()
|
||||
{
|
||||
close();
|
||||
}
|
||||
void ShareManager::applyAndClose()
|
||||
{
|
||||
// std::cerr << "ShareManager:::close(): updating!" << std::endl;
|
||||
// This is the only place where we change things.
|
||||
|
||||
std::list<SharedDirInfo> infos ;
|
||||
|
||||
for(uint32_t i=0;i<mDirInfos.size();++i)
|
||||
infos.push_back(mDirInfos[i]) ;
|
||||
|
||||
rsFiles->setSharedDirectories(infos) ;
|
||||
|
||||
updateFlags() ;
|
||||
close() ;
|
||||
}
|
||||
|
||||
void ShareManager::shareddirListCostumPopupMenu( QPoint /*point*/ )
|
||||
void ShareManager::shareddirListCustomPopupMenu( QPoint /*point*/ )
|
||||
{
|
||||
QMenu contextMnu( this );
|
||||
|
||||
@ -121,6 +182,19 @@ void ShareManager::shareddirListCostumPopupMenu( QPoint /*point*/ )
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void ShareManager::reload()
|
||||
{
|
||||
std::list<SharedDirInfo> dirs ;
|
||||
rsFiles->getSharedDirectories(dirs) ;
|
||||
|
||||
mDirInfos.clear();
|
||||
|
||||
for(std::list<SharedDirInfo>::const_iterator it(dirs.begin());it!=dirs.end();++it)
|
||||
mDirInfos.push_back(*it) ;
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
/** Loads the settings for this page */
|
||||
void ShareManager::load()
|
||||
{
|
||||
@ -128,44 +202,46 @@ void ShareManager::load()
|
||||
return ;
|
||||
|
||||
isLoading = true;
|
||||
// std::cerr << "ShareManager:: In load !!!!!" << std::endl ;
|
||||
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
/* get a link to the table */
|
||||
QTableWidget *listWidget = ui.shareddirList;
|
||||
|
||||
/* set new row count */
|
||||
listWidget->setRowCount(dirs.size());
|
||||
listWidget->setRowCount(mDirInfos.size());
|
||||
|
||||
int row=0 ;
|
||||
for(it = dirs.begin(); it != dirs.end(); ++it,++row)
|
||||
for(uint32_t row=0;row<mDirInfos.size();++row)
|
||||
{
|
||||
listWidget->setItem(row, COLUMN_PATH, new QTableWidgetItem(QString::fromUtf8((*it).filename.c_str())));
|
||||
listWidget->setItem(row, COLUMN_VIRTUALNAME, new QTableWidgetItem(QString::fromUtf8((*it).virtualname.c_str())));
|
||||
listWidget->setItem(row, COLUMN_PATH, new QTableWidgetItem(QString::fromUtf8(mDirInfos[row].filename.c_str())));
|
||||
listWidget->setItem(row, COLUMN_VIRTUALNAME, new QTableWidgetItem(QString::fromUtf8(mDirInfos[row].virtualname.c_str())));
|
||||
|
||||
GroupFlagsWidget *widget = new GroupFlagsWidget(NULL,(*it).shareflags);
|
||||
GroupFlagsWidget *widget = new GroupFlagsWidget(NULL,mDirInfos[row].shareflags);
|
||||
|
||||
listWidget->setRowHeight(row, 32 * QFontMetricsF(font()).height()/14.0);
|
||||
listWidget->setCellWidget(row, COLUMN_SHARE_FLAGS, widget);
|
||||
listWidget->setRowHeight(row, 32 * QFontMetricsF(font()).height()/14.0);
|
||||
listWidget->setCellWidget(row, COLUMN_SHARE_FLAGS, widget);
|
||||
|
||||
listWidget->setItem(row, COLUMN_GROUPS, new QTableWidgetItem()) ;
|
||||
listWidget->item(row,COLUMN_GROUPS)->setBackgroundColor(QColor(183,236,181)) ;
|
||||
listWidget->setItem(row, COLUMN_GROUPS, new QTableWidgetItem()) ;
|
||||
listWidget->item(row,COLUMN_GROUPS)->setBackgroundColor(QColor(183,236,181)) ;
|
||||
|
||||
//connect(widget,SIGNAL(flagsChanged(FileStorageFlags)),this,SLOT(updateFlags())) ;
|
||||
connect(widget,SIGNAL(flagsChanged(FileStorageFlags)),this,SLOT(updateFlags())) ;
|
||||
|
||||
listWidget->item(row,COLUMN_PATH)->setToolTip(tr("Double click to change shared directory path")) ;
|
||||
listWidget->item(row,COLUMN_GROUPS)->setToolTip(tr("Double click to select which groups of friends can see the files")) ;
|
||||
listWidget->item(row,COLUMN_VIRTUALNAME)->setToolTip(tr("Double click to change the name that friends will see")) ;
|
||||
|
||||
listWidget->item(row,COLUMN_GROUPS)->setText(getGroupString(mDirInfos[row].parent_groups));
|
||||
|
||||
QFont font = listWidget->item(row,COLUMN_GROUPS)->font();
|
||||
font.setBold(mDirInfos[row].shareflags & DIR_FLAGS_BROWSABLE) ;
|
||||
listWidget->item(row,COLUMN_GROUPS)->setTextColor( (mDirInfos[row].shareflags & DIR_FLAGS_BROWSABLE)? (Qt::black):(Qt::lightGray)) ;
|
||||
listWidget->item(row,COLUMN_GROUPS)->setFont(font);
|
||||
}
|
||||
|
||||
listWidget->setColumnWidth(COLUMN_SHARE_FLAGS,132 * QFontMetricsF(font()).height()/14.0) ;
|
||||
|
||||
//ui.incomingDir->setText(QString::fromStdString(rsFiles->getDownloadDirectory()));
|
||||
listWidget->setColumnWidth(COLUMN_SHARE_FLAGS,132 * QFontMetricsF(font()).height()/14.0) ;
|
||||
|
||||
listWidget->update(); /* update display */
|
||||
update();
|
||||
|
||||
isLoading = false ;
|
||||
updateGroups();
|
||||
}
|
||||
|
||||
void ShareManager::showYourself()
|
||||
@ -173,6 +249,7 @@ void ShareManager::showYourself()
|
||||
if(_instance == NULL)
|
||||
_instance = new ShareManager() ;
|
||||
|
||||
_instance->reload() ;
|
||||
_instance->show() ;
|
||||
_instance->activateWindow();
|
||||
}
|
||||
@ -184,109 +261,39 @@ void ShareManager::showYourself()
|
||||
}
|
||||
|
||||
if (update_local) {
|
||||
_instance->load();
|
||||
_instance->reload();
|
||||
}
|
||||
}
|
||||
|
||||
void ShareManager::updateFlags()
|
||||
{
|
||||
if(isLoading)
|
||||
return ;
|
||||
|
||||
isLoading = true ; // stops GUI update. Otherwise each call to rsFiles->updateShareFlags() modifies the GUI that we count on to check
|
||||
// what has changed => fail!
|
||||
|
||||
// std::cerr << "Updating flags" << std::endl;
|
||||
|
||||
std::list<SharedDirInfo>::iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
std::map<QString, FileStorageFlags> mapped_flags ;
|
||||
|
||||
for(int row=0;row<ui.shareddirList->rowCount();++row)
|
||||
{
|
||||
QString dirpath = ui.shareddirList->item(row,COLUMN_PATH)->text() ;
|
||||
FileStorageFlags flags = (dynamic_cast<GroupFlagsWidget*>(ui.shareddirList->cellWidget(row,COLUMN_SHARE_FLAGS)))->flags() ;
|
||||
|
||||
mapped_flags[dirpath] = flags ;
|
||||
|
||||
// std::cerr << "Getting new flags " << flags << " for path " << dirpath.toStdString() << std::endl;
|
||||
}
|
||||
|
||||
for(std::list<SharedDirInfo>::iterator it(dirs.begin());it!=dirs.end();++it)
|
||||
{
|
||||
FileStorageFlags newf = mapped_flags[QString::fromUtf8((*it).filename.c_str())] ;
|
||||
|
||||
if( (*it).shareflags != newf )
|
||||
{
|
||||
(*it).shareflags = newf ;
|
||||
rsFiles->updateShareFlags(*it) ; // modifies the flags
|
||||
|
||||
// std::cerr << "Updating flags to " << newf << " for dir " << (*it).filename << std::endl ;
|
||||
}
|
||||
}
|
||||
|
||||
isLoading = false ; // re-enable GUI load
|
||||
load() ; // update the GUI.
|
||||
}
|
||||
|
||||
void ShareManager::updateGroups()
|
||||
{
|
||||
if(isLoading)
|
||||
return ;
|
||||
|
||||
// std::cerr << "Updating groups" << std::endl;
|
||||
|
||||
std::list<SharedDirInfo>::iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
int row=0 ;
|
||||
for(it = dirs.begin(); it != dirs.end(); ++it,++row)
|
||||
for(int row=0;row<ui.shareddirList->rowCount();++row)
|
||||
{
|
||||
QTableWidgetItem *item = ui.shareddirList->item(row, COLUMN_GROUPS);
|
||||
|
||||
QString group_string;
|
||||
int n = 0;
|
||||
for (std::list<RsNodeGroupId>::const_iterator it2((*it).parent_groups.begin());it2!=(*it).parent_groups.end();++it2,++n)
|
||||
{
|
||||
if (n>0)
|
||||
group_string += ", " ;
|
||||
|
||||
RsGroupInfo groupInfo;
|
||||
rsPeers->getGroupInfo(*it2, groupInfo);
|
||||
group_string += GroupDefs::name(groupInfo);
|
||||
}
|
||||
|
||||
item->setText(group_string);
|
||||
FileStorageFlags flags = (dynamic_cast<GroupFlagsWidget*>(ui.shareddirList->cellWidget(row,COLUMN_SHARE_FLAGS)))->flags() ;
|
||||
mDirInfos[row].shareflags = flags ;
|
||||
}
|
||||
load() ; // update the GUI.
|
||||
}
|
||||
|
||||
void ShareManager::editShareDirectory()
|
||||
QString ShareManager::getGroupString(const std::list<RsNodeGroupId>& groups)
|
||||
{
|
||||
/* id current dir */
|
||||
int row = ui.shareddirList->currentRow();
|
||||
QTableWidgetItem *item = ui.shareddirList->item(row, COLUMN_PATH);
|
||||
if(groups.empty())
|
||||
return tr("[All friend nodes]") ;
|
||||
|
||||
if (item) {
|
||||
std::string filename = item->text().toUtf8().constData();
|
||||
int n = 0;
|
||||
QString group_string ;
|
||||
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
for (std::list<RsNodeGroupId>::const_iterator it(groups.begin());it!=groups.end();++it,++n)
|
||||
{
|
||||
if (n>0)
|
||||
group_string += ", " ;
|
||||
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (it->filename == filename) {
|
||||
/* file name found, show dialog */
|
||||
ShareDialog sharedlg (it->filename, this);
|
||||
sharedlg.setWindowTitle(tr("Edit Shared Folder"));
|
||||
sharedlg.exec();
|
||||
load();
|
||||
break;
|
||||
}
|
||||
}
|
||||
RsGroupInfo groupInfo;
|
||||
rsPeers->getGroupInfo(*it, groupInfo);
|
||||
group_string += GroupDefs::name(groupInfo);
|
||||
}
|
||||
|
||||
return group_string ;
|
||||
}
|
||||
|
||||
void ShareManager::removeShareDirectory()
|
||||
@ -301,7 +308,10 @@ void ShareManager::removeShareDirectory()
|
||||
{
|
||||
if ((QMessageBox::question(this, tr("Warning!"),tr("Do you really want to stop sharing this directory ?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes)
|
||||
{
|
||||
rsFiles->removeSharedDirectory( qdir->text().toUtf8().constData());
|
||||
for(uint32_t i=row;i+1<mDirInfos.size();++i)
|
||||
mDirInfos[i] = mDirInfos[i+1] ;
|
||||
|
||||
mDirInfos.pop_back() ;
|
||||
load();
|
||||
}
|
||||
}
|
||||
@ -315,6 +325,30 @@ void ShareManager::showEvent(QShowEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void ShareManager::addShare()
|
||||
{
|
||||
QString fname = QFileDialog::getExistingDirectory(NULL,tr("Choose a directory to share"),QString(),QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly);
|
||||
|
||||
if(fname.isNull())
|
||||
return;
|
||||
|
||||
std::string dir_name ( fname.toUtf8() );
|
||||
|
||||
// check that the directory does not already exist
|
||||
|
||||
for(uint32_t i=0;i<mDirInfos.size();++i)
|
||||
if(mDirInfos[i].filename == dir_name)
|
||||
return ;
|
||||
|
||||
mDirInfos.push_back(SharedDirInfo());
|
||||
mDirInfos.back().filename = dir_name ;
|
||||
mDirInfos.back().virtualname = std::string();
|
||||
mDirInfos.back().shareflags = DIR_FLAGS_ANONYMOUS_DOWNLOAD | DIR_FLAGS_ANONYMOUS_SEARCH;
|
||||
mDirInfos.back().parent_groups.clear();
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
void ShareManager::showShareDialog()
|
||||
{
|
||||
ShareDialog sharedlg ("", this);
|
||||
@ -327,14 +361,6 @@ void ShareManager::shareddirListCurrentCellChanged(int currentRow, int currentCo
|
||||
Q_UNUSED(currentColumn);
|
||||
Q_UNUSED(previousRow);
|
||||
Q_UNUSED(previousColumn);
|
||||
|
||||
if (currentRow >= 0) {
|
||||
ui.editButton->setEnabled(true);
|
||||
ui.removeButton->setEnabled(true);
|
||||
} else {
|
||||
ui.editButton->setEnabled(false);
|
||||
ui.removeButton->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void ShareManager::dragEnterEvent(QDragEnterEvent *event)
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <QDialog>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include <retroshare/rsfiles.h>
|
||||
#include "ui_ShareManager.h"
|
||||
|
||||
class ShareManager : public QDialog
|
||||
@ -54,15 +55,20 @@ protected:
|
||||
private slots:
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void shareddirListCurrentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
|
||||
void shareddirListCostumPopupMenu( QPoint point );
|
||||
void shareddirListCustomPopupMenu( QPoint point );
|
||||
void addShare();
|
||||
void doubleClickedCell(int,int);
|
||||
void handleCellChange(int row,int column);
|
||||
void editShareDirectory();
|
||||
|
||||
void showShareDialog();
|
||||
void editShareDirectory();
|
||||
void removeShareDirectory();
|
||||
void updateFlags();
|
||||
void updateGroups();
|
||||
void applyAndClose() ;
|
||||
void applyAndClose() ;
|
||||
void cancel() ;
|
||||
void reload() ;
|
||||
|
||||
static QString getGroupString(const std::list<RsNodeGroupId>& groups);
|
||||
private:
|
||||
static ShareManager *_instance;
|
||||
bool isLoading;
|
||||
@ -72,6 +78,8 @@ private:
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::ShareManager ui;
|
||||
|
||||
std::vector<SharedDirInfo> mDirInfos ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>741</width>
|
||||
<width>1210</width>
|
||||
<height>334</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -18,7 +18,16 @@
|
||||
<normaloff>:/images/logo/logo_16.png</normaloff>:/images/logo/logo_16.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
@ -49,7 +58,7 @@
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0" colspan="6">
|
||||
<item row="1" column="0" colspan="4">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Shared Folder Manager</string>
|
||||
@ -64,7 +73,7 @@
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
<set>QAbstractItemView::DoubleClicked</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
@ -92,17 +101,17 @@
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Directory</string>
|
||||
<string>Shared directory</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Virtual Folder</string>
|
||||
<string>Visible name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Share flags</string>
|
||||
<string>Access</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="If activated, the share is anonymously accessible to anybody"/>
|
||||
@ -110,7 +119,7 @@
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Groups</string>
|
||||
<string>Visibility</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="If checked, the share is browsable by your friends"/>
|
||||
@ -139,7 +148,7 @@
|
||||
<string>Add a Share Directory</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
<string>Add new</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -149,35 +158,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="removeButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Stop sharing selected Directory</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<item row="2" column="1">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -190,24 +171,14 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="closeButton">
|
||||
<property name="text">
|
||||
<string>Apply and close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="editButton">
|
||||
<property name="toolTip">
|
||||
<string>Edit selected Shared Directory</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="StyledLabel" name="labelInstructions">
|
||||
<property name="palette">
|
||||
<palette>
|
||||
@ -290,6 +261,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,8 +25,10 @@
|
||||
#include <QTreeView>
|
||||
#include <QClipboard>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QProcess>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include "SharedFilesDialog.h"
|
||||
#include "settings/AddFileAssociationDialog.h"
|
||||
@ -114,6 +116,36 @@ private:
|
||||
RetroshareDirModel *m_dirModel;
|
||||
};
|
||||
|
||||
// This class allows to draw the item in the share flags column using an appropriate size
|
||||
|
||||
class ShareFlagsItemDelegate: public QStyledItemDelegate
|
||||
{
|
||||
public:
|
||||
ShareFlagsItemDelegate() {}
|
||||
|
||||
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
Q_ASSERT(index.isValid());
|
||||
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
initStyleOption(&opt, index);
|
||||
// disable default icon
|
||||
opt.icon = QIcon();
|
||||
// draw default item
|
||||
QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, 0);
|
||||
|
||||
const QRect r = option.rect;
|
||||
|
||||
// get pixmap
|
||||
QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole));
|
||||
QPixmap pix = icon.pixmap(r.size());
|
||||
|
||||
// draw pixmap at center of item
|
||||
const QPoint p = QPoint((r.width() - pix.width())/2, (r.height() - pix.height())/2);
|
||||
painter->drawPixmap(r.topLeft() + p, pix);
|
||||
}
|
||||
};
|
||||
|
||||
/** Constructor */
|
||||
SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareDirModel *_flat_model,QWidget *parent)
|
||||
: RsAutoUpdatePage(1000,parent),model(NULL)
|
||||
@ -220,7 +252,9 @@ LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent)
|
||||
editshareAct = new QAction(QIcon(IMAGE_EDITSHARE), tr("Edit Share Permissions"), this) ;
|
||||
connect(editshareAct, SIGNAL(triggered()), this, SLOT(editSharePermissions())) ;
|
||||
|
||||
ui.titleBarPixmap->setPixmap(QPixmap(IMAGE_MYFILES)) ;
|
||||
ui.titleBarPixmap->setPixmap(QPixmap(IMAGE_MYFILES)) ;
|
||||
|
||||
ui.dirTreeView->setItemDelegateForColumn(COLUMN_FRIEND,new ShareFlagsItemDelegate()) ;
|
||||
}
|
||||
|
||||
RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
||||
@ -232,6 +266,7 @@ RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
||||
|
||||
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(downloadRemoteSelected()));
|
||||
connect(ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), this, SLOT( expanded(const QModelIndex & ) ) );
|
||||
connect(ui.dirTreeView, SIGNAL( doubleClicked(const QModelIndex & ) ), this, SLOT( expanded(const QModelIndex & ) ) );
|
||||
|
||||
// load settings
|
||||
processSettings(true);
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>737</width>
|
||||
<width>1156</width>
|
||||
<height>402</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -86,7 +86,7 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="addShares_PB">
|
||||
<property name="text">
|
||||
<string>Add Share</string>
|
||||
<string>Configure shared directories</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "util/HandleRichText.h"
|
||||
|
||||
static QHash<QString, QString> Smileys;
|
||||
static QVector<QString> order;
|
||||
|
||||
void Emoticons::load()
|
||||
{
|
||||
@ -115,6 +116,7 @@ void Emoticons::load()
|
||||
} else {
|
||||
Smileys.insert(smcode, smfile);
|
||||
}
|
||||
order.append(smcode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,15 +176,15 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
|
||||
x = 0;
|
||||
y = 0;
|
||||
|
||||
QHashIterator<QString, QString> i(Smileys);
|
||||
QVectorIterator<QString> i(order);
|
||||
while(i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
QString key = i.next();
|
||||
QPushButton *smButton = new QPushButton("", smWidget);
|
||||
smButton->setGeometry(x*buttonWidth, y*buttonHeight, buttonWidth, buttonHeight);
|
||||
smButton->setIconSize(QSize(buttonWidth, buttonHeight));
|
||||
smButton->setIcon(QPixmap(i.value()));
|
||||
smButton->setToolTip(i.key());
|
||||
smButton->setIcon(QPixmap(Smileys.value(key)));
|
||||
smButton->setToolTip(key);
|
||||
smButton->setStyleSheet("QPushButton:hover {border: 3px solid white; border-radius: 2px;}");
|
||||
smButton->setFlat(true);
|
||||
++x;
|
||||
|
@ -3,31 +3,26 @@
|
||||
#include "GroupFlagsWidget.h"
|
||||
#include <retroshare/rsfiles.h>
|
||||
|
||||
#define FLAGS_GROUP_NETWORK_WIDE_ICON ":images/anonymous_128_green.png"
|
||||
#define FLAGS_GROUP_BROWSABLE_ICON ":images/browsable_128_green.png"
|
||||
#define FLAGS_GROUP_UNCHECKED ":images/blank_128_green.png"
|
||||
#define FLAGS_OTHER_NETWORK_WIDE_ICON ":images/anonymous_128_blue.png"
|
||||
#define FLAGS_OTHER_BROWSABLE_ICON ":images/browsable_128_blue.png"
|
||||
#define FLAGS_OTHER_UNCHECKED ":images/blank_128_blue.png"
|
||||
#define FLAGS_ANONYMOUS_SEARCH_ON ":icons/search_red_128.png"
|
||||
#define FLAGS_ANONYMOUS_SEARCH_OFF ":icons/blank_red_128.png"
|
||||
#define FLAGS_BROWSABLE_ON ":icons/browsable_green_128.png"
|
||||
#define FLAGS_BROWSABLE_OFF ":icons/blank_green_128.png"
|
||||
#define FLAGS_ANONYMOUS_DL_ON ":icons/anonymous_blue_128.png"
|
||||
#define FLAGS_ANONYMOUS_DL_OFF ":icons/blank_blue_128.png"
|
||||
|
||||
#define INDEX_GROUP_BROWSABLE 0
|
||||
#define INDEX_GROUP_NETWORK_W 1
|
||||
#define INDEX_OTHER_BROWSABLE 2
|
||||
#define INDEX_OTHER_NETWORK_W 3
|
||||
#define INDEX_GROUP_UNCHECKED 4
|
||||
#define INDEX_OTHER_UNCHECKED 5
|
||||
#define INDEX_ANON_SEARCH 0
|
||||
#define INDEX_ANON_DL 1
|
||||
#define INDEX_BROWSABLE 2
|
||||
|
||||
/*QString GroupFlagsWidget::_tooltips_on[4] = {
|
||||
QObject::tr("Directory is browsable for friends from groups"),
|
||||
QObject::tr("Directory is accessible by anonymous tunnels from friends from groups"),
|
||||
QObject::tr("Directory is browsable for any friend"),
|
||||
QObject::tr("Directory is accessible by anonymous tunnels from any friend")
|
||||
QObject::tr("Directory is visible to friends"),
|
||||
QObject::tr("Directory can be search anonymously"),
|
||||
QObject::tr("Directory is accessible by anonymous tunnels")
|
||||
};
|
||||
QString GroupFlagsWidget::_tooltips_off[4] = {
|
||||
QObject::tr("Directory is NOT browsable for friends from groups"),
|
||||
QObject::tr("Directory is NOT accessible by anonymous tunnels from friends from groups"),
|
||||
QObject::tr("Directory is NOT browsable for any friend"),
|
||||
QObject::tr("Directory is NOT accessible by anonymous tunnels from any friend")
|
||||
QObject::tr("Directory is not visible to friends"),
|
||||
QObject::tr("Directory cannot be searched anonymously"),
|
||||
QObject::tr("Directory is NOT accessible by anonymous tunnels")
|
||||
};
|
||||
*/
|
||||
GroupFlagsWidget::GroupFlagsWidget(QWidget *parent,FileStorageFlags flags)
|
||||
@ -39,35 +34,33 @@ GroupFlagsWidget::GroupFlagsWidget(QWidget *parent,FileStorageFlags flags)
|
||||
setMaximumSize(128 * QFontMetricsF(font()).height()/14.0,32 * QFontMetricsF(font()).height()/14.0) ;
|
||||
setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
|
||||
_icons[INDEX_GROUP_BROWSABLE] = new QIcon(FLAGS_GROUP_BROWSABLE_ICON) ;
|
||||
_icons[INDEX_GROUP_NETWORK_W] = new QIcon(FLAGS_GROUP_NETWORK_WIDE_ICON) ;
|
||||
_icons[INDEX_OTHER_BROWSABLE] = new QIcon(FLAGS_OTHER_BROWSABLE_ICON) ;
|
||||
_icons[INDEX_OTHER_NETWORK_W] = new QIcon(FLAGS_OTHER_NETWORK_WIDE_ICON) ;
|
||||
_icons[INDEX_GROUP_UNCHECKED] = new QIcon(FLAGS_GROUP_UNCHECKED) ;
|
||||
_icons[INDEX_OTHER_UNCHECKED] = new QIcon(FLAGS_OTHER_UNCHECKED) ;
|
||||
_icons[2*INDEX_BROWSABLE+0] = new QIcon(FLAGS_BROWSABLE_OFF) ;
|
||||
_icons[2*INDEX_BROWSABLE+1] = new QIcon(FLAGS_BROWSABLE_ON) ;
|
||||
_icons[2*INDEX_ANON_SEARCH+0] = new QIcon(FLAGS_ANONYMOUS_SEARCH_OFF) ;
|
||||
_icons[2*INDEX_ANON_SEARCH+1] = new QIcon(FLAGS_ANONYMOUS_SEARCH_ON) ;
|
||||
_icons[2*INDEX_ANON_DL+0] = new QIcon(FLAGS_ANONYMOUS_DL_OFF) ;
|
||||
_icons[2*INDEX_ANON_DL+1] = new QIcon(FLAGS_ANONYMOUS_DL_ON) ;
|
||||
|
||||
setLayout(_layout) ;
|
||||
|
||||
_flags[0] = DIR_FLAGS_BROWSABLE_GROUPS ;
|
||||
_flags[1] = DIR_FLAGS_NETWORK_WIDE_GROUPS ;
|
||||
_flags[2] = DIR_FLAGS_BROWSABLE_OTHERS ;
|
||||
_flags[3] = DIR_FLAGS_NETWORK_WIDE_OTHERS ;
|
||||
_flags[INDEX_BROWSABLE ] = DIR_FLAGS_BROWSABLE ;
|
||||
_flags[INDEX_ANON_SEARCH] = DIR_FLAGS_ANONYMOUS_SEARCH ;
|
||||
_flags[INDEX_ANON_DL ] = DIR_FLAGS_ANONYMOUS_DOWNLOAD ;
|
||||
|
||||
for(int i=0;i<4;++i)
|
||||
for(int i=0;i<3;++i)
|
||||
{
|
||||
_buttons[i] = new QPushButton(this) ;
|
||||
_buttons[i]->setCheckable(true) ;
|
||||
_buttons[i]->setChecked(flags & _flags[i]) ;
|
||||
_buttons[i]->setIconSize(QSize(32 * QFontMetricsF(font()).height()/14.0,32 * QFontMetricsF(font()).height()/14.0));
|
||||
|
||||
update_button_state(_buttons[i]->isChecked(),i) ;
|
||||
_layout->addWidget(_buttons[i]) ;
|
||||
}
|
||||
_buttons[INDEX_GROUP_NETWORK_W]->setHidden(true);
|
||||
|
||||
connect(_buttons[INDEX_GROUP_NETWORK_W],SIGNAL(toggled(bool)),this,SLOT(update_GN_button(bool))) ;
|
||||
connect(_buttons[INDEX_OTHER_NETWORK_W],SIGNAL(toggled(bool)),this,SLOT(update_ON_button(bool))) ;
|
||||
connect(_buttons[INDEX_GROUP_BROWSABLE],SIGNAL(toggled(bool)),this,SLOT(update_GB_button(bool))) ;
|
||||
connect(_buttons[INDEX_OTHER_BROWSABLE],SIGNAL(toggled(bool)),this,SLOT(update_OB_button(bool))) ;
|
||||
connect(_buttons[INDEX_ANON_DL ],SIGNAL(toggled(bool)),this,SLOT(update_DL_button(bool))) ;
|
||||
connect(_buttons[INDEX_ANON_SEARCH],SIGNAL(toggled(bool)),this,SLOT(update_SR_button(bool))) ;
|
||||
connect(_buttons[INDEX_BROWSABLE ],SIGNAL(toggled(bool)),this,SLOT(update_BR_button(bool))) ;
|
||||
|
||||
_layout->setSpacing(0);
|
||||
_layout->setContentsMargins(0, 0, 0, 0);
|
||||
@ -84,16 +77,15 @@ FileStorageFlags GroupFlagsWidget::flags() const
|
||||
{
|
||||
FileStorageFlags flags ;
|
||||
|
||||
for(int i=0;i<4;++i)
|
||||
for(int i=0;i<3;++i)
|
||||
if(_buttons[i]->isChecked()) flags |= _flags[i] ;
|
||||
|
||||
flags &= ~DIR_FLAGS_NETWORK_WIDE_GROUPS ;
|
||||
return flags ;
|
||||
}
|
||||
|
||||
void GroupFlagsWidget::setFlags(FileStorageFlags flags)
|
||||
{
|
||||
for(int i=0;i<4;++i)
|
||||
for(int i=0;i<3;++i)
|
||||
{
|
||||
_buttons[i]->setChecked(flags & _flags[i]) ;
|
||||
update_button_state(_buttons[i]->isChecked(),i) ;
|
||||
@ -104,41 +96,28 @@ void GroupFlagsWidget::update_button_state(bool b,int button_id)
|
||||
{
|
||||
QString tip_on, tip_off;
|
||||
switch (button_id) {
|
||||
case 0:
|
||||
tip_on = tr("Directory is browsable for friends from groups");
|
||||
tip_off = tr("Directory is NOT browsable for friends from groups");
|
||||
case INDEX_BROWSABLE:
|
||||
tip_on = tr("Directory content is visible to friend nodes (see list at right)");
|
||||
tip_off = tr("Directory content is NOT visible to friend nodes");
|
||||
break;
|
||||
case 1:
|
||||
tip_on = tr("Directory is accessible by anonymous tunnels from friends from groups");
|
||||
tip_off = tr("Directory is NOT accessible by anonymous tunnels from friends from groups");
|
||||
case INDEX_ANON_SEARCH:
|
||||
tip_on = tr("Directory can be searched anonymously");
|
||||
tip_off = tr("Directory cannot be searched anonymously");
|
||||
break;
|
||||
case 2:
|
||||
tip_on = tr("Directory is browsable for any friend");
|
||||
tip_off = tr("Directory is NOT browsable for any friend");
|
||||
break;
|
||||
case 3:
|
||||
tip_on = tr("Directory is accessible by anonymous tunnels from any friend");
|
||||
tip_off = tr("Directory is NOT accessible by anonymous tunnels from any friend");
|
||||
case INDEX_ANON_DL:
|
||||
if(_buttons[INDEX_ANON_SEARCH]->isChecked())
|
||||
tip_on = tr("Files can be accessed using anonymous tunnels");
|
||||
else
|
||||
tip_on = tr("Files can be accessed using anonymous & end-to-end encrypted tunnels");
|
||||
|
||||
tip_off = tr("Files cannot be downloaded anonymously");
|
||||
break;
|
||||
default:
|
||||
tip_on = "";
|
||||
tip_off = "";
|
||||
}
|
||||
if(b)
|
||||
{
|
||||
_buttons[button_id]->setIcon(*_icons[button_id]) ;
|
||||
_buttons[button_id]->setToolTip(tip_on) ;
|
||||
}
|
||||
else if(button_id == INDEX_GROUP_NETWORK_W || button_id == INDEX_GROUP_BROWSABLE)
|
||||
{
|
||||
_buttons[button_id]->setIcon(*_icons[INDEX_GROUP_UNCHECKED]) ;
|
||||
_buttons[button_id]->setToolTip(tip_off) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
_buttons[button_id]->setIcon(*_icons[INDEX_OTHER_UNCHECKED]) ;
|
||||
_buttons[button_id]->setToolTip(tip_off) ;
|
||||
}
|
||||
_buttons[button_id]->setIcon(*_icons[2*button_id+(int)b]) ;
|
||||
_buttons[button_id]->setToolTip(b?tip_on:tip_off) ;
|
||||
}
|
||||
|
||||
QString GroupFlagsWidget::groupInfoString(FileStorageFlags flags, const QList<QString>& groupNames)
|
||||
@ -155,42 +134,39 @@ QString GroupFlagsWidget::groupInfoString(FileStorageFlags flags, const QList<QS
|
||||
groups_string += *it ;
|
||||
}
|
||||
|
||||
if(flags & DIR_FLAGS_BROWSABLE_OTHERS)
|
||||
res += tr("All friend nodes can browse this directory") + "\n" ;
|
||||
else if(flags & DIR_FLAGS_BROWSABLE_GROUPS)
|
||||
if(!groupNames.empty())
|
||||
res += tr("Only friend nodes in groups %1 can browse this directory").arg(groups_string) + "\n" ;
|
||||
else
|
||||
res += tr("No one can browse this directory") + "\n" ;
|
||||
else
|
||||
res += tr("No one can browse this directory") + "\n" ;
|
||||
if(flags & DIR_FLAGS_BROWSABLE)
|
||||
{
|
||||
if(groupNames.empty())
|
||||
res += tr("All friend nodes can see this directory") + "\n" ;
|
||||
else
|
||||
res += tr("Only visible to friend nodes in groups: %1").arg(groups_string) + "\n" ;
|
||||
}
|
||||
else
|
||||
res += tr("Not visible to friend nodes") + "\n" ;
|
||||
|
||||
if(flags & DIR_FLAGS_NETWORK_WIDE_OTHERS)
|
||||
res += tr("All friend nodes can relay anonymous tunnels to this directory") ;
|
||||
else if(flags & DIR_FLAGS_NETWORK_WIDE_GROUPS)
|
||||
res += tr("Only friend nodes in groups")+" " + groups_string +" "+ tr("can relay anonymous tunnels to this directory") ;
|
||||
else
|
||||
res += tr("No one can anonymously access this directory.") ;
|
||||
|
||||
//if(flags.toUInt32() == 0)
|
||||
// res += tr("No friends can access nor see this directory.") ;
|
||||
if((flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) && !(flags & DIR_FLAGS_ANONYMOUS_SEARCH))
|
||||
res += tr("Files can be downloaded (but not searched) anonymously") ;
|
||||
else if((flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) && (flags & DIR_FLAGS_ANONYMOUS_SEARCH))
|
||||
res += tr("Files can be downloaded and searched anonymously") ;
|
||||
else if(!(flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) && (flags & DIR_FLAGS_ANONYMOUS_SEARCH))
|
||||
res += tr("Files can be searched (but not downloaded) anonymously") ;
|
||||
else
|
||||
res += tr("No one can anonymously access/search these files.") ;
|
||||
|
||||
return res ;
|
||||
}
|
||||
|
||||
void GroupFlagsWidget::update_GN_button(bool b) { update_button_state(b,INDEX_GROUP_NETWORK_W) ; updated() ; }
|
||||
void GroupFlagsWidget::update_GB_button(bool b) { update_button_state(b,INDEX_GROUP_BROWSABLE) ; updated() ; }
|
||||
void GroupFlagsWidget::update_ON_button(bool b) { update_button_state(b,INDEX_OTHER_NETWORK_W) ; updated() ; }
|
||||
void GroupFlagsWidget::update_OB_button(bool b) { update_button_state(b,INDEX_OTHER_BROWSABLE) ; updated() ; }
|
||||
void GroupFlagsWidget::update_DL_button(bool b) { update_button_state(b,INDEX_ANON_DL ) ; updated() ; }
|
||||
void GroupFlagsWidget::update_SR_button(bool b) { update_button_state(b,INDEX_ANON_SEARCH) ; updated() ; }
|
||||
void GroupFlagsWidget::update_BR_button(bool b) { update_button_state(b,INDEX_BROWSABLE ) ; updated() ; }
|
||||
|
||||
GroupFlagsWidget::~GroupFlagsWidget()
|
||||
{
|
||||
for(int i=0;i<4;++i)
|
||||
for(int i=0;i<3;++i)
|
||||
{
|
||||
delete _buttons[i] ;
|
||||
delete _icons[i] ;
|
||||
}
|
||||
delete _icons[INDEX_GROUP_UNCHECKED] ;
|
||||
delete _icons[INDEX_OTHER_UNCHECKED] ;
|
||||
delete _icons[2*i+0] ;
|
||||
delete _icons[2*i+1] ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,10 +22,9 @@ class GroupFlagsWidget: public QWidget
|
||||
void updated() ;
|
||||
|
||||
protected slots:
|
||||
void update_GN_button(bool) ;
|
||||
void update_GB_button(bool) ;
|
||||
void update_ON_button(bool) ;
|
||||
void update_OB_button(bool) ;
|
||||
void update_DL_button(bool) ;
|
||||
void update_SR_button(bool) ;
|
||||
void update_BR_button(bool) ;
|
||||
|
||||
signals:
|
||||
void flagsChanged(FileStorageFlags) const ;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <QLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include "GroupSelectionBox.h"
|
||||
#include "GroupDefs.h"
|
||||
@ -17,7 +19,6 @@ GroupSelectionBox::GroupSelectionBox(QWidget *parent)
|
||||
// Fill with available groups
|
||||
fillGroups();
|
||||
}
|
||||
|
||||
void GroupSelectionBox::fillGroups()
|
||||
{
|
||||
std::list<RsNodeGroupId> selectedIds;
|
||||
@ -78,3 +79,39 @@ void GroupSelectionBox::selectedGroupNames(QList<QString> &groupNames) const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::list<RsNodeGroupId> GroupSelectionDialog::selectGroups(const std::list<RsNodeGroupId>& default_groups)
|
||||
{
|
||||
GroupSelectionDialog gsd(NULL) ;
|
||||
|
||||
gsd.mBox->setSelectedGroupIds(default_groups) ;
|
||||
|
||||
gsd.exec();
|
||||
|
||||
std::list<RsNodeGroupId> selected_groups ;
|
||||
gsd.mBox->selectedGroupIds(selected_groups);
|
||||
|
||||
return selected_groups ;
|
||||
}
|
||||
|
||||
GroupSelectionDialog::~GroupSelectionDialog()
|
||||
{
|
||||
delete mBox ;
|
||||
}
|
||||
GroupSelectionDialog::GroupSelectionDialog(QWidget *parent)
|
||||
{
|
||||
mBox = new GroupSelectionBox(this) ;
|
||||
|
||||
QLayout *l = new QVBoxLayout ;
|
||||
setLayout(l) ;
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
l->addWidget(mBox) ;
|
||||
l->addWidget(buttonBox) ;
|
||||
l->update() ;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <QListWidget>
|
||||
#include <QDialog>
|
||||
#include <retroshare/rsids.h>
|
||||
|
||||
class GroupSelectionBox: public QListWidget
|
||||
@ -8,6 +9,8 @@ class GroupSelectionBox: public QListWidget
|
||||
public:
|
||||
GroupSelectionBox(QWidget *parent);
|
||||
|
||||
static void selectGroups(const std::list<RsNodeGroupId>& default_groups) ;
|
||||
|
||||
void selectedGroupIds(std::list<RsNodeGroupId> &groupIds) const;
|
||||
void selectedGroupNames(QList<QString> &groupNames) const;
|
||||
|
||||
@ -16,3 +19,17 @@ public:
|
||||
private slots:
|
||||
void fillGroups();
|
||||
};
|
||||
|
||||
class GroupSelectionDialog: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GroupSelectionDialog(QWidget *parent) ;
|
||||
virtual ~GroupSelectionDialog() ;
|
||||
|
||||
static std::list<RsNodeGroupId> selectGroups(const std::list<RsNodeGroupId>& default_groups) ;
|
||||
|
||||
private:
|
||||
GroupSelectionBox *mBox ;
|
||||
};
|
||||
|
@ -78,6 +78,17 @@ void MimeTextEdit::insertFromMimeData(const QMimeData* source)
|
||||
}
|
||||
#endif
|
||||
|
||||
//insert retroshare links
|
||||
QList<RetroShareLink> links;
|
||||
RSLinkClipboard::parseText(source->text(), links);
|
||||
if(links.size() > 0)
|
||||
{
|
||||
for(int i = 0; i < links.size(); ++i)
|
||||
insertHtml(links[i].toHtml() + "<br>");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return RSTextEdit::insertFromMimeData(source);
|
||||
}
|
||||
|
||||
|
@ -25,15 +25,16 @@
|
||||
<file>icons/settings/sound.svg</file>
|
||||
<file>icons/settings/webinterface.svg</file>
|
||||
<file>icons/add_user_256.png</file>
|
||||
<file>icons/anonymous_blue_128.png</file>
|
||||
<file>icons/anonymous_green_128.png</file>
|
||||
<file>icons/aol.png</file>
|
||||
<file>icons/avatar_128.png</file>
|
||||
<file>icons/avatar_grey_128.png</file>
|
||||
<file>icons/blank_blue_128.png</file>
|
||||
<file>icons/blank_red_128.png</file>
|
||||
<file>icons/void_128.png</file>
|
||||
<file>icons/blank_green_128.png</file>
|
||||
<file>icons/browsable_blue_128.png</file>
|
||||
<file>icons/blank_blue_128.png</file>
|
||||
<file>icons/browsable_green_128.png</file>
|
||||
<file>icons/search_red_128.png</file>
|
||||
<file>icons/anonymous_blue_128.png</file>
|
||||
<file>icons/bullet_blue_128.png</file>
|
||||
<file>icons/bullet_green_128.png</file>
|
||||
<file>icons/bullet_grey_128.png</file>
|
||||
|
BIN
retroshare-gui/src/gui/icons/blank_red_128.png
Normal file
BIN
retroshare-gui/src/gui/icons/blank_red_128.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
@ -3,7 +3,7 @@
|
||||
echo '<RCC>'
|
||||
echo '\t<qresource prefix="/">'
|
||||
|
||||
for i in `ls *.png`; do
|
||||
for i in `ls *.png */*png */*svg`; do
|
||||
echo '\t\t<file>icons/'$i'</file>'
|
||||
done
|
||||
|
||||
|
BIN
retroshare-gui/src/gui/icons/search_red_128.png
Normal file
BIN
retroshare-gui/src/gui/icons/search_red_128.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.7 KiB |
BIN
retroshare-gui/src/gui/icons/void_128.png
Normal file
BIN
retroshare-gui/src/gui/icons/void_128.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
@ -32,24 +32,31 @@
|
||||
TransferPage::TransferPage(QWidget * parent, Qt::WindowFlags flags)
|
||||
: ConfigPage(parent, flags)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
ui._queueSize_SB->setValue(rsFiles->getQueueSize()) ;
|
||||
ui._queueSize_SB->setValue(rsFiles->getQueueSize()) ;
|
||||
|
||||
switch(rsFiles->defaultChunkStrategy())
|
||||
{
|
||||
case FileChunksInfo::CHUNK_STRATEGY_STREAMING: ui._defaultStrategy_CB->setCurrentIndex(0) ; break ;
|
||||
case FileChunksInfo::CHUNK_STRATEGY_PROGRESSIVE: ui._defaultStrategy_CB->setCurrentIndex(1) ; break ;
|
||||
case FileChunksInfo::CHUNK_STRATEGY_RANDOM: ui._defaultStrategy_CB->setCurrentIndex(2) ; break ;
|
||||
}
|
||||
switch(rsFiles->defaultChunkStrategy())
|
||||
{
|
||||
case FileChunksInfo::CHUNK_STRATEGY_STREAMING: ui._defaultStrategy_CB->setCurrentIndex(0) ; break ;
|
||||
case FileChunksInfo::CHUNK_STRATEGY_PROGRESSIVE: ui._defaultStrategy_CB->setCurrentIndex(1) ; break ;
|
||||
case FileChunksInfo::CHUNK_STRATEGY_RANDOM: ui._defaultStrategy_CB->setCurrentIndex(2) ; break ;
|
||||
}
|
||||
|
||||
ui._diskSpaceLimit_SB->setValue(rsFiles->freeDiskSpaceLimit()) ;
|
||||
switch(rsFiles->defaultEncryptionPolicy())
|
||||
{
|
||||
case RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE: ui._e2e_encryption_CB->setCurrentIndex(0) ; break ;
|
||||
case RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT : ui._e2e_encryption_CB->setCurrentIndex(1) ; break ;
|
||||
}
|
||||
|
||||
QObject::connect(ui._queueSize_SB,SIGNAL(valueChanged(int)),this,SLOT(updateQueueSize(int))) ;
|
||||
QObject::connect(ui._defaultStrategy_CB,SIGNAL(activated(int)),this,SLOT(updateDefaultStrategy(int))) ;
|
||||
QObject::connect(ui._diskSpaceLimit_SB,SIGNAL(valueChanged(int)),this,SLOT(updateDiskSizeLimit(int))) ;
|
||||
QObject::connect(ui._max_tr_up_per_sec_SB, SIGNAL( valueChanged( int ) ), this, SLOT( updateMaxTRUpRate(int) ) );
|
||||
ui._diskSpaceLimit_SB->setValue(rsFiles->freeDiskSpaceLimit()) ;
|
||||
|
||||
QObject::connect(ui._queueSize_SB,SIGNAL(valueChanged(int)),this,SLOT(updateQueueSize(int))) ;
|
||||
QObject::connect(ui._defaultStrategy_CB,SIGNAL(activated(int)),this,SLOT(updateDefaultStrategy(int))) ;
|
||||
QObject::connect(ui._e2e_encryption_CB,SIGNAL(activated(int)),this,SLOT(updateEncryptionPolicy(int))) ;
|
||||
QObject::connect(ui._diskSpaceLimit_SB,SIGNAL(valueChanged(int)),this,SLOT(updateDiskSizeLimit(int))) ;
|
||||
QObject::connect(ui._max_tr_up_per_sec_SB, SIGNAL( valueChanged( int ) ), this, SLOT( updateMaxTRUpRate(int) ) );
|
||||
|
||||
ui._max_tr_up_per_sec_SB->setValue(rsTurtle->getMaxTRForwardRate()) ;
|
||||
}
|
||||
@ -57,6 +64,19 @@ void TransferPage::updateMaxTRUpRate(int b)
|
||||
{
|
||||
rsTurtle->setMaxTRForwardRate(b) ;
|
||||
}
|
||||
|
||||
void TransferPage::updateEncryptionPolicy(int b)
|
||||
{
|
||||
switch(b)
|
||||
{
|
||||
case 1: rsFiles->setDefaultEncryptionPolicy(RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT) ;
|
||||
break ;
|
||||
default:
|
||||
case 0: rsFiles->setDefaultEncryptionPolicy(RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
void TransferPage::updateDefaultStrategy(int i)
|
||||
{
|
||||
switch(i)
|
||||
|
@ -49,6 +49,7 @@ class TransferPage: public ConfigPage
|
||||
void updateDefaultStrategy(int) ;
|
||||
void updateDiskSizeLimit(int) ;
|
||||
void updateMaxTRUpRate(int);
|
||||
void updateEncryptionPolicy(int);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>700</width>
|
||||
<height>356</height>
|
||||
<width>741</width>
|
||||
<height>372</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@ -49,6 +49,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>End-to-end encryption:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@ -135,6 +142,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="_e2e_encryption_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Anonymous tunnels can be end-o-end encrypted. In order to maintain backward compatibility, this can be made optional (choosing &quot;Accepted&quot;), but in the end, all Retroshare nodes will be switched to &quot;Enforced&quot;, meaning that all anonymous transfers will be end-to-end encrypted.</p></body></html></string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Accepted</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Enforced</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -234,6 +234,9 @@ macx {
|
||||
mac_icon.files = $$files($$PWD/rsMacIcon.icns)
|
||||
mac_icon.path = Contents/Resources
|
||||
QMAKE_BUNDLE_DATA += mac_icon
|
||||
mac_webui.files = $$files($$PWD/../../libresapi/src/webui)
|
||||
mac_webui.path = Contents/Resources
|
||||
QMAKE_BUNDLE_DATA += mac_webui
|
||||
|
||||
CONFIG += version_detail_bash_script
|
||||
LIBS += -lssl -lcrypto -lz
|
||||
|
@ -108,12 +108,12 @@ macx {
|
||||
LIB_DIR += "/usr/local/lib"
|
||||
LIB_DIR += "/opt/local/lib"
|
||||
!QMAKE_MACOSX_DEPLOYMENT_TARGET {
|
||||
message(***retroshare.pri: No Target, set it to MacOS 10.10 )
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10
|
||||
message(***retroshare.pri: No Target. Set it to MacOS 10.11 )
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.11
|
||||
}
|
||||
!QMAKE_MAC_SDK {
|
||||
message(***retroshare.pri: No SDK, set it to MacOS 10.10 )
|
||||
QMAKE_MAC_SDK = macosx10.10
|
||||
message(***retroshare.pri: No SDK. Set it to MacOS 10.11 )
|
||||
QMAKE_MAC_SDK = macosx10.11
|
||||
}
|
||||
CONFIG += c++11
|
||||
}
|
||||
|
@ -182,33 +182,40 @@ win32 {
|
||||
################################# MacOSX ##########################################
|
||||
|
||||
mac {
|
||||
QMAKE_CC = $${QMAKE_CXX}
|
||||
OBJECTS_DIR = temp/obj
|
||||
MOC_DIR = temp/moc
|
||||
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
||||
#DEFINES *= MINIUPNPC_VERSION=13
|
||||
DESTDIR = lib
|
||||
QMAKE_CC = $${QMAKE_CXX}
|
||||
OBJECTS_DIR = temp/obj
|
||||
MOC_DIR = temp/moc
|
||||
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
||||
#DEFINES *= MINIUPNPC_VERSION=13
|
||||
DESTDIR = lib
|
||||
|
||||
CONFIG += upnp_miniupnpc
|
||||
CONFIG += upnp_miniupnpc
|
||||
|
||||
# zeroconf disabled at the end of libretroshare.pro (but need the code)
|
||||
CONFIG += zeroconf
|
||||
CONFIG += zcnatassist
|
||||
# zeroconf disabled at the end of libretroshare.pro (but need the code)
|
||||
#CONFIG += zeroconf
|
||||
#CONFIG += zcnatassist
|
||||
|
||||
# Beautiful Hack to fix 64bit file access.
|
||||
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs
|
||||
# Beautiful Hack to fix 64bit file access.
|
||||
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs
|
||||
|
||||
UPNPC_DIR = ../../../miniupnpc-1.0
|
||||
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||
#GPGME_DIR = ../../../../gpgme-1.1.8
|
||||
#UPNPC_DIR = ../../../miniupnpc-1.0
|
||||
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||
#GPGME_DIR = ../../../../gpgme-1.1.8
|
||||
#OPENPGPSDK_DIR = ../../openpgpsdk/src
|
||||
#INCLUDEPATH += . $${UPNPC_DIR}
|
||||
#INCLUDEPATH += $${OPENPGPSDK_DIR}
|
||||
|
||||
OPENPGPSDK_DIR = ../../openpgpsdk/src
|
||||
#for(lib, LIB_DIR):exists($$lib/libminiupnpc.a){ LIBS += $$lib/libminiupnpc.a}
|
||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
||||
|
||||
INCLUDEPATH += . $${UPNPC_DIR}
|
||||
INCLUDEPATH += $${OPENPGPSDK_DIR}
|
||||
DEPENDPATH += . $$INC_DIR
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
INCLUDEPATH += ../../../.
|
||||
|
||||
#../openpgpsdk
|
||||
#INCLUDEPATH += . $${UPNPC_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
|
||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||
LIBS += /usr/local/lib/libsqlcipher.a
|
||||
#LIBS += -lsqlite3
|
||||
}
|
||||
|
||||
################################# FreeBSD ##########################################
|
||||
|
12
tests/unittests/libretroshare/crypto/chacha20_test.cc
Normal file
12
tests/unittests/libretroshare/crypto/chacha20_test.cc
Normal file
@ -0,0 +1,12 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
// from libretroshare
|
||||
|
||||
#include "crypto/chacha20.h"
|
||||
|
||||
TEST(libretroshare_crypto, ChaCha20)
|
||||
{
|
||||
std::cerr << "Testing Chacha20" << std::endl;
|
||||
|
||||
EXPECT_TRUE(librs::crypto::perform_tests()) ;
|
||||
}
|
@ -1,156 +1,156 @@
|
||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||
|
||||
QT += network xml script
|
||||
CONFIG += bitdht
|
||||
|
||||
CONFIG += gxs debug
|
||||
|
||||
gxs {
|
||||
DEFINES += RS_ENABLE_GXS
|
||||
}
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = unittests
|
||||
|
||||
OPENPGPSDK_DIR = ../../openpgpsdk/src
|
||||
INCLUDEPATH *= $${OPENPGPSDK_DIR} ../openpgpsdk
|
||||
|
||||
# it is impossible to use precompield googletest lib
|
||||
# because googletest must be compiled with same compiler flags as the tests!
|
||||
!exists(../googletest/googletest/src/gtest-all.cc){
|
||||
message(trying to git clone googletest...)
|
||||
!system(git clone https://github.com/google/googletest.git ../googletest){
|
||||
error(Could not git clone googletest files. You can manually download them to /tests/googletest)
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDEPATH += \
|
||||
../googletest/googletest/include \
|
||||
../googletest/googletest
|
||||
|
||||
SOURCES += ../googletest/googletest/src/gtest-all.cc
|
||||
|
||||
################################# Linux ##########################################
|
||||
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
||||
linux-* {
|
||||
#CONFIG += version_detail_bash_script
|
||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
||||
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += ../librssimulator/lib/librssimulator.a
|
||||
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS += -lssl -lupnp -lixml -lXss -lgnome-keyring
|
||||
LIBS *= -lcrypto -ldl -lX11 -lz -lpthread
|
||||
|
||||
#LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
no_sqlcipher {
|
||||
DEFINES *= NO_SQLCIPHER
|
||||
PKGCONFIG *= sqlite3
|
||||
} else {
|
||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||
|
||||
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
|
||||
isEmpty(SQLCIPHER_OK) {
|
||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||
|
||||
! exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
|
||||
message(../../../lib/sqlcipher/.libs/libsqlcipher.a does not exist)
|
||||
error(Please fix this and try again. Will stop now.)
|
||||
}
|
||||
|
||||
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a
|
||||
INCLUDEPATH += ../../../lib/sqlcipher/src/
|
||||
INCLUDEPATH += ../../../lib/sqlcipher/tsrc/
|
||||
} else {
|
||||
LIBS += -lsqlcipher
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LIBS *= -lglib-2.0
|
||||
LIBS *= -rdynamic
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= HAS_GNOME_KEYRING
|
||||
}
|
||||
|
||||
linux-g++ {
|
||||
OBJECTS_DIR = temp/linux-g++/obj
|
||||
}
|
||||
|
||||
linux-g++-64 {
|
||||
OBJECTS_DIR = temp/linux-g++-64/obj
|
||||
}
|
||||
|
||||
#################### Cross compilation for windows under Linux ###################
|
||||
|
||||
win32-x-g++ {
|
||||
OBJECTS_DIR = temp/win32-x-g++/obj
|
||||
|
||||
LIBS += ../../libretroshare/src/lib.win32xgcc/libretroshare.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libssl.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libcrypto.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libgpgme.dll.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libminiupnpc.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libz.a
|
||||
LIBS += -L${HOME}/.wine/drive_c/pthreads/lib -lpthreadGCE2
|
||||
LIBS += -lQtUiTools
|
||||
LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32 -gdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
||||
DEFINES *= WINDOWS_SYS WIN32 WIN32_CROSS_UBUNTU
|
||||
|
||||
INCLUDEPATH += ../../../../gpgme-1.1.8/src/
|
||||
INCLUDEPATH += ../../../../libgpg-error-1.7/src/
|
||||
|
||||
RC_FILE = gui/images/retroshare_win.rc
|
||||
}
|
||||
|
||||
#################################### Windows #####################################
|
||||
|
||||
win32 {
|
||||
# Switch on extra warnings
|
||||
QMAKE_CFLAGS += -Wextra
|
||||
QMAKE_CXXFLAGS += -Wextra
|
||||
|
||||
QT += network xml script
|
||||
CONFIG += bitdht
|
||||
|
||||
CONFIG += gxs debug
|
||||
|
||||
gxs {
|
||||
DEFINES += RS_ENABLE_GXS
|
||||
}
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = unittests
|
||||
|
||||
OPENPGPSDK_DIR = ../../openpgpsdk/src
|
||||
INCLUDEPATH *= $${OPENPGPSDK_DIR} ../openpgpsdk
|
||||
|
||||
# it is impossible to use precompield googletest lib
|
||||
# because googletest must be compiled with same compiler flags as the tests!
|
||||
!exists(../googletest/googletest/src/gtest-all.cc){
|
||||
message(trying to git clone googletest...)
|
||||
!system(git clone https://github.com/google/googletest.git ../googletest){
|
||||
error(Could not git clone googletest files. You can manually download them to /tests/googletest)
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDEPATH += \
|
||||
../googletest/googletest/include \
|
||||
../googletest/googletest
|
||||
|
||||
SOURCES += ../googletest/googletest/src/gtest-all.cc
|
||||
|
||||
################################# Linux ##########################################
|
||||
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
||||
linux-* {
|
||||
#CONFIG += version_detail_bash_script
|
||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
||||
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += ../librssimulator/lib/librssimulator.a
|
||||
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS += -lssl -lupnp -lixml -lXss -lgnome-keyring
|
||||
LIBS *= -lcrypto -ldl -lX11 -lz -lpthread
|
||||
|
||||
#LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
no_sqlcipher {
|
||||
DEFINES *= NO_SQLCIPHER
|
||||
PKGCONFIG *= sqlite3
|
||||
} else {
|
||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||
|
||||
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
|
||||
isEmpty(SQLCIPHER_OK) {
|
||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||
|
||||
! exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
|
||||
message(../../../lib/sqlcipher/.libs/libsqlcipher.a does not exist)
|
||||
error(Please fix this and try again. Will stop now.)
|
||||
}
|
||||
|
||||
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a
|
||||
INCLUDEPATH += ../../../lib/sqlcipher/src/
|
||||
INCLUDEPATH += ../../../lib/sqlcipher/tsrc/
|
||||
} else {
|
||||
LIBS += -lsqlcipher
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LIBS *= -lglib-2.0
|
||||
LIBS *= -rdynamic
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= HAS_GNOME_KEYRING
|
||||
}
|
||||
|
||||
linux-g++ {
|
||||
OBJECTS_DIR = temp/linux-g++/obj
|
||||
}
|
||||
|
||||
linux-g++-64 {
|
||||
OBJECTS_DIR = temp/linux-g++-64/obj
|
||||
}
|
||||
|
||||
#################### Cross compilation for windows under Linux ###################
|
||||
|
||||
win32-x-g++ {
|
||||
OBJECTS_DIR = temp/win32-x-g++/obj
|
||||
|
||||
LIBS += ../../libretroshare/src/lib.win32xgcc/libretroshare.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libssl.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libcrypto.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libgpgme.dll.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libminiupnpc.a
|
||||
LIBS += ../../../../lib/win32-x-g++-v0.5/libz.a
|
||||
LIBS += -L${HOME}/.wine/drive_c/pthreads/lib -lpthreadGCE2
|
||||
LIBS += -lQtUiTools
|
||||
LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32 -gdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
||||
DEFINES *= WINDOWS_SYS WIN32 WIN32_CROSS_UBUNTU
|
||||
|
||||
INCLUDEPATH += ../../../../gpgme-1.1.8/src/
|
||||
INCLUDEPATH += ../../../../libgpg-error-1.7/src/
|
||||
|
||||
RC_FILE = gui/images/retroshare_win.rc
|
||||
}
|
||||
|
||||
#################################### Windows #####################################
|
||||
|
||||
win32 {
|
||||
# Switch on extra warnings
|
||||
QMAKE_CFLAGS += -Wextra
|
||||
QMAKE_CXXFLAGS += -Wextra
|
||||
|
||||
# solve linker warnings because of the order of the libraries
|
||||
QMAKE_LFLAGS += -Wl,--start-group
|
||||
|
||||
# Switch off optimization for release version
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE += -O0
|
||||
QMAKE_CFLAGS_RELEASE -= -O2
|
||||
QMAKE_CFLAGS_RELEASE += -O0
|
||||
|
||||
# Switch on optimization for debug version
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||
#QMAKE_CFLAGS_DEBUG += -O2
|
||||
|
||||
OBJECTS_DIR = temp/obj
|
||||
#LIBS += -L"D/Qt/2009.03/qt/plugins/imageformats"
|
||||
#QTPLUGIN += qjpeg
|
||||
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS *= ../librssimulator/lib/librssimulator.a
|
||||
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
||||
|
||||
# Switch off optimization for release version
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE += -O0
|
||||
QMAKE_CFLAGS_RELEASE -= -O2
|
||||
QMAKE_CFLAGS_RELEASE += -O0
|
||||
|
||||
# Switch on optimization for debug version
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||
#QMAKE_CFLAGS_DEBUG += -O2
|
||||
|
||||
OBJECTS_DIR = temp/obj
|
||||
#LIBS += -L"D/Qt/2009.03/qt/plugins/imageformats"
|
||||
#QTPLUGIN += qjpeg
|
||||
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS *= ../librssimulator/lib/librssimulator.a
|
||||
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
||||
|
||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
||||
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += ../librssimulator/lib/librssimulator.a
|
||||
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS += -L"$$PWD/../../../lib"
|
||||
|
||||
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32 -lgdi32
|
||||
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS += -L"$$PWD/../../../lib"
|
||||
|
||||
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32 -lgdi32
|
||||
LIBS += -lwinmm
|
||||
|
||||
DEFINES *= WINDOWS_SYS WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T
|
||||
|
||||
|
||||
DEFINES *= WINDOWS_SYS WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T
|
||||
|
||||
# create lib directory
|
||||
message(CHK_DIR_EXISTS=$(CHK_DIR_EXISTS))
|
||||
message(MKDIR=$(MKDIR))
|
||||
@ -166,227 +166,232 @@ win32 {
|
||||
# Qt 4
|
||||
QMAKE_RC += --include-dir=$$_PRO_FILE_PWD_/../../libretroshare/src
|
||||
}
|
||||
}
|
||||
|
||||
##################################### MacOS ######################################
|
||||
|
||||
macx {
|
||||
# ENABLE THIS OPTION FOR Univeral Binary BUILD.
|
||||
CONFIG += ppc x86
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
|
||||
|
||||
CONFIG += version_detail_bash_script
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += ../librssimulator/lib/librssimulator.a
|
||||
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS += -lssl -lcrypto -lz
|
||||
#LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan
|
||||
LIBS += ../../../miniupnpc-1.0/libminiupnpc.a
|
||||
LIBS += -framework CoreFoundation
|
||||
LIBS += -framework Security
|
||||
|
||||
gxs {
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
LIBS += ../../../lib/libsqlcipher.a
|
||||
#LIBS += -lsqlite3
|
||||
|
||||
}
|
||||
|
||||
|
||||
INCLUDEPATH += .
|
||||
#DEFINES* = MAC_IDLE # for idle feature
|
||||
CONFIG -= uitools
|
||||
|
||||
|
||||
}
|
||||
|
||||
##################################### FreeBSD ######################################
|
||||
|
||||
freebsd-* {
|
||||
INCLUDEPATH *= /usr/local/include/gpgme
|
||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= ../librssimulator/lib/librssimulator.a
|
||||
LIBS *= -lssl
|
||||
LIBS *= -lgpgme
|
||||
LIBS *= -lupnp
|
||||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
gxs {
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
##################################### OpenBSD ######################################
|
||||
|
||||
openbsd-* {
|
||||
INCLUDEPATH *= /usr/local/include
|
||||
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
||||
|
||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= ../librssimulator/lib/librssimulator.a
|
||||
LIBS *= ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS *= -lssl -lcrypto
|
||||
LIBS *= -lgpgme
|
||||
LIBS *= -lupnp
|
||||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
gxs {
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
}
|
||||
|
||||
LIBS *= -rdynamic
|
||||
}
|
||||
|
||||
|
||||
|
||||
############################## Common stuff ######################################
|
||||
|
||||
# On Linux systems that alredy have libssl and libcrypto it is advisable
|
||||
# to rename the patched version of SSL to something like libsslxpgp.a and libcryptoxpg.a
|
||||
|
||||
# ###########################################
|
||||
|
||||
bitdht {
|
||||
LIBS += ../../libbitdht/src/lib/libbitdht.a
|
||||
PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
|
||||
}
|
||||
|
||||
win32 {
|
||||
# must be added after bitdht
|
||||
LIBS += -lws2_32
|
||||
}
|
||||
|
||||
DEPENDPATH += . \
|
||||
|
||||
INCLUDEPATH += ../../libretroshare/src/
|
||||
INCLUDEPATH += ../librssimulator/
|
||||
|
||||
SOURCES += unittests.cc \
|
||||
|
||||
################################ Serialiser ################################
|
||||
HEADERS += libretroshare/serialiser/support.h \
|
||||
libretroshare/serialiser/rstlvutil.h \
|
||||
|
||||
SOURCES += libretroshare/serialiser/rsturtleitem_test.cc \
|
||||
libretroshare/serialiser/rsbaseitem_test.cc \
|
||||
libretroshare/serialiser/rsgxsupdateitem_test.cc \
|
||||
libretroshare/serialiser/rsmsgitem_test.cc \
|
||||
libretroshare/serialiser/rsstatusitem_test.cc \
|
||||
libretroshare/serialiser/rsnxsitems_test.cc \
|
||||
libretroshare/serialiser/rsgxsiditem_test.cc \
|
||||
# libretroshare/serialiser/rsphotoitem_test.cc \
|
||||
libretroshare/serialiser/tlvbase_test2.cc \
|
||||
libretroshare/serialiser/tlvrandom_test.cc \
|
||||
libretroshare/serialiser/tlvbase_test.cc \
|
||||
libretroshare/serialiser/tlvstack_test.cc \
|
||||
libretroshare/serialiser/tlvitems_test.cc \
|
||||
# libretroshare/serialiser/rsgrouteritem_test.cc \
|
||||
libretroshare/serialiser/tlvtypes_test.cc \
|
||||
libretroshare/serialiser/tlvkey_test.cc \
|
||||
libretroshare/serialiser/support.cc \
|
||||
libretroshare/serialiser/rstlvutil.cc \
|
||||
|
||||
# Still to convert these.
|
||||
# libretroshare/serialiser/rsconfigitem_test.cc \
|
||||
# libretroshare/serialiser/rsgrouteritem_test.cc \
|
||||
|
||||
|
||||
################################## GXS #####################################
|
||||
|
||||
HEADERS += libretroshare/gxs/common/data_support.h \
|
||||
|
||||
SOURCES += libretroshare/gxs/common/data_support.cc \
|
||||
|
||||
HEADERS += libretroshare/gxs/nxs_test/nxsdummyservices.h \
|
||||
libretroshare/gxs/nxs_test/nxsgrptestscenario.h \
|
||||
libretroshare/gxs/nxs_test/nxsmsgtestscenario.h \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsync_test.h \
|
||||
libretroshare/gxs/nxs_test/nxsmsgsync_test.h \
|
||||
libretroshare/gxs/nxs_test/nxstesthub.h \
|
||||
libretroshare/gxs/nxs_test/nxstestscenario.h \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsyncdelayed.h
|
||||
|
||||
SOURCES += libretroshare/gxs/nxs_test/nxsdummyservices.cc \
|
||||
libretroshare/gxs/nxs_test/nxsgrptestscenario.cc \
|
||||
libretroshare/gxs/nxs_test/nxsmsgtestscenario.cc \
|
||||
libretroshare/gxs/nxs_test/nxstesthub.cc \
|
||||
libretroshare/gxs/nxs_test/rsgxsnetservice_test.cc \
|
||||
libretroshare/gxs/nxs_test/nxsmsgsync_test.cc \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsync_test.cc \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsyncdelayed.cc
|
||||
|
||||
HEADERS += libretroshare/gxs/gen_exchange/genexchangetester.h \
|
||||
libretroshare/gxs/gen_exchange/gxspublishmsgtest.h \
|
||||
libretroshare/gxs/gen_exchange/genexchangetestservice.h \
|
||||
libretroshare/gxs/gen_exchange/gxspublishgrouptest.h \
|
||||
libretroshare/gxs/gen_exchange/rsdummyservices.h \
|
||||
libretroshare/gxs/gen_exchange/gxsteststats.cpp
|
||||
|
||||
# libretroshare/gxs/gen_exchange/gxsmsgrelatedtest.h \
|
||||
|
||||
SOURCES += libretroshare/gxs/gen_exchange/gxspublishgrouptest.cc \
|
||||
libretroshare/gxs/gen_exchange/gxsteststats.cpp \
|
||||
libretroshare/gxs/gen_exchange/gxspublishmsgtest.cc \
|
||||
libretroshare/gxs/gen_exchange/rsdummyservices.cc \
|
||||
libretroshare/gxs/gen_exchange/rsgenexchange_test.cc \
|
||||
libretroshare/gxs/gen_exchange/genexchangetester.cc \
|
||||
libretroshare/gxs/gen_exchange/genexchangetestservice.cc \
|
||||
|
||||
SOURCES += libretroshare/gxs/security/gxssecurity_test.cc
|
||||
|
||||
# libretroshare/gxs/gen_exchange/gxsmsgrelatedtest.cc \
|
||||
|
||||
HEADERS += libretroshare/gxs/data_service/rsdataservice_test.h \
|
||||
|
||||
SOURCES += libretroshare/gxs/data_service/rsdataservice_test.cc \
|
||||
libretroshare/gxs/data_service/rsgxsdata_test.cc \
|
||||
|
||||
|
||||
################################ dbase #####################################
|
||||
|
||||
|
||||
#SOURCES += libretroshare/dbase/fisavetest.cc \
|
||||
# libretroshare/dbase/fitest2.cc \
|
||||
# libretroshare/dbase/searchtest.cc \
|
||||
|
||||
# libretroshare/dbase/ficachetest.cc \
|
||||
# libretroshare/dbase/fimontest.cc \
|
||||
|
||||
|
||||
############################### services ###################################
|
||||
|
||||
SOURCES += libretroshare/services/status/status_test.cc \
|
||||
|
||||
############################### gxs ########################################
|
||||
|
||||
HEADERS += libretroshare/services/gxs/rsgxstestitems.h \
|
||||
libretroshare/services/gxs/gxstestservice.h \
|
||||
libretroshare/services/gxs/GxsIsolatedServiceTester.h \
|
||||
libretroshare/services/gxs/GxsPeerNode.h \
|
||||
libretroshare/services/gxs/GxsPairServiceTester.h \
|
||||
libretroshare/services/gxs/FakePgpAuxUtils.h \
|
||||
|
||||
# libretroshare/services/gxs/RsGxsNetServiceTester.h \
|
||||
|
||||
SOURCES += libretroshare/services/gxs/rsgxstestitems.cc \
|
||||
libretroshare/services/gxs/gxstestservice.cc \
|
||||
libretroshare/services/gxs/GxsIsolatedServiceTester.cc \
|
||||
libretroshare/services/gxs/GxsPeerNode.cc \
|
||||
libretroshare/services/gxs/GxsPairServiceTester.cc \
|
||||
libretroshare/services/gxs/FakePgpAuxUtils.cc \
|
||||
libretroshare/services/gxs/nxsbasic_test.cc \
|
||||
libretroshare/services/gxs/nxspair_tests.cc \
|
||||
libretroshare/services/gxs/gxscircle_tests.cc \
|
||||
|
||||
# libretroshare/services/gxs/gxscircle_mintest.cc \
|
||||
|
||||
|
||||
# libretroshare/services/gxs/RsGxsNetServiceTester.cc \
|
||||
}
|
||||
|
||||
##################################### MacOS ######################################
|
||||
|
||||
macx {
|
||||
# ENABLE THIS OPTION FOR Univeral Binary BUILD.
|
||||
#CONFIG += ppc x86
|
||||
#QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
|
||||
|
||||
CONFIG += version_detail_bash_script
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += ../librssimulator/lib/librssimulator.a
|
||||
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS += -lssl -lcrypto -lz
|
||||
#LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan
|
||||
for(lib, LIB_DIR):exists($$lib/libminiupnpc.a){ LIBS += $$lib/libminiupnpc.a}
|
||||
LIBS += -framework CoreFoundation
|
||||
LIBS += -framework Security
|
||||
|
||||
|
||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
||||
|
||||
DEPENDPATH += . $$INC_DIR
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
|
||||
#LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||
LIBS += /usr/local/lib/libsqlcipher.a
|
||||
#LIBS += -lsqlite3
|
||||
|
||||
#DEFINES* = MAC_IDLE # for idle feature
|
||||
CONFIG -= uitools
|
||||
}
|
||||
|
||||
##################################### FreeBSD ######################################
|
||||
|
||||
freebsd-* {
|
||||
INCLUDEPATH *= /usr/local/include/gpgme
|
||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= ../librssimulator/lib/librssimulator.a
|
||||
LIBS *= -lssl
|
||||
LIBS *= -lgpgme
|
||||
LIBS *= -lupnp
|
||||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
gxs {
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
##################################### OpenBSD ######################################
|
||||
|
||||
openbsd-* {
|
||||
INCLUDEPATH *= /usr/local/include
|
||||
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
||||
|
||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= ../librssimulator/lib/librssimulator.a
|
||||
LIBS *= ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||
LIBS *= -lssl -lcrypto
|
||||
LIBS *= -lgpgme
|
||||
LIBS *= -lupnp
|
||||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
gxs {
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
}
|
||||
|
||||
LIBS *= -rdynamic
|
||||
}
|
||||
|
||||
|
||||
|
||||
############################## Common stuff ######################################
|
||||
|
||||
# On Linux systems that alredy have libssl and libcrypto it is advisable
|
||||
# to rename the patched version of SSL to something like libsslxpgp.a and libcryptoxpg.a
|
||||
|
||||
# ###########################################
|
||||
|
||||
bitdht {
|
||||
LIBS += ../../libbitdht/src/lib/libbitdht.a
|
||||
PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
|
||||
}
|
||||
|
||||
win32 {
|
||||
# must be added after bitdht
|
||||
LIBS += -lws2_32
|
||||
}
|
||||
|
||||
DEPENDPATH += . \
|
||||
|
||||
INCLUDEPATH += ../../libretroshare/src/
|
||||
INCLUDEPATH += ../librssimulator/
|
||||
|
||||
SOURCES += unittests.cc \
|
||||
|
||||
################################## Crypto ##################################
|
||||
|
||||
SOURCES += libretroshare/crypto/chacha20_test.cc
|
||||
|
||||
################################ Serialiser ################################
|
||||
HEADERS += libretroshare/serialiser/support.h \
|
||||
libretroshare/serialiser/rstlvutil.h \
|
||||
|
||||
SOURCES += libretroshare/serialiser/rsturtleitem_test.cc \
|
||||
libretroshare/serialiser/rsbaseitem_test.cc \
|
||||
libretroshare/serialiser/rsgxsupdateitem_test.cc \
|
||||
libretroshare/serialiser/rsmsgitem_test.cc \
|
||||
libretroshare/serialiser/rsstatusitem_test.cc \
|
||||
libretroshare/serialiser/rsnxsitems_test.cc \
|
||||
libretroshare/serialiser/rsgxsiditem_test.cc \
|
||||
# libretroshare/serialiser/rsphotoitem_test.cc \
|
||||
libretroshare/serialiser/tlvbase_test2.cc \
|
||||
libretroshare/serialiser/tlvrandom_test.cc \
|
||||
libretroshare/serialiser/tlvbase_test.cc \
|
||||
libretroshare/serialiser/tlvstack_test.cc \
|
||||
libretroshare/serialiser/tlvitems_test.cc \
|
||||
# libretroshare/serialiser/rsgrouteritem_test.cc \
|
||||
libretroshare/serialiser/tlvtypes_test.cc \
|
||||
libretroshare/serialiser/tlvkey_test.cc \
|
||||
libretroshare/serialiser/support.cc \
|
||||
libretroshare/serialiser/rstlvutil.cc \
|
||||
|
||||
# Still to convert these.
|
||||
# libretroshare/serialiser/rsconfigitem_test.cc \
|
||||
# libretroshare/serialiser/rsgrouteritem_test.cc \
|
||||
|
||||
|
||||
################################## GXS #####################################
|
||||
|
||||
HEADERS += libretroshare/gxs/common/data_support.h \
|
||||
|
||||
SOURCES += libretroshare/gxs/common/data_support.cc \
|
||||
|
||||
HEADERS += libretroshare/gxs/nxs_test/nxsdummyservices.h \
|
||||
libretroshare/gxs/nxs_test/nxsgrptestscenario.h \
|
||||
libretroshare/gxs/nxs_test/nxsmsgtestscenario.h \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsync_test.h \
|
||||
libretroshare/gxs/nxs_test/nxsmsgsync_test.h \
|
||||
libretroshare/gxs/nxs_test/nxstesthub.h \
|
||||
libretroshare/gxs/nxs_test/nxstestscenario.h \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsyncdelayed.h
|
||||
|
||||
SOURCES += libretroshare/gxs/nxs_test/nxsdummyservices.cc \
|
||||
libretroshare/gxs/nxs_test/nxsgrptestscenario.cc \
|
||||
libretroshare/gxs/nxs_test/nxsmsgtestscenario.cc \
|
||||
libretroshare/gxs/nxs_test/nxstesthub.cc \
|
||||
libretroshare/gxs/nxs_test/rsgxsnetservice_test.cc \
|
||||
libretroshare/gxs/nxs_test/nxsmsgsync_test.cc \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsync_test.cc \
|
||||
libretroshare/gxs/nxs_test/nxsgrpsyncdelayed.cc
|
||||
|
||||
HEADERS += libretroshare/gxs/gen_exchange/genexchangetester.h \
|
||||
libretroshare/gxs/gen_exchange/gxspublishmsgtest.h \
|
||||
libretroshare/gxs/gen_exchange/genexchangetestservice.h \
|
||||
libretroshare/gxs/gen_exchange/gxspublishgrouptest.h \
|
||||
libretroshare/gxs/gen_exchange/rsdummyservices.h \
|
||||
libretroshare/gxs/gen_exchange/gxsteststats.cpp
|
||||
|
||||
# libretroshare/gxs/gen_exchange/gxsmsgrelatedtest.h \
|
||||
|
||||
SOURCES += libretroshare/gxs/gen_exchange/gxspublishgrouptest.cc \
|
||||
libretroshare/gxs/gen_exchange/gxsteststats.cpp \
|
||||
libretroshare/gxs/gen_exchange/gxspublishmsgtest.cc \
|
||||
libretroshare/gxs/gen_exchange/rsdummyservices.cc \
|
||||
libretroshare/gxs/gen_exchange/rsgenexchange_test.cc \
|
||||
libretroshare/gxs/gen_exchange/genexchangetester.cc \
|
||||
libretroshare/gxs/gen_exchange/genexchangetestservice.cc \
|
||||
|
||||
SOURCES += libretroshare/gxs/security/gxssecurity_test.cc
|
||||
|
||||
# libretroshare/gxs/gen_exchange/gxsmsgrelatedtest.cc \
|
||||
|
||||
HEADERS += libretroshare/gxs/data_service/rsdataservice_test.h \
|
||||
|
||||
SOURCES += libretroshare/gxs/data_service/rsdataservice_test.cc \
|
||||
libretroshare/gxs/data_service/rsgxsdata_test.cc \
|
||||
|
||||
|
||||
################################ dbase #####################################
|
||||
|
||||
|
||||
#SOURCES += libretroshare/dbase/fisavetest.cc \
|
||||
# libretroshare/dbase/fitest2.cc \
|
||||
# libretroshare/dbase/searchtest.cc \
|
||||
|
||||
# libretroshare/dbase/ficachetest.cc \
|
||||
# libretroshare/dbase/fimontest.cc \
|
||||
|
||||
|
||||
############################### services ###################################
|
||||
|
||||
SOURCES += libretroshare/services/status/status_test.cc \
|
||||
|
||||
############################### gxs ########################################
|
||||
|
||||
HEADERS += libretroshare/services/gxs/rsgxstestitems.h \
|
||||
libretroshare/services/gxs/gxstestservice.h \
|
||||
libretroshare/services/gxs/GxsIsolatedServiceTester.h \
|
||||
libretroshare/services/gxs/GxsPeerNode.h \
|
||||
libretroshare/services/gxs/GxsPairServiceTester.h \
|
||||
libretroshare/services/gxs/FakePgpAuxUtils.h \
|
||||
|
||||
# libretroshare/services/gxs/RsGxsNetServiceTester.h \
|
||||
|
||||
SOURCES += libretroshare/services/gxs/rsgxstestitems.cc \
|
||||
libretroshare/services/gxs/gxstestservice.cc \
|
||||
libretroshare/services/gxs/GxsIsolatedServiceTester.cc \
|
||||
libretroshare/services/gxs/GxsPeerNode.cc \
|
||||
libretroshare/services/gxs/GxsPairServiceTester.cc \
|
||||
libretroshare/services/gxs/FakePgpAuxUtils.cc \
|
||||
libretroshare/services/gxs/nxsbasic_test.cc \
|
||||
libretroshare/services/gxs/nxspair_tests.cc \
|
||||
libretroshare/services/gxs/gxscircle_tests.cc \
|
||||
|
||||
# libretroshare/services/gxs/gxscircle_mintest.cc \
|
||||
|
||||
|
||||
# libretroshare/services/gxs/RsGxsNetServiceTester.cc \
|
||||
|
Loading…
x
Reference in New Issue
Block a user