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 *= UBUNTU
DEFINES *= HAS_GNOME_KEYRING
PKGCONFIG *= gnome-keyring-1
PKGCONFIG *= libssl libupnp
PKGCONFIG *= libcrypto zlib

View File

@ -4,7 +4,7 @@
#include "rsloginhandler.h"
#include "util/rsdir.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>
GnomeKeyringPasswordSchema my_schema = {
@ -119,7 +119,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef __HAIKU__
#ifndef WINDOWS_SYS /* UNIX */
#if defined(UBUNTU) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(HAS_GNOME_KEYRING) || defined(__FreeBSD__) || defined(__OpenBSD__)
gchar *passwd = NULL;
@ -195,7 +195,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
return (status == 0);
/******************** 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");
@ -246,7 +246,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
return true;
#endif // APPLE
#endif // UBUNTU
#endif // HAS_GNOME_KEYRING
/******* WINDOWS BELOW *****/
#else
@ -370,7 +370,7 @@ bool RsLoginHandler::enableAutoLogin(const RsPeerId& ssl_id,const std::string& s
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef __HAIKU__
#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))
{
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;
#endif // __APPLE__
#endif // UBUNTU.
#endif // HAS_GNOME_KEYRING.
#else /* windows */
/* 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)
{
#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))
{
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 *= -rdynamic -frtti
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
DEFINES *= UBUNTU
DEFINES *= HAS_GNOME_KEYRING
}
linux-g++ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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