author | chicken <chicken> | 2004-03-01 15:58:07 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-01 15:58:07 (UTC) |
commit | 931c55406a043195712955c732a875e17899df90 (patch) (side-by-side diff) | |
tree | 8097c88ee3e96f8fb613ccca1ebf36bf73070dcc /libopie2 | |
parent | 87676b131aad1bfe979570a48107527db4040020 (diff) | |
download | opie-931c55406a043195712955c732a875e17899df90.zip opie-931c55406a043195712955c732a875e17899df90.tar.gz opie-931c55406a043195712955c732a875e17899df90.tar.bz2 |
fix includes
25 files changed, 1 insertions, 67 deletions
diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp index 4505ce7..a40ef53 100644 --- a/libopie2/opiecore/odebug.cpp +++ b/libopie2/opiecore/odebug.cpp @@ -2,110 +2,99 @@ This file is part of the Opie Project (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de) (C) 2002 Holger Freyther (freyther@kde.org) (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Include this header without OPIE_NO_DEBUG defined to avoid having the oDebugInfo // functions inlined to noops (which would then conflict with their definition here). #include <opie2/odebug.h> #ifdef OPIE_NO_DEBUG #undef odDebug #undef odBacktrace #endif /* OPIE */ #include <opie2/oapplication.h> #include <opie2/oglobalsettings.h> #include <opie2/oconfig.h> /* QT */ -#include <qbrush.h> -#include <qdatetime.h> #include <qfile.h> -#include <qhostaddress.h> #include <qmessagebox.h> -#include <qintdict.h> -#include <qpoint.h> -#include <qrect.h> -#include <qregion.h> -#include <qsize.h> #include <qsocketdevice.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtextstream.h> /* UNIX */ #include <stdlib.h> // abort #include <unistd.h> // getpid #include <stdarg.h> // vararg stuff #include <ctype.h> // isprint #include <syslog.h> #include <errno.h> #include <string.h> #ifndef OPIE_NO_BACKTRACE #include <execinfo.h> #endif /*====================================================================================== * debug levels *======================================================================================*/ enum DebugLevels { ODEBUG_INFO = 0, ODEBUG_WARN = 1, ODEBUG_ERROR = 2, ODEBUG_FATAL = 3 }; /*====================================================================================== * oDebug private data *======================================================================================*/ /*====================================================================================== * the main debug function *======================================================================================*/ static void oDebugBackend( unsigned short level, unsigned int area, const char *data) { //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data ); // ML: OPIE doesn't use areacodes at the moment. See the KDE debug classes for an // ML: example use. I think it's not necessary to implement such a strategy here. // ML: Comments? int priority = 0; QString caption; QString lev; switch( level ) { diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp index 879e80f..1aa206e 100644 --- a/libopie2/opiecore/oglobal.cpp +++ b/libopie2/opiecore/oglobal.cpp @@ -1,80 +1,79 @@ /* This file is part of the Opie Project Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> =. Copyright (C) 2004 Holger 'zecke' Freyther <zecke@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <opie2/oglobal.h> -#include <qfile.h> #include <qtextstream.h> #include <qdir.h> #include <qpe/mimetype.h> #include <qpe/qpeapplication.h> #include <qpe/storage.h> #include <unistd.h> #include <sys/types.h> static const char Base64EncMap[64] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F }; static char Base64DecMap[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00 }; OConfig* OGlobal::_config = 0; OConfig* OGlobal::_qpe_config = 0; OConfig* OGlobal::config() { if ( !OGlobal::_config ) diff --git a/libopie2/opiecore/oglobalsettings.cpp b/libopie2/opiecore/oglobalsettings.cpp index 66adbd0..192e55b 100644 --- a/libopie2/opiecore/oglobalsettings.cpp +++ b/libopie2/opiecore/oglobalsettings.cpp @@ -1,92 +1,89 @@ /* This file is part of the Opie Project Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> Inspired by the KDE globalsettings which are Copyright (C) 2000 David Faure <faure@kde.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* OPIE */ #include <opie2/oglobalsettings.h> #include <opie2/oconfig.h> #include <opie2/oglobal.h> /* QT */ -#include <qobject.h> #include <qdir.h> -#include <qpixmap.h> -#include <qfontinfo.h> /* UNIX */ #include <stdlib.h> QString* OGlobalSettings::s_desktopPath = 0; QString* OGlobalSettings::s_autostartPath = 0; QString* OGlobalSettings::s_trashPath = 0; QString* OGlobalSettings::s_documentPath = 0; QFont *OGlobalSettings::_generalFont = 0; QFont *OGlobalSettings::_fixedFont = 0; QFont *OGlobalSettings::_toolBarFont = 0; QFont *OGlobalSettings::_menuFont = 0; QFont *OGlobalSettings::_windowTitleFont = 0; QFont *OGlobalSettings::_taskbarFont = 0; QColor *OGlobalSettings::OpieGray = 0; QColor *OGlobalSettings::OpieHighlight = 0; QColor *OGlobalSettings::OpieAlternate = 0; OGlobalSettings::OMouseSettings *OGlobalSettings::s_mouseSettings = 0; //FIXME: Add manipulators to the accessors int OGlobalSettings::dndEventDelay() { OConfig *c = OGlobal::config(); OConfigGroupSaver cgs( c, "General" ); return c->readNumEntry("DndDelay", 2); } bool OGlobalSettings::singleClick() { OConfig *c = OGlobal::config(); OConfigGroupSaver cgs( c, "OPIE" ); return c->readBoolEntry("SingleClick", OPIE_DEFAULT_SINGLECLICK); } bool OGlobalSettings::insertTearOffHandle() { OConfig *c = OGlobal::config(); OConfigGroupSaver cgs( c, "OPIE" ); return c->readBoolEntry("InsertTearOffHandle", OPIE_DEFAULT_INSERTTEAROFFHANDLES); } bool OGlobalSettings::changeCursorOverIcon() { OConfig *c = OGlobal::config(); diff --git a/libopie2/opiecore/oprocctrl.cpp b/libopie2/opiecore/oprocctrl.cpp index b3d57c8..0403526 100644 --- a/libopie2/opiecore/oprocctrl.cpp +++ b/libopie2/opiecore/oprocctrl.cpp @@ -1,90 +1,89 @@ /* This file is part of the KDE libraries Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // // KPROCESSCONTROLLER -- A helper class for KProcess // // version 0.3.1, Jan, 8th 1997 // // (C) Christian Czezatke // e9025461@student.tuwien.ac.at // Ported by Holger Freyther // //#include <config.h> #include <sys/types.h> #include <sys/socket.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <assert.h> #include <qsocketnotifier.h> -#include "oprocess.h" #include "oprocctrl.h" OProcessController *OProcessController::theOProcessController = 0; struct sigaction OProcessController::oldChildHandlerData; bool OProcessController::handlerSet = false; OProcessController::OProcessController() { assert( theOProcessController == 0 ); if (0 > pipe(fd)) printf(strerror(errno)); notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read); notifier->setEnabled(true); QObject::connect(notifier, SIGNAL(activated(int)), this, SLOT(slotDoHousekeeping(int))); connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()), SLOT( delayedChildrenCleanup())); theOProcessController = this; setupHandlers(); } void OProcessController::setupHandlers() { if( handlerSet ) return; struct sigaction act; act.sa_handler=theSigCHLDHandler; sigemptyset(&(act.sa_mask)); sigaddset(&(act.sa_mask), SIGCHLD); // Make sure we don't block this signal. gdb tends to do that :-( sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0); act.sa_flags = SA_NOCLDSTOP; // CC: take care of SunOS which automatically restarts interrupted system // calls (and thus does not have SA_RESTART) #ifdef SA_RESTART act.sa_flags |= SA_RESTART; #endif sigaction( SIGCHLD, &act, &oldChildHandlerData ); diff --git a/libopie2/opiecore/oprocess.cpp b/libopie2/opiecore/oprocess.cpp index 83677aa..0a361a1 100644 --- a/libopie2/opiecore/oprocess.cpp +++ b/libopie2/opiecore/oprocess.cpp @@ -1,90 +1,88 @@ /* This file is part of the Opie Project Copyright (C) 2002-2004 Holger Freyther <zecke@handhelds.org> and The Opie Team <opie-devel@handhelds.org> =. Based on KProcess (C) 1997 Christian Czezatke (e9025461@student.tuwien.ac.at) .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "oprocctrl.h" /* OPIE */ #include <opie2/oprocess.h> /* QT */ #include <qapplication.h> #include <qdir.h> -#include <qfile.h> #include <qmap.h> -#include <qregexp.h> #include <qsocketnotifier.h> #include <qtextstream.h> /* STD */ #include <errno.h> #include <fcntl.h> #include <pwd.h> #include <stdlib.h> #include <signal.h> #include <stdio.h> #include <string.h> #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/socket.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif #ifdef HAVE_INITGROUPS #include <grp.h> #endif class OProcessPrivate { public: OProcessPrivate() : useShell( false ) { } bool useShell; QMap<QString, QString> env; QString wd; QCString shell; }; OProcess::OProcess( QObject *parent, const char *name ) : QObject( parent, name ) { init ( ); } OProcess::OProcess( const QString &arg0, QObject *parent, const char *name ) : QObject( parent, name ) { init ( ); *this << arg0; } diff --git a/libopie2/opiedb/osqlbackendmanager.cpp b/libopie2/opiedb/osqlbackendmanager.cpp index 0f261b9..95ed77b 100644 --- a/libopie2/opiedb/osqlbackendmanager.cpp +++ b/libopie2/opiedb/osqlbackendmanager.cpp @@ -1,50 +1,49 @@ #include <qdir.h> -#include <qfile.h> #include <qmap.h> #include "osqlbackendmanager.h" namespace { class Config { typedef QMap<QString, QString> List; public: Config( const QString& fileName ); /** * Quite simple layout in nature * BeginFile * Key = Value */ bool load(); QString value( const QString& key ); private: List m_list; QString m_fileName; }; Config::Config( const QString& fileName ) : m_fileName( fileName ) { } bool Config::load() { if (!QFile::exists( m_fileName ) ) return false; QFile file( m_fileName ); if (!file.open(IO_ReadOnly ) ) return false; QStringList list = QStringList::split( '\n', file.readAll() ); QStringList::Iterator it; QString line; for (it = list.begin(); it != list.end(); ++it ) { line = (*it).stripWhiteSpace(); qWarning("Anonymous::Config:" + line ); QStringList test = QStringList::split(' ', line ); m_list.insert( test[0], test[2] ); } return true; } QString Config::value( const QString& key ) { return m_list[key]; } }; OSQLBackEndManager::OSQLBackEndManager( const QStringList& path ) :m_path( path ) { diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp index b857534..6141504 100644 --- a/libopie2/opiedb/osqlitedriver.cpp +++ b/libopie2/opiedb/osqlitedriver.cpp @@ -1,79 +1,78 @@ /* This file is part of the Opie Project =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "osqlresult.h" #include "osqlquery.h" #include "osqlitedriver.h" #include <opie2/odebug.h> #include <stdlib.h> // fromLocal8Bit() does not work as expected. Thus it // is replaced by fromLatin1() (eilers) #define __BUGGY_LOCAL8BIT_ namespace { struct Query { OSQLError::ValueList errors; OSQLResultItem::ValueList items; OSQLiteDriver *driver; }; } OSQLiteDriver::OSQLiteDriver( QLibrary *lib ) : OSQLDriver( lib ) { m_sqlite = 0l; } OSQLiteDriver::~OSQLiteDriver() { close(); } QString OSQLiteDriver::id()const { return QString::fromLatin1("SQLite"); } void OSQLiteDriver::setUserName( const QString& ) {} void OSQLiteDriver::setPassword( const QString& ) {} void OSQLiteDriver::setUrl( const QString& url ) { m_url = url; } diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp index b0fea04..766ebe1 100644 --- a/libopie2/opiedb/osqlmanager.cpp +++ b/libopie2/opiedb/osqlmanager.cpp @@ -1,53 +1,51 @@ #include <stdlib.h> -#include "osqlbackend.h" -#include "osqldriver.h" #include "osqlmanager.h" #include "osqlbackendmanager.h" #include "osqlitedriver.h" OSQLManager::OSQLManager() { } OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { m_list.clear(); QString opie = QString::fromLatin1( getenv("OPIEDIR") ); QString qpe = QString::fromLatin1( getenv("QPEDIR") ); if ( !m_path.contains(opie) && !opie.isEmpty() ) m_path << opie; if ( !m_path.contains(qpe) && !qpe.isEmpty() ) m_path << qpe; OSQLBackEndManager mng( m_path ); m_list = mng.scan(); m_list += builtIn(); return m_list; } /* * loading dso's is currently not enabled due problems with QLibrary * beeing in libqpe and not libqte */ OSQLDriver* OSQLManager::load( const QString& name ) { OSQLDriver* driver = 0l; if ( name == "SQLite" ) { driver = new OSQLiteDriver(); } return driver; } /* * same as above */ OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { OSQLDriver *driver = 0l; if ( end.library() == "builtin" && end.name() == "SQLite" ) driver = new OSQLiteDriver(); return driver; } /* * let's find the a default with the highes preference */ diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp index 490fb45..42da356 100644 --- a/libopie2/opiedb/osqlresult.cpp +++ b/libopie2/opiedb/osqlresult.cpp @@ -1,50 +1,49 @@ -#include "osqlquery.h" #include "osqlresult.h" OSQLResultItem::OSQLResultItem( const TableString& string, const TableInt& Int) : m_string( string ), m_int( Int ) { } OSQLResultItem::~OSQLResultItem() { } OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) { *this = item; } OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) { m_string = other.m_string; m_int = other.m_int; return *this; } OSQLResultItem::TableString OSQLResultItem::tableString()const{ return m_string; } OSQLResultItem::TableInt OSQLResultItem::tableInt()const { return m_int; } QString OSQLResultItem::data( const QString& columnName, bool *ok ) { TableString::Iterator it = m_string.find( columnName ); /* if found */ if ( it != m_string.end() ) { if ( ok ) *ok = true; return it.data(); }else{ if ( ok ) *ok = false; return QString::null; } } QString OSQLResultItem::data( int column, bool *ok ) { TableInt::Iterator it = m_int.find( column ); /* if found */ if ( it != m_int.end() ) { if ( ok ) *ok = true; return it.data(); }else{ if ( ok ) *ok = false; return QString::null; } diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp index ca63389..51e088c 100644 --- a/libopie2/opiemm/osoundsystem.cpp +++ b/libopie2/opiemm/osoundsystem.cpp @@ -1,91 +1,90 @@ /* This file is part of the Opie Project (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <opie2/osoundsystem.h> #include <opie2/odebug.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/soundcard.h> #include <sys/stat.h> -#include <qstringlist.h> /*====================================================================================== * OSoundSystem *======================================================================================*/ OSoundSystem* OSoundSystem::_instance = 0; OSoundSystem::OSoundSystem() { odebug << "OSoundSystem::OSoundSystem()" << oendl; synchronize(); } void OSoundSystem::synchronize() { // gather available interfaces by inspecting /dev //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices _interfaces.clear(); _interfaces.insert( "soundcard", new OSoundCard( this, "soundcard" ) ); /* QString str; QFile f( "/dev/sound" ); bool hasFile = f.open( IO_ReadOnly ); if ( !hasFile ) { odebug << "OSoundSystem: /dev/sound not existing. No sound devices available" << oendl; return; } QTextStream s( &f ); s.readLine(); s.readLine(); while ( !s.atEnd() ) { s >> str; str.truncate( str.find( ':' ) ); qDebug( "OSoundSystem: found interface '%s'", (const char*) str ); OAudioInterface* iface; iface = new OAudioInterface( this, (const char*) str ); _interfaces.insert( str, iface ); s.readLine(); } */ diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp index 2da549c..b93b752 100644 --- a/libopie2/opienet/omanufacturerdb.cpp +++ b/libopie2/opienet/omanufacturerdb.cpp @@ -1,91 +1,90 @@ /* This file is part of the Opie Project (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "omanufacturerdb.h" #define OPIE_IMPROVE_GUI_LATENCY 1 /* OPIE */ #include <opie2/odebug.h> #ifdef OPIE_IMPROVE_GUI_LATENCY #include <qpe/global.h> #endif /* QT */ #include <qapplication.h> -#include <qstring.h> #include <qfile.h> #include <qtextstream.h> OManufacturerDB* OManufacturerDB::_instance = 0; OManufacturerDB* OManufacturerDB::instance() { if ( !OManufacturerDB::_instance ) { odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl; _instance = new OManufacturerDB(); } return _instance; } OManufacturerDB::OManufacturerDB() { #ifdef OPIE_IMPROVE_GUI_LATENCY Global::statusMessage( "Reading Manufacturers..." ); #endif QString filename( "/etc/manufacturers" ); odebug << "OManufacturerDB: trying to read " << filename << oendl; if ( !QFile::exists( filename ) ) { filename = "/opt/QtPalmtop/etc/manufacturers"; odebug << "OManufacturerDB: trying to read " << filename << oendl; if ( !QFile::exists( filename ) ) { filename = "/usr/share/wellenreiter/manufacturers"; odebug << "OManufacturerDB: trying to read " << filename << oendl; } } QFile file( filename ); bool hasFile = file.open( IO_ReadOnly ); if (!hasFile) { owarn << "OManufacturerDB: no valid manufacturer list found." << oendl; } else { odebug << "OManufacturerDB: found manufacturer list in " << filename << oendl; QTextStream s( &file ); QString addr; QString manu; QString extManu; #ifdef OPIE_IMPROVE_GUI_LATENCY diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index 0adba68..5d92b8f 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp @@ -1,90 +1,88 @@ /* This file is part of the Opie Project Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * XML Backend for the OPIE-Contact Database. */ #include <opie2/ocontactaccessbackend_xml.h> #include <qasciidict.h> -#include <qdatetime.h> #include <qfile.h> #include <qfileinfo.h> #include <qregexp.h> #include <qarray.h> #include <qmap.h> -#include <qdatetime.h> #include <qpe/global.h> #include <opie2/xmltree.h> #include <opie2/ocontactaccessbackend.h> #include <opie2/ocontactaccess.h> #include <stdlib.h> #include <errno.h> using namespace Opie; namespace Opie { OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ): m_changed( false ) { // Just m_contactlist should call delete if an entry // is removed. m_contactList.setAutoDelete( true ); m_uidToContact.setAutoDelete( false ); m_appName = appname; /* Set journalfile name ... */ m_journalName = getenv("HOME"); m_journalName +="/.abjournal" + appname; /* Expecting to access the default filename if nothing else is set */ if ( filename.isEmpty() ){ m_fileName = Global::applicationFileName( "addressbook","addressbook.xml" ); } else m_fileName = filename; /* Load Database now */ load (); } bool OPimContactAccessBackend_XML::save() { if ( !m_changed ) return true; QString strNewFile = m_fileName + ".new"; QFile f( strNewFile ); if ( !f.open( IO_WriteOnly|IO_Raw ) ) return false; diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp index a5df597..4a774e8 100644 --- a/libopie2/opiepim/core/opimcontact.cpp +++ b/libopie2/opiepim/core/opimcontact.cpp @@ -1,94 +1,90 @@ /* This file is part of the Opie Project Copyright (C) Stefan Eilers <eilers.stefan@epost.de> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define QTOPIA_INTERNAL_CONTACT_MRE #include "opimcontact.h" /* OPIE */ #include <opie2/opimresolver.h> #include <opie2/opimdateconversion.h> #include <qpe/stringutil.h> #include <qpe/timestring.h> #include <qpe/config.h> /* QT */ -#include <qobject.h> -#include <qregexp.h> #include <qstylesheet.h> -#include <qfileinfo.h> -#include <qmap.h> /* STD */ #include <stdio.h> /*! \class Contact contact.h \brief The Contact class holds the data of an address book entry. This data includes information the name of the person, contact information, and business information such as deparment and job title. \ingroup qtopiaemb \ingroup qtopiadesktop */ namespace Opie { /*! Creates a new, empty contact. */ OPimContact::OPimContact():OPimRecord(), mMap(), d( 0 ) {} /*! \internal Creates a new contact. The properties of the contact are set from \a fromMap. */ OPimContact::OPimContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap( fromMap ), d( 0 ) { QString cats = mMap[ Qtopia::AddressCategory ]; if ( !cats.isEmpty() ) setCategories( idsFromString( cats ) ); QString uidStr = find( Qtopia::AddressUid ); if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) ) { qWarning( "Invalid UID found. Generate new one.." ); setUid( uidGen().generate() ); } else setUid( uidStr.toInt() ); // if ( !uidStr.isEmpty() ) // setUid( uidStr.toInt() ); } diff --git a/libopie2/opiepim/core/opimcontactfields.cpp b/libopie2/opiepim/core/opimcontactfields.cpp index 4b0ba3b..120beb6 100644 --- a/libopie2/opiepim/core/opimcontactfields.cpp +++ b/libopie2/opiepim/core/opimcontactfields.cpp @@ -1,87 +1,85 @@ /* This file is part of the Opie Project Copyright (C) Stefan Eilers <eilers.stefan@epost.de> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opimcontactfields.h" /* OPIE */ #include <opie2/opimcontact.h> -#include <qpe/recordfields.h> // We should use our own enum in the future .. #include <qpe/config.h> /* QT */ #include <qobject.h> -#include <qstringlist.h> namespace Opie { /*! \internal Returns a list of personal field names for a contact. */ QStringList OPimContactFields::personalfields( bool sorted, bool translated ) { QStringList list; QMap<int, QString> mapIdToStr; if ( translated ) mapIdToStr = idToTrFields(); else mapIdToStr = idToUntrFields(); list.append( mapIdToStr[ Qtopia::AddressUid ] ); list.append( mapIdToStr[ Qtopia::AddressCategory ] ); list.append( mapIdToStr[ Qtopia::Title ] ); list.append( mapIdToStr[ Qtopia::FirstName ] ); list.append( mapIdToStr[ Qtopia::MiddleName ] ); list.append( mapIdToStr[ Qtopia::LastName ] ); list.append( mapIdToStr[ Qtopia::Suffix ] ); list.append( mapIdToStr[ Qtopia::FileAs ] ); list.append( mapIdToStr[ Qtopia::JobTitle ] ); list.append( mapIdToStr[ Qtopia::Department ] ); list.append( mapIdToStr[ Qtopia::Company ] ); list.append( mapIdToStr[ Qtopia::Notes ] ); list.append( mapIdToStr[ Qtopia::Groups ] ); if ( sorted ) list.sort(); return list; } /*! \internal Returns a list of details field names for a contact. */ QStringList OPimContactFields::detailsfields( bool sorted, bool translated ) { QStringList list; QMap<int, QString> mapIdToStr; if ( translated ) mapIdToStr = idToTrFields(); diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp index 3ddbf85..77730e9 100644 --- a/libopie2/opiepim/core/opimevent.cpp +++ b/libopie2/opiepim/core/opimevent.cpp @@ -1,90 +1,87 @@ /* This file is part of the Opie Project Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opimevent.h" /* OPIE */ #include <opie2/opimrecurrence.h> #include <opie2/opimresolver.h> #include <opie2/opimnotifymanager.h> #include <qpe/categories.h> -#include <qpe/palmtopuidgen.h> #include <qpe/stringutil.h> /* QT */ -#include <qshared.h> -#include <qarray.h> namespace Opie { int OCalendarHelper::week( const QDate& date ) { // Calculates the week this date is in within that // month. Equals the "row" is is in in the month view int week = 1; QDate tmp( date.year(), date.month(), 1 ); if ( date.dayOfWeek() < tmp.dayOfWeek() ) ++week; week += ( date.day() - 1 ) / 7; return week; } int OCalendarHelper::ocurrence( const QDate& date ) { // calculates the number of occurrances of this day of the // week till the given date (e.g 3rd Wednesday of the month) return ( date.day() - 1 ) / 7 + 1; } int OCalendarHelper::dayOfWeek( char day ) { int dayOfWeek = 1; char i = OPimRecurrence::MON; while ( !( i & day ) && i <= OPimRecurrence::SUN ) { i <<= 1; ++dayOfWeek; } return dayOfWeek; } int OCalendarHelper::monthDiff( const QDate& first, const QDate& second ) { return ( second.year() - first.year() ) * 12 + second.month() - first.month(); } struct OPimEvent::Data : public QShared diff --git a/libopie2/opiepim/core/opimnotify.cpp b/libopie2/opiepim/core/opimnotify.cpp index 43858f0..417b0b9 100644 --- a/libopie2/opiepim/core/opimnotify.cpp +++ b/libopie2/opiepim/core/opimnotify.cpp @@ -1,81 +1,80 @@ /* This file is part of the Opie Project Copyright (C) The Main Author <main-author@whereever.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opimnotify.h" /* QT */ -#include <qshared.h> namespace Opie { struct OPimNotify::Data : public QShared { Data() : QShared(), dur( -1 ), parent( 0 ) { } QDateTime start; int dur; QString application; int parent; }; OPimNotify::OPimNotify( const QDateTime& start, int duration, int parent ) { data = new Data; data->start = start; data->dur = duration; data->parent = parent; } OPimNotify::OPimNotify( const OPimNotify& noti ) : data( noti.data ) { data->ref(); } OPimNotify::~OPimNotify() { if ( data->deref() ) { delete data; data = 0l; } } OPimNotify &OPimNotify::operator=( const OPimNotify& noti ) { noti.data->ref(); deref(); data = noti.data; return *this; diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index c603f44..67eed41 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp @@ -1,85 +1,84 @@ /* This file is part of the Opie Project Copyright (C) The Main Author <main-author@whereever.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opimrecord.h" /* OPIE */ #include <qpe/categories.h> #include <qpe/categoryselect.h> /* QT */ -#include <qarray.h> namespace Opie { Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia ); OPimRecord::OPimRecord( int uid ) : Qtopia::Record() { m_lastHit = -1; setUid( uid ); } OPimRecord::~OPimRecord() {} OPimRecord::OPimRecord( const OPimRecord& rec ) : Qtopia::Record( rec ) { ( *this ) = rec; } OPimRecord &OPimRecord::operator=( const OPimRecord& rec ) { if ( this == &rec ) return * this; Qtopia::Record::operator=( rec ); m_xrefman = rec.m_xrefman; m_lastHit = rec.m_lastHit; return *this; } /* * category names */ QStringList OPimRecord::categoryNames( const QString& appname ) const { QStringList list; QArray<int> cats = categories(); Categories catDB; catDB.load( categoryFileName() ); diff --git a/libopie2/opiepim/core/opimtodo.cpp b/libopie2/opiepim/core/opimtodo.cpp index 34df807..f246bfd 100644 --- a/libopie2/opiepim/core/opimtodo.cpp +++ b/libopie2/opiepim/core/opimtodo.cpp @@ -1,91 +1,90 @@ /* This file is part of the Opie Project Copyright (C) The Main Author <main-author@whereever.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opimtodo.h" /* OPIE */ #include <opie2/opimstate.h> #include <opie2/opimrecurrence.h> #include <opie2/opimmaintainer.h> #include <opie2/opimnotifymanager.h> #include <opie2/opimresolver.h> #include <qpe/palmtopuidgen.h> -#include <qpe/stringutil.h> #include <qpe/palmtoprecord.h> -#include <qpe/stringutil.h> #include <qpe/categories.h> #include <qpe/categoryselect.h> +#include <qpe/stringutil.h> /* QT */ #include <qobject.h> #include <qshared.h> namespace Opie { struct OPimTodo::OPimTodoData : public QShared { OPimTodoData() : QShared() { recur = 0; state = 0; maintainer = 0; notifiers = 0; }; ~OPimTodoData() { delete recur; delete maintainer; delete notifiers; } QDate date; bool isCompleted: 1; bool hasDate: 1; int priority; QString desc; QString sum; QMap<QString, QString> extra; ushort prog; OPimState *state; OPimRecurrence *recur; OPimMaintainer *maintainer; QDate start; QDate completed; OPimNotifyManager *notifiers; }; OPimTodo::OPimTodo( const OPimTodo &event ) : OPimRecord( event ), data( event.data ) { data->ref(); // qWarning("ref up"); } diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp index 49628c9..49ddeb6 100644 --- a/libopie2/opieui/ofontselector.cpp +++ b/libopie2/opieui/ofontselector.cpp @@ -1,87 +1,86 @@ /* This file is part of the Opie Project Copyright (C) Robert Griebl <sandman@handhelds.org> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* OPIE */ #include <opie2/ofontselector.h> #include <qpe/fontdatabase.h> /* QT */ #include <qlayout.h> #include <qlistbox.h> #include <qcombobox.h> #include <qlabel.h> -#include <qfont.h> #include <qmultilineedit.h> using namespace Opie; namespace Opie { class OFontSelectorPrivate { public: QListBox * m_font_family_list; QComboBox * m_font_style_list; QComboBox * m_font_size_list; QMultiLineEdit *m_preview; bool m_pointbug : 1; FontDatabase m_fdb; }; }; namespace { class FontListItem : public QListBoxText { public: FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText() { m_name = t; m_styles = styles; m_sizes = sizes; QString str = t; str [0] = str [0]. upper(); setText ( str ); } QString family() const { return m_name; } const QStringList &styles() const { return m_styles; } diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index 38f3fe2..84617f8 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp @@ -1,82 +1,79 @@ /* This file is part of the Opie Project =. (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* QT */ -#include <qcolor.h> -#include <qheader.h> -#include <qpainter.h> #include <qpixmap.h> /* OPIE */ #include <opie2/odebug.h> #include <opie2/olistview.h> /*====================================================================================== * OListView *======================================================================================*/ OListView::OListView( QWidget *parent, const char *name ) :QListView( parent, name ) { //FIXME: get from global settings and calculate ==> see oglobalsettings.* m_alternateBackground = QColor( 238, 246, 255 ); m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); m_fullWidth = true; connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); } OListView::~OListView() { } void OListView::setFullWidth( bool fullWidth ) { m_fullWidth = m_fullWidth; #if QT_VERSION > 290 header()->setStretchEnabled( fullWidth, columns()-1 ); #endif } bool OListView::fullWidth() const { return m_fullWidth; } int OListView::addColumn( const QString& label, int width ) { int result = QListView::addColumn( label, width ); #if QT_VERSION > 290 if (m_fullWidth) { header()->setStretchEnabled( false, columns()-2 ); header()->setStretchEnabled( true, columns()-1 ); } #endif diff --git a/libopie2/opieui/opopupmenu.cpp b/libopie2/opieui/opopupmenu.cpp index ac73188..d5cc575 100644 --- a/libopie2/opieui/opopupmenu.cpp +++ b/libopie2/opieui/opopupmenu.cpp @@ -1,78 +1,71 @@ /* This file is part of the KDE libraries Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> Copyright (C) 2002 Hamish Rodda <meddie@yoyo.its.monash.edu.au> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* QT */ -#include <qapplication.h> -#include <qcursor.h> -#include <qpainter.h> #include <qdrawutil.h> #include <qtimer.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qregexp.h> -#include <qstyle.h> /* OPIE */ #include <opie2/opopupmenu.h> #include <opie2/oconfig.h> OPopupTitle::OPopupTitle(QWidget *parent, const char *name) : QWidget(parent, name) { setMinimumSize(16, fontMetrics().height()+8); } OPopupTitle::OPopupTitle(OPixmapEffect::GradientType /* gradient */, const QColor &/* color */, const QColor &/* textColor */, QWidget *parent, const char *name) : QWidget(parent, name) { setMinimumSize(16, fontMetrics().height()+8); } OPopupTitle::OPopupTitle(const OPixmap & /* background */, const QColor &/* color */, const QColor &/* textColor */, QWidget *parent, const char *name) : QWidget(parent, name) { setMinimumSize(16, fontMetrics().height()+8); } void OPopupTitle::setTitle(const QString &text, const QPixmap *icon) { titleStr = text; if (icon) miniicon = *icon; else miniicon.resize(0, 0); int w = miniicon.width()+fontMetrics().width(titleStr); int h = QMAX( fontMetrics().height(), miniicon.height() ); setMinimumSize( w+16, h+8 ); } void OPopupTitle::setText( const QString &text ) { titleStr = text; int w = miniicon.width()+fontMetrics().width(titleStr); int h = QMAX( fontMetrics().height(), miniicon.height() ); setMinimumSize( w+16, h+8 ); } diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp index ec5af6b..23b3ce3 100644 --- a/libopie2/opieui/oselector.cpp +++ b/libopie2/opieui/oselector.cpp @@ -1,71 +1,70 @@ /* This file is part of the KDE libraries Copyright (C) 1997 Martin Jones (mjones@kde.org) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* QT */ #include <qimage.h> -#include <qpainter.h> #include <qdrawutil.h> /* OPIE */ #include <opie2/oimageeffect.h> #include <opie2/oselector.h> #define STORE_W 8 #define STORE_W2 STORE_W * 2 //----------------------------------------------------------------------------- /* * 2D value selector. * The contents of the selector are drawn by derived class. */ OXYSelector::OXYSelector( QWidget *parent, const char *name ) : QWidget( parent, name ) { xPos = 0; yPos = 0; minX = 0; minY = 0; maxX = 100; maxY = 100; store.setOptimization( QPixmap::BestOptim ); store.resize( STORE_W2, STORE_W2 ); } OXYSelector::~OXYSelector() {} void OXYSelector::setRange( int _minX, int _minY, int _maxX, int _maxY ) { px = 2; py = 2; minX = _minX; minY = _minY; maxX = _maxX; maxY = _maxY; } void OXYSelector::setValues( int _xPos, int _yPos ) { xPos = _xPos; yPos = _yPos; diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp index 98d42c7..b93c225 100644 --- a/libopie2/opieui/oseparator.cpp +++ b/libopie2/opieui/oseparator.cpp @@ -1,87 +1,86 @@ /* This file is part of the Opie Project Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> Copyright (C) 1997 Michael Roth <mroth@wirlweb.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* OPIE */ #include <opie2/odebug.h> #include <opie2/oseparator.h> /* QT */ -#include <qstyle.h> OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) : QFrame(parent, name, f) { setLineWidth(1); setMidLineWidth(0); setOrientation( HLine ); } OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f) : QFrame(parent, name, f) { setLineWidth(1); setMidLineWidth(0); setOrientation( orientation ); } void OSeparator::setOrientation(int orientation) { switch(orientation) { case Vertical: case VLine: setFrameStyle( QFrame::VLine | QFrame::Sunken ); setMinimumSize(2, 0); break; default: owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl; case Horizontal: case HLine: setFrameStyle( QFrame::HLine | QFrame::Sunken ); setMinimumSize(0, 2); break; } } int OSeparator::orientation() const { if ( frameStyle() & VLine ) return VLine; diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp index 9f9f2c2..d4712a4 100644 --- a/libopie2/opieui/otimepicker.cpp +++ b/libopie2/opieui/otimepicker.cpp @@ -1,83 +1,80 @@ /* This file is part of the Opie Project Copyright (C) Stefan Eilers <eilers.stefan@epost.de> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* QT */ -#include <qbuttongroup.h> #include <qlayout.h> #include <qlineedit.h> -#include <qstring.h> -#include <qtoolbutton.h> /* OPIE */ #include <opie2/otimepicker.h> using namespace Opie; /** * Constructs the widget * @param parent The parent of the OTimePicker * @param name The name of the object * @param fl Window Flags */ OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl) :QWidget(parent,name,fl) { QVBoxLayout *vbox=new QVBoxLayout(this); OClickableLabel *r; QString s; // Hour Row QWidget *row=new QWidget(this); QHBoxLayout *l=new QHBoxLayout(row); vbox->addWidget(row); for (int i=0; i<24; i++) { r=new OClickableLabel(row); hourLst.append(r); s.sprintf("%.2d",i); r->setText(s); r->setToggleButton(true); r->setAlignment(AlignHCenter | AlignVCenter); l->addWidget(r); connect(r, SIGNAL(toggled(bool)), this, SLOT(slotHour(bool))); if (i==11) { // Second row row=new QWidget(this); l=new QHBoxLayout(row); vbox->addWidget(row); } } // Minute Row row=new QWidget(this); l=new QHBoxLayout(row); diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp index 65fe3d8..8839456 100644 --- a/libopie2/opieui/oversatileview.cpp +++ b/libopie2/opieui/oversatileview.cpp @@ -1,100 +1,89 @@ /* This file is part of the Opie Project =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* OPIE */ #include <opie2/odebug.h> #include <opie2/oversatileview.h> #include <opie2/oversatileviewitem.h> #include <opie2/olistview.h> /* QT */ #include <qaction.h> -#include <qbrush.h> -#include <qfont.h> -#include <qiconset.h> -#include <qiconview.h> -#include <qlistview.h> -#include <qpalette.h> -#include <qpoint.h> #include <qpopupmenu.h> -#include <qrect.h> -#include <qsize.h> -#include <qstring.h> -#include <qwidgetstack.h> /* XPM */ static const char * view_icon_xpm[] = { "16 16 16 1", " c None", ". c #87BD88", "+ c #8BBE8B", "@ c #81BA81", "# c #6DAF6D", "$ c #87BD87", "% c #FCFDFC", "& c #AED0AE", "* c #4E9C4C", "= c #91BD91", "- c #72B172", "; c #448643", "> c #519F50", ", c #499247", "' c #356A35", ") c #686868", " ", " .+@# .+@# ", " $%&* $%&* ", " @=-; @=-; ", " #>,' #>,' ", " ", " )))))) )))))) ", " ", " ", " .+@# .+@# ", " $%&* $%&* ", " @=-; @=-; ", " #>,' #>,' ", " ", " )))))) )))))) ", " "}; /* XPM */ static const char * view_tree_xpm[] = { "16 16 17 1", " c None", ". c #3A3A3A", "+ c #87BD88", "@ c #8BBE8B", "# c #81BA81", "$ c #6DAF6D", "% c #87BD87", "& c #FCFDFC", |