summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index af26302..3934411 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -879,101 +879,99 @@ void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const
if ( !error.isNull() ) {
if ( QMessageBox::warning( this, tr("Error!"), error, tr("Fix it"), tr("Continue"), 0, 0, 1 ) == 0 )
continue;
}
db->addEvent( ev );
emit newEvent();
break;
}
}
void DateBook::setDocument( const QString &filename )
{
if ( filename.find(".vcs") != int(filename.length()) - 4 ) return;
QValueList<Event> tl = Event::readVCalendar( filename );
for( QValueList<Event>::Iterator it = tl.begin(); it != tl.end(); ++it ) {
db->addEvent( *it );
}
}
static const char * beamfile = "/tmp/obex/event.vcs";
void DateBook::beamEvent( const Event &e )
{
qDebug("trying to beamn");
unlink( beamfile ); // delete if exists
mkdir("/tmp/obex/", 0755);
Event::writeVCalendar( beamfile, e );
Ir *ir = new Ir( this );
connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
QString description = e.description();
ir->send( beamfile, description, "text/x-vCalendar" );
}
void DateBook::beamDone( Ir *ir )
{
delete ir;
unlink( beamfile );
}
void DateBook::slotFind()
{
// move it to the day view...
viewDay();
FindDialog frmFind( "Calendar", this ); // no tr needed
frmFind.setUseDate( true );
frmFind.setDate( currentDate() );
QObject::connect( &frmFind,
- SIGNAL(signalFindClicked(const QString&, const QDate&,
- bool, bool, int)),
+ SIGNAL(signalFindClicked(const QString&,const QDate&,bool,bool,int)),
this,
- SLOT(slotDoFind(const QString&, const QDate&,
- bool, bool, int)) );
+ SLOT(slotDoFind(const QString&,const QDate&,bool,bool,int)) );
QObject::connect( this,
SIGNAL(signalNotFound()),
&frmFind,
SLOT(slotNotFound()) );
QObject::connect( this,
SIGNAL(signalWrapAround()),
&frmFind,
SLOT(slotWrapAround()) );
frmFind.move(0,0);
frmFind.exec();
inSearch = false;
}
bool catComp( QArray<int> cats, int category )
{
bool returnMe;
int i,
count;
count = int(cats.count());
returnMe = false;
if ( (category == -1 && count == 0) || category == -2 )
returnMe = true;
else {
for ( i = 0; i < count; i++ ) {
if ( category == cats[i] ) {
returnMe = true;
break;
}
}
}
return returnMe;
}
void DateBook::slotDoFind( const QString& txt, const QDate &dt,
bool caseSensitive, bool /*backwards*/,
int category )
{
QDateTime dtEnd( QDate(3001, 1, 1), QTime(0, 0, 0) ),
next;
QRegExp r( txt );
r.setCaseSensitive( caseSensitive );
static Event rev, nonrev;
if ( !inSearch ) {