rename define UBUNTU to HAS_GNOME_KEYRING

The name UBUNTU is misleading since it is only used to select the keyring backend (which is gnome keyring on linux).
This also allows to support other keyrings on linux in the future (e.g. KDEs keyring)
This commit is contained in:
sehraf 2016-06-02 13:22:24 +02:00
parent 4f60c8cc9b
commit 6e38554bcd
10 changed files with 17 additions and 17 deletions

View file

@ -160,7 +160,7 @@ linux-* {
DEFINES *= PATCHED_LIBUPNP DEFINES *= PATCHED_LIBUPNP
} }
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
PKGCONFIG *= gnome-keyring-1 PKGCONFIG *= gnome-keyring-1
PKGCONFIG *= libssl libupnp PKGCONFIG *= libssl libupnp
PKGCONFIG *= libcrypto zlib PKGCONFIG *= libcrypto zlib

View file

@ -4,7 +4,7 @@
#include "rsloginhandler.h" #include "rsloginhandler.h"
#include "util/rsdir.h" #include "util/rsdir.h"
#include "rsaccounts.h" #include "rsaccounts.h"
#if defined(UBUNTU) || defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(HAS_GNOME_KEYRING) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <gnome-keyring-1/gnome-keyring.h> #include <gnome-keyring-1/gnome-keyring.h>
GnomeKeyringPasswordSchema my_schema = { GnomeKeyringPasswordSchema my_schema = {
@ -119,7 +119,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/ /******************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef __HAIKU__ #ifndef __HAIKU__
#ifndef WINDOWS_SYS /* UNIX */ #ifndef WINDOWS_SYS /* UNIX */
#if defined(UBUNTU) || defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(HAS_GNOME_KEYRING) || defined(__FreeBSD__) || defined(__OpenBSD__)
gchar *passwd = NULL; gchar *passwd = NULL;
@ -195,7 +195,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
return (status == 0); return (status == 0);
/******************** OSX KeyChain stuff *****************************/ /******************** OSX KeyChain stuff *****************************/
#else /* UNIX, but not UBUNTU or APPLE */ #else /* UNIX, but not HAS_GNOME_KEYRING or APPLE */
FILE* helpFile = RsDirUtil::rs_fopen(getAutologinFileName(ssl_id).c_str(), "r"); FILE* helpFile = RsDirUtil::rs_fopen(getAutologinFileName(ssl_id).c_str(), "r");
@ -246,7 +246,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
return true; return true;
#endif // APPLE #endif // APPLE
#endif // UBUNTU #endif // HAS_GNOME_KEYRING
/******* WINDOWS BELOW *****/ /******* WINDOWS BELOW *****/
#else #else
@ -370,7 +370,7 @@ bool RsLoginHandler::enableAutoLogin(const RsPeerId& ssl_id,const std::string& s
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/ /******************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef __HAIKU__ #ifndef __HAIKU__
#ifndef WINDOWS_SYS /* UNIX */ #ifndef WINDOWS_SYS /* UNIX */
#if defined(UBUNTU) || defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(HAS_GNOME_KEYRING) || defined(__FreeBSD__) || defined(__OpenBSD__)
if(GNOME_KEYRING_RESULT_OK == gnome_keyring_store_password_sync(&my_schema, NULL, (gchar*)("RetroShare password for SSL Id "+ssl_id.toStdString()).c_str(),(gchar*)ssl_passwd.c_str(),"RetroShare SSL Id",ssl_id.toStdString().c_str(),NULL)) if(GNOME_KEYRING_RESULT_OK == gnome_keyring_store_password_sync(&my_schema, NULL, (gchar*)("RetroShare password for SSL Id "+ssl_id.toStdString()).c_str(),(gchar*)ssl_passwd.c_str(),"RetroShare SSL Id",ssl_id.toStdString().c_str(),NULL))
{ {
std::cerr << "Stored passwd " << "************************" << " into gnome keyring" << std::endl; std::cerr << "Stored passwd " << "************************" << " into gnome keyring" << std::endl;
@ -448,7 +448,7 @@ bool RsLoginHandler::enableAutoLogin(const RsPeerId& ssl_id,const std::string& s
return true; return true;
#endif // __APPLE__ #endif // __APPLE__
#endif // UBUNTU. #endif // HAS_GNOME_KEYRING.
#else /* windows */ #else /* windows */
/* store password encrypted in a file */ /* store password encrypted in a file */
@ -532,7 +532,7 @@ bool RsLoginHandler::enableAutoLogin(const RsPeerId& ssl_id,const std::string& s
bool RsLoginHandler::clearAutoLogin(const RsPeerId& ssl_id) bool RsLoginHandler::clearAutoLogin(const RsPeerId& ssl_id)
{ {
#ifdef UBUNTU #ifdef HAS_GNOME_KEYRING
if(GNOME_KEYRING_RESULT_OK == gnome_keyring_delete_password_sync(&my_schema,"RetroShare SSL Id", ssl_id.toStdString().c_str(),NULL)) if(GNOME_KEYRING_RESULT_OK == gnome_keyring_delete_password_sync(&my_schema,"RetroShare SSL Id", ssl_id.toStdString().c_str(),NULL))
{ {
std::cerr << "Successfully Cleared gnome keyring passwd for SSLID " << ssl_id << std::endl; std::cerr << "Successfully Cleared gnome keyring passwd for SSLID " << ssl_id << std::endl;

View file

@ -76,7 +76,7 @@ linux-* {
LIBS += -lssl -lgpgme -lupnp -lixml -lgnome-keyring -lsqlite3 -lbz2 LIBS += -lssl -lgpgme -lupnp -lixml -lgnome-keyring -lsqlite3 -lbz2
LIBS *= -rdynamic -frtti LIBS *= -rdynamic -frtti
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
} }
linux-g++ { linux-g++ {

View file

@ -61,7 +61,7 @@ linux-* {
LIBS += /home/crispy/Development/retroshare/sqlcipher/sqlcipher/.libs/libsqlite3.a LIBS += /home/crispy/Development/retroshare/sqlcipher/sqlcipher/.libs/libsqlite3.a
LIBS *= -rdynamic -frtti LIBS *= -rdynamic -frtti
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
} }
linux-g++ { linux-g++ {

View file

@ -76,7 +76,7 @@ linux-* {
LIBS += -lssl -lgpgme -lupnp -lixml -lgnome-keyring -lsqlite3 -lbz2 LIBS += -lssl -lgpgme -lupnp -lixml -lgnome-keyring -lsqlite3 -lbz2
LIBS *= -rdynamic -frtti LIBS *= -rdynamic -frtti
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
} }
linux-g++ { linux-g++ {

View file

@ -101,8 +101,8 @@ RshareSettings::RshareSettings()
void RshareSettings::initSettings() void RshareSettings::initSettings()
{ {
#ifdef UBUNTU #ifdef Q_OS_LINUX
// use GTK as default style on ubuntu // use GTK as default style on linux
setDefault(SETTING_STYLE, "GTK+"); setDefault(SETTING_STYLE, "GTK+");
#else #else
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)

View file

@ -70,7 +70,7 @@ linux-* {
LIBS *= -rdynamic LIBS *= -rdynamic
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
} }
unix { unix {

View file

@ -100,7 +100,7 @@ linux-* {
DEFINES *= PATCHED_LIBUPNP DEFINES *= PATCHED_LIBUPNP
} }
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
INCLUDEPATH += /usr/include/glib-2.0/ /usr/lib/glib-2.0/include INCLUDEPATH += /usr/include/glib-2.0/ /usr/lib/glib-2.0/include
LIBS *= -lgnome-keyring LIBS *= -lgnome-keyring
} }

View file

@ -61,7 +61,7 @@ linux-* {
LIBS += /home/crispy/Development/retroshare/sqlcipher/sqlcipher/.libs/libsqlite3.a LIBS += /home/crispy/Development/retroshare/sqlcipher/sqlcipher/.libs/libsqlite3.a
LIBS *= -rdynamic -frtti LIBS *= -rdynamic -frtti
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
} }
linux-g++ { linux-g++ {

View file

@ -72,7 +72,7 @@ linux-* {
LIBS *= -lglib-2.0 LIBS *= -lglib-2.0
LIBS *= -rdynamic LIBS *= -rdynamic
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU DEFINES *= HAS_GNOME_KEYRING
} }
linux-g++ { linux-g++ {