gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r36654 - in gnunet-qt/secushare: . core/gnunet core/identit


From: gnunet
Subject: [GNUnet-SVN] r36654 - in gnunet-qt/secushare: . core/gnunet core/identity core/social models preferences
Date: Thu, 12 Nov 2015 19:30:33 +0100

Author: tg
Date: 2015-11-12 19:30:33 +0100 (Thu, 12 Nov 2015)
New Revision: 36654

Modified:
   gnunet-qt/secushare/core/gnunet/gnunet.cpp
   gnunet-qt/secushare/core/identity/identityService.cpp
   gnunet-qt/secushare/core/social/place.cpp
   gnunet-qt/secushare/models/PlacesModel.cpp
   gnunet-qt/secushare/preferences/preferences.cpp
   gnunet-qt/secushare/preferences/preferences.h
   gnunet-qt/secushare/psyc.cpp
Log:
fix prefs path

Modified: gnunet-qt/secushare/core/gnunet/gnunet.cpp
===================================================================
--- gnunet-qt/secushare/core/gnunet/gnunet.cpp  2015-11-12 18:30:31 UTC (rev 
36653)
+++ gnunet-qt/secushare/core/gnunet/gnunet.cpp  2015-11-12 18:30:33 UTC (rev 
36654)
@@ -1,8 +1,8 @@
 /*
-     This file is part of SecureShare
+     This file is part of secushare
      (C) 2013 Bruno Cabral (and other contributing authors)
 
-     SecureShare is free software; you can redistribute it and/or modify
+     secushare is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
      by the Free Software Foundation; either version 3, or (at your
      option) any later version.
@@ -46,11 +46,8 @@
     GNUNet* gnunetInstance = (GNUNet*)cls;
     Q_ASSERT(gnunetInstance);
 
-
     //Call our main loop
     gnunetInstance->mainLoop(args,cfgfile,cfg);
-
-
 }
 
 
@@ -100,8 +97,6 @@
 
 void GNUNet::start()
 {
-
-
     m_identity = new IdentityService(this);
 
     m_social = new SocialService(this);
@@ -110,24 +105,14 @@
         GNUNET_GETOPT_OPTION_END
     };
 
-
-    /*
-    QString gnunetConfig = thePrefs->getGNUNetConfig();
-    QByteArray byteArray = gnunetConfig.toUtf8();
-    const char* cString = byteArray.constData();
-*/
-
     const char *const argv[] = {
-        "SecureShare",
-        // "-c", cString,
+        "secushare",
         NULL
     };
 
     GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,(char 
*const*)argv,
-                        "SecureShare", "SecureShare helper", options,
+                        "secushare", "secushare helper", options,
                         mainLoopCallback, this);
-
-
 }
 
 /**
@@ -140,11 +125,8 @@
     Q_UNUSED(cfgfile);
     Q_UNUSED(cfg);
 
-
-
     char *privateKeyFileName;
 
-
     //Create our configuration
     m_config = GNUNET_CONFIGURATION_create ();
     GNUNET_CONFIGURATION_load (m_config, cfgfile);
@@ -175,8 +157,6 @@
 
     //Start arm
     startServices();
-
-
 }
 
 
@@ -192,10 +172,8 @@
 }
 
 
-
 void GNUNet::identitySetSlot(){
     m_social->start(m_config);
-
 }
 
 /**
@@ -204,7 +182,6 @@
 void GNUNet::processEvents()
 {
     QCoreApplication::processEvents();
-
 }
 
 
@@ -212,4 +189,3 @@
 {
     return m_myPeer;
 }
-

Modified: gnunet-qt/secushare/core/identity/identityService.cpp
===================================================================
--- gnunet-qt/secushare/core/identity/identityService.cpp       2015-11-12 
18:30:31 UTC (rev 36653)
+++ gnunet-qt/secushare/core/identity/identityService.cpp       2015-11-12 
18:30:33 UTC (rev 36654)
@@ -5,6 +5,7 @@
 #include "models/IdentityModel.h"
 #include "core/identity/identity.h"
 
+
 IdentityService::IdentityService(QObject *parent) :
     QObject(parent)
 {
@@ -17,8 +18,6 @@
  */
 void IdentityService::start(struct GNUNET_CONFIGURATION_Handle *config)
 {
-
-
     this->m_config = config;
 
     QObject::connect(this, &IdentityService::createEgoSignal, this,
@@ -69,8 +68,6 @@
 }
 
 
-
-
 void
 IdentityService::createEgo(QString ego)
 {
@@ -80,8 +77,6 @@
 void
 IdentityService::createEgoSlot(QString ego)
 {
-
-
     QByteArray byteArray = ego.toUtf8();
     const char* cString = byteArray.constData();
 
@@ -92,7 +87,6 @@
 }
 
 
-
 void
 IdentityService::addEgo(struct GNUNET_IDENTITY_Ego *ego,
                         void **ego_ctx,
@@ -101,7 +95,6 @@
     Identity* identity;
     struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
-
     if (NULL == ego)
       return; /* nothing to be done */
 
@@ -116,7 +109,6 @@
 
         identity = theApp->models()->identityModel()->add(strId,strName,ego);
 
-
         *ego_ctx = identity;
     }
     else if (NULL == name) // Delete
@@ -128,5 +120,4 @@
         QString strName = QString::fromLatin1(name);
         identity->setName(strName);
     }
-
 }

Modified: gnunet-qt/secushare/core/social/place.cpp
===================================================================
--- gnunet-qt/secushare/core/social/place.cpp   2015-11-12 18:30:31 UTC (rev 
36653)
+++ gnunet-qt/secushare/core/social/place.cpp   2015-11-12 18:30:33 UTC (rev 
36654)
@@ -25,8 +25,6 @@
 
     connect(this,&Place::setTrayMessageSignal,
             theApp,&PsycCore::setTrayMessage, Qt::QueuedConnection);
-
-
 }
 
 /**
@@ -45,7 +43,6 @@
  */
 void Place::talk(QString text)
 {
-
     if(m_isHost)
     {
         emit hostTalkSignal(this,text);
@@ -54,7 +51,6 @@
     {
         emit guestTalkSignal(this,text);
     }
-
 }
 
 /**

Modified: gnunet-qt/secushare/models/PlacesModel.cpp
===================================================================
--- gnunet-qt/secushare/models/PlacesModel.cpp  2015-11-12 18:30:31 UTC (rev 
36653)
+++ gnunet-qt/secushare/models/PlacesModel.cpp  2015-11-12 18:30:33 UTC (rev 
36654)
@@ -41,11 +41,13 @@
     connect(this, &PlacesModel::addNewPeerSignal, this, 
&PlacesModel::addNewPeerSlot);
 }
 
+
 PlacesModel::~PlacesModel()
 {
 
 }
 
+
 /**
  * @brief PlacesModel::save, will save the list of places
  */
@@ -70,8 +72,9 @@
     }
 }
 
-void PlacesModel::load(){
 
+void PlacesModel::load()
+{
     QString filename = thePrefs->getFolder() + "/rooms.keys";
     QFile file(filename);
 
@@ -120,7 +123,6 @@
 
     Place* peer = m_data[index.row()];
 
-
     switch(role)
     {
     case NAME:
@@ -136,10 +138,10 @@
         return QVariant::Invalid;
     }
 
-
     return QVariant::Invalid;
 }
 
+
 QHash<int, QByteArray> PlacesModel::roleNames() const {
     QHash<int, QByteArray> roles;
     roles[NAME]                   = "name";
@@ -157,6 +159,7 @@
     emit dataChanged(modelIndex, modelIndex);
 }
 
+
 /**
  * @brief PlacesModel::add, add a new place to the model.
  * @param key
@@ -203,6 +206,7 @@
 
 }
 
+
 Place* PlacesModel::get(QString key)
 {
     if (m_lookupIndex.contains(key))
@@ -215,9 +219,9 @@
         return NULL;
 }
 
+
 Place* PlacesModel::get(QModelIndex index)
 {
-
     if(getCount() < index.row())
         return NULL;
 
@@ -224,9 +228,9 @@
     return m_data[index.row()];
 }
 
+
 Place* PlacesModel::get(int index)
 {
-
     if(getCount() < index)
         return NULL;
 
@@ -238,12 +242,8 @@
     return peer;
 }
 
+
 int PlacesModel::getCount()
 {
     return m_data.count();
 }
-
-
-
-
-

Modified: gnunet-qt/secushare/preferences/preferences.cpp
===================================================================
--- gnunet-qt/secushare/preferences/preferences.cpp     2015-11-12 18:30:31 UTC 
(rev 36653)
+++ gnunet-qt/secushare/preferences/preferences.cpp     2015-11-12 18:30:33 UTC 
(rev 36654)
@@ -1,13 +1,13 @@
 /*
-     This file is part of PYSC
+     This file is part of secushare
      (C) 2014 Bruno Cabral (and other contributing authors)
      
-     PYSC is free software; you can redistribute it and/or modify
+     secushare is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
      by the Free Software Foundation; either version 3, or (at your
      option) any later version.
      
-     PYSC is distributed in the hope that it will be useful, but
+     secushare is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      General Public License for more details.
@@ -28,17 +28,15 @@
 #include "psyc.h"
 #include "core/identity/identity.h"
 
-Preferences::Preferences(QObject *parent) :
-  QSettings(QSettings::IniFormat, QSettings::UserScope,"PYSC","PYSC", parent)
+Preferences::Preferences(QObject *parent)
+  : QSettings(QSettings::IniFormat, QSettings::UserScope,
+              "gnunet", "secushare", parent)
 {
-
   sync();
-
 }
 
 void Preferences::save()
 {
-
   sync();
 }
 
@@ -50,16 +48,7 @@
   QDir fileDir = fi.dir();
   QString fileDirStr = fileDir.absolutePath();
 
-
   Identity* iden = theApp->identity();
 
-
-  return fileDirStr + iden->name();
+  return fileDirStr + "/" + applicationName() + "/" + iden->name();
 }
-
-
-
-
-
-
-

Modified: gnunet-qt/secushare/preferences/preferences.h
===================================================================
--- gnunet-qt/secushare/preferences/preferences.h       2015-11-12 18:30:31 UTC 
(rev 36653)
+++ gnunet-qt/secushare/preferences/preferences.h       2015-11-12 18:30:33 UTC 
(rev 36654)
@@ -1,8 +1,8 @@
 /*
-     This file is part of PYSC
+     This file is part of secushare
      (C) 2014 Bruno Cabral (and other contributing authors)
      
-     PYSC is free software; you can redistribute it and/or modify
+     secushare is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
      by the Free Software Foundation; either version 3, or (at your
      option) any later version.
@@ -32,13 +32,9 @@
     Q_OBJECT
     Q_DISABLE_COPY (Preferences)
 
-
     /*
-   *
-   * GENERAL
-   *
-   *
-   */
+     * GENERAL
+     */
     Q_PROPERTY(bool minimizeToTray READ minimizeToTray WRITE setMinimizeToTray 
NOTIFY minimizeToTrayChangedSignal)
 
     Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChangedSignal)
@@ -46,31 +42,20 @@
 
     Q_PROPERTY(bool saveRoom READ saveRoom WRITE setSaveRoom NOTIFY 
saveRoomChangedSignal)
 
-
-
 public:
     explicit Preferences(QObject *parent = 0);
 
-
-
-
     /*
-   *
-   * GENERAL
-   *
-   *
-   */
+     * GENERAL
+     */
 
-
     bool minimizeToTray()
     {
-
         return value("core/minimizeToTray",true).toBool();
     }
 
     void setMinimizeToTray(bool flag)
     {
-
         setValue("core/minimizeToTray",flag);
         emit minimizeToTrayChangedSignal(flag);
     }
@@ -77,13 +62,11 @@
 
     QString name()
     {
-
       return value("core/name","My Username").toString();
     }
 
     void setName(QString name)
     {
-
       setValue("core/name",name);
       emit nameChangedSignal(name);
     }
@@ -90,7 +73,6 @@
 
     QString status()
     {
-
       return value("core/status","My Status").toString();
     }
 
@@ -103,13 +85,11 @@
 
     bool saveRoom()
     {
-
         return value("core/saveRoom",true).toBool();
     }
 
     void setSaveRoom(bool flag)
     {
-
         setValue("core/saveRoom",flag);
         emit saveRoomChangedSignal(flag);
     }
@@ -120,11 +100,8 @@
     QString getFolder();
 signals:
     /*
-   *
-   * GENERAL
-   *
-   *
-   */
+     * GENERAL
+     */
 
     void minimizeToTrayChangedSignal(bool flag);
     void nameChangedSignal(QString name);
@@ -131,9 +108,6 @@
     void statusChangedSignal(QString status);
     void saveRoomChangedSignal(bool flag);
 
-
-
-
 public slots:
 
 

Modified: gnunet-qt/secushare/psyc.cpp
===================================================================
--- gnunet-qt/secushare/psyc.cpp        2015-11-12 18:30:31 UTC (rev 36653)
+++ gnunet-qt/secushare/psyc.cpp        2015-11-12 18:30:33 UTC (rev 36654)
@@ -42,7 +42,6 @@
     Q_UNUSED(engine);
     Q_UNUSED(scriptEngine);
 
-
     return theApp;
 }
 
@@ -52,16 +51,12 @@
     Q_UNUSED(engine);
     Q_UNUSED(scriptEngine);
 
-
     return thePrefs;
 }
 
 
-
-
 void Psyc::registerQmlTypes()
 {
-
     qmlRegisterSingletonType<PsycCore>(URI, 1, 0, "Preferences", 
thePrefs_provider);
     qmlRegisterSingletonType<PsycCore>(URI, 1, 0, "Psyc", theApp_provider);
 
@@ -76,8 +71,6 @@
     qmlRegisterUncreatableType<Identity>(URI, 1, 0, "Identity", 
QLatin1String("Use calling the psyc method."));
     qmlRegisterUncreatableType<SocialService>(URI, 1, 0, "SocialService", 
QLatin1String("Use calling the psyc method."));
     qmlRegisterUncreatableType<Place>(URI, 1, 0, "Place", QLatin1String("Use 
calling the psyc method."));
-
-
 }
 
 /**
@@ -87,6 +80,4 @@
 void Psyc::registerImageProvider(QQmlEngine *engine)
 {
     engine->addImageProvider("qrProvider",theApp->qrProvider());
-
-
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]