author | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
commit | 6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (unidiff) | |
tree | 6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/network.cpp | |
parent | d10cddb3c9ce75bc90b14add14bc133737fe35aa (diff) | |
download | opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2 |
Qtopia1-6 merge
still to test
bic changes to be resolved
more changes to be made?
-rw-r--r-- | library/network.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/library/network.cpp b/library/network.cpp index e6d2781..185b147 100644 --- a/library/network.cpp +++ b/library/network.cpp | |||
@@ -1,10 +1,10 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
@@ -22,23 +22,26 @@ | |||
22 | #include "qpe/network.h" | 22 | #include "qpe/network.h" |
23 | #include "qpe/networkinterface.h" | 23 | #include "qpe/networkinterface.h" |
24 | #include "qpe/global.h" | 24 | #include "qpe/global.h" |
25 | #include "qpe/config.h" | 25 | #include "qpe/config.h" |
26 | #include "qpe/resource.h" | 26 | #include "qpe/resource.h" |
27 | #include "qpe/qpeapplication.h" | 27 | #include "qpe/qpeapplication.h" |
28 | #ifdef QWS | ||
28 | #include <qpe/qcopenvelope_qws.h> | 29 | #include <qpe/qcopenvelope_qws.h> |
30 | #endif | ||
29 | #include <qpe/qlibrary.h> | 31 | #include <qpe/qlibrary.h> |
30 | 32 | ||
31 | #include <qlistbox.h> | 33 | #include <qlistbox.h> |
32 | #include <qdir.h> | 34 | #include <qdir.h> |
33 | #include <qlayout.h> | 35 | #include <qlayout.h> |
34 | #include <qdict.h> | 36 | #include <qdict.h> |
35 | #include <qtranslator.h> | 37 | #include <qtranslator.h> |
36 | 38 | ||
37 | #include <stdlib.h> | 39 | #include <stdlib.h> |
38 | 40 | ||
41 | #ifndef QT_NO_COP | ||
39 | class NetworkEmitter : public QCopChannel { | 42 | class NetworkEmitter : public QCopChannel { |
40 | Q_OBJECT | 43 | Q_OBJECT |
41 | public: | 44 | public: |
42 | NetworkEmitter() : QCopChannel("QPE/Network",qApp) | 45 | NetworkEmitter() : QCopChannel("QPE/Network",qApp) |
43 | { | 46 | { |
44 | } | 47 | } |
@@ -65,12 +68,13 @@ void Network::start(const QString& choice, const QString& password) | |||
65 | e << choice << password; | 68 | e << choice << password; |
66 | } | 69 | } |
67 | 70 | ||
68 | /*! | 71 | /*! |
69 | \class Network network.h | 72 | \class Network network.h |
70 | \brief The Network class provides network access functionality. | 73 | \brief The Network class provides network access functionality. |
74 | \internal | ||
71 | */ | 75 | */ |
72 | 76 | ||
73 | // copy the proxy settings of the active config over to the Proxies.conf file | 77 | // copy the proxy settings of the active config over to the Proxies.conf file |
74 | /*! | 78 | /*! |
75 | \internal | 79 | \internal |
76 | */ | 80 | */ |
@@ -110,20 +114,22 @@ void Network::connectChoiceChange(QObject* receiver, const char* slot) | |||
110 | { | 114 | { |
111 | if ( !emitter ) | 115 | if ( !emitter ) |
112 | emitter = new NetworkEmitter; | 116 | emitter = new NetworkEmitter; |
113 | QObject::connect(emitter,SIGNAL(changed()),receiver,slot); | 117 | QObject::connect(emitter,SIGNAL(changed()),receiver,slot); |
114 | } | 118 | } |
115 | 119 | ||
120 | #endif// QT_NO_COP | ||
116 | /*! | 121 | /*! |
117 | \internal | 122 | \internal |
118 | */ | 123 | */ |
119 | QString Network::settingsDir() | 124 | QString Network::settingsDir() |
120 | { | 125 | { |
121 | return Global::applicationFileName("Network", "modules"); | 126 | return Global::applicationFileName("Network", "modules"); |
122 | } | 127 | } |
123 | 128 | ||
129 | #ifndef QT_NO_COP | ||
124 | /*! | 130 | /*! |
125 | \internal | 131 | \internal |
126 | */ | 132 | */ |
127 | QStringList Network::choices(QListBox* lb, const QString& dir) | 133 | QStringList Network::choices(QListBox* lb, const QString& dir) |
128 | { | 134 | { |
129 | QStringList list; | 135 | QStringList list; |
@@ -131,13 +137,13 @@ QStringList Network::choices(QListBox* lb, const QString& dir) | |||
131 | if ( lb ) | 137 | if ( lb ) |
132 | lb->clear(); | 138 | lb->clear(); |
133 | 139 | ||
134 | QString adir = dir.isEmpty() ? settingsDir() : dir; | 140 | QString adir = dir.isEmpty() ? settingsDir() : dir; |
135 | QDir settingsdir(adir); | 141 | QDir settingsdir(adir); |
136 | settingsdir.mkdir(adir); | 142 | settingsdir.mkdir(adir); |
137 | 143 | ||
138 | QStringList files = settingsdir.entryList("*.conf"); | 144 | QStringList files = settingsdir.entryList("*.conf"); |
139 | for (QStringList::ConstIterator it=files.begin(); it!=files.end(); ++it ) { | 145 | for (QStringList::ConstIterator it=files.begin(); it!=files.end(); ++it ) { |
140 | QString filename = settingsdir.filePath(*it); | 146 | QString filename = settingsdir.filePath(*it); |
141 | Config cfg(filename, Config::File); | 147 | Config cfg(filename, Config::File); |
142 | cfg.setGroup("Info"); | 148 | cfg.setGroup("Info"); |
143 | if ( lb ) | 149 | if ( lb ) |
@@ -149,13 +155,13 @@ QStringList Network::choices(QListBox* lb, const QString& dir) | |||
149 | return list; | 155 | return list; |
150 | } | 156 | } |
151 | 157 | ||
152 | class NetworkServer : public QCopChannel { | 158 | class NetworkServer : public QCopChannel { |
153 | Q_OBJECT | 159 | Q_OBJECT |
154 | public: | 160 | public: |
155 | NetworkServer(QObject* parent) : QCopChannel("QPE/Network",parent) | 161 | NetworkServer(QObject* parent) : QCopChannel("QPE/Network",parent), wait(0) |
156 | { | 162 | { |
157 | up = FALSE; | 163 | up = FALSE; |
158 | examineNetworks( TRUE ); | 164 | examineNetworks( TRUE ); |
159 | QCopChannel* card = new QCopChannel("QPE/Card",parent); | 165 | QCopChannel* card = new QCopChannel("QPE/Card",parent); |
160 | connect(card,SIGNAL(received(const QCString &, const QByteArray&)), | 166 | connect(card,SIGNAL(received(const QCString &, const QByteArray&)), |
161 | this,SLOT(cardMessage(const QCString &, const QByteArray&))); | 167 | this,SLOT(cardMessage(const QCString &, const QByteArray&))); |
@@ -434,6 +440,7 @@ NetworkInterface* Network::loadPlugin(const QString& type) | |||
434 | #else | 440 | #else |
435 | return 0; | 441 | return 0; |
436 | #endif | 442 | #endif |
437 | } | 443 | } |
438 | 444 | ||
439 | #include "network.moc" | 445 | #include "network.moc" |
446 | #endif// QT_NO_COP | ||