summaryrefslogtreecommitdiff
path: root/core/launcher
authoralwin <alwin>2004-03-02 12:14:15 (UTC)
committer alwin <alwin>2004-03-02 12:14:15 (UTC)
commit0d59c780513da78033f4d9040475dee9db0256d4 (patch) (side-by-side diff)
tree503d320b4aa3daae9982082e7b34e3e2c48bdfb7 /core/launcher
parenta0981652d61776d70f25980f035748b21339e946 (diff)
downloadopie-0d59c780513da78033f4d9040475dee9db0256d4.zip
opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.gz
opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.bz2
run the optimize_connect script
the whole cvs is tagged with "before_optimize_connect" if there are problems you can check the diff (but it had compiled and run here)
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/appicons.cpp14
-rw-r--r--core/launcher/applauncher.cpp8
-rw-r--r--core/launcher/firstuse.cpp8
-rw-r--r--core/launcher/inputmethods.cpp4
-rw-r--r--core/launcher/launcher.cpp12
-rw-r--r--core/launcher/launcherview.cpp12
-rw-r--r--core/launcher/packageslave.cpp4
-rw-r--r--core/launcher/qcopbridge.cpp12
-rw-r--r--core/launcher/runningappbar.cpp4
-rw-r--r--core/launcher/server.cpp18
-rw-r--r--core/launcher/serverapp.cpp10
-rw-r--r--core/launcher/shutdownimpl.cpp6
-rw-r--r--core/launcher/taskbar.cpp4
-rw-r--r--core/launcher/transferserver.cpp12
14 files changed, 65 insertions, 63 deletions
diff --git a/core/launcher/appicons.cpp b/core/launcher/appicons.cpp
index c51ee5a..4d48b24 100644
--- a/core/launcher/appicons.cpp
+++ b/core/launcher/appicons.cpp
@@ -1,95 +1,97 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "appicons.h"
-#include <qpe/qcopenvelope_qws.h>
+#ifdef QWS
+#include <qtopia/qcopenvelope_qws.h>
+#endif
#include <qtooltip.h>
#include <qpixmap.h>
AppIcons::AppIcons( QWidget *parent ) :
QHBox(parent)
{
buttons.setAutoDelete(TRUE);
#ifndef QT_NO_COP
QCopChannel* channel = new QCopChannel("Qt/Tray", this);
- connect(channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(receive(const QCString&, const QByteArray&)));
+ connect(channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(receive(const QCString&,const QByteArray&)));
#endif
}
void AppIcons::setIcon(int id, const QPixmap& pm)
{
button(id)->setPixmap(pm);
}
class FlatButton : public QLabel {
Q_OBJECT
public:
FlatButton(QWidget* parent) : QLabel(parent) { }
void mouseDoubleClickEvent(QMouseEvent* e)
{
emit clicked(e->pos(),e->button(),TRUE);
}
void mouseReleaseEvent(QMouseEvent* e)
{
if ( rect().contains(e->pos()) )
emit clicked(e->pos(),e->button(),FALSE);
}
signals:
void clicked(const QPoint&, int, bool);
};
QLabel* AppIcons::button(int id)
{
QLabel* f = buttons.find(id);
if ( !f ) {
buttons.insert(id,f=new FlatButton(this));
- connect(f,SIGNAL(clicked(const QPoint&, int, bool)),this,SLOT(clicked(const QPoint&, int, bool)));
+ connect(f,SIGNAL(clicked(const QPoint&,int,bool)),this,SLOT(clicked(const QPoint&,int,bool)));
f->show();
}
return f;
}
int AppIcons::findId(QLabel* b)
{
QIntDictIterator<QLabel> it(buttons);
for ( ; ; ++it )
if ( it.current() == b ) return it.currentKey();
}
void AppIcons::clicked(const QPoint& relpos, int button, bool dbl)
{
#ifndef QT_NO_COP
QLabel* s = (QLabel*)sender();
if ( button == RightButton ) {
QCopEnvelope("Qt/Tray","popup(int,QPoint)")
<< findId(s) << s->mapToGlobal(QPoint(0,0));
} else {
QCopEnvelope("Qt/Tray",
dbl ? "doubleClicked(int,QPoint)" : "clicked(int,QPoint)")
<< findId(s) << relpos;
}
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index 7d3c032..08a3cb4 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -65,54 +65,54 @@ const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
static AppLauncher* appLauncherPtr;
const int appStopEventID = 1290;
class AppStoppedEvent : public QCustomEvent
{
public:
AppStoppedEvent(int pid, int status)
: QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { }
int pid() { return mPid; }
int status() { return mStatus; }
private:
int mPid, mStatus;
};
AppLauncher::AppLauncher(QObject *parent, const char *name)
: QObject(parent, name), qlPid(0), qlReady(FALSE),
appKillerBox(0)
{
connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&)));
connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&)));
QCopChannel* channel = new QCopChannel( "QPE/System", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(received(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(received(const QCString&,const QByteArray&)) );
channel = new QCopChannel( "QPE/Server", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(received(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(received(const QCString&,const QByteArray&)) );
#ifndef Q_OS_WIN32
signal(SIGCHLD, signalHandler);
#else
runningAppsProc.setAutoDelete( TRUE );
#endif
QString tmp = qApp->argv()[0];
int pos = tmp.findRev('/');
if ( pos > -1 )
tmp = tmp.mid(++pos);
runningApps[::getpid()] = tmp;
appLauncherPtr = this;
QTimer::singleShot( 1000, this, SLOT(createQuickLauncher()) );
}
AppLauncher::~AppLauncher()
{
appLauncherPtr = 0;
#ifndef Q_OS_WIN32
signal(SIGCHLD, SIG_DFL);
#endif
if ( qlPid ) {
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp
index 50ae6c2..4316648 100644
--- a/core/launcher/firstuse.cpp
+++ b/core/launcher/firstuse.cpp
@@ -77,50 +77,50 @@ settingsTable [] =
QT_TR_NOOP("Time and Date") },
#endif
{ FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr
QT_TR_NOOP("Personal Information") },
{ FALSE, 0, 0, 0, 0 }
};
FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
QDialog( parent, name, TRUE, wf),
transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1),
waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE)
{
ServerApplication::allowRestart = FALSE;
// we force our height beyound the maximum (which we set anyway)
QRect desk = qApp->desktop()->geometry();
setGeometry( 0, 0, desk.width(), desk.height() );
connect(qwsServer, SIGNAL(newChannel(const QString&)),
this, SLOT(newQcopChannel(const QString&)));
// Create a DocumentList so appLauncher has appLnkSet to search
docList = new DocumentList( 0, FALSE );
appLauncher = new AppLauncher( this );
- connect( appLauncher, SIGNAL(terminated(int, const QString&)),
- this, SLOT(terminated(int, const QString&)) );
+ connect( appLauncher, SIGNAL(terminated(int,const QString&)),
+ this, SLOT(terminated(int,const QString&)) );
// more hackery
// I will be run as either the main server or as part of the main server
QWSServer::setScreenSaverIntervals(0);
loadPixmaps();
//check if there is a language program
#ifndef Q_OS_WIN32
QString exeSuffix;
#else
QString exeSuffix(".exe");
#endif
for ( int i = 0; settingsTable[i].app; i++ ) {
QString file = QPEApplication::qpeDir() + "bin/";
file += settingsTable[i].app;
file += exeSuffix;
if ( QFile::exists(file) )
settingsTable[i].enabled = TRUE;
}
setFocusPolicy(NoFocus);
taskBar = new QWidget(0, 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | WGroupLeader);
@@ -136,50 +136,50 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
next = new QPushButton(tr("Next >>"), taskBar);
next->setFocusPolicy(NoFocus);
connect(next, SIGNAL(clicked()), this, SLOT(nextDialog()) );
// need to set the geom to lower corner
QSize sz = inputMethods->sizeHint();
int buttonWidth = (width() - sz.width()) / 2;
int x = 0;
controlHeight = back->sizeHint().height();
inputMethods->setGeometry(0,0, sz.width(), controlHeight );
x += sz.width();
back->setGeometry(x, 0, buttonWidth, controlHeight);
x += buttonWidth;
next->setGeometry(x, 0, buttonWidth, controlHeight);
taskBar->setGeometry( 0, height() - controlHeight, desk.width(), controlHeight);
taskBar->hide();
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
qDebug("Setting up QCop to QPE/System");
QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
- connect(sysChannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(message(const QCString &, const QByteArray &)) );
+ connect(sysChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(message(const QCString&,const QByteArray&)) );
#endif
calcMaxWindowRect();
m_calHandler = ( QWSServer::mouseHandler() && QWSServer::mouseHandler()->inherits("QCalibratedMouseHandler") ) ? true : false;
if ( m_calHandler) {
if ( !QFile::exists("/etc/pointercal") ) {
needCalibrate = TRUE;
grabMouse();
}
}
Config config("locale");
config.setGroup( "Language");
lang = config.readEntry( "Language", "en");
defaultFont = font();
//###language/font hack; should look it up somewhere
#ifdef Q_WS_QWS
if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) {
QFont fn = FontManager::unicodeFont( FontManager::Proportional );
qApp->setFont( fn, TRUE );
}
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index 683f1e2..19e799a 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -124,50 +124,50 @@ InputMethods::InputMethods( QWidget *parent ) :
connect( (QPEApplication*)qApp, SIGNAL(clientMoused()),
this, SLOT(resetStates()) );
imButton = new QWidgetStack( this ); // later a widget stack
imButton->setFocusPolicy(NoFocus);
if (parent->sizeHint().height() > 0)
imButton->setFixedHeight( parent->sizeHint().height() );
hbox->addWidget(imButton);
imChoice = new QToolButton( this );
imChoice->setFocusPolicy(NoFocus);
imChoice->setPixmap( QPixmap( (const char **)tri_xpm ) );
if (parent->sizeHint().height() > 0)
imChoice->setFixedHeight( parent->sizeHint().height() );
imChoice->setFixedWidth( 13 );
imChoice->setAutoRaise( TRUE );
hbox->addWidget( imChoice );
connect( imChoice, SIGNAL(clicked()), this, SLOT(chooseIm()) );
loadInputMethods();
QCopChannel *channel = new QCopChannel( "QPE/IME", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(qcopReceive(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(qcopReceive(const QCString&,const QByteArray&)) );
}
InputMethods::~InputMethods()
{
Config cfg("qpe");
cfg.setGroup("InputMethod");
if (imethod)
cfg.writeEntry("im", imethod->name() );
if (mkeyboard)
cfg.writeEntry("current", mkeyboard->name() );
unloadInputMethods();
}
void InputMethods::hideInputMethod()
{
kbdButton->setOn( FALSE );
}
void InputMethods::showInputMethod()
{
kbdButton->setOn( TRUE );
}
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 54efb0b..5d0c778 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -77,52 +77,52 @@
static bool isVisibleWindow( int );
//===========================================================================
LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
QVBox( parent ), docview( 0 )
{
docLoadingWidgetEnabled = false;
docLoadingWidget = 0;
docLoadingWidgetProgress = 0;
launcher = parent;
categoryBar = new LauncherTabBar( this );
QPalette pal = categoryBar->palette();
pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
pal.setColor( QColorGroup::Background, pal.active().background().light(110) );
categoryBar->setPalette( pal );
stack = new QWidgetStack(this);
connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) );
categoryBar->show();
stack->show();
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
QCopChannel *channel = new QCopChannel( "QPE/Launcher", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(launcherMessage(const QCString&, const QByteArray&)) );
- connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
- this, SLOT(appMessage(const QCString&, const QByteArray&)));
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(launcherMessage(const QCString&,const QByteArray&)) );
+ connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
+ this, SLOT(appMessage(const QCString&,const QByteArray&)));
#endif
createDocLoadingWidget();
}
void LauncherTabWidget::createDocLoadingWidget()
{
// Construct the 'doc loading widget' shown when finding documents
// ### LauncherView class needs changing to be more generic so
// this widget can change its background similar to the iconviews
// so the background for this matches
docLoadingWidget = new LauncherView( stack );
docLoadingWidget->hideIcons();
QVBox *docLoadingVBox = new QVBox( docLoadingWidget );
docLoadingVBox->setSpacing( 20 );
docLoadingVBox->setMargin( 10 );
QWidget *space1 = new QWidget( docLoadingVBox );
docLoadingVBox->setStretchFactor( space1, 1 );
QLabel *waitPixmap = new QLabel( docLoadingVBox );
waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) );
@@ -456,50 +456,50 @@ void Launcher::createGUI()
tabs = new LauncherTabWidget( this );
setCentralWidget( tabs );
ServerInterface::dockWidget( tb, ServerInterface::Bottom );
tb->show();
qApp->installEventFilter( this );
connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) );
connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) );
connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) );
connect( tb, SIGNAL(tabSelected(const QString&)),
this, SLOT(showTab(const QString&)) );
connect( tabs, SIGNAL(selected(const QString&)),
this, SLOT(viewSelected(const QString&)) );
connect( tabs, SIGNAL(clicked(const AppLnk*)),
this, SLOT(select(const AppLnk*)));
connect( tabs, SIGNAL(rightPressed(AppLnk*)),
this, SLOT(properties(AppLnk*)));
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
- connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(systemMessage( const QCString &, const QByteArray &)) );
+ connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(systemMessage(const QCString&,const QByteArray&)) );
#endif
// all documents
QImage img( Resource::loadImage( "DocsIcon" ) );
QPixmap pm;
pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
// It could add this itself if it handles docs
tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE );
QTimer::singleShot( 0, tabs, SLOT( initLayout() ) );
qApp->setMainWidget( this );
QTimer::singleShot( 500, this, SLOT( makeVisible() ) );
}
Launcher::~Launcher()
{
if ( tb )
destroyGUI();
}
bool Launcher::requiresDocuments() const
{
Config cfg( "Launcher" );
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 513b1bd..6c7d487 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -594,56 +594,56 @@ bool LauncherIconView::removeLink(const QString& linkfile)
return did;
}
//===========================================================================
LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
: QVBox( parent, name, fl )
{
catmb = 0;
icons = new LauncherIconView( this );
setFocusProxy(icons);
QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold );
icons->setItemsMovable( FALSE );
icons->setAutoArrange( TRUE );
icons->setSorting( TRUE );
icons->setFrameStyle( QFrame::NoFrame );
icons->setMargin( 0 );
icons->setSelectionMode( QIconView::NoSelection );
icons->setBackgroundMode( PaletteBase );
icons->setResizeMode( QIconView::Fixed );
vmode = (ViewMode)-1;
setViewMode( Icon );
- connect( icons, SIGNAL(mouseButtonClicked(int, QIconViewItem *, const QPoint&)),
- SLOT(itemClicked(int, QIconViewItem *)) );
+ connect( icons, SIGNAL(mouseButtonClicked(int,QIconViewItem*,const QPoint&)),
+ SLOT(itemClicked(int,QIconViewItem*)) );
connect( icons, SIGNAL(selectionChanged()),
SLOT(selectionChanged()) );
- connect( icons, SIGNAL(returnPressed(QIconViewItem *)),
- SLOT(returnPressed(QIconViewItem *)) );
- connect( icons, SIGNAL(mouseButtonPressed(int, QIconViewItem *, const QPoint&)),
- SLOT(itemPressed(int, QIconViewItem *)) );
+ connect( icons, SIGNAL(returnPressed(QIconViewItem*)),
+ SLOT(returnPressed(QIconViewItem*)) );
+ connect( icons, SIGNAL(mouseButtonPressed(int,QIconViewItem*,const QPoint&)),
+ SLOT(itemPressed(int,QIconViewItem*)) );
tools = 0;
setBackgroundType( Ruled, QString::null );
}
LauncherView::~LauncherView()
{
if ( bgCache && bgCache->contains( bgName ) )
(*bgCache)[bgName]->ref--;
}
void LauncherView::hideIcons()
{
icons->hide();
}
void LauncherView::setToolsEnabled(bool y)
{
if ( !y != !tools ) {
if ( y ) {
tools = new QHBox(this);
// Type filter
typemb = new QComboBox(tools);
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp
index 321b5dd..7e61b0e 100644
--- a/core/launcher/packageslave.cpp
+++ b/core/launcher/packageslave.cpp
@@ -31,50 +31,50 @@
#include <qtextstream.h>
#include <stdlib.h>
#include <sys/stat.h> // mkdir()
#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
#include <unistd.h>
#include <sys/vfs.h>
#include <mntent.h>
#elif defined(Q_OS_WIN32)
#include <windows.h>
#include <winbase.h>
#elif defined(Q_OS_MACX)
#include <unistd.h>
#endif
PackageHandler::PackageHandler( QObject *parent, char* name )
: QObject( parent, name ), packageChannel( 0 ), currentProcess( 0 ), mNoSpaceLeft( FALSE )
{
// setup qcop channel
#ifndef QT_NO_COP
packageChannel = new QCopChannel( "QPE/Package", this );
- connect( packageChannel, SIGNAL( received(const QCString &, const QByteArray &) ),
- this, SLOT( qcopMessage( const QCString &, const QByteArray &) ) );
+ connect( packageChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
+ this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) );
#endif
}
void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "installPackage(QString)" ) {
QString file;
stream >> file;
installPackage( file );
} else if ( msg == "removePackage(QString)" ) {
QString file;
stream >> file;
removePackage( file );
} else if ( msg == "addPackageFiles(QString,QString)" ) {
QString location, listfile;
stream >> location >> listfile;
addPackageFiles( location, listfile);
} else if ( msg == "addPackages(QString)" ) {
QString location;
stream >> location;
addPackages( location );
} else if ( msg == "cleanupPackageFiles(QString)" ) {
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 24f471d..53efba4 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -44,87 +44,87 @@
#include <unistd.h>
#include <sys/types.h>
#endif
#if defined(_OS_LINUX_)
#include <shadow.h>
#endif
//#define INSECURE
const int block_size = 51200;
QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
const char* name )
: QServerSocket( port, 1, parent, name ),
desktopChannel( 0 ),
cardChannel( 0 )
{
if ( !ok() )
qWarning( "Failed to bind to port %d", port );
else {
#ifndef QT_NO_COP
desktopChannel = new QCopChannel( "QPE/Desktop", this );
- connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(desktopMessage( const QCString &, const QByteArray &)) );
+ connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
cardChannel = new QCopChannel( "QPE/Card", this );
- connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(desktopMessage( const QCString &, const QByteArray &)) );
+ connect( cardChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
#endif
}
sendSync = FALSE;
openConnections.setAutoDelete( TRUE );
authorizeConnections();
}
QCopBridge::~QCopBridge()
{
#ifndef QT_NO_COP
delete desktopChannel;
#endif
}
void QCopBridge::authorizeConnections()
{
Config cfg("Security");
cfg.setGroup("SyncMode");
m_mode = Mode(cfg.readNumEntry("Mode", Sharp ));
QListIterator<QCopBridgePI> it(openConnections);
while ( it.current() ) {
if ( !it.current()->verifyAuthorised() ) {
- disconnect ( it.current(), SIGNAL( connectionClosed( QCopBridgePI *) ), this, SLOT( closed( QCopBridgePI *) ) );
+ disconnect ( it.current(), SIGNAL( connectionClosed(QCopBridgePI*) ), this, SLOT( closed(QCopBridgePI*) ) );
openConnections.removeRef( it.current() );
} else
++it;
}
}
void QCopBridge::newConnection( int socket )
{
QCopBridgePI *pi = new QCopBridgePI( socket, this );
openConnections.append( pi );
- connect ( pi, SIGNAL( connectionClosed( QCopBridgePI *) ), this, SLOT( closed( QCopBridgePI *) ) );
+ connect ( pi, SIGNAL( connectionClosed(QCopBridgePI*) ), this, SLOT( closed(QCopBridgePI*) ) );
/* ### libqtopia merge FIXME */
#if 0
QPEApplication::setTempScreenSaverMode( QPEApplication::DisableSuspend );
#endif
#ifndef QT_NO_COP
QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
#endif
if ( sendSync ) {
pi ->startSync();
sendSync = FALSE;
}
}
void QCopBridge::closed( QCopBridgePI *pi )
{
emit connectionClosed( pi->peerAddress() );
openConnections.removeRef( pi );
if ( openConnections.count() == 0 ) {
/* ### FIXME libqtopia merge */
#if 0
QPEApplication::setTempScreenSaverMode( QPEApplication::Enable );
#endif
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp
index 11d10dc..2e9d2a9 100644
--- a/core/launcher/runningappbar.cpp
+++ b/core/launcher/runningappbar.cpp
@@ -13,50 +13,50 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
***********************************************************************/
#define QTOPIA_INTERNAL_PRELOADACCESS
#include <stdlib.h>
#include <qpainter.h>
#include <qtopia/qcopenvelope_qws.h>
#include "runningappbar.h"
#include "serverinterface.h"
RunningAppBar::RunningAppBar(QWidget* parent)
: QFrame(parent), selectedAppIndex(-1)
{
QCopChannel* channel = new QCopChannel( "QPE/System", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(received(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(received(const QCString&,const QByteArray&)) );
spacing = AppLnk::smallIconSize()+3;
}
RunningAppBar::~RunningAppBar()
{
}
void RunningAppBar::received(const QCString& msg, const QByteArray& data) {
// Since fast apps appear and disappear without disconnecting from their
// channel we need to watch for the showing/hiding events and update according.
QDataStream stream( data, IO_ReadOnly );
if ( msg == "fastAppShowing(QString)") {
QString appName;
stream >> appName;
// qDebug("fastAppShowing %s", appName.data() );
const AppLnk* f = ServerInterface::appLnks().findExec(appName);
if ( f ) addTask(*f);
} else if ( msg == "fastAppHiding(QString)") {
QString appName;
stream >> appName;
const AppLnk* f = ServerInterface::appLnks().findExec(appName);
if ( f ) removeTask(*f);
}
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 068d716..ea0b792 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -126,72 +126,72 @@ static Global::Command builtins[] = {
Server::Server() :
QWidget( 0, 0, WStyle_Tool | WStyle_Customize ),
qcopBridge( 0 ),
transferServer( 0 ),
packageHandler( 0 ),
syncDialog( 0 )
{
Global::setBuiltinCommands(builtins);
tid_xfer = 0;
/* ### FIXME ### */
/* tid_today = startTimer(3600*2*1000);*/
last_today_show = QDate::currentDate();
#if 0
tsmMonitor = new TempScreenSaverMode();
connect( tsmMonitor, SIGNAL(forceSuspend()), qApp, SIGNAL(power()) );
#endif
serverGui = new Launcher;
serverGui->createGUI();
docList = new DocumentList( serverGui );
appLauncher = new AppLauncher(this);
- connect(appLauncher, SIGNAL(launched(int, const QString &)), this, SLOT(applicationLaunched(int, const QString &)) );
- connect(appLauncher, SIGNAL(terminated(int, const QString &)), this, SLOT(applicationTerminated(int, const QString &)) );
- connect(appLauncher, SIGNAL(connected(const QString &)), this, SLOT(applicationConnected(const QString &)) );
+ connect(appLauncher, SIGNAL(launched(int,const QString&)), this, SLOT(applicationLaunched(int,const QString&)) );
+ connect(appLauncher, SIGNAL(terminated(int,const QString&)), this, SLOT(applicationTerminated(int,const QString&)) );
+ connect(appLauncher, SIGNAL(connected(const QString&)), this, SLOT(applicationConnected(const QString&)) );
storage = new StorageInfo( this );
connect( storage, SIGNAL(disksChanged()), this, SLOT(storageChanged()) );
// start services
startTransferServer();
(void) new IrServer( this );
packageHandler = new PackageHandler( this );
connect(qApp, SIGNAL(activate(const Opie::ODeviceButton*,bool)),
this,SLOT(activate(const Opie::ODeviceButton*,bool)));
setGeometry( -10, -10, 9, 9 );
QCopChannel *channel = new QCopChannel("QPE/System", this);
- connect(channel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(systemMsg(const QCString &, const QByteArray &)) );
+ connect(channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(systemMsg(const QCString&,const QByteArray&)) );
QCopChannel *tbChannel = new QCopChannel( "QPE/TaskBar", this );
- connect( tbChannel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(receiveTaskBar(const QCString&, const QByteArray&)) );
+ connect( tbChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(receiveTaskBar(const QCString&,const QByteArray&)) );
connect( qApp, SIGNAL(prepareForRestart()), this, SLOT(terminateServers()) );
connect( qApp, SIGNAL(timeChanged()), this, SLOT(pokeTimeMonitors()) );
preloadApps();
}
void Server::show()
{
ServerApplication::login(TRUE);
QWidget::show();
}
Server::~Server()
{
serverGui->destroyGUI();
delete docList;
delete qcopBridge;
delete transferServer;
delete serverGui;
#if 0
delete tsmMonitor;
#endif
}
@@ -592,50 +592,50 @@ bool Server::mkdir(const QString &localPath)
//qDebug("mkdir making dir %s", checkedPath.latin1());
if (!checkDir.mkdir(checkedPath)) {
qDebug("Unable to make directory %s", checkedPath.latin1());
return FALSE;
}
}
}
return TRUE;
}
void Server::styleChange( QStyle &s )
{
QWidget::styleChange( s );
}
void Server::startTransferServer()
{
if ( !qcopBridge ) {
// start qcop bridge server
qcopBridge = new QCopBridge( 4243 );
if ( qcopBridge->ok() ) {
// ... OK
- connect( qcopBridge, SIGNAL(connectionClosed(const QHostAddress &)),
- this, SLOT(syncConnectionClosed(const QHostAddress &)) );
+ connect( qcopBridge, SIGNAL(connectionClosed(const QHostAddress&)),
+ this, SLOT(syncConnectionClosed(const QHostAddress&)) );
} else {
delete qcopBridge;
qcopBridge = 0;
}
}
if ( !transferServer ) {
// start transfer server
transferServer = new TransferServer( 4242 );
if ( transferServer->ok() ) {
// ... OK
} else {
delete transferServer;
transferServer = 0;
}
}
if ( !transferServer || !qcopBridge )
tid_xfer = startTimer( 2000 );
}
void Server::timerEvent( QTimerEvent *e )
{
if ( e->timerId() == tid_xfer ) {
killTimer( tid_xfer );
tid_xfer = 0;
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index f7c2341..d38dd97 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -280,60 +280,60 @@ void ServerApplication::switchLCD( bool on ) {
dapp-> m_screensaver-> setDisplayState ( false );
}
ServerApplication::ServerApplication( int& argc, char **argv, Type t )
: QPEApplication( argc, argv, t )
{
ms_is_starting = true;
// We know we'll have lots of cached pixmaps due to App/DocLnks
QPixmapCache::setCacheLimit(512);
m_ps = new PowerStatus;
m_ps_last = new PowerStatus;
pa = new DesktopPowerAlerter( 0 );
m_apm_timer = new QTimer( this );
connect(m_apm_timer, SIGNAL( timeout() ),
this, SLOT( apmTimeout() ) );
reloadPowerWarnSettings();
QCopChannel *channel = new QCopChannel( "QPE/System", this );
- connect(channel, SIGNAL(received( const QCString&, const QByteArray& ) ),
- this, SLOT(systemMessage(const QCString&, const QByteArray& ) ) );
+ connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ),
+ this, SLOT(systemMessage(const QCString&,const QByteArray&) ) );
channel = new QCopChannel("QPE/Launcher", this );
- connect(channel, SIGNAL(received( const QCString&, const QByteArray& ) ),
- this, SLOT(launcherMessage( const QCString&, const QByteArray& ) ) );
+ connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ),
+ this, SLOT(launcherMessage(const QCString&,const QByteArray&) ) );
m_screensaver = new OpieScreenSaver();
m_screensaver->setInterval( -1 );
QWSServer::setScreenSaver( m_screensaver );
- connect( qApp, SIGNAL( volumeChanged( bool ) ),
+ connect( qApp, SIGNAL( volumeChanged(bool) ),
this, SLOT( rereadVolumes() ) );
/* ### PluginLoader libqtopia SafeMode */
#if 0
if ( PluginLoader::inSafeMode() )
QTimer::singleShot(500, this, SLOT(showSafeMode()) );
QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) );
#endif
kf = new KeyFilter(this);
connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) );
connect( kf, SIGNAL(power()), this, SIGNAL(power()) );
connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) );
connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol()));
connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle()));
connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle()));
connect( kf, SIGNAL(activate(const Opie::ODeviceButton*,bool)),
this,SIGNAL(activate(const Opie::ODeviceButton*,bool)));
connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) );
diff --git a/core/launcher/shutdownimpl.cpp b/core/launcher/shutdownimpl.cpp
index f43a2a3..2731568 100644
--- a/core/launcher/shutdownimpl.cpp
+++ b/core/launcher/shutdownimpl.cpp
@@ -85,52 +85,52 @@ ShutdownImpl::ShutdownImpl( QWidget* parent, const char *name, WFlags fl )
grid-> addWidget ( shutdown, 0, 0 );
vbox-> addWidget ( btngrp );
m_info = new QLabel ( this, "info" );
m_info-> setText( tr( "<p>\n" "These termination options are provided primarily for use while developing and testing the Opie system. In a normal environment, these concepts are unnecessary." ) );
vbox-> addWidget ( m_info );
m_progress = new QProgressBar ( this, "progressBar" );
m_progress-> setFrameShape ( QProgressBar::Panel );
m_progress-> setFrameShadow ( QProgressBar::Sunken );
m_progress-> setTotalSteps ( 20 );
m_progress-> setIndicatorFollowsStyle ( false );
vbox-> addWidget ( m_progress );
vbox-> addItem ( new QSpacerItem ( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
QPushButton *cancel = new QPushButton ( tr( "Cancel" ), this, "cancel" );
changeButtonColor ( cancel, QColor( 181, 222, 178 ) );
cancel-> setDefault ( true );
cancel-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding, cancel-> sizePolicy ( ). hasHeightForWidth ( ) ) );
vbox-> addWidget ( cancel );
m_timer = new QTimer ( this );
- connect ( m_timer, SIGNAL( timeout ( ) ), this, SLOT( timeout ( ) ) );
+ connect ( m_timer, SIGNAL( timeout() ), this, SLOT( timeout() ) );
- connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( buttonClicked ( int ) ) );
- connect ( cancel, SIGNAL( clicked ( ) ), this, SLOT( cancelClicked ( ) ) );
+ connect ( btngrp, SIGNAL( clicked(int) ), this, SLOT( buttonClicked(int) ) );
+ connect ( cancel, SIGNAL( clicked() ), this, SLOT( cancelClicked() ) );
m_progress-> hide ( );
Global::hideInputMethod ( );
}
void ShutdownImpl::buttonClicked ( int b )
{
m_counter = 0;
switch ( b ) {
case 1:
m_operation = ShutdownSystem;
break;
case 2:
m_operation = RebootSystem;
break;
case 3:
m_operation = RestartDesktop;
break;
case 4:
m_operation = TerminateDesktop;
break;
}
m_info-> hide ( );
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 491a8a3..91e2f20 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -192,50 +192,50 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn
runningAppBar = new RunningAppBar(stack);
stack->raiseWidget(runningAppBar);
waitIcon = new Wait( this );
(void) new AppIcons( this );
sysTray = new SysTray( this );
/* ### FIXME plugin loader and safe mode */
#if 0
if (PluginLoader::inSafeMode())
(void)new SafeMode( this );
#endif
// ## make customizable in some way?
#ifdef QT_QWS_CUSTOM
lockState = new LockKeyState( this );
#else
lockState = 0;
#endif
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(receive(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(receive(const QCString&,const QByteArray&)) );
#endif
#endif
waitTimer = new QTimer( this );
connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) );
clearer = new QTimer( this );
QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar()));
connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) );
connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) );
connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) );
}
void TaskBar::setStatusMessage( const QString &text )
{
if ( !text.isEmpty() ) {
label->setText( text );
stack->raiseWidget( label );
if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) )
sysTray->hide();
clearer->start( 3000, TRUE );
} else {
clearStatusBar();
}
}
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index b998e95..a5e20b2 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -52,68 +52,68 @@
#ifdef Q_WS_QWS
#include <qtopia/qcopenvelope_qws.h>
#endif
#include "transferserver.h"
#include <qtopia/qprocess.h>
const int block_size = 51200;
TransferServer::TransferServer( Q_UINT16 port, QObject *parent,
const char* name)
: QServerSocket( port, 1, parent, name )
{
connections.setAutoDelete( TRUE );
if ( !ok() )
qWarning( "Failed to bind to port %d", port );
}
void TransferServer::authorizeConnections()
{
QListIterator<ServerPI> it(connections);
while ( it.current() ) {
if ( !it.current()->verifyAuthorised() ) {
- disconnect( it.current(), SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) );
+ disconnect( it.current(), SIGNAL(connectionClosed(ServerPI*)), this, SLOT( closed(ServerPI*)) );
connections.removeRef( it.current() );
} else
++it;
}
}
void TransferServer::closed(ServerPI *item)
{
connections.removeRef(item);
}
TransferServer::~TransferServer()
{
}
void TransferServer::newConnection( int socket )
{
ServerPI *ptr = new ServerPI( socket, this );
- connect( ptr, SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) );
+ connect( ptr, SIGNAL(connectionClosed(ServerPI*)), this, SLOT( closed(ServerPI*)) );
connections.append( ptr );
}
QString SyncAuthentication::serverId()
{
Config cfg("Security");
cfg.setGroup("Sync");
QString r = cfg.readEntry("serverid");
if ( r.isEmpty() ) {
r = OGlobal::generateUuid();
cfg.writeEntry("serverid", r );
}
return r;
}
QString SyncAuthentication::ownerName()
{
QString vfilename = Global::applicationFileName("addressbook",
"businesscard.vcf");
if (QFile::exists(vfilename)) {
Contact c;
c = Contact::readVCard( vfilename )[0];
return c.fullName();
@@ -312,61 +312,61 @@ ServerPI::ServerPI( int socket, QObject *parent, const char* name )
peerport = peerPort();
peeraddress = peerAddress();
#ifndef INSECURE
if ( !SyncAuthentication::isAuthorized(peeraddress) ) {
state = Forbidden;
startTimer( 0 );
} else
#endif
{
connect( this, SIGNAL( readyRead() ), SLOT( read() ) );
connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) );
passiv = FALSE;
for( int i = 0; i < 4; i++ )
wait[i] = FALSE;
send( "220 Qtopia " QPE_VERSION " FTP Server" ); // No tr
state = Wait_USER;
dtp = new ServerDTP( this );
connect( dtp, SIGNAL( completed() ), SLOT( dtpCompleted() ) );
connect( dtp, SIGNAL( failed() ), SLOT( dtpFailed() ) );
- connect( dtp, SIGNAL( error( int ) ), SLOT( dtpError( int ) ) );
+ connect( dtp, SIGNAL( error(int) ), SLOT( dtpError(int) ) );
directory = QDir::currentDirPath();
static int p = 1024;
while ( !serversocket || !serversocket->ok() ) {
delete serversocket;
serversocket = new ServerSocket( ++p, this );
}
- connect( serversocket, SIGNAL( newIncomming( int ) ),
- SLOT( newConnection( int ) ) );
+ connect( serversocket, SIGNAL( newIncomming(int) ),
+ SLOT( newConnection(int) ) );
}
}
ServerPI::~ServerPI()
{
close();
if ( dtp )
dtp->close();
delete dtp;
delete serversocket;
}
bool ServerPI::verifyAuthorised()
{
if ( !SyncAuthentication::isAuthorized(peerAddress()) ) {
state = Forbidden;
return FALSE;
}
return TRUE;
}
void ServerPI::connectionClosed()
{
@@ -1065,49 +1065,49 @@ QString ServerPI::absFilePath( const QString& file )
{
if ( file.isEmpty() ) return file;
QString filepath( file );
if ( file[0] != "/" )
filepath = directory.path() + "/" + file;
return filepath;
}
void ServerPI::timerEvent( QTimerEvent * )
{
connectionClosed();
}
ServerDTP::ServerDTP( QObject *parent, const char* name)
: QSocket( parent, name ), mode( Idle ), createTargzProc( 0 ),
retrieveTargzProc( 0 )
{
connect( this, SIGNAL( connected() ), SLOT( connected() ) );
connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) );
- connect( this, SIGNAL( bytesWritten( int ) ), SLOT( bytesWritten( int ) ) );
+ connect( this, SIGNAL( bytesWritten(int) ), SLOT( bytesWritten(int) ) );
connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) );
createTargzProc = new QProcess( QString("tar"), this, "createTargzProc"); // No tr
createTargzProc->setCommunication( QProcess::Stdout );
createTargzProc->setWorkingDirectory( QDir::rootDirPath() );
connect( createTargzProc, SIGNAL( processExited() ), SLOT( targzDone() ) );
retrieveTargzProc = new QProcess( this, "retrieveTargzProc" );
retrieveTargzProc->setCommunication( QProcess::Stdin );
retrieveTargzProc->setWorkingDirectory( QDir::rootDirPath() );
connect( retrieveTargzProc, SIGNAL( processExited() ),
SIGNAL( completed() ) );
connect( retrieveTargzProc, SIGNAL( processExited() ),
SLOT( extractTarDone() ) );
}
ServerDTP::~ServerDTP()
{
buf.close();
if ( RetrieveFile == mode && file.isOpen() ) {
// We're being shutdown before the client closed.
file.close();
if ( recvFileSize >= 0 && (int)file.size() != recvFileSize ) {
qDebug( "STOR incomplete" );