[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdelibs/ksecretsservice] /: Merge branch 'acl'
From: Valentin Rusu <kde () rusu ! info>
Date: 2011-09-04 15:26:47
Message-ID: 20110904152647.675F5A60C9 () git ! kde ! org
[Download RAW message or body]
Git commit edab7c331954c916df0c6a64b391dcb6f20577d8 by Valentin Rusu.
Committed on 15/10/2010 at 00:25.
Pushed by vrusu into branch 'ksecretsservice'.
Merge branch 'acl'
svn path=/trunk/playground/base/ksecretservice/; revision=1186010
A +40 -0 createcollectioninfo.h [License: GPL (v2/3)]
A +65 -0 peer.h [License: GPL (v2/3)]
M +1 -0 CMakeLists.txt
A +57 -0 peer.cpp [License: GPL (v2/3)]
http://commits.kde.org/kdelibs/edab7c331954c916df0c6a64b391dcb6f20577d8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 194c614..4b91a89 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,7 @@ SET (ksecretservice_lib_SRCS
jobqueue.cpp
queuedjob.cpp
secrettool.cpp
+ peer.cpp
)
KDE4_ADD_LIBRARY (ksecretservicelib STATIC ${ksecretservice_lib_SRCS})
diff --git a/createcollectioninfo.h b/createcollectioninfo.h
new file mode 100644
index 0000000..194c850
--- /dev/null
+++ b/createcollectioninfo.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2010, Valentin Rusu <kde@rusu.info>
+ *
+ * This program 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 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * This program 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CREATECOLLECTIONINFO_H
+#define CREATECOLLECTIONINFO_H
+
+#include <QtCore/QString>
+
+class Peer;
+
+struct CreateCollectionInfo
+{
+ const QString &m_label;
+ bool m_locked;
+ const Peer* m_peer;
+
+ CreateCollectionInfo( const QString& label ) :
+ m_label( label ), m_locked(false), m_peer(0)
+ {
+ }
+};
+
+#endif // CREATECOLLECTIONINFO_H
diff --git a/peer.cpp b/peer.cpp
new file mode 100644
index 0000000..2f11768
--- /dev/null
+++ b/peer.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2010, Valentin Rusu <kde@rusu.info>
+ *
+ * This program 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 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * This program 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "peer.h"
+
+#include <QFile>
+
+#include <kdebug.h>
+
+Peer::Peer( uint pid ) :
+ m_pid( pid )
+{
+ kDebug() << "Peer " << pid;
+ kDebug() << " cmdLine = " << cmdLine();
+ kDebug() << " exePath = " << exePath();
+}
+
+QString Peer::procFileName() const
+{
+ return QString("/proc/%1").arg( m_pid );
+}
+
+QString Peer::cmdLine() const
+{
+ QFile procFile( QString("%s/cmd").arg( procFileName() ) );
+ return procFile.readLine();
+}
+
+bool Peer::isStillRunning() const
+{
+ QFile procFile( procFileName() );
+ return procFile.exists();
+}
+
+QString Peer::exePath() const
+{
+ QFile procFile( QString("%s/exe").arg( procFileName() )) ;
+ // TODO: add a watch an trigger signal when the peer process ends
+ return procFile.symLinkTarget();
+}
diff --git a/peer.h b/peer.h
new file mode 100644
index 0000000..8b33049
--- /dev/null
+++ b/peer.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2010, Valentin Rusu <kde@rusu.info>
+ *
+ * This program 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 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * This program 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DEAMON_PEER_H
+#define DEAMON_PEER_H
+
+#include <QtGlobal>
+
+/**
+ * Representation of a daemon peer, wich is typically a client application
+ * Note that the client application firstly connect to the dbus deamon wich
+ * forwards messages to ksecretservice daemon using another connection
+ */
+class Peer
+{
+public:
+ Peer( uint pid );
+
+ /**
+ * Get the running state of the peer process
+ */
+ bool isStillRunning() const;
+
+ /**
+ * Get the executable path of the running process
+ */
+ QString exePath() const;
+
+ /**
+ * Get the command line used to launch the running process
+ */
+ QString cmdLine() const;
+
+private:
+ /**
+ * Helper method witch returns the /proc/pid path for the
+ * peer process
+ */
+ QString procFileName() const;
+
+ /**
+ * Peer process PID
+ */
+ uint m_pid;
+};
+
+#endif // DEAMON_PEER_H
+
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic