summaryrefslogtreecommitdiff
path: root/library
authorzecke <zecke>2003-10-07 13:12:03 (UTC)
committer zecke <zecke>2003-10-07 13:12:03 (UTC)
commit23fd77c2b4ea230af2915d4ce3f2e75cefdedb2b (patch) (side-by-side diff)
tree242800673c3db80966ae9f8cd5dc8546c2e440ec /library
parente125e425d7c25b32527726c416b347902294bfdf (diff)
downloadopie-23fd77c2b4ea230af2915d4ce3f2e75cefdedb2b.zip
opie-23fd77c2b4ea230af2915d4ce3f2e75cefdedb2b.tar.gz
opie-23fd77c2b4ea230af2915d4ce3f2e75cefdedb2b.tar.bz2
ifndef -> if defined... we want big icons on high_res_small_phy
Diffstat (limited to 'library') (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index cd1c62e..d4734ae 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -497,193 +497,193 @@ static void setTreble( int t = 0, int percent = -1 )
\fn void QPEApplication::dateFormatChanged(DateFormat)
This signal is emitted whenever the date format is changed.
*/
/*!
\fn void QPEApplication::flush()
###
*/
/*!
\fn void QPEApplication::reload()
*/
void QPEApplication::processQCopFile()
{
QString qcopfn("/tmp/qcop-msg-");
qcopfn += d->appName; // append command name
QFile f(qcopfn);
if ( f.open(IO_ReadWrite) ) {
#ifndef Q_OS_WIN32
flock(f.handle(), LOCK_EX);
#endif
QDataStream ds(&f);
QCString channel, message;
QByteArray data;
while(!ds.atEnd()) {
ds >> channel >> message >> data;
d->enqueueQCop(channel,message,data);
}
::ftruncate(f.handle(), 0);
#ifndef Q_OS_WIN32
f.flush();
flock(f.handle(), LOCK_UN);
#endif
}
#endif
}
/*!
\fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data )
This signal is emitted when a message is received on this
application's QPE/Application/<i>appname</i> \link qcop.html
QCop\endlink channel.
The slot to which you connect this signal uses \a msg and \a data
in the following way:
\code
void MyWidget::receive( const QCString& msg, const QByteArray& data )
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "someMessage(int,int,int)" ) {
int a,b,c;
stream >> a >> b >> c;
...
} else if ( msg == "otherMessage(QString)" ) {
...
}
}
\endcode
\sa qcop.html
Note that messages received here may be processed by qpe application
and emitted as signals, such as flush() and reload().
*/
/*!
Constructs a QPEApplication just as you would construct
a QApplication, passing \a argc, \a argv, and \a t.
For applications, \a t should be the default, GuiClient. Only
the Qtopia server passes GuiServer.
*/
QPEApplication::QPEApplication( int & argc, char **argv, Type t )
: QApplication( hack(argc), argv, t ), pidChannel( 0 )
{
QPixmapCache::setCacheLimit(256); // sensible default for smaller devices.
d = new QPEApplicationData;
d->loadTextCodecs();
d->loadImageCodecs();
int dw = desktop() ->width();
if ( dw < 200 ) {
setFont( QFont( "vera", 8 ) );
AppLnk::setSmallIconSize( 10 );
AppLnk::setBigIconSize( 28 );
}
-#ifndef OPIE_HIGH_RES_SMALL_PHY
+#if defined(OPIE_HIGH_RES_SMALL_PHY)
else if ( dw > 600 ) {
setFont( QFont( "vera", 16 ) );
AppLnk::setSmallIconSize( 24 );
AppLnk::setBigIconSize( 48 );
}
#endif
else if ( dw > 200 ) {
setFont( QFont( "vera", 10 ) );
AppLnk::setSmallIconSize( 14 );
AppLnk::setBigIconSize( 32 );
}
QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory );
connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) );
sysChannel = new QCopChannel( "QPE/System", this );
connect( sysChannel, SIGNAL( received( const QCString &, const QByteArray & ) ),
this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) );
/* COde now in initapp */
#if 0
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
QString qcopfn( "/tmp/qcop-msg-" );
qcopfn += QString( argv[ 0 ] ); // append command name
QFile f( qcopfn );
if ( f.open( IO_ReadOnly ) ) {
flock( f.handle(), LOCK_EX );
}
QCString channel = QCString( argv[ 0 ] );
channel.replace( QRegExp( ".*/" ), "" );
d->appName = channel;
channel = "QPE/Application/" + channel;
pidChannel = new QCopChannel( channel, this );
connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ),
this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) );
if ( f.isOpen() ) {
d->keep_running = FALSE;
QDataStream ds( &f );
QCString channel, message;
QByteArray data;
while ( !ds.atEnd() ) {
ds >> channel >> message >> data;
d->enqueueQCop( channel, message, data );
}
flock( f.handle(), LOCK_UN );
f.close();
f.remove();
}
for ( int a = 0; a < argc; a++ ) {
if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) {
argv[ a ] = argv[ a + 1 ];
a++;
d->preloaded = TRUE;
argc -= 1;
}
else if ( qstrcmp( argv[ a ], "-preload-show" ) == 0 ) {
argv[ a ] = argv[ a + 1 ];
a++;
d->preloaded = TRUE;
d->forceshow = TRUE;
argc -= 1;
}
}
/* overide stored arguments */
setArgs( argc, argv );
#endif
#else
initApp( argc, argv );
#endif
// qwsSetDecoration( new QPEDecoration() );
#ifndef QT_NO_TRANSLATION
d->langs = Global::languageList();
for ( QStringList::ConstIterator it = d->langs.begin(); it != d->langs.end(); ++it ) {
QString lang = *it;
installTranslation( lang + "/libopie.qm");
installTranslation( lang + "/libqpe.qm" );
installTranslation( lang + "/" + d->appName + ".qm" );
//###language/font hack; should look it up somewhere
#ifdef QWS