summaryrefslogtreecommitdiff
authorzecke <zecke>2002-09-30 15:39:19 (UTC)
committer zecke <zecke>2002-09-30 15:39:19 (UTC)
commitd2a7ac3311bda821ee07ff070c24f17958657129 (patch) (unidiff)
treed616be7f21e75c0a7f27f2155fbb5bb5a0855266
parentda273e4780502b8819118c5e31c9d565fc1a1b49 (diff)
downloadopie-d2a7ac3311bda821ee07ff070c24f17958657129.zip
opie-d2a7ac3311bda821ee07ff070c24f17958657129.tar.gz
opie-d2a7ac3311bda821ee07ff070c24f17958657129.tar.bz2
Make QtopiaDesktop1.6 work with Opie again
it did rely on the counter part to send a version number starting with 1
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 1bd1156..6948976 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -595,25 +595,25 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl )
595 595
596 syncDialog = 0; 596 syncDialog = 0;
597 597
598 // we have a pretty good idea how big we'll be 598 // we have a pretty good idea how big we'll be
599 setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); 599 setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() );
600 600
601 tabs = 0; 601 tabs = 0;
602 rootFolder = 0; 602 rootFolder = 0;
603 docsFolder = 0; 603 docsFolder = 0;
604 604
605 int stamp = uidgen.generate(); // this is our timestamp to see which devices we know 605 int stamp = uidgen.generate(); // this is our timestamp to see which devices we know
606 //uidgen.store( stamp ); 606 //uidgen.store( stamp );
607 m_timeStamp = QString::number( stamp ); 607 m_timeStamp = QString::number( stamp );
608 608
609 tabs = new CategoryTabWidget( this ); 609 tabs = new CategoryTabWidget( this );
610 tabs->setMaximumWidth( qApp->desktop()->width() ); 610 tabs->setMaximumWidth( qApp->desktop()->width() );
611 setCentralWidget( tabs ); 611 setCentralWidget( tabs );
612 612
613 connect( tabs, SIGNAL(selected(const QString&)), 613 connect( tabs, SIGNAL(selected(const QString&)),
614 this, SLOT(viewSelected(const QString&)) ); 614 this, SLOT(viewSelected(const QString&)) );
615 connect( tabs, SIGNAL(clicked(const AppLnk*)), 615 connect( tabs, SIGNAL(clicked(const AppLnk*)),
616 this, SLOT(select(const AppLnk*))); 616 this, SLOT(select(const AppLnk*)));
617 connect( tabs, SIGNAL(rightPressed(AppLnk*)), 617 connect( tabs, SIGNAL(rightPressed(AppLnk*)),
618 this, SLOT(properties(AppLnk*))); 618 this, SLOT(properties(AppLnk*)));
619 619
@@ -970,29 +970,34 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
970 QString modifier, appName, delay; 970 QString modifier, appName, delay;
971 stream >> modifier >> appName >> delay; 971 stream >> modifier >> appName >> delay;
972 Config cfg( "autostart" ); 972 Config cfg( "autostart" );
973 cfg.setGroup( "AutoStart" ); 973 cfg.setGroup( "AutoStart" );
974 if ( modifier.compare("add") == 0 ){ 974 if ( modifier.compare("add") == 0 ){
975 // only add it appname is entered 975 // only add it appname is entered
976 if (!appName.isEmpty()) { 976 if (!appName.isEmpty()) {
977 cfg.writeEntry("Apps", appName); 977 cfg.writeEntry("Apps", appName);
978 cfg.writeEntry("Delay", delay); 978 cfg.writeEntry("Delay", delay);
979 } 979 }
980 } else { 980 } else {
981 } 981 }
982 } else if ( msg == "sendVersionInfo()" ) { 982 }
983 /*
984 * QtopiaDesktop relies on the major number
985 * to start with 1. We're at 0.9
986 * so wee need to fake at least 1.4 to be able
987 * to sync with QtopiaDesktop1.6
988 */
989 else if ( msg == "sendVersionInfo()" ) {
983 QCopEnvelope e( "QPE/Desktop", "versionInfo(QString)" ); 990 QCopEnvelope e( "QPE/Desktop", "versionInfo(QString)" );
984 QString v = QPE_VERSION; 991 QString v2 = QString::fromLatin1("1.4");
985 QStringList l = QStringList::split( '.', v );
986 QString v2 = l[0] + '.' + l[1];
987 e << v2; 992 e << v2;
988 //qDebug("version %s\n", line.latin1()); 993 //qDebug("version %s\n", line.latin1());
989 } else if ( msg == "sendCardInfo()" ) { 994 } else if ( msg == "sendCardInfo()" ) {
990#ifndef QT_NO_COP 995#ifndef QT_NO_COP
991 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); 996 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
992#endif 997#endif
993 const QList<FileSystem> &fs = storage->fileSystems(); 998 const QList<FileSystem> &fs = storage->fileSystems();
994 QListIterator<FileSystem> it ( fs ); 999 QListIterator<FileSystem> it ( fs );
995 QString s; 1000 QString s;
996 QString homeDir = getenv("HOME"); 1001 QString homeDir = getenv("HOME");
997 QString hardDiskHome, hardDiskHomePath; 1002 QString hardDiskHome, hardDiskHomePath;
998 for ( ; it.current(); ++it ) { 1003 for ( ; it.current(); ++it ) {
@@ -1041,25 +1046,25 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
1041 cfg.writeEntry( app, date ); 1046 cfg.writeEntry( app, date );
1042 //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1()); 1047 //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1());
1043 } else if ( msg == "startSync(QString)" ) { 1048 } else if ( msg == "startSync(QString)" ) {
1044 QString what; 1049 QString what;
1045 stream >> what; 1050 stream >> what;
1046 delete syncDialog; syncDialog = 0; 1051 delete syncDialog; syncDialog = 0;
1047 syncDialog = new SyncDialog( this, "syncProgress", FALSE, 1052 syncDialog = new SyncDialog( this, "syncProgress", FALSE,
1048 WStyle_Tool | WStyle_Customize | 1053 WStyle_Tool | WStyle_Customize |
1049 Qt::WStyle_StaysOnTop ); 1054 Qt::WStyle_StaysOnTop );
1050 syncDialog->showMaximized(); 1055 syncDialog->showMaximized();
1051 syncDialog->whatLabel->setText( "<b>" + what + "</b>" ); 1056 syncDialog->whatLabel->setText( "<b>" + what + "</b>" );
1052 connect( syncDialog->buttonCancel, SIGNAL( clicked() ), 1057 connect( syncDialog->buttonCancel, SIGNAL( clicked() ),
1053 SLOT( cancelSync() ) ); 1058 SLOT( cancelSync() ) );
1054 } else if ( msg == "stopSync()") { 1059 } else if ( msg == "stopSync()") {
1055 delete syncDialog; syncDialog = 0; 1060 delete syncDialog; syncDialog = 0;
1056 } else if ( msg == "getAllDocLinks()" ) { 1061 } else if ( msg == "getAllDocLinks()" ) {
1057 loadDocs(); 1062 loadDocs();
1058 1063
1059 QString contents; 1064 QString contents;
1060 1065
1061 //Categories cats; 1066 //Categories cats;
1062 for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) { 1067 for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) {
1063 DocLnk *doc = it.current(); 1068 DocLnk *doc = it.current();
1064 QFileInfo fi( doc->file() ); 1069 QFileInfo fi( doc->file() );
1065 if ( !fi.exists() ) 1070 if ( !fi.exists() )
@@ -1084,25 +1089,25 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
1084 contents += "Name = "+doc->name()+"\n"; // No tr 1089 contents += "Name = "+doc->name()+"\n"; // No tr
1085 contents += "Type = "+doc->type()+"\n"; // No tr 1090 contents += "Type = "+doc->type()+"\n"; // No tr
1086 } 1091 }
1087 contents += "File = "+doc->file()+"\n"; // No tr // (resolves path) 1092 contents += "File = "+doc->file()+"\n"; // No tr // (resolves path)
1088 contents += QString("Size = %1\n").arg( fi.size() ); // No tr 1093 contents += QString("Size = %1\n").arg( fi.size() ); // No tr
1089 } 1094 }
1090 1095
1091 //qDebug( "sending length %d", contents.length() ); 1096 //qDebug( "sending length %d", contents.length() );
1092#ifndef QT_NO_COP 1097#ifndef QT_NO_COP
1093 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); 1098 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" );
1094 e << contents; 1099 e << contents;
1095#endif 1100#endif
1096 1101
1097 //qDebug( "================ \n\n%s\n\n===============", 1102 //qDebug( "================ \n\n%s\n\n===============",
1098 //contents.latin1() ); 1103 //contents.latin1() );
1099 1104
1100 delete docsFolder; 1105 delete docsFolder;
1101 docsFolder = 0; 1106 docsFolder = 0;
1102#ifdef QWS 1107#ifdef QWS
1103 } else if ( msg == "setMouseProto(QString)" ) { 1108 } else if ( msg == "setMouseProto(QString)" ) {
1104 QString mice; 1109 QString mice;
1105 stream >> mice; 1110 stream >> mice;
1106 setenv("QWS_MOUSE_PROTO",mice.latin1(),1); 1111 setenv("QWS_MOUSE_PROTO",mice.latin1(),1);
1107 qwsServer->openMouse(); 1112 qwsServer->openMouse();
1108 } else if ( msg == "setKeyboard(QString)" ) { 1113 } else if ( msg == "setKeyboard(QString)" ) {