summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-10-22 06:06:15 (UTC)
committer llornkcor <llornkcor>2004-10-22 06:06:15 (UTC)
commit0ad51ab1359feaf04c3be229250a4e2e93892564 (patch) (side-by-side diff)
tree4e5a55814f2ab401b4c54cb4bd7a47ee347bf4ee
parent84b7a20c67226aa4305ad0cb7c05e2507ca0cc0e (diff)
downloadopie-0ad51ab1359feaf04c3be229250a4e2e93892564.zip
opie-0ad51ab1359feaf04c3be229250a4e2e93892564.tar.gz
opie-0ad51ab1359feaf04c3be229250a4e2e93892564.tar.bz2
upon further investigation, QD does indeed do different stuff for different version strings.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 0eaebcf..42186d3 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -294,200 +294,205 @@ static const KeyOverride jp109keys[] = {
{ 0x70, { Qt::Key_Hiragana_Katakana, 0xffff, 0xffff, 0xffff } },
{ 0x73, { Qt::Key_Backslash, '\\' , '_' , 0xffff } },
{ 0x79, { Qt::Key_Henkan, 0xffff, 0xffff, 0xffff } },
{ 0x7b, { Qt::Key_Muhenkan, 0xffff, 0xffff, 0xffff } },
{ 0x7d, { Qt::Key_yen, 0x00a5, '|' , 0xffff } },
{ 0x00, { 0, 0xffff, 0xffff, 0xffff } }
};
bool Server::setKeyboardLayout( const QString &kb )
{
//quick demo version that can be extended
QIntDict<QWSServer::KeyMap> *om = 0;
if ( kb == "us101" ) { // No tr
om = 0;
} else if ( kb == "jp109" ) {
om = new QIntDict<QWSServer::KeyMap>(37);
const KeyOverride *k = jp109keys;
while ( k->scan_code ) {
om->insert( k->scan_code, &k->map );
k++;
}
}
QWSServer::setOverrideKeys( om );
return TRUE;
}
#endif
void Server::systemMsg(const QCString &msg, const QByteArray &data)
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "securityChanged()" ) {
if ( transferServer )
transferServer->authorizeConnections();
if ( qcopBridge )
qcopBridge->authorizeConnections();
#warning FIXME support TempScreenSaverMode
#if 0
} else if ( msg == "setTempScreenSaverMode(int,int)" ) {
int mode, pid;
stream >> mode >> pid;
tsmMonitor->setTempMode(mode, pid);
#endif
} else if ( msg == "linkChanged(QString)" ) {
QString link;
stream >> link;
odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
docList->linkChanged(link);
} else if ( msg == "serviceChanged(QString)" ) {
MimeType::updateApplications();
} else if ( msg == "mkdir(QString)" ) {
QString dir;
stream >> dir;
if ( !dir.isEmpty() )
mkdir( dir );
} else if ( msg == "rdiffGenSig(QString,QString)" ) {
QString baseFile, sigFile;
stream >> baseFile >> sigFile;
QRsync::generateSignature( baseFile, sigFile );
} else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {
QString baseFile, sigFile, deltaFile;
stream >> baseFile >> sigFile >> deltaFile;
QRsync::generateDiff( baseFile, sigFile, deltaFile );
} else if ( msg == "rdiffApplyPatch(QString,QString)" ) {
QString baseFile, deltaFile;
stream >> baseFile >> deltaFile;
if ( !QFile::exists( baseFile ) ) {
QFile f( baseFile );
f.open( IO_WriteOnly );
f.close();
}
QRsync::applyDiff( baseFile, deltaFile );
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
e << baseFile;
#endif
} else if ( msg == "rdiffCleanup()" ) {
mkdir( "/tmp/rdiff" );
QDir dir;
dir.setPath( "/tmp/rdiff" );
QStringList entries = dir.entryList();
for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
dir.remove( *it );
} else if ( msg == "sendHandshakeInfo()" ) {
QString home = getenv( "HOME" );
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
e << home;
int locked = (int) ServerApplication::screenLocked();
e << locked;
#endif
} else if ( msg == "sendVersionInfo()" ) {
/*
- * QtopiaDesktop relies on the major number
- * to start with 1.
- * we need to fake at least 1.4 to be able
- * to sync with QtopiaDesktop1.6
+ * @&$*! Qtopiadesktop relies on the major number
+ * to start with 1. (or 2 as the case of version 2.1 will be)
+ * we need to fake 1.7 to be able
+ * to sync with Qtopiadesktop 1.7.
+ * We'll send it Opie's version in the platform string for now,
+ * until such time when QD gets rewritten correctly.
*/
QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" );
- QString opiename = "Opie";
- e << QString(QPE_VERSION) << opiename;
+
+ QString opiename = "Opie "+QString(QPE_VERSION);
+ QString QDVersion="1.7";
+ e << QDVersion << opiename;
+
} else if ( msg == "sendCardInfo()" ) {
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
#endif
storage->update();
const QList<FileSystem> &fs = storage->fileSystems();
QListIterator<FileSystem> it ( fs );
QString s;
QString homeDir = getenv("HOME");
QString homeFs, homeFsPath;
for ( ; it.current(); ++it ) {
int k4 = (*it)->blockSize()/256;
if ( (*it)->isRemovable() ) {
s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
+ QString::number( (*it)->availBlocks() * k4/4 )
+ "K " + (*it)->options() + ";";
} else if ( homeDir.contains( (*it)->path() ) &&
(*it)->path().length() > homeFsPath.length() ) {
homeFsPath = (*it)->path();
homeFs =
(*it)->name() + "=" + homeDir + "/Documents " // No tr
+ QString::number( (*it)->availBlocks() * k4/4 )
+ "K " + (*it)->options() + ";";
}
}
if ( !homeFs.isEmpty() )
s += homeFs;
#ifndef QT_NO_COP
e << s;
#endif
} else if ( msg == "sendInstallLocations()" ) {
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" );
e << installLocationsString();
#endif
} else if ( msg == "sendSyncDate(QString)" ) {
QString app;
stream >> app;
Config cfg( "qpe" );
cfg.setGroup("SyncDate");
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
e << app << cfg.readEntry( app );
#endif
//odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response "
// << cfg.readEntry( app ).latin1() << oendl;
} else if ( msg == "setSyncDate(QString,QString)" ) {
QString app, date;
stream >> app >> date;
Config cfg( "qpe" );
cfg.setGroup("SyncDate");
cfg.writeEntry( app, date );
//odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl;
} else if ( msg == "startSync(QString)" ) {
QString what;
stream >> what;
delete syncDialog;
syncDialog = new SyncDialog( this, what );
syncDialog->show();
connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) );
} else if ( msg == "stopSync()") {
delete syncDialog;
syncDialog = 0;
} else if (msg == "restoreDone(QString)") {
docList->restoreDone();
} else if ( msg == "getAllDocLinks()" ) {
docList->sendAllDocLinks();
}
#ifdef QPE_HAVE_DIRECT_ACCESS
else if ( msg == "prepareDirectAccess()" ) {
prepareDirectAccess();
} else if ( msg == "postDirectAccess()" ) {
postDirectAccess();
}
#endif
#ifdef Q_WS_QWS
else if ( msg == "setMouseProto(QString)" ) {
QString mice;
stream >> mice;
setenv("QWS_MOUSE_PROTO",mice.latin1(),1);
qwsServer->openMouse();
} else if ( msg == "setKeyboard(QString)" ) {
QString kb;
stream >> kb;
setenv("QWS_KEYBOARD",kb.latin1(),1);
qwsServer->openKeyboard();
} else if ( msg == "setKeyboardAutoRepeat(int,int)" ) {
int delay, period;
stream >> delay >> period;
qwsSetKeyboardAutoRepeat( delay, period );
Config cfg( "qpe" );
cfg.setGroup("Keyboard");
cfg.writeEntry( "RepeatDelay", delay );
cfg.writeEntry( "RepeatPeriod", period );
} else if ( msg == "setKeyboardLayout(QString)" ) {