summaryrefslogtreecommitdiff
authorzecke <zecke>2004-02-21 13:09:17 (UTC)
committer zecke <zecke>2004-02-21 13:09:17 (UTC)
commit4024cfd1e32a43d82361d6ba9977fe64db88e3ce (patch) (unidiff)
tree1d2e0592a3df330a17d9a07cd2f29615ce5be595
parentaa11789fc4d735a04fac09063851753d8a57027b (diff)
downloadopie-4024cfd1e32a43d82361d6ba9977fe64db88e3ce.zip
opie-4024cfd1e32a43d82361d6ba9977fe64db88e3ce.tar.gz
opie-4024cfd1e32a43d82361d6ba9977fe64db88e3ce.tar.bz2
Fix up syncing mode
InetlliSync,Opie1.0,QtopiaNEW
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/qcopbridge.cpp2
-rw-r--r--core/launcher/qcopbridge.h3
-rw-r--r--core/launcher/transferserver.cpp28
3 files changed, 26 insertions, 7 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index b45f0cc..9bca360 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -165,7 +165,7 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &data
165 pi->sendDesktopMessage( command, data ); 165 pi->sendDesktopMessage( command, data );
166 } 166 }
167 } 167 }
168 if ( m_mode & Sharp ) 168 if ( ( m_mode & Sharp ) || (m_mode & IntelliSync) )
169 sendDesktopMessageOld( command, data ); 169 sendDesktopMessageOld( command, data );
170} 170}
171 171
diff --git a/core/launcher/qcopbridge.h b/core/launcher/qcopbridge.h
index 9483d9d..d5988cd 100644
--- a/core/launcher/qcopbridge.h
+++ b/core/launcher/qcopbridge.h
@@ -37,7 +37,8 @@ class QCopBridge : public QServerSocket
37 Q_OBJECT 37 Q_OBJECT
38 38
39public: 39public:
40 enum Mode { Qtopia1_7= 0x01, Sharp = 0x02, Both = Qtopia1_7 | Sharp }; 40 /* can not or anymore :) */
41 enum Mode { Qtopia1_7= 0x01, Sharp = 0x02, IntelliSync = 0x04 };
41 QCopBridge( Q_UINT16 port, QObject *parent = 0, const char* name = 0 ); 42 QCopBridge( Q_UINT16 port, QObject *parent = 0, const char* name = 0 );
42 virtual ~QCopBridge(); 43 virtual ~QCopBridge();
43 44
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index 9cb9d7a..8367a62 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -194,15 +194,33 @@ bool SyncAuthentication::checkPassword( const QString& password )
194 int now = time(0); 194 int now = time(0);
195 195
196 Config cfg("Security"); 196 Config cfg("Security");
197 cfg.setGroup("Sync"); 197 cfg.setGroup("SyncMode");
198 QString syncapp = cfg.readEntry("syncapp","Qtopia"); 198 int mode = cfg.readNumEntry("Mode", 0x02 );
199 199
200 //No password needed if the user really wants it 200 //No pass word needed if the user really needs it
201 if (syncapp == "IntelliSync") { 201 if (mode & 0x04) {
202 QMessageBox unauth(
203 tr("Sync Connection"),
204 tr("<qt><p>An unauthorized system is requesting access to this device."
205 "<p>You chose IntelliSync so you may I allow or deny this connection.</qt>" ),
206 QMessageBox::Warning,
207 QMessageBox::Ok, QMessageBox::Cancel|QMessageBox::Default, QMessageBox::NoButton,
208 0, QString::null, TRUE, WStyle_StaysOnTop);
209 unauth.setButtonText(QMessageBox::Ok, tr("Allow" ) );
210 unauth.setButtonText(QMessageBox::Cancel, tr("Deny"));
211 switch( unauth.exec() ) {
212 case QMessageBox::Ok:
202 return TRUE; 213 return TRUE;
214 break;
215 case QMessageBox::Cancel:
216 default:
217 denials++;
218 lastdenial=now;
219 return FALSE;
220 }
203 } 221 }
204 222
205 // Detect old Qtopia Desktop (no password) 223 // Detect old Qtopia Desktop (no password) and fail
206 if ( password.isEmpty() ) { 224 if ( password.isEmpty() ) {
207 if ( denials < 3 || now > lastdenial+600 ) { 225 if ( denials < 3 || now > lastdenial+600 ) {
208 QMessageBox unauth( 226 QMessageBox unauth(