summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp8
-rw-r--r--libopie2/opiepim/ui/opimmainwindow.cpp8
-rw-r--r--libopie2/opiepim/ui/opimrecurrencewidget.cpp4
3 files changed, 10 insertions, 10 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index c12e138..4f9b504 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -28,102 +28,102 @@
*/
/*
* =====================================================================
* ToDo: XML-Backend: Automatic reload if something was changed...
*
*
*/
#include "ocontactaccess.h"
#include "obackendfactory.h"
#include <qasciidict.h>
#include <qdatetime.h>
#include <qfile.h>
#include <qregexp.h>
#include <qlist.h>
#include <qcopchannel_qws.h>
//#include <qpe/qcopenvelope_qws.h>
#include <qpe/global.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <opie2/ocontactaccessbackend_xml.h>
namespace Opie {
OPimContactAccess::OPimContactAccess ( const QString appname, const QString ,
OPimContactAccessBackend* end, bool autosync ):
OPimAccessTemplate<OPimContact>( end )
{
/* take care of the backend. If there is no one defined, we
* will use the XML-Backend as default (until we have a cute SQL-Backend..).
*/
if( end == 0 ) {
qWarning ("Using BackendFactory !");
end = OBackendFactory<OPimContactAccessBackend>::Default( "contact", appname );
}
// Set backend locally and in template
m_backEnd = end;
OPimAccessTemplate<OPimContact>::setBackEnd (end);
/* Connect signal of external db change to function */
QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this );
- connect( dbchannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(copMessage( const QCString &, const QByteArray &)) );
+ connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(copMessage(const QCString&,const QByteArray&)) );
if ( autosync ){
QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this );
- connect( syncchannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(copMessage( const QCString &, const QByteArray &)) );
+ connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(copMessage(const QCString&,const QByteArray&)) );
}
}
OPimContactAccess::~OPimContactAccess ()
{
/* The user may forget to save the changed database, therefore try to
* do it for him..
*/
save();
// delete m_backEnd; is done by template..
}
bool OPimContactAccess::save ()
{
/* If the database was changed externally, we could not save the
* Data. This will remove added items which is unacceptable !
* Therefore: Reload database and merge the data...
*/
if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() )
reload();
bool status = OPimAccessTemplate<OPimContact>::save();
if ( !status ) return false;
/* Now tell everyone that new data is available.
*/
QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" );
return true;
}
const uint OPimContactAccess::querySettings()
{
return ( m_backEnd->querySettings() );
}
bool OPimContactAccess::hasQuerySettings ( int querySettings ) const
{
return ( m_backEnd->hasQuerySettings ( querySettings ) );
}
OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const
{
QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat );
return ( OPimRecordList<OPimContact>(matchingContacts, this) );
}
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp
index 10ed743..40dc297 100644
--- a/libopie2/opiepim/ui/opimmainwindow.cpp
+++ b/libopie2/opiepim/ui/opimmainwindow.cpp
@@ -2,100 +2,100 @@
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 <qapplication.h>
#include <qdatetime.h>
#include <qcopchannel_qws.h>
#include <qpe/sound.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include <opie2/opimresolver.h>
#include "opimmainwindow.h"
namespace Opie {
OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent,
const char* name, WFlags flag )
: QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) {
/*
* let's generate our QCopChannel
*/
m_str = QString("QPE/"+m_service).local8Bit();
m_channel= new QCopChannel(m_str, this );
- connect(m_channel, SIGNAL(received(const QCString&, const QByteArray& ) ),
- this, SLOT( appMessage( const QCString&, const QByteArray& ) ) );
- connect(qApp, SIGNAL(appMessage(const QCString&, const QByteArray& ) ),
- this, SLOT( appMessage( const QCString&, const QByteArray& ) ) );
+ connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ),
+ this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
+ connect(qApp, SIGNAL(appMessage(const QCString&,const QByteArray&) ),
+ this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
/* connect flush and reload */
connect(qApp, SIGNAL(flush() ),
this, SLOT(flush() ) );
connect(qApp, SIGNAL(reload() ),
this, SLOT(reload() ) );
}
OPimMainWindow::~OPimMainWindow() {
delete m_channel;
}
QCopChannel* OPimMainWindow::channel() {
return m_channel;
}
void OPimMainWindow::doSetDocument( const QString& ) {
}
void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) {
bool needShow = false;
/*
* create demands to create
* a new record...
*/
QDataStream stream(array, IO_ReadOnly);
if ( cmd == "create()" ) {
raise();
int uid = create();
QCopEnvelope e(m_str, "created(int)" );
e << uid;
needShow = true;
}else if ( cmd == "remove(int)" ) {
int uid;
stream >> uid;
bool rem = remove( uid );
QCopEnvelope e(m_str, "removed(bool)" );
e << rem;
needShow = true;
}else if ( cmd == "beam(int)" ) {
int uid;
stream >> uid;
beam( uid);
}else if ( cmd == "show(int)" ) {
raise();
int uid;
stream >> uid;
show( uid );
needShow = true;
}else if ( cmd == "edit(int)" ) {
raise();
diff --git a/libopie2/opiepim/ui/opimrecurrencewidget.cpp b/libopie2/opiepim/ui/opimrecurrencewidget.cpp
index 569bdd5..90c1a5f 100644
--- a/libopie2/opiepim/ui/opimrecurrencewidget.cpp
+++ b/libopie2/opiepim/ui/opimrecurrencewidget.cpp
@@ -507,98 +507,98 @@ void OPimRecurrenceWidget::setupWeekly() {
// might as well set the day too...
if ( startWeekOnMonday ) {
fraExtra->setButton( start.dayOfWeek() - 1 );
} else {
fraExtra->setButton( start.dayOfWeek() % 7 );
}
lblFreq->setText( tr("week(s)") );
lblVar2->show();
showRepeatStuff();
setupRepeatLabel( 1 );
}
void OPimRecurrenceWidget::setupMonthly() {
hideExtras();
lblWeekVar->hide();
fraExtra->setTitle( tr("Repeat By") );
fraExtra->setExclusive( TRUE );
fraExtra->show();
cmdExtra1->setText( tr("Day") );
cmdExtra1->show();
cmdExtra2->setText( tr("Date") );
cmdExtra2->show();
spinFreq->setValue( 1 );
lblFreq->setText( tr("month(s)") );
lblVar2->show();
showRepeatStuff();
setupRepeatLabel( 1 );
}
void OPimRecurrenceWidget::setupYearly() {
hideExtras();
lblWeekVar->hide();
spinFreq->setValue( 1 );
lblFreq->setText( tr("year(s)") );
lblFreq->show();
lblFreq->show();
showRepeatStuff();
lblVar2->show();
QString strEvery = strYearTemplate.arg( start.monthName(start.month()) ).arg( numberPlacing(start.day()) );
lblRepeat->setText( strEvery );
setupRepeatLabel( 1 );
}
void OPimRecurrenceWidget::init() {
QPopupMenu *m1 = new QPopupMenu( this );
repeatPicker = new DateBookMonth( m1, 0, TRUE );
m1->insertItem( repeatPicker );
cmdEnd->setPopup( m1 );
cmdEnd->setPopupDelay( 0 );
- QObject::connect( repeatPicker, SIGNAL(dateClicked(int, int, int)),
- this, SLOT(endDateChanged(int, int, int)) );
+ QObject::connect( repeatPicker, SIGNAL(dateClicked(int,int,int)),
+ this, SLOT(endDateChanged(int,int,int)) );
QObject::connect( qApp, SIGNAL(weekChanged(bool)),
this, SLOT(slotChangeStartOfWeek(bool)) );
listRTypeButtons.setAutoDelete( TRUE );
listRTypeButtons.append( cmdNone );
listRTypeButtons.append( cmdDay );
listRTypeButtons.append( cmdWeek );
listRTypeButtons.append( cmdMonth );
listRTypeButtons.append( cmdYear );
listExtra.setAutoDelete( TRUE );
listExtra.append( cmdExtra1 );
listExtra.append( cmdExtra2 );
listExtra.append( cmdExtra3 );
listExtra.append( cmdExtra4 );
listExtra.append( cmdExtra5 );
listExtra.append( cmdExtra6 );
listExtra.append( cmdExtra7 );
}
void OPimRecurrenceWidget::hideExtras() {
// hide the extra buttons...
fraExtra->hide();
chkNoEnd->hide();
QListIterator<QToolButton> it( listExtra );
for ( ; *it; ++it ) {
(*it)->hide();
(*it)->setOn( FALSE );
}
}
void OPimRecurrenceWidget::showRepeatStuff() {
cmdEnd->show();
chkNoEnd->show();
lblFreq->show();
lblEvery->show();
lblFreq->show();
spinFreq->show();
lblEnd->show();
lblRepeat->setText( tr("Every") );
}
static int week( const QDate &start )
{
// figure out the week...
int stop = start.day(),
sentinel = start.dayOfWeek(),
dayOfWeek = QDate( start.year(), start.month(), 1 ).dayOfWeek(),
week = 1,