mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-25 14:56:28 -05:00
merged and fixed conflict with upstream/master
This commit is contained in:
commit
2bb9a87b3b
@ -1,27 +1,31 @@
|
|||||||
##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.
|
Use default options. And add Qt Script support.
|
||||||
Add to the PATH environment variable with this temporary solution.
|
|
||||||
|
|
||||||
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.
|
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)
|
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 -v selfupdate
|
||||||
$sudo port install openssl
|
$sudo port install openssl
|
||||||
$sudo port install miniupnpc
|
$sudo port install miniupnpc
|
||||||
|
$sudo port install libmicrohttpd
|
||||||
|
|
||||||
For VOIP Plugin:
|
For VOIP Plugin:
|
||||||
|
|
||||||
@ -30,36 +34,50 @@ For VOIP Plugin:
|
|||||||
|
|
||||||
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:
|
||||||
|
|
||||||
and select "Pull" with "Rebase"
|
$xcode-select --install
|
||||||
|
|
||||||
###Compil missing libraries
|
Start XCode to get it updated and to able C compiler to create executables.
|
||||||
####SQLCipher
|
|
||||||
|
#### Install libraries
|
||||||
|
|
||||||
|
$brew install openssl
|
||||||
|
$brew install miniupnpc
|
||||||
|
$brew install libmicrohttpd
|
||||||
|
|
||||||
|
If you have error in linking, run this:
|
||||||
|
|
||||||
|
$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>
|
cd <your development directory>
|
||||||
git clone https://github.com/sqlcipher/sqlcipher.git
|
git clone https://github.com/sqlcipher/sqlcipher.git
|
||||||
cd sqlcipher
|
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
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
NOTE, might be necessary to *chmod 000 /usr/local/ssl* temporarily during *./configure* if
|
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.
|
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
|
|
||||||
|
|
||||||
You can now compile RS into Qt Creator or with terminal
|
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
|
cd retroshare
|
||||||
qmake; make
|
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*
|
You can find compiled application on *./retroshare/retroshare-gui/src/RetroShare06.app*
|
||||||
|
@ -113,7 +113,8 @@ libresapihttpserver {
|
|||||||
} else {
|
} else {
|
||||||
mac {
|
mac {
|
||||||
INCLUDEPATH += . $$INC_DIR
|
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 {
|
} else {
|
||||||
LIBS *= -lmicrohttpd
|
LIBS *= -lmicrohttpd
|
||||||
}
|
}
|
||||||
|
@ -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;
|
std::cerr << "[directory storage] removing non existing file " << f.file_name << " at index " << d.subfiles[i] << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delete mNodes[d.subfiles[i]] ;
|
deleteNode(d.subfiles[i]) ;
|
||||||
mNodes[d.subfiles[i]] = NULL ;
|
|
||||||
|
|
||||||
d.subfiles[i] = d.subfiles[d.subfiles.size()-1] ;
|
d.subfiles[i] = d.subfiles[d.subfiles.size()-1] ;
|
||||||
d.subfiles.pop_back();
|
d.subfiles.pop_back();
|
||||||
@ -374,23 +373,29 @@ bool InternalFileHierarchyStorage::updateFile(const DirectoryStorage::EntryIndex
|
|||||||
return true;
|
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()
|
DirectoryStorage::EntryIndex InternalFileHierarchyStorage::allocateNewIndex()
|
||||||
{
|
{
|
||||||
int found = -1;
|
while(!mFreeNodes.empty())
|
||||||
for(uint32_t j=0;j<mNodes.size();++j)
|
|
||||||
if(mNodes[j] == NULL)
|
|
||||||
{
|
|
||||||
found = j;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(found < 0)
|
|
||||||
{
|
{
|
||||||
mNodes.push_back(NULL) ;
|
uint32_t index = mFreeNodes.front();
|
||||||
return mNodes.size()-1 ;
|
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)
|
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;
|
std::cerr << "(EE) Cannot delete node of index " << it->second << " because it is not a file. Inconsistency error!" << std::endl;
|
||||||
continue ;
|
continue ;
|
||||||
}
|
}
|
||||||
delete mNodes[it->second] ;
|
deleteNode(it->second) ;
|
||||||
mNodes[it->second] = NULL ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// now update row and parent index for all subnodes
|
// now update row and parent index for all subnodes
|
||||||
@ -740,6 +744,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.
|
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
|
hits[0] = 1 ; // because 0 is never the child of anyone
|
||||||
|
|
||||||
|
mFreeNodes.clear();
|
||||||
|
|
||||||
for(uint32_t i=0;i<mNodes.size();++i)
|
for(uint32_t i=0;i<mNodes.size();++i)
|
||||||
if(mNodes[i] != NULL && mNodes[i]->type() == FileStorageNode::TYPE_DIR)
|
if(mNodes[i] != NULL && mNodes[i]->type() == FileStorageNode::TYPE_DIR)
|
||||||
{
|
{
|
||||||
@ -787,13 +793,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)
|
for(uint32_t i=0;i<hits.size();++i)
|
||||||
if(hits[i] == 0 && mNodes[i] != NULL)
|
if(hits[i] == 0 && mNodes[i] != NULL)
|
||||||
{
|
{
|
||||||
error_string += " - Orphean node!" ;
|
error_string += " - Orphean node!" ;
|
||||||
delete mNodes[i] ;
|
|
||||||
mNodes[i] = NULL ;
|
deleteNode(i) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_string.empty();;
|
return error_string.empty();;
|
||||||
@ -887,12 +895,9 @@ bool InternalFileHierarchyStorage::recursRemoveDirectory(DirectoryStorage::Entry
|
|||||||
recursRemoveDirectory(d.subdirs[i]);
|
recursRemoveDirectory(d.subdirs[i]);
|
||||||
|
|
||||||
for(uint32_t i=0;i<d.subfiles.size();++i)
|
for(uint32_t i=0;i<d.subfiles.size();++i)
|
||||||
{
|
deleteNode(d.subfiles[i]);
|
||||||
delete mNodes[d.subfiles[i]] ;
|
|
||||||
mNodes[d.subfiles[i]] = NULL ;
|
deleteNode(dir) ;
|
||||||
}
|
|
||||||
delete mNodes[dir] ;
|
|
||||||
mNodes[dir] = NULL ;
|
|
||||||
|
|
||||||
mDirHashes.erase(hash) ;
|
mDirHashes.erase(hash) ;
|
||||||
|
|
||||||
@ -1005,6 +1010,8 @@ bool InternalFileHierarchyStorage::load(const std::string& fname)
|
|||||||
uint32_t buffer_size = 0 ;
|
uint32_t buffer_size = 0 ;
|
||||||
uint32_t buffer_offset = 0 ;
|
uint32_t buffer_offset = 0 ;
|
||||||
|
|
||||||
|
mFreeNodes.clear();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(!FileListIO::loadEncryptedDataFromFile(fname,buffer,buffer_size) )
|
if(!FileListIO::loadEncryptedDataFromFile(fname,buffer,buffer_size) )
|
||||||
|
@ -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
|
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 ;
|
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.
|
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
|
void compress() ; // use empty space in the vector, mostly due to deleted entries. This is a complicated operation, mostly due to
|
||||||
@ -159,6 +160,10 @@ private:
|
|||||||
|
|
||||||
DirectoryStorage::EntryIndex allocateNewIndex();
|
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
|
// 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.
|
// phase. That allows to keep file information when moving them around.
|
||||||
|
|
||||||
|
@ -542,7 +542,7 @@ uint32_t p3FileDatabase::locked_getFriendIndex(const RsPeerId& pid)
|
|||||||
mUpdateFlags |= P3FILELISTS_UPDATE_FLAG_REMOTE_MAP_CHANGED ;
|
mUpdateFlags |= P3FILELISTS_UPDATE_FLAG_REMOTE_MAP_CHANGED ;
|
||||||
|
|
||||||
#ifdef DEBUG_P3FILELISTS
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,7 +569,7 @@ uint32_t p3FileDatabase::locked_getFriendIndex(const RsPeerId& pid)
|
|||||||
mUpdateFlags |= P3FILELISTS_UPDATE_FLAG_REMOTE_MAP_CHANGED ;
|
mUpdateFlags |= P3FILELISTS_UPDATE_FLAG_REMOTE_MAP_CHANGED ;
|
||||||
|
|
||||||
#ifdef DEBUG_P3FILELISTS
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ mac {
|
|||||||
OBJECTS_DIR = temp/obj
|
OBJECTS_DIR = temp/obj
|
||||||
MOC_DIR = temp/moc
|
MOC_DIR = temp/moc
|
||||||
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
||||||
DEFINES *= MINIUPNPC_VERSION=13
|
#DEFINES *= MINIUPNPC_VERSION=13
|
||||||
|
|
||||||
CONFIG += upnp_miniupnpc
|
CONFIG += upnp_miniupnpc
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
@ -305,7 +305,7 @@ mac {
|
|||||||
#CONFIG += zcnatassist
|
#CONFIG += zcnatassist
|
||||||
|
|
||||||
# Beautiful Hack to fix 64bit file access.
|
# 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
|
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||||
#GPGME_DIR = ../../../../gpgme-1.1.8
|
#GPGME_DIR = ../../../../gpgme-1.1.8
|
||||||
@ -315,6 +315,7 @@ mac {
|
|||||||
|
|
||||||
DEPENDPATH += . $$INC_DIR
|
DEPENDPATH += . $$INC_DIR
|
||||||
INCLUDEPATH += . $$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.
|
# 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 += /usr/local/lib/libsqlcipher.a
|
||||||
|
@ -30,7 +30,17 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <time.h>
|
#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 __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
|
#ifdef RSMUTEX_DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -167,19 +177,21 @@ void RsThread::start(const std::string &threadName)
|
|||||||
// set name
|
// set name
|
||||||
|
|
||||||
if(pthread_setname_np)
|
if(pthread_setname_np)
|
||||||
if(!threadName.empty())
|
{
|
||||||
{
|
if(!threadName.empty())
|
||||||
// thread names are restricted to 16 characters including the terminating null byte
|
{
|
||||||
if(threadName.length() > 15)
|
// thread names are restricted to 16 characters including the terminating null byte
|
||||||
{
|
if(threadName.length() > 15)
|
||||||
|
{
|
||||||
#ifdef DEBUG_THREADS
|
#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
|
#endif
|
||||||
pthread_setname_np(mTid, threadName.substr(0, 15).c_str());
|
RS_pthread_setname_np(mTid, threadName.substr(0, 15).c_str());
|
||||||
} else {
|
} else {
|
||||||
pthread_setname_np(mTid, threadName.c_str());
|
RS_pthread_setname_np(mTid, threadName.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
macx {
|
CONFIG += staticlib
|
||||||
CONFIG = staticlib
|
|
||||||
} else {
|
|
||||||
CONFIG += staticlib
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFINES *= OPENSSL_NO_IDEA
|
DEFINES *= OPENSSL_NO_IDEA
|
||||||
|
|
||||||
@ -13,8 +9,8 @@ QMAKE_CXXFLAGS *= -Wall -Werror -W
|
|||||||
|
|
||||||
TARGET = ops
|
TARGET = ops
|
||||||
DESTDIR = lib
|
DESTDIR = lib
|
||||||
DEPENDPATH += .
|
DEPENDPATH += . $$INC_DIR
|
||||||
INCLUDEPATH += .
|
INCLUDEPATH += . $$INC_DIR
|
||||||
|
|
||||||
#################################### Windows #####################################
|
#################################### Windows #####################################
|
||||||
|
|
||||||
@ -34,9 +30,13 @@ win32 {
|
|||||||
# Switch on optimization for debug version
|
# Switch on optimization for debug version
|
||||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||||
#QMAKE_CFLAGS_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
|
# Input
|
||||||
@ -73,8 +73,10 @@ HEADERS += openpgpsdk/writer.h \
|
|||||||
openpgpsdk/armour.h \
|
openpgpsdk/armour.h \
|
||||||
openpgpsdk/parse_local.h \
|
openpgpsdk/parse_local.h \
|
||||||
openpgpsdk/keyring_local.h \
|
openpgpsdk/keyring_local.h \
|
||||||
openpgpsdk/opsdir.h \
|
openpgpsdk/opsdir.h
|
||||||
openpgpsdk/opsstring.h
|
win32{
|
||||||
|
HEADERS += openpgpsdk/opsstring.h
|
||||||
|
}
|
||||||
|
|
||||||
SOURCES += openpgpsdk/accumulate.c \
|
SOURCES += openpgpsdk/accumulate.c \
|
||||||
openpgpsdk/compress.c \
|
openpgpsdk/compress.c \
|
||||||
@ -113,5 +115,7 @@ SOURCES += openpgpsdk/accumulate.c \
|
|||||||
openpgpsdk/writer_memory.c \
|
openpgpsdk/writer_memory.c \
|
||||||
openpgpsdk/writer_skey_checksum.c \
|
openpgpsdk/writer_skey_checksum.c \
|
||||||
openpgpsdk/writer_stream_encrypt_se_ip.c \
|
openpgpsdk/writer_stream_encrypt_se_ip.c \
|
||||||
openpgpsdk/opsdir.c \
|
openpgpsdk/opsdir.c
|
||||||
openpgpsdk/opsstring.c
|
win32{
|
||||||
|
SOURCES += openpgpsdk/opsstring.c
|
||||||
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "opsdir.h"
|
#include "opsdir.h"
|
||||||
|
#ifdef WIN32
|
||||||
#include "opsstring.h"
|
#include "opsstring.h"
|
||||||
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
int ops_open(const char* filename, int flag, int pmode)
|
int ops_open(const char* filename, int flag, int pmode)
|
||||||
|
@ -584,10 +584,13 @@ void GenCertDialog::genPerson()
|
|||||||
|
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance();
|
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())
|
if (ed->hasPendingEvents())
|
||||||
while(ed->processEvents(QEventLoop::AllEvents));
|
while(ed->processEvents(QEventLoop::AllEvents) && (time(NULL) < waitEnd));
|
||||||
|
|
||||||
std::string email_str = "" ;
|
std::string email_str = "" ;
|
||||||
|
std::cout << "RsAccounts::GeneratePGPCertificate" << std::endl;
|
||||||
RsAccounts::GeneratePGPCertificate(
|
RsAccounts::GeneratePGPCertificate(
|
||||||
ui.name_input->text().toUtf8().constData(),
|
ui.name_input->text().toUtf8().constData(),
|
||||||
email_str.c_str(),
|
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::cerr << "GenCertDialog::genPerson() Generating SSL cert with gpg id : " << PGPId << std::endl;
|
||||||
std::string err;
|
std::string err;
|
||||||
this->hide();//To show dialog asking password PGP Key.
|
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);
|
bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err);
|
||||||
|
|
||||||
if (okGen)
|
if (okGen)
|
||||||
|
@ -1587,46 +1587,8 @@ void RSLinkClipboard::parseClipboard(QList<RetroShareLink> &links)
|
|||||||
{
|
{
|
||||||
// parse clipboard for links.
|
// parse clipboard for links.
|
||||||
//
|
//
|
||||||
links.clear();
|
|
||||||
QString text = QApplication::clipboard()->text() ;
|
QString text = QApplication::clipboard()->text() ;
|
||||||
|
parseText(text, links);
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString RSLinkClipboard::toString()
|
QString RSLinkClipboard::toString()
|
||||||
@ -1690,3 +1652,46 @@ bool RSLinkClipboard::empty(RetroShareLink::enumType type /* = RetroShareLink::T
|
|||||||
return RetroShareLink::process(linksToProcess, flag);
|
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 int process(RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
|
||||||
|
|
||||||
|
static void parseText(QString text, QList<RetroShareLink> &links) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void parseClipboard(QList<RetroShareLink> &links) ;
|
static void parseClipboard(QList<RetroShareLink> &links) ;
|
||||||
};
|
};
|
||||||
|
@ -78,6 +78,17 @@ void MimeTextEdit::insertFromMimeData(const QMimeData* source)
|
|||||||
}
|
}
|
||||||
#endif
|
#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);
|
return RSTextEdit::insertFromMimeData(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,6 +234,9 @@ macx {
|
|||||||
mac_icon.files = $$files($$PWD/rsMacIcon.icns)
|
mac_icon.files = $$files($$PWD/rsMacIcon.icns)
|
||||||
mac_icon.path = Contents/Resources
|
mac_icon.path = Contents/Resources
|
||||||
QMAKE_BUNDLE_DATA += mac_icon
|
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
|
CONFIG += version_detail_bash_script
|
||||||
LIBS += -lssl -lcrypto -lz
|
LIBS += -lssl -lcrypto -lz
|
||||||
|
@ -77,12 +77,12 @@ macx {
|
|||||||
LIB_DIR += "/usr/local/lib"
|
LIB_DIR += "/usr/local/lib"
|
||||||
LIB_DIR += "/opt/local/lib"
|
LIB_DIR += "/opt/local/lib"
|
||||||
!QMAKE_MACOSX_DEPLOYMENT_TARGET {
|
!QMAKE_MACOSX_DEPLOYMENT_TARGET {
|
||||||
message(***retroshare.pri: No Target, set it to MacOS 10.10 )
|
message(***retroshare.pri: No Target. Set it to MacOS 10.11 )
|
||||||
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10
|
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.11
|
||||||
}
|
}
|
||||||
!QMAKE_MAC_SDK {
|
!QMAKE_MAC_SDK {
|
||||||
message(***retroshare.pri: No SDK, set it to MacOS 10.10 )
|
message(***retroshare.pri: No SDK. Set it to MacOS 10.11 )
|
||||||
QMAKE_MAC_SDK = macosx10.10
|
QMAKE_MAC_SDK = macosx10.11
|
||||||
}
|
}
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
}
|
}
|
||||||
|
@ -182,33 +182,40 @@ win32 {
|
|||||||
################################# MacOSX ##########################################
|
################################# MacOSX ##########################################
|
||||||
|
|
||||||
mac {
|
mac {
|
||||||
QMAKE_CC = $${QMAKE_CXX}
|
QMAKE_CC = $${QMAKE_CXX}
|
||||||
OBJECTS_DIR = temp/obj
|
OBJECTS_DIR = temp/obj
|
||||||
MOC_DIR = temp/moc
|
MOC_DIR = temp/moc
|
||||||
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
||||||
#DEFINES *= MINIUPNPC_VERSION=13
|
#DEFINES *= MINIUPNPC_VERSION=13
|
||||||
DESTDIR = lib
|
DESTDIR = lib
|
||||||
|
|
||||||
CONFIG += upnp_miniupnpc
|
CONFIG += upnp_miniupnpc
|
||||||
|
|
||||||
# zeroconf disabled at the end of libretroshare.pro (but need the code)
|
# zeroconf disabled at the end of libretroshare.pro (but need the code)
|
||||||
CONFIG += zeroconf
|
#CONFIG += zeroconf
|
||||||
CONFIG += zcnatassist
|
#CONFIG += zcnatassist
|
||||||
|
|
||||||
# Beautiful Hack to fix 64bit file access.
|
# 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
|
||||||
|
|
||||||
UPNPC_DIR = ../../../miniupnpc-1.0
|
#UPNPC_DIR = ../../../miniupnpc-1.0
|
||||||
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||||
#GPGME_DIR = ../../../../gpgme-1.1.8
|
#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}
|
DEPENDPATH += . $$INC_DIR
|
||||||
INCLUDEPATH += $${OPENPGPSDK_DIR}
|
INCLUDEPATH += . $$INC_DIR
|
||||||
|
INCLUDEPATH += ../../../.
|
||||||
|
|
||||||
#../openpgpsdk
|
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||||
#INCLUDEPATH += . $${UPNPC_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
|
LIBS += /usr/local/lib/libsqlcipher.a
|
||||||
|
#LIBS += -lsqlite3
|
||||||
}
|
}
|
||||||
|
|
||||||
################################# FreeBSD ##########################################
|
################################# FreeBSD ##########################################
|
||||||
|
@ -171,34 +171,35 @@ win32 {
|
|||||||
##################################### MacOS ######################################
|
##################################### MacOS ######################################
|
||||||
|
|
||||||
macx {
|
macx {
|
||||||
# ENABLE THIS OPTION FOR Univeral Binary BUILD.
|
# ENABLE THIS OPTION FOR Univeral Binary BUILD.
|
||||||
CONFIG += ppc x86
|
#CONFIG += ppc x86
|
||||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
|
#QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
|
||||||
|
|
||||||
CONFIG += version_detail_bash_script
|
CONFIG += version_detail_bash_script
|
||||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||||
LIBS += ../librssimulator/lib/librssimulator.a
|
LIBS += ../librssimulator/lib/librssimulator.a
|
||||||
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
|
||||||
LIBS += -lssl -lcrypto -lz
|
LIBS += -lssl -lcrypto -lz
|
||||||
#LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan
|
#LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan
|
||||||
LIBS += ../../../miniupnpc-1.0/libminiupnpc.a
|
for(lib, LIB_DIR):exists($$lib/libminiupnpc.a){ LIBS += $$lib/libminiupnpc.a}
|
||||||
LIBS += -framework CoreFoundation
|
LIBS += -framework CoreFoundation
|
||||||
LIBS += -framework Security
|
LIBS += -framework Security
|
||||||
|
|
||||||
gxs {
|
|
||||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
|
||||||
|
|
||||||
LIBS += ../../../lib/libsqlcipher.a
|
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||||
#LIBS += -lsqlite3
|
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
|
||||||
|
|
||||||
INCLUDEPATH += .
|
|
||||||
#DEFINES* = MAC_IDLE # for idle feature
|
#DEFINES* = MAC_IDLE # for idle feature
|
||||||
CONFIG -= uitools
|
CONFIG -= uitools
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
##################################### FreeBSD ######################################
|
##################################### FreeBSD ######################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user