-rw-r--r-- | library/global.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/library/global.cpp b/library/global.cpp index 9b908bf..d02e711 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -24,11 +24,9 @@ | |||
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/storage.h> | 26 | #include <qpe/storage.h> |
27 | #include <qpe/applnk.h> | 27 | #include <qpe/applnk.h> |
28 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 28 | #include <qpe/qcopenvelope_qws.h> |
29 | #include "qpe/qcopenvelope_qws.h" | ||
30 | #endif | ||
31 | 29 | ||
32 | #include <qfile.h> | 30 | #include <qfile.h> |
33 | #include <qlabel.h> | 31 | #include <qlabel.h> |
34 | #include <qtimer.h> | 32 | #include <qtimer.h> |
@@ -44,11 +42,9 @@ | |||
44 | #include <sys/types.h> | 42 | #include <sys/types.h> |
45 | #include <fcntl.h> | 43 | #include <fcntl.h> |
46 | #include <unistd.h> | 44 | #include <unistd.h> |
47 | 45 | ||
48 | #ifdef QWS | ||
49 | #include <qwindowsystem_qws.h> // for qwsServer | 46 | #include <qwindowsystem_qws.h> // for qwsServer |
50 | #endif | ||
51 | #include <qdatetime.h> | 47 | #include <qdatetime.h> |
52 | 48 | ||
53 | #include <qfile.h> | 49 | #include <qfile.h> |
54 | 50 | ||
@@ -109,15 +105,13 @@ StartingAppList* StartingAppList::appl = 0; | |||
109 | 105 | ||
110 | StartingAppList::StartingAppList( QObject *parent, const char* name ) | 106 | StartingAppList::StartingAppList( QObject *parent, const char* name ) |
111 | :QObject( parent, name ) | 107 | :QObject( parent, name ) |
112 | { | 108 | { |
113 | #ifdef QWS | ||
114 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) | 109 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) |
115 | connect( qwsServer, SIGNAL( newChannel(const QString&)), | 110 | connect( qwsServer, SIGNAL( newChannel(const QString&)), |
116 | this, SLOT( handleNewChannel(const QString&)) ); | 111 | this, SLOT( handleNewChannel(const QString&)) ); |
117 | dict.setAutoDelete( TRUE ); | 112 | dict.setAutoDelete( TRUE ); |
118 | #endif | 113 | #endif |
119 | #endif | ||
120 | } | 114 | } |
121 | 115 | ||
122 | void StartingAppList::add( const QString& name ) | 116 | void StartingAppList::add( const QString& name ) |
123 | { | 117 | { |
@@ -392,9 +386,9 @@ void Global::createDocDir() | |||
392 | in the taskbar for a short amount of time, then disappears. | 386 | in the taskbar for a short amount of time, then disappears. |
393 | */ | 387 | */ |
394 | void Global::statusMessage(const QString& message) | 388 | void Global::statusMessage(const QString& message) |
395 | { | 389 | { |
396 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 390 | #if!defined(QT_NO_COP) |
397 | QCopEnvelope e( "QPE/TaskBar", "message(QString)" ); | 391 | QCopEnvelope e( "QPE/TaskBar", "message(QString)" ); |
398 | e << message; | 392 | e << message; |
399 | #endif | 393 | #endif |
400 | } | 394 | } |
@@ -403,9 +397,9 @@ void Global::statusMessage(const QString& message) | |||
403 | \internal | 397 | \internal |
404 | */ | 398 | */ |
405 | void Global::applyStyle() | 399 | void Global::applyStyle() |
406 | { | 400 | { |
407 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 401 | #if !defined(QT_NO_COP) |
408 | QCopChannel::send( "QPE/System", "applyStyle()" ); | 402 | QCopChannel::send( "QPE/System", "applyStyle()" ); |
409 | #else | 403 | #else |
410 | ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version | 404 | ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version |
411 | #endif | 405 | #endif |
@@ -415,9 +409,9 @@ void Global::applyStyle() | |||
415 | \internal | 409 | \internal |
416 | */ | 410 | */ |
417 | QWidget *Global::shutdown( bool ) | 411 | QWidget *Global::shutdown( bool ) |
418 | { | 412 | { |
419 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 413 | #if !defined(QT_NO_COP) |
420 | QCopChannel::send( "QPE/System", "shutdown()" ); | 414 | QCopChannel::send( "QPE/System", "shutdown()" ); |
421 | #endif | 415 | #endif |
422 | return 0; | 416 | return 0; |
423 | } | 417 | } |
@@ -426,9 +420,9 @@ QWidget *Global::shutdown( bool ) | |||
426 | \internal | 420 | \internal |
427 | */ | 421 | */ |
428 | QWidget *Global::restart( bool ) | 422 | QWidget *Global::restart( bool ) |
429 | { | 423 | { |
430 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 424 | #if !defined(QT_NO_COP) |
431 | QCopChannel::send( "QPE/System", "restart()" ); | 425 | QCopChannel::send( "QPE/System", "restart()" ); |
432 | #endif | 426 | #endif |
433 | return 0; | 427 | return 0; |
434 | } | 428 | } |
@@ -444,9 +438,9 @@ QWidget *Global::restart( bool ) | |||
444 | \sa hideInputMethod() | 438 | \sa hideInputMethod() |
445 | */ | 439 | */ |
446 | void Global::showInputMethod() | 440 | void Global::showInputMethod() |
447 | { | 441 | { |
448 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 442 | #if !defined(QT_NO_COP) |
449 | QCopChannel::send( "QPE/TaskBar", "showInputMethod()" ); | 443 | QCopChannel::send( "QPE/TaskBar", "showInputMethod()" ); |
450 | #endif | 444 | #endif |
451 | } | 445 | } |
452 | 446 | ||
@@ -459,9 +453,9 @@ void Global::showInputMethod() | |||
459 | \sa showInputMethod() | 453 | \sa showInputMethod() |
460 | */ | 454 | */ |
461 | void Global::hideInputMethod() | 455 | void Global::hideInputMethod() |
462 | { | 456 | { |
463 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 457 | #if !defined(QT_NO_COP) |
464 | QCopChannel::send( "QPE/TaskBar", "hideInputMethod()" ); | 458 | QCopChannel::send( "QPE/TaskBar", "hideInputMethod()" ); |
465 | #endif | 459 | #endif |
466 | } | 460 | } |
467 | 461 | ||
@@ -558,9 +552,9 @@ void Global::invoke(const QString &c) | |||
558 | { | 552 | { |
559 | // Convert the command line in to a list of arguments | 553 | // Convert the command line in to a list of arguments |
560 | QStringList list = QStringList::split(QRegExp(" *"),c); | 554 | QStringList list = QStringList::split(QRegExp(" *"),c); |
561 | 555 | ||
562 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 556 | #if !defined(QT_NO_COP) |
563 | QString ap=list[0]; | 557 | QString ap=list[0]; |
564 | // see if the application is already running | 558 | // see if the application is already running |
565 | // XXX should lock file /tmp/qcop-msg-ap | 559 | // XXX should lock file /tmp/qcop-msg-ap |
566 | if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { | 560 | if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { |
@@ -594,9 +588,9 @@ void Global::invoke(const QString &c) | |||
594 | for ( j = 0; j < slist.count(); j++ ) | 588 | for ( j = 0; j < slist.count(); j++ ) |
595 | args[j] = slist.at(j); | 589 | args[j] = slist.at(j); |
596 | args[j] = NULL; | 590 | args[j] = NULL; |
597 | 591 | ||
598 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 592 | #if !defined(QT_NO_COP) |
599 | // an attempt to show a wait... | 593 | // an attempt to show a wait... |
600 | // more logic should be used, but this will be fine for the moment... | 594 | // more logic should be used, but this will be fine for the moment... |
601 | QCopEnvelope ( "QPE/System", "busy()" ); | 595 | QCopEnvelope ( "QPE/System", "busy()" ); |
602 | #endif | 596 | #endif |
@@ -635,9 +629,9 @@ void Global::invoke(const QString &c) | |||
635 | void Global::execute( const QString &c, const QString& document ) | 629 | void Global::execute( const QString &c, const QString& document ) |
636 | { | 630 | { |
637 | if ( qApp->type() != QApplication::GuiServer ) { | 631 | if ( qApp->type() != QApplication::GuiServer ) { |
638 | // ask the server to do the work | 632 | // ask the server to do the work |
639 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 633 | #if !defined(QT_NO_COP) |
640 | if ( document.isNull() ) { | 634 | if ( document.isNull() ) { |
641 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 635 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
642 | e << c; | 636 | e << c; |
643 | } else { | 637 | } else { |
@@ -675,9 +669,9 @@ void Global::execute( const QString &c, const QString& document ) | |||
675 | 669 | ||
676 | // Convert the command line in to a list of arguments | 670 | // Convert the command line in to a list of arguments |
677 | QStringList list = QStringList::split(QRegExp(" *"),c); | 671 | QStringList list = QStringList::split(QRegExp(" *"),c); |
678 | 672 | ||
679 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 673 | #if !defined(QT_NO_COP) |
680 | QString ap=list[0]; | 674 | QString ap=list[0]; |
681 | 675 | ||
682 | qDebug("executing %s", ap.latin1() ); | 676 | qDebug("executing %s", ap.latin1() ); |
683 | 677 | ||