Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: dev-libs/soprano/, dev-libs/soprano/files/
Date: Fri, 08 Jun 2012 11:11:17
Message-Id: 1339153708.a31532f7ad53da59f951161c5bd681539d16d06e.dilfridge@gentoo
1 commit: a31532f7ad53da59f951161c5bd681539d16d06e
2 Author: Andreas K. Huettel (dilfridge) <mail <AT> akhuettel <DOT> de>
3 AuthorDate: Fri Jun 8 11:08:28 2012 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 8 11:08:28 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=a31532f7
7
8 [dev-libs/soprano] Restore ABI/API compatibility (tcpclient stub)
9
10 (Portage version: 2.2.0_alpha110/git/Linux x86_64, unsigned Manifest commit)
11
12 ---
13 .../soprano/files/soprano-2.7.56-tcpclient.patch | 196 ++++++++++++++++++++
14 ...rano-2.7.56.ebuild => soprano-2.7.56-r1.ebuild} | 1 +
15 2 files changed, 197 insertions(+), 0 deletions(-)
16
17 diff --git a/dev-libs/soprano/files/soprano-2.7.56-tcpclient.patch b/dev-libs/soprano/files/soprano-2.7.56-tcpclient.patch
18 new file mode 100644
19 index 0000000..2b04f66
20 --- /dev/null
21 +++ b/dev-libs/soprano/files/soprano-2.7.56-tcpclient.patch
22 @@ -0,0 +1,196 @@
23 +commit ed17a950a9c6f83590fa62cb97e7278ba7f3e234
24 +Author: Aaron Seigo <aseigo@×××.org>
25 +Date: Wed May 30 10:18:52 2012 +0200
26 +
27 + restore SC / BC with a stub impl of tcpclient
28 +
29 +diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
30 +index 2689568..4e73e3c 100644
31 +--- a/client/CMakeLists.txt
32 ++++ b/client/CMakeLists.txt
33 +@@ -14,6 +14,8 @@ include_directories(
34 + )
35 +
36 + set(soprano_client_SRC
37 ++ ${soprano_server_SOURCE_DIR}/datastream.cpp
38 ++ tcpclient.cpp
39 + socket.cpp
40 + socketstream.cpp
41 + localsocketclient.cpp
42 +@@ -94,6 +96,7 @@ INSTALL(TARGETS sopranoclient
43 +
44 + install(
45 + FILES
46 ++ tcpclient.h
47 + localsocketclient.h
48 + DESTINATION include/soprano
49 + )
50 +diff --git a/client/tcpclient.cpp b/client/tcpclient.cpp
51 +index 796ca59..01dce0e 100644
52 +--- a/client/tcpclient.cpp
53 ++++ b/client/tcpclient.cpp
54 +@@ -33,151 +33,58 @@ Q_DECLARE_METATYPE( QAbstractSocket::SocketError )
55 + const quint16 Soprano::Client::TcpClient::DEFAULT_PORT = 5000;
56 +
57 +
58 +-namespace Soprano {
59 +- namespace Client {
60 +- class TcpClientConnection : public ClientConnection
61 +- {
62 +- public:
63 +- TcpClientConnection( const QHostAddress& address, int port, QObject* parent );
64 +- ~TcpClientConnection();
65 +-
66 +- protected:
67 +- QIODevice* newConnection();
68 +- bool isConnected( QIODevice* );
69 +-
70 +- private:
71 +- QHostAddress m_address;
72 +- int m_port;
73 +- };
74 +-
75 +- TcpClientConnection::TcpClientConnection( const QHostAddress& address, int port, QObject* parent )
76 +- : ClientConnection( parent ),
77 +- m_address( address ),
78 +- m_port( port )
79 +- {
80 +- }
81 +-
82 +- TcpClientConnection::~TcpClientConnection()
83 +- {
84 +- }
85 +-
86 +- QIODevice* TcpClientConnection::newConnection()
87 +- {
88 +- clearError();
89 +-
90 +- QTcpSocket* socket = new QTcpSocket;
91 +- socket->connectToHost( m_address, m_port );
92 +- if ( socket->waitForConnected() ) {
93 +- QObject::connect( socket, SIGNAL(error(QAbstractSocket::SocketError)),
94 +- parent(), SLOT(slotError(QAbstractSocket::SocketError)) );
95 +- return socket;
96 +- }
97 +- else {
98 +- setError( socket->errorString() );
99 +- delete socket;
100 +- return 0;
101 +- }
102 +- }
103 +-
104 +- bool TcpClientConnection::isConnected( QIODevice* device ) {
105 +- return device ? ( static_cast<QTcpSocket*>( device )->state() == QAbstractSocket::ConnectedState ) : false;
106 +- }
107 +- }
108 +-}
109 +-
110 +-
111 +-class Soprano::Client::TcpClient::Private
112 +-{
113 +-public:
114 +- Private()
115 +- : connection( 0 ) {
116 +- }
117 +-
118 +- TcpClientConnection* connection;
119 +-};
120 +-
121 +-
122 + Soprano::Client::TcpClient::TcpClient( QObject* parent )
123 + : QObject( parent ),
124 +- d( new Private() )
125 ++ d( 0 )
126 + {
127 +- qRegisterMetaType<QAbstractSocket::SocketError>();
128 ++ qWarning() << "This class is deprecated, and the implementation is only a stub now. DO NOT USE IT IN YOUR APPLICATION.";
129 + }
130 +
131 +
132 + Soprano::Client::TcpClient::~TcpClient()
133 + {
134 +- disconnect();
135 +- delete d;
136 ++ //delete d;
137 + }
138 +
139 +
140 + bool Soprano::Client::TcpClient::connect( const QHostAddress& address, int port )
141 + {
142 +- if ( !isConnected() ) {
143 +- if ( !d->connection )
144 +- d->connection = new TcpClientConnection( address, port, this );
145 +- if ( d->connection->connect() &&
146 +- d->connection->checkProtocolVersion() ) {
147 +- return true;
148 +- }
149 +- else {
150 +- disconnect();
151 +- return false;
152 +- }
153 +- }
154 +- else {
155 +- setError( "Already connected" );
156 +- return false;
157 +- }
158 ++ Q_UNUSED(address)
159 ++ Q_UNUSED(port)
160 ++ return false;
161 + }
162 +
163 +
164 + bool Soprano::Client::TcpClient::isConnected()
165 + {
166 +- return d->connection ? d->connection->isConnected() : false;
167 ++ return false;
168 + }
169 +
170 +
171 + void Soprano::Client::TcpClient::disconnect()
172 + {
173 +- delete d->connection;
174 +- d->connection = 0;
175 + }
176 +
177 +
178 + Soprano::Model* Soprano::Client::TcpClient::createModel( const QString& name, const QList<BackendSetting>& settings )
179 + {
180 +- if ( d->connection ) {
181 +- int modelId = d->connection->createModel( name, settings );
182 +- setError( d->connection->lastError() );
183 +- if ( modelId > 0 ) {
184 +- StorageModel* model = new ClientModel( 0, modelId, d->connection );
185 +- return model;
186 +- }
187 +- }
188 +- else {
189 +- setError( "Not connected" );
190 +- }
191 +-
192 ++ Q_UNUSED(name)
193 ++ Q_UNUSED(settings)
194 ++ setError( "Not connected" );
195 + return 0;
196 + }
197 +
198 +
199 + void Soprano::Client::TcpClient::removeModel( const QString& name )
200 + {
201 +- if ( d->connection ) {
202 +- d->connection->removeModel( name );
203 +- setError( d->connection->lastError() );
204 +- }
205 +- else {
206 +- setError( "Not connected" );
207 +- }
208 ++ Q_UNUSED(name)
209 ++ setError( "Not connected" );
210 + }
211 +
212 +
213 + void Soprano::Client::TcpClient::slotError( QAbstractSocket::SocketError error )
214 + {
215 ++ Q_UNUSED(error)
216 + qDebug() << "Error: " << error;
217 + }
218 +
219
220 diff --git a/dev-libs/soprano/soprano-2.7.56.ebuild b/dev-libs/soprano/soprano-2.7.56-r1.ebuild
221 similarity index 98%
222 rename from dev-libs/soprano/soprano-2.7.56.ebuild
223 rename to dev-libs/soprano/soprano-2.7.56-r1.ebuild
224 index b5583ab..a29cff6 100644
225 --- a/dev-libs/soprano/soprano-2.7.56.ebuild
226 +++ b/dev-libs/soprano/soprano-2.7.56-r1.ebuild
227 @@ -49,6 +49,7 @@ CMAKE_IN_SOURCE_BUILD="1"
228
229 PATCHES=(
230 "${FILESDIR}/${PN}-2.4.4-make-broken-redland-fatal.cmake"
231 + "${FILESDIR}/${PN}-2.7.56-tcpclient.patch"
232 )
233
234 pkg_setup() {