summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/opietooth2/OTGateway.cpp
authorwimpie <wimpie>2005-01-05 02:42:18 (UTC)
committer wimpie <wimpie>2005-01-05 02:42:18 (UTC)
commitbf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e (patch) (unidiff)
treeec61a57a8ace5c74e6cae46a676f40d849f4b9b1 /noncore/settings/networksettings2/opietooth2/OTGateway.cpp
parent2f343aab63dd30e97a893e3691501cdd55114e82 (diff)
downloadopie-bf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e.zip
opie-bf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e.tar.gz
opie-bf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e.tar.bz2
Slightly better layout for OTMainGUI.
Fixed segfault bug in disconnectNotify call (signal string could be NULL)
Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTGateway.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTGateway.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp
index 2d13ce9..6531cf6 100644
--- a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp
+++ b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp
@@ -147,55 +147,55 @@ bool OTGateway::isEnabled() {
147 if( getOTDevice()->deviceNr() >= 0 && 147 if( getOTDevice()->deviceNr() >= 0 &&
148 driver( getOTDevice()->deviceNr() )->isUp() ) 148 driver( getOTDevice()->deviceNr() )->isUp() )
149 return TRUE; 149 return TRUE;
150 150
151 // else check system 151 // else check system
152 return getOTDevice()->isAttached(); 152 return getOTDevice()->isAttached();
153} 153}
154 154
155void OTGateway::SLOT_ShowError( const QString & S ) { 155void OTGateway::SLOT_ShowError( const QString & S ) {
156 156
157 owarn << S << oendl; 157 owarn << S << oendl;
158 158
159 if( ErrorConnectCount > 0 ) { 159 if( ErrorConnectCount > 0 ) {
160 // pass error 160 // pass error
161 emit error( QString( "<p>" ) + S + "</p>" ); 161 emit error( QString( "<p>" ) + S + "</p>" );
162 return; 162 return;
163 } 163 }
164 164
165 QMessageBox::warning( 0, 165 QMessageBox::warning( 0,
166 tr("OTGateway error"), 166 tr("OTGateway error"),
167 S ); 167 S );
168} 168}
169 169
170void OTGateway::connectNotify( const char * S ) { 170void OTGateway::connectNotify( const char * S ) {
171 if( strcmp( S, "error(const QString&)" ) == 0 ) { 171 if( S && strcmp( S, "error(const QString&)" ) == 0 ) {
172 ErrorConnectCount ++; 172 ErrorConnectCount ++;
173 } 173 }
174} 174}
175 175
176void OTGateway::disconnectNotify( const char * S ) { 176void OTGateway::disconnectNotify( const char * S ) {
177 if( strcmp( S, "error(const QString&)" ) == 0 ) { 177 if( S && strcmp( S, "error(const QString&)" ) == 0 ) {
178 ErrorConnectCount --; 178 ErrorConnectCount --;
179 } 179 }
180} 180}
181 181
182void OTGateway::timerEvent( QTimerEvent * ) { 182void OTGateway::timerEvent( QTimerEvent * ) {
183 183
184 OTDriver * D; 184 OTDriver * D;
185 unsigned int oldc = AllDrivers.count(); 185 unsigned int oldc = AllDrivers.count();
186 bool old; 186 bool old;
187 187
188 AllDrivers.update(); 188 AllDrivers.update();
189 189
190 if( oldc != AllDrivers.count() ) { 190 if( oldc != AllDrivers.count() ) {
191 updateDrivers(); 191 updateDrivers();
192 } else { 192 } else {
193 for( unsigned int i = 0; 193 for( unsigned int i = 0;
194 i < AllDrivers.count(); 194 i < AllDrivers.count();
195 i ++ ) { 195 i ++ ) {
196 D = AllDrivers[i]; 196 D = AllDrivers[i];
197 old = D->isUp(); 197 old = D->isUp();
198 if( D->currentState() >= 0 ) { 198 if( D->currentState() >= 0 ) {
199 if( old != D->isUp() ) { 199 if( old != D->isUp() ) {
200 emit stateChange( D, D->isUp() ); 200 emit stateChange( D, D->isUp() );
201 } 201 }