[X2Go-Commits] x2godesktopsharing.git - build-main (branch) updated: 3.0.1-2

X2Go dev team git-admin at x2go.org
Sat Jun 8 01:13:17 CEST 2013


The branch, build-main has been updated
       via  ca0b017bcc352c2e30b8dd08df6076e515be1d53 (commit)
      from  6211d8271a11719550dec13cc6254aab4db5c94d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 .kdev4/x2godesktopsharing-3.0.1.kdev4 |    2 +
 debian/changelog                      |    6 +
 debian/control                        |    2 +-
 debian/{postinst.ex => postinst}      |    6 +-
 listdialog.o                          |  Bin 9624 -> 0 bytes
 main.cpp                              |   61 ++++--
 moc_listdialog.o                      |  Bin 9480 -> 0 bytes
 sharetray.cpp                         |  375 ++++++++++++++++++---------------
 x2godesktopsharing-3.0.1.kdev4        |    3 +
 x2godesktopsharing.kdevelop.pcs       |  Bin 42767 -> 43380 bytes
 x2godesktopsharing.kdevses            |   16 +-
 11 files changed, 264 insertions(+), 207 deletions(-)
 create mode 100644 .kdev4/x2godesktopsharing-3.0.1.kdev4
 copy debian/{postinst.ex => postinst} (88%)
 mode change 100644 => 100755
 delete mode 100644 listdialog.o
 delete mode 100644 moc_listdialog.o
 create mode 100644 x2godesktopsharing-3.0.1.kdev4

The diff of changes is:
diff --git a/.kdev4/x2godesktopsharing-3.0.1.kdev4 b/.kdev4/x2godesktopsharing-3.0.1.kdev4
new file mode 100644
index 0000000..df7eacc
--- /dev/null
+++ b/.kdev4/x2godesktopsharing-3.0.1.kdev4
@@ -0,0 +1,2 @@
+[Buildset]
+BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x000\x00x\x002\x00g\x00o\x00d\x00e\x00s\x00k\x00t\x00o\x00p\x00s\x00h\x00a\x00r\x00i\x00n\x00g\x00-\x003\x00.\x000\x00.\x001)
diff --git a/debian/changelog b/debian/changelog
index 0bf8011..48c9103 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+x2godesktopsharing (3.0.1-2) unstable; urgency=low
+
+  * adapted to work with x2goserver-3.1
+
+ -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>  Tue, 25 Jan 2011 16:43:58 +0100
+
 x2godesktopsharing (3.0.1-1) unstable; urgency=low
 
   * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>
diff --git a/debian/control b/debian/control
index 58c1fb6..3ce86a1 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.7.2
 
 Package: x2godesktopsharing
 Architecture: any
-Depends: ${misc:Depends}, x2goserver, libqt4-gui
+Depends: ${misc:Depends}, x2goserver (>= 3.0.99), libqt4-gui
 Recommends:
 Description: x2godesktopsharing
  x2go is a serverbased computing environment with
diff --git a/debian/postinst.ex b/debian/postinst
old mode 100644
new mode 100755
similarity index 88%
copy from debian/postinst.ex
copy to debian/postinst
index 01310e0..dd56409
--- a/debian/postinst.ex
+++ b/debian/postinst
@@ -3,7 +3,6 @@
 #
 # see: dh_installdeb(1)
 
-set -e
 
 # summary of how this script can be called:
 #        * <postinst> `configure' <most-recently-configured-version>
@@ -20,6 +19,11 @@ set -e
 
 case "$1" in
     configure)
+    X2GOGRP=`getent group | grep x2gousers`
+    if [ "$X2GOGRP" == "" ]
+    then 
+         addgroup --system x2gousers
+    fi
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/listdialog.o b/listdialog.o
deleted file mode 100644
index 0f6a01d..0000000
Binary files a/listdialog.o and /dev/null differ
diff --git a/main.cpp b/main.cpp
index eeed122..636c43c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -30,37 +30,52 @@
 
 using namespace std;
 
-void  client(QString cmd)
+void  client ( const QStringList & cmd )
 {
-    cerr<<"starting in client mode, cmd: "<<
-    cmd.toAscii().data()<<std::endl;
-    QString dispname=getenv("DISPLAY");
-    QString socketName=QDir::tempPath()+"/x2godesktopsharing_@"+
-                getenv("LOGNAME")+"@"+dispname;
-    
+
+    if ( cmd.size() !=10 )
+    {
+        cerr<<"wrong parameters"<<endl;
+        cout<<"DEN";
+	return;
+    }
+    QStringList params=cmd[9].split ( "XSHAD" );
+    if ( params.size() !=3 )
+    {
+        cerr<<"wrong parameters"<<endl;
+        cout<<"DEN";
+	return;
+    }
+
+    cerr<<"starting x2godesktopsharing in client mode, cmd: "<<
+        cmd.join(" ").toAscii().data() <<std::endl;
+
+    QString dispname=params[2];
+    QString socketName=QDir::tempPath() +"/x2godesktopsharing_@"+
+                       params[1]+"@"+dispname;
     QLocalSocket sock;
     sock.connectToServer ( socketName );
     if ( !sock.waitForConnected ( 3000 ) )
     {
         QString message="Unable to connect: " +socketName;
-        cout<<message.toAscii().data() <<endl;
+        cout<<"DEN";
         cerr<<message.toAscii().data() <<endl;
-        exit ( -1 );
+	return;
     }
-    sock.write ( cmd.toAscii().data(),cmd.toAscii().length() );
+    sock.write ( cmd.join(" ").toAscii().data(),cmd.join(" ").toAscii().length() );
     if ( !sock.waitForReadyRead() )
     {
-        cout<<"Cannot write to socket: " <<socketName.toAscii().data()<<endl;
-        cerr<<"Cannot write to socket: "<<socketName.toAscii().data()<<endl;
-        exit ( -1 );
+        cout<<"DEN";
+        cerr<<"Cannot write to socket: "<<socketName.toAscii().data() <<endl;
+        return;;
     }
     char buffer[256];
     int read=sock.read ( buffer,255 );
     if ( read<=0 )
     {
-        cout<<"Cannot read from socket: " <<socketName.toAscii().data()<<endl;
-        cerr<<"Cannot read from socket: " <<socketName.toAscii().data()<<endl;
-        exit ( -1 );
+        cout<<"DEN";
+        cerr<<"Cannot read from socket: " <<socketName.toAscii().data() <<endl;
+        return;    
     }
     buffer[read]=0;
     cout<<buffer<<endl;
@@ -68,19 +83,19 @@ void  client(QString cmd)
 
 int main ( int argc, char *argv[] )
 {
-    if (argc>2)
+    if ( argc>2 )
     {
         QString par=argv[1];
-        if (par == "client")
+        if ( par == "client" )
         {
             QStringList cmdl;
-            for (int i=2; i<argc;++i)
+            for ( int i=2; i<argc;++i )
                 cmdl<<argv[i];
-            client(cmdl.join(" "));
+            client ( cmdl );
             return 0;
         }
     }
-    
+
     QApplication app ( argc,argv );
     QTranslator translator;
     QString filename=QString ( ":/x2godesktopsharing_%1" ).arg (
@@ -106,7 +121,7 @@ int main ( int argc, char *argv[] )
         app.installTranslator ( &qtTranslator );
     ShareTray* tray=new ShareTray;
     tray->hide();
-    
-    
+
+
     return app.exec();
 }
diff --git a/moc_listdialog.o b/moc_listdialog.o
deleted file mode 100644
index 0e7d9ee..0000000
Binary files a/moc_listdialog.o and /dev/null differ
diff --git a/sharetray.cpp b/sharetray.cpp
index 5ed3626..541b50c 100644
--- a/sharetray.cpp
+++ b/sharetray.cpp
@@ -29,7 +29,8 @@
 #include <QSystemTrayIcon>
 #include <QCloseEvent>
 #include <QDateTime>
-
+#include <grp.h>
+#include <QProcess>
 #define STAT_ACT_COUNT 10
 
 #define VERSION "3.0.1-1"
@@ -41,96 +42,96 @@ ShareTray::ShareTray()
     menuClose=false;
     current_list=BLACK;
 
-    ui.setupUi(this);
-    ui.box->setSelectionMode(QAbstractItemView::ExtendedSelection);
+    ui.setupUi ( this );
+    ui.box->setSelectionMode ( QAbstractItemView::ExtendedSelection );
 
-    connect(ui.close_box,SIGNAL(clicked(QAbstractButton*)),
-            SLOT(slotMsgClose(QAbstractButton*)));
+    connect ( ui.close_box,SIGNAL ( clicked ( QAbstractButton* ) ),
+              SLOT ( slotMsgClose ( QAbstractButton* ) ) );
 
-    connect(ui.ok_cancel_box,SIGNAL(clicked(QAbstractButton*)),
-            SLOT(slotMsgOkCancel(QAbstractButton*)));
+    connect ( ui.ok_cancel_box,SIGNAL ( clicked ( QAbstractButton* ) ),
+              SLOT ( slotMsgOkCancel ( QAbstractButton* ) ) );
 
-    connect(ui.del,SIGNAL(clicked()),
-            SLOT(slotDelListItem()));
+    connect ( ui.del,SIGNAL ( clicked() ),
+              SLOT ( slotDelListItem() ) );
 
-    ui.icon->setPixmap(QPixmap(":icons/128x128/x2godesktopsharing.png"));
+    ui.icon->setPixmap ( QPixmap ( ":icons/128x128/x2godesktopsharing.png" ) );
 
-    ui.text->setText(tr ( "<b>X2GO DesktopSharing V. " ) +VERSION+
-                     " </b >(Qt - "+qVersion() +")"+
-                     ui.text->text());
+    ui.text->setText ( tr ( "<b>X2GO DesktopSharing V. " ) +VERSION+
+                       " </b >(Qt - "+qVersion() +")"+
+                       ui.text->text() );
 
-    setWindowFlags(Qt::Dialog);
+    setWindowFlags ( Qt::Dialog );
     Qt::WindowFlags flags=windowFlags();
     flags&= ~Qt::WindowTitleHint;
-    setWindowFlags(flags);
-
-    QString dispname=getenv("DISPLAY");
-    socketFname=QDir::tempPath()+"/x2godesktopsharing_@"+
-                getenv("LOGNAME")+"@"+dispname;
-    lockFname=QDir::tempPath()+"/x2godesktopsharing.lock_"+
-              getenv("LOGNAME")+"@"+dispname;
-    if (QFile::exists(lockFname))
+    setWindowFlags ( flags );
+
+    QString dispname=getenv ( "DISPLAY" );
+    socketFname=QDir::tempPath() +"/x2godesktopsharing_@"+
+                getenv ( "LOGNAME" ) +"@"+dispname;
+    lockFname=QDir::tempPath() +"/x2godesktopsharing.lock_"+
+              getenv ( "LOGNAME" ) +"@"+dispname;
+    if ( QFile::exists ( lockFname ) )
     {
-        QFile file(lockFname);
-        if (file.open(QIODevice::ReadOnly | QIODevice::Text))
+        QFile file ( lockFname );
+        if ( file.open ( QIODevice::ReadOnly | QIODevice::Text ) )
         {
-            QTextStream in(&file);
-            if (!in.atEnd())
+            QTextStream in ( &file );
+            if ( !in.atEnd() )
             {
                 QString line = in.readLine();
                 file.close();
-                if (abs(line.toUInt() -
-                        QDateTime::currentDateTime().toTime_t())<5)
+                if ( abs ( line.toUInt() -
+                           QDateTime::currentDateTime().toTime_t() ) <5 )
                 {
 
-                    QString message=QString(
-                                        tr(
+                    QString message=QString (
+                                        tr (
                                             "X2Go desktop sharing application "
                                             "is already active for this "
                                             "display \n"
                                             "if this application is no longer "
                                             "running, remove %1\n"
-                                            "and start again")).arg(lockFname);
+                                            "and start again" ) ).arg ( lockFname );
                     QMessageBox::critical ( 0l,tr (
                                                 "Error" ),message,
                                             QMessageBox::Ok,
                                             QMessageBox::NoButton );
-                    exit (-1);
+                    exit ( -1 );
                 }
             }
         }
-        QFile::remove(lockFname);
+        QFile::remove ( lockFname );
     }
-    if (QFile::exists(socketFname))
-        QFile::remove(socketFname);
-
-    QTimer *lockTimer = new QTimer(this);
-    connect(lockTimer, SIGNAL(timeout()), this, SLOT(slotUpdateLockFile()));
-    lockTimer->start(3000);
-    trayIcon=new QSystemTrayIcon(this);
-    setWindowIcon(QIcon(":icons/22x22/x2godesktopsharing.png"));
-    menu = new QMenu(this);
-    trayIcon->setContextMenu(menu);
-    trayIcon->setToolTip(tr("X2Go desktop sharing application"));
+    if ( QFile::exists ( socketFname ) )
+        QFile::remove ( socketFname );
+
+    QTimer *lockTimer = new QTimer ( this );
+    connect ( lockTimer, SIGNAL ( timeout() ), this, SLOT ( slotUpdateLockFile() ) );
+    lockTimer->start ( 3000 );
+    trayIcon=new QSystemTrayIcon ( this );
+    setWindowIcon ( QIcon ( ":icons/22x22/x2godesktopsharing.png" ) );
+    menu = new QMenu ( this );
+    trayIcon->setContextMenu ( menu );
+    trayIcon->setToolTip ( tr ( "X2Go desktop sharing application" ) );
 
     menu->addSeparator();
 
-    actWhite = menu->addAction(QIcon (":icons/32x32/wlist.png" ) ,
-                               tr("Granted users..."));
-    actBlack = menu->addAction(QIcon (":icons/32x32/blist.png" ) ,
-                               tr("Banned users..."));
+    actWhite = menu->addAction ( QIcon ( ":icons/32x32/wlist.png" ) ,
+                                 tr ( "Granted users..." ) );
+    actBlack = menu->addAction ( QIcon ( ":icons/32x32/blist.png" ) ,
+                                 tr ( "Banned users..." ) );
     menu->addSeparator();
 
-    actStart = menu->addAction(QIcon (":icons/32x32/share.png" ) ,
-                               tr("Activate desktop sharing"));
+    actStart = menu->addAction ( QIcon ( ":icons/32x32/share.png" ) ,
+                                 tr ( "Activate desktop sharing" ) );
 
-    actStop = menu->addAction(QIcon (":icons/32x32/stop.png" ) ,
-                              tr("Deactivate desktop sharing"));
+    actStop = menu->addAction ( QIcon ( ":icons/32x32/stop.png" ) ,
+                                tr ( "Deactivate desktop sharing" ) );
 
     menu->addSeparator();
-    QAction* actAbout=menu->addAction(
-                          QIcon (":icons/32x32/x2godesktopsharing.png" ),
-                          tr("About X2GO Sharing"));
+    QAction* actAbout=menu->addAction (
+                          QIcon ( ":icons/32x32/x2godesktopsharing.png" ),
+                          tr ( "About X2GO Sharing" ) );
 //
 //     QAction* actAboutQt=menu->addAction(
 //                              tr("About Qt"));
@@ -142,8 +143,8 @@ ShareTray::ShareTray()
 
 
     menu->addSeparator();
-    QAction* actExit = menu->addAction(QIcon (":icons/32x32/exit.png" ) ,
-                                       tr("&Quit"));
+    QAction* actExit = menu->addAction ( QIcon ( ":icons/32x32/exit.png" ) ,
+                                         tr ( "&Quit" ) );
 
     connect ( actWhite,SIGNAL ( triggered ( bool ) ),this,
               SLOT ( slotWhiteList() ) );
@@ -162,11 +163,11 @@ ShareTray::ShareTray()
 
 
 
-    actStop->setEnabled(false);
+    actStop->setEnabled ( false );
 
-    QTimer *timer = new QTimer(this);
-    connect(timer, SIGNAL(timeout()), this, SLOT(slotTimer()));
-    timer->start(5000);
+    QTimer *timer = new QTimer ( this );
+    connect ( timer, SIGNAL ( timeout() ), this, SLOT ( slotTimer() ) );
+    timer->start ( 5000 );
     loadSettings();
     setTrayIcon();
     trayIcon->show();
@@ -176,45 +177,47 @@ ShareTray::ShareTray()
 ShareTray::~ShareTray()
 {
     slotStopSharing();
-    if (QFile::exists(lockFname))
-        QFile::remove(lockFname);
+    if ( QFile::exists ( lockFname ) )
+        QFile::remove ( lockFname );
     saveSettings();
 }
 
 
 void ShareTray::slotStopSharing()
 {
-    if (serverSocket)
+    if ( serverSocket )
     {
         serverSocket->close();
         delete serverSocket;
         serverSocket=0l;
     }
-    if (QFile::exists(socketFname))
-        QFile::remove(socketFname);
-    for (int i=menu->actions().count()-STAT_ACT_COUNT-1;i>=0;--i)
+    if ( QFile::exists ( socketFname ) )
+        QFile::remove ( socketFname );
+    for ( int i=menu->actions().count()-STAT_ACT_COUNT-1;i>=0;--i )
     {
-        slotCloseConnection((AccessAction*)(menu->actions()[i]));
+        slotCloseConnection ( ( AccessAction* ) ( menu->actions() [i] ) );
     }
-    actStop->setEnabled(false);
-    actStart->setEnabled(true);
+    actStop->setEnabled ( false );
+    actStart->setEnabled ( true );
     setTrayIcon();
 }
 
 
 void ShareTray::slotStartSharing()
 {
-    actStop->setEnabled(true);
-    actStart->setEnabled(false);
-    if (serverSocket)
+    actStop->setEnabled ( true );
+    actStart->setEnabled ( false );
+    if ( serverSocket )
         delete serverSocket;
-    if (QFile::exists(socketFname))
-        QFile::remove(socketFname);
-    serverSocket=new QLocalServer(this);
-    if ( serverSocket->listen ( socketFname) )
+    if ( QFile::exists ( socketFname ) )
+        QFile::remove ( socketFname );
+    serverSocket=new QLocalServer ( this );
+    if ( serverSocket->listen ( socketFname ) )
     {
-        QFile::setPermissions (socketFname,
-                               QFile::ReadOwner|QFile::WriteOwner );
+
+        chown ( socketFname.toAscii(),getuid(),getgrnam ( "x2gousers" )->gr_gid );
+        QFile::setPermissions ( socketFname,
+                                QFile::ReadOwner|QFile::WriteOwner|QFile::ReadGroup|QFile::WriteGroup );
         connect ( serverSocket,SIGNAL ( newConnection() ),
                   this,SLOT ( slotServerConnection() ) );
     }
@@ -237,133 +240,157 @@ bool ShareTray::acceptConnections()
     return actStop->isEnabled();
 }
 
-QString ShareTray::getSocketAnswer(QString message)
+QString ShareTray::getSocketAnswer ( QString message )
 {
-    QStringList lst=message.split(' ');
-    if (lst[0] == "ACCESS")
+    qDebug() <<"message: "<<message;
+    QStringList lst=message.split ( ' ' );
+    if ( lst.size() !=10 )
     {
-        if (getAccess(lst[1],lst[2])==QMessageBox::Yes)
-        {
-            trayMessage(tr("Access granted"),QString(
-                            tr(
-                                "%1(%2): access granted")).arg(
-                            lst[1]).arg(lst[2]));
-            return "GRANT";
-        }
-        trayMessage(tr("Access denied"),QString(
-                        tr("%1(%2): access denied")).arg(lst[1]).arg(lst[2]));
+        qDebug() <<"wrong parameters";
+        return "DENY";
+    }
+    QStringList params=lst[9].split ( "XSHAD" );
+    if ( params.size() !=3 )
+    {
+        qDebug() <<"wrong parameters";
         return "DENY";
     }
-    if (lst[0] == "AGENT")
+    QString client=lst[0];
+    QString user=params[1];
+    if ( getAccess ( user,client ) ==QMessageBox::Yes )
     {
-        AccessAction *act=new AccessAction(
-            lst[1],lst[2],lst[3],
-            QString(tr("Disconnect %1(%2)")).arg(lst[2]).arg(lst[3]),
-            this);
-        menu->insertAction(menu->actions()[0],act);
-        connect(act,SIGNAL(actionActivated( AccessAction* )),this,
-                SLOT(slotCloseConnection( AccessAction* )));
-        trayMessage(tr("Remote connection"),
-                    QString(
-                        tr("%1(%2) connected")).arg(lst[2]).arg(lst[3]));
-        setTrayIcon();
-        return "OK";
+        trayMessage ( tr ( "Access granted" ),QString (
+                          tr (
+                              "%1(%2): access granted" ) ).arg (
+                          user ).arg ( client ) );
+        //start agent
+        QProcess proc ( this );
+        lst.removeAt ( 0 );;
+        proc.start ( "x2gostartagent",lst );
+        if ( !proc.waitForFinished ( 5000 ) )
+        {
+            return "DENY";
+        }
+        else
+        {
+            QString output=proc.readAllStandardOutput();
+            qDebug() <<"agent out: "<<output;
+            QStringList lines=output.split ( "\n" );
+            QString pid="pid";
+            if ( lines.size() >3 )
+                pid=lines[2];
+            qDebug() <<"agent pid: "<<pid;
+            AccessAction *act=new AccessAction (
+                pid,user,client,
+                QString ( tr ( "Disconnect %1(%2)" ) ).arg ( user ).arg ( client ),
+                this );
+            menu->insertAction ( menu->actions() [0],act );
+            connect ( act,SIGNAL ( actionActivated ( AccessAction* ) ),this,
+                      SLOT ( slotCloseConnection ( AccessAction* ) ) );
+            trayMessage ( tr ( "Remote connection" ),
+                          QString (
+                              tr ( "%1(%2) connected" ) ).arg ( user ).arg ( client ) );
+            setTrayIcon();
+            return output;
+        }
     }
-    return "ERROR";
+    trayMessage ( tr ( "Access denied" ),QString (
+                      tr ( "%1(%2): access denied" ) ).arg ( params[1] ).arg ( client ) );
+    return "DENY";
 }
 
-void ShareTray::closeSocket(SimpleLocalSocket* sock)
+void ShareTray::closeSocket ( SimpleLocalSocket* sock )
 {
-    qDebug()<<"closing null socket";
-    if (sock)
+    qDebug() <<"closing null socket";
+    if ( sock )
     {
-        qDebug()<<"closing socket";
+        qDebug() <<"closing socket";
         delete sock;
-        qDebug()<<"done";
+        qDebug() <<"done";
     }
 }
 
 void ShareTray::slotServerConnection()
 {
-    new SimpleLocalSocket(this,serverSocket->nextPendingConnection());
+    new SimpleLocalSocket ( this,serverSocket->nextPendingConnection() );
 }
 
-void ShareTray::slotCloseConnection(AccessAction* action)
+void ShareTray::slotCloseConnection ( AccessAction* action )
 {
-    kill(action->pid().toUInt(),15);
-    menu->removeAction(action);
+    kill ( action->pid().toUInt(),15 );
+    menu->removeAction ( action );
     delete action;
     setTrayIcon();
 }
 
 
-int ShareTray::getAccess(QString user, QString host)
+int ShareTray::getAccess ( QString user, QString host )
 {
-    if (whiteList.contains(user))
+    if ( whiteList.contains ( user ) )
         return QMessageBox::Yes;
-    if (blackList.contains(user))
+    if ( blackList.contains ( user ) )
         return QMessageBox::No;
 
-    MessageBox m(user,host, this);
+    MessageBox m ( user,host, this );
     m.activateWindow();
     m.raise();
     int res=m.exec();
-    if (m.isChecked()&&res==QMessageBox::Yes)
+    if ( m.isChecked() &&res==QMessageBox::Yes )
         whiteList<<user;
-    if (m.isChecked()&&res==QMessageBox::No)
+    if ( m.isChecked() &&res==QMessageBox::No )
         blackList<<user;
-    actBlack->setEnabled(blackList.size()>0);
-    actWhite->setEnabled(whiteList.size()>0);
+    actBlack->setEnabled ( blackList.size() >0 );
+    actWhite->setEnabled ( whiteList.size() >0 );
     return res;
 }
 
-void ShareTray::closeEvent ( QCloseEvent*  ev)
+void ShareTray::closeEvent ( QCloseEvent*  ev )
 {
-    if (!menuClose)
+    if ( !menuClose )
     {
         ev->ignore();
         hide();
         return;
     }
     slotStopSharing();
-    if (QFile::exists(lockFname))
-        QFile::remove(lockFname);
+    if ( QFile::exists ( lockFname ) )
+        QFile::remove ( lockFname );
     saveSettings();
 }
 
 void ShareTray::slotTimer()
 {
-    for (int i=menu->actions().count()-STAT_ACT_COUNT-1;i>=0;--i)
+    for ( int i=menu->actions().count()-STAT_ACT_COUNT-1;i>=0;--i )
     {
-        AccessAction* action=(AccessAction*)(menu->actions()[i]);
-        if (!isProcessRunning(action->pid()))
+        AccessAction* action= ( AccessAction* ) ( menu->actions() [i] );
+        if ( !isProcessRunning ( action->pid() ) )
         {
-            trayMessage(tr("User disconnected"),
-                        QString(
-                            tr("%1(%2) disconnected")).arg(
-                            action->user()).arg(action->host()));
-            menu->removeAction(action);
+            trayMessage ( tr ( "User disconnected" ),
+                          QString (
+                              tr ( "%1(%2) disconnected" ) ).arg (
+                              action->user() ).arg ( action->host() ) );
+            menu->removeAction ( action );
             delete action;
         }
     }
     setTrayIcon();
 }
 
-void ShareTray::trayMessage(QString title, QString text)
+void ShareTray::trayMessage ( QString title, QString text )
 {
-    if (!QSystemTrayIcon::supportsMessages ())
-        QToolTip::showText(geometry().topLeft(),
-                           text);
+    if ( !QSystemTrayIcon::supportsMessages () )
+        QToolTip::showText ( geometry().topLeft(),
+                             text );
     else
-        trayIcon->showMessage(title,text);
+        trayIcon->showMessage ( title,text );
 }
 
 
-bool ShareTray::isProcessRunning(QString pid)
+bool ShareTray::isProcessRunning ( QString pid )
 {
-    if (kill(pid.toInt(),SIGCONT)==-1)
+    if ( kill ( pid.toInt(),SIGCONT ) ==-1 )
     {
-        if (errno==ESRCH)
+        if ( errno==ESRCH )
         {
             return false;
         }
@@ -376,7 +403,7 @@ void ShareTray::slotBlackList()
 {
     current_list=BLACK;
     showList();
-    setWindowTitle(tr("Banned users"));
+    setWindowTitle ( tr ( "Banned users" ) );
 
 }
 
@@ -384,7 +411,7 @@ void ShareTray::slotWhiteList()
 {
     current_list=WHITE;
     showList();
-    setWindowTitle(tr("Granted users"));
+    setWindowTitle ( tr ( "Granted users" ) );
 
 }
 
@@ -400,13 +427,13 @@ void ShareTray::showList()
     ui.text->hide();
 
     QStringList* lst;
-    if (current_list==BLACK)
+    if ( current_list==BLACK )
         lst=&blackList;
     else
         lst=&whiteList;
     lst->sort();
     ui.box->clear();
-    ui.box->insertItems(0,*lst);
+    ui.box->insertItems ( 0,*lst );
 }
 
 void ShareTray::loadSettings()
@@ -414,11 +441,11 @@ void ShareTray::loadSettings()
     QSettings st ( QDir::homePath() +"/.x2godesktopshare/settings",
                    QSettings::NativeFormat );
 
-    blackList= st.value("blacklist").toStringList();
-    whiteList= st.value("whitelist").toStringList();
+    blackList= st.value ( "blacklist" ).toStringList();
+    whiteList= st.value ( "whitelist" ).toStringList();
 
-    actBlack->setEnabled(blackList.size()>0);
-    actWhite->setEnabled(whiteList.size()>0);
+    actBlack->setEnabled ( blackList.size() >0 );
+    actWhite->setEnabled ( whiteList.size() >0 );
 }
 
 void ShareTray::saveSettings()
@@ -426,31 +453,31 @@ void ShareTray::saveSettings()
     QSettings st ( QDir::homePath() +"/.x2godesktopshare/settings",
                    QSettings::NativeFormat );
 
-    st.setValue("blacklist",blackList);
-    st.setValue("whitelist",whiteList);
+    st.setValue ( "blacklist",blackList );
+    st.setValue ( "whitelist",whiteList );
 }
 
 
 void ShareTray::setTrayIcon()
 {
-    if (!acceptConnections())
+    if ( !acceptConnections() )
     {
-        trayIcon->setIcon(QIcon(":icons/22x22/discard.png"));
+        trayIcon->setIcon ( QIcon ( ":icons/22x22/discard.png" ) );
         return;
     }
-    if (menu->actions().count()>STAT_ACT_COUNT)
+    if ( menu->actions().count() >STAT_ACT_COUNT )
     {
-        trayIcon->setIcon(QIcon(":icons/22x22/view.png"));
+        trayIcon->setIcon ( QIcon ( ":icons/22x22/view.png" ) );
         return;
     }
-    trayIcon->setIcon(QIcon(":icons/22x22/accept.png"));
+    trayIcon->setIcon ( QIcon ( ":icons/22x22/accept.png" ) );
 }
 
 
 
 void ShareTray::slotAbout()
 {
-    setWindowTitle(tr("X2Go Desktop Sharing"));
+    setWindowTitle ( tr ( "X2Go Desktop Sharing" ) );
 
     show();
     ui.ok_cancel_box->hide();
@@ -468,39 +495,39 @@ void ShareTray::slotAboutQt()
     QMessageBox::aboutQt ( 0 );
 }
 
-void ShareTray::slotMsgOkCancel(QAbstractButton* button)
+void ShareTray::slotMsgOkCancel ( QAbstractButton* button )
 {
-    if (ui.ok_cancel_box->buttonRole(button)==QDialogButtonBox::AcceptRole)
+    if ( ui.ok_cancel_box->buttonRole ( button ) ==QDialogButtonBox::AcceptRole )
     {
         QStringList* lst;
-        if (current_list==BLACK)
+        if ( current_list==BLACK )
             lst=&blackList;
         else
             lst=&whiteList;
         lst->clear();
-        for (int i=ui.box->count()-1;i>=0;--i)
+        for ( int i=ui.box->count()-1;i>=0;--i )
         {
-            *lst<<ui.box->item(i)->text();
+            *lst<<ui.box->item ( i )->text();
         }
     }
-    actBlack->setEnabled(blackList.size()>0);
-    actWhite->setEnabled(whiteList.size()>0);
+    actBlack->setEnabled ( blackList.size() >0 );
+    actWhite->setEnabled ( whiteList.size() >0 );
     hide();
 }
 
-void ShareTray::slotMsgClose(QAbstractButton*)
+void ShareTray::slotMsgClose ( QAbstractButton* )
 {
     hide();
 }
 
 void ShareTray::slotDelListItem()
 {
-    for (int i=ui.box->count()-1;i>=0;--i)
+    for ( int i=ui.box->count()-1;i>=0;--i )
     {
-        QListWidgetItem* it=ui.box->item(i);
-        if (it->isSelected())
+        QListWidgetItem* it=ui.box->item ( i );
+        if ( it->isSelected() )
         {
-            ui.box->takeItem(i);
+            ui.box->takeItem ( i );
             delete it;
         }
     }
@@ -516,10 +543,10 @@ void ShareTray::slotMenuClose()
 
 void ShareTray::slotUpdateLockFile()
 {
-    QFile file(lockFname);
-    if (file.open(QIODevice::WriteOnly | QIODevice::Text))
+    QFile file ( lockFname );
+    if ( file.open ( QIODevice::WriteOnly | QIODevice::Text ) )
     {
-        QTextStream out(&file);
+        QTextStream out ( &file );
         out<<QDateTime::currentDateTime().toTime_t();
     }
 }
diff --git a/x2godesktopsharing-3.0.1.kdev4 b/x2godesktopsharing-3.0.1.kdev4
new file mode 100644
index 0000000..70f84e2
--- /dev/null
+++ b/x2godesktopsharing-3.0.1.kdev4
@@ -0,0 +1,3 @@
+[Project]
+Manager=KDevCustomMakeManager
+Name=x2godesktopsharing-3.0.1
diff --git a/x2godesktopsharing.kdevelop.pcs b/x2godesktopsharing.kdevelop.pcs
index c4ebe00..a6fd93a 100644
Binary files a/x2godesktopsharing.kdevelop.pcs and b/x2godesktopsharing.kdevelop.pcs differ
diff --git a/x2godesktopsharing.kdevses b/x2godesktopsharing.kdevses
index a6aab76..0dddff4 100644
--- a/x2godesktopsharing.kdevses
+++ b/x2godesktopsharing.kdevses
@@ -3,21 +3,21 @@
 <KDevPrjSession>
  <DocsAndViews NumberOfDocuments="6" >
   <Doc0 NumberOfViews="1" URL="file:///usr/src.cur/db-builds/x2godesktopsharing/x2godesktopsharing-3.0.1/sharetray.cpp" >
-   <View0 Encoding="" line="427" Type="Source" />
+   <View0 Encoding="" Type="Source" />
   </Doc0>
-  <Doc1 NumberOfViews="1" URL="file:///usr/share/doc/qt3-doc/html/qaxserver-example-simple.html" >
+  <Doc1 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/qtimer.html" >
    <View0 Type="Documentation" />
   </Doc1>
-  <Doc2 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/qdialogbuttonbox.html#ButtonRole-enum" >
-   <View0 Type="Documentation" />
-  </Doc2>
-  <Doc3 NumberOfViews="1" URL="file:///usr/src.cur/db-builds/x2godesktopsharing/x2godesktopsharing-3.0.1/sharetray.h" >
+  <Doc2 NumberOfViews="1" URL="file:///usr/src.cur/db-builds/x2godesktopsharing/x2godesktopsharing-3.0.1/sharetray.h" >
    <View0 Encoding="" Type="Source" />
+  </Doc2>
+  <Doc3 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/qgraphicslayout.html" >
+   <View0 Type="Documentation" />
   </Doc3>
-  <Doc4 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/qt.html#WindowType-enum" >
+  <Doc4 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/qgraphicslinearlayout.html#addStretch" >
    <View0 Type="Documentation" />
   </Doc4>
-  <Doc5 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/examples.html#activeqt" >
+  <Doc5 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/qstring.html" >
    <View0 Type="Documentation" />
   </Doc5>
  </DocsAndViews>


hooks/post-receive
-- 
x2godesktopsharing.git (Desktop Sharing for X2Go)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2godesktopsharing.git" (Desktop Sharing for X2Go).




More information about the x2go-commits mailing list