summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp289
-rw-r--r--core/pim/today/changelog1
-rw-r--r--core/pim/today/today.cpp6
3 files changed, 148 insertions, 148 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index a0f04f1..59b38e3 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -525,29 +525,29 @@ void Launcher::updateMimeTypes()
void Launcher::updateMimeTypes(AppLnkSet* folder)
{
for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) {
AppLnk *app = it.current();
if ( app->type() == "Folder" )
updateMimeTypes((AppLnkSet *)app);
else {
MimeType::registerApp(*app);
}
}
}
-/** This is a HACK....
+/** This is a HACK....
* Reason: scanning huge mediums, microdirvers for examples
* consomes time. To avoid that we invented the MediumMountCheck
- *
- * a) the user globally disabled medium checking. We can ignore
+ *
+ * a) the user globally disabled medium checking. We can ignore
* all removable medium
* b) the user enabled medium checking globally and we need to use this mimefilter
* c) the user enabled medium checking on a per medium bases
* c1) we already checked and its not ask again turns
* c2) we need to ask and then apply the mimefilter
*/
void Launcher::loadDocs() // ok here comes a hack belonging to Global::
{
delete docsFolder;
docsFolder = new DocLnkSet;
DocLnkSet *tmp = 0;
@@ -563,25 +563,25 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
return;
// find out wich filesystems are new in this round
// We will do this by having a timestamp inside each mountpoint
// if the current timestamp doesn't match this is a new file system and
// come up with our MediumMountGui :) let the hacking begin
int stamp = uidgen.generate();
QString newStamp = QString::number( stamp ); // generates newtime Stamp
StorageInfo storage;
const QList<FileSystem> &fileSystems = storage.fileSystems();
QListIterator<FileSystem> it ( fileSystems );
-
+
// b)
if( mediumCfg.readBoolEntry("global", true ) ){
QString mime = configToMime(&mediumCfg).join(";");
for( ; it.current(); ++it ){
if( (*it)->isRemovable() ){
tmp = new DocLnkSet( (*it)->path(), mime );
docsFolder->appendFrom( *tmp );
delete tmp;
}
} // done
return; // save the else
}
@@ -592,25 +592,25 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
cfg.setGroup("main");
QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() );
/** This medium is uptodate
*/
if( stamp == m_timeStamp ){ // ok we know this card
cfg.writeEntry("timestamp", newStamp ); //just write a new timestamp
// we need to scan the list now. Hopefully the cache will be there
// read the mimetypes from the config and search for documents
QStringList mimetypes = configToMime( &cfg);
tmp = new DocLnkSet( (*it)->path(), mimetypes.join(";") );
docsFolder->appendFrom( *tmp );
delete tmp;
-
+
}else{ // come up with the gui cause this a new card
MediumMountGui medium(&cfg, (*it)->path() );
if( medium.check() ){ // we did not ask before or ask again is off
/** c2) */
if( medium.exec() ){ // he clicked yes so search it
// speicher
//cfg.read(); // cause of a race we need to reread - fixed
cfg.setGroup("main");
cfg.writeEntry("timestamp", newStamp );
cfg.write();
tmp = new DocLnkSet( (*it)->path(), medium.mimeTypes().join(";" ) );
docsFolder->appendFrom( *tmp );
@@ -709,83 +709,83 @@ void Launcher::updateLink(const QString& link)
if (link.isNull())
updateTabs();
else if (link.isEmpty())
updateDocs();
else
tabs->updateLink(link);
}
void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "closing(QString)" ){
- QString app;
- stream >> app;
- qWarning("app closed %s", app.latin1() );
- MRUList::removeTask( app );
+ QString app;
+ stream >> app;
+ qWarning("app closed %s", app.latin1() );
+ MRUList::removeTask( app );
}else if ( msg == "linkChanged(QString)" ) {
- QString link;
- stream >> link;
- if ( in_lnk_props ) {
- got_lnk_change = TRUE;
- lnk_change = link;
- } else {
- updateLink(link);
- }
+ QString link;
+ stream >> link;
+ if ( in_lnk_props ) {
+ got_lnk_change = TRUE;
+ lnk_change = link;
+ } else {
+ updateLink(link);
+ }
} else if ( msg == "busy()" ) {
- emit busy();
+ emit busy();
} else if ( msg == "notBusy(QString)" ) {
- QString app;
- stream >> app;
- tabs->setBusy(FALSE);
- emit notBusy(app);
+ QString app;
+ stream >> app;
+ tabs->setBusy(FALSE);
+ emit notBusy(app);
} else if ( msg == "mkdir(QString)" ) {
- QString dir;
- stream >> dir;
- if ( !dir.isEmpty() )
- mkdir( dir );
+ QString dir;
+ stream >> dir;
+ if ( !dir.isEmpty() )
+ mkdir( dir );
} else if ( msg == "rdiffGenSig(QString,QString)" ) {
- QString baseFile, sigFile;
- stream >> baseFile >> sigFile;
- QRsync::generateSignature( baseFile, sigFile );
+ QString baseFile, sigFile;
+ stream >> baseFile >> sigFile;
+ QRsync::generateSignature( baseFile, sigFile );
} else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {
- QString baseFile, sigFile, deltaFile;
- stream >> baseFile >> sigFile >> deltaFile;
- QRsync::generateDiff( baseFile, sigFile, deltaFile );
+ QString baseFile, sigFile, deltaFile;
+ stream >> baseFile >> sigFile >> deltaFile;
+ QRsync::generateDiff( baseFile, sigFile, deltaFile );
} else if ( msg == "rdiffApplyPatch(QString,QString)" ) {
- QString baseFile, deltaFile;
- stream >> baseFile >> deltaFile;
- if ( !QFile::exists( baseFile ) ) {
- QFile f( baseFile );
- f.open( IO_WriteOnly );
- f.close();
- }
- QRsync::applyDiff( baseFile, deltaFile );
- QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
- e << baseFile;
+ QString baseFile, deltaFile;
+ stream >> baseFile >> deltaFile;
+ if ( !QFile::exists( baseFile ) ) {
+ QFile f( baseFile );
+ f.open( IO_WriteOnly );
+ f.close();
+ }
+ QRsync::applyDiff( baseFile, deltaFile );
+ QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
+ e << baseFile;
} else if ( msg == "rdiffCleanup()" ) {
- mkdir( "/tmp/rdiff" );
- QDir dir;
- dir.setPath( "/tmp/rdiff" );
- QStringList entries = dir.entryList();
- for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
- dir.remove( *it );
+ mkdir( "/tmp/rdiff" );
+ QDir dir;
+ dir.setPath( "/tmp/rdiff" );
+ QStringList entries = dir.entryList();
+ for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
+ dir.remove( *it );
} else if ( msg == "sendHandshakeInfo()" ) {
- QString home = getenv( "HOME" );
- QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
- e << home;
- int locked = (int) Desktop::screenLocked();
- e << locked;
- // register an app for autostart
- // if clear is send the list is cleared.
+ QString home = getenv( "HOME" );
+ QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
+ e << home;
+ int locked = (int) Desktop::screenLocked();
+ e << locked;
+ // register an app for autostart
+ // if clear is send the list is cleared.
} else if ( msg == "autoStart(QString)" ) {
QString appName;
stream >> appName;
Config cfg( "autostart" );
cfg.setGroup( "AutoStart" );
if ( appName.compare("clear") == 0){
cfg.writeEntry("Apps", "");
}
} else if ( msg == "autoStart(QString,QString)" ) {
QString modifier, appName;
stream >> modifier >> appName;
Config cfg( "autostart" );
@@ -810,124 +810,123 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
QString modifier, appName, delay;
stream >> modifier >> appName >> delay;
Config cfg( "autostart" );
cfg.setGroup( "AutoStart" );
if ( modifier.compare("add") == 0 ){
// only add it appname is entered
if (!appName.isEmpty()) {
cfg.writeEntry("Apps", appName);
cfg.writeEntry("Delay", delay);
}
} else {
}
- } else if ( msg == "sendCardInfo()" ) {
+ } else if ( msg == "sendCardInfo()" ) {
QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
const QList<FileSystem> &fs = storage->fileSystems();
- QListIterator<FileSystem> it ( fs );
- QString s;
- QString homeDir = getenv("HOME");
- QString hardDiskHome;
- for ( ; it.current(); ++it ) {
- if ( (*it)->isRemovable() )
- s += (*it)->name() + "=" + (*it)->path() + "/Documents "
- + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
- + " " + (*it)->options() + ";";
- else if ( (*it)->disk() == "/dev/mtdblock1" ||
- (*it)->disk() == "/dev/mtdblock/1" )
- s += (*it)->name() + "=" + homeDir + "/Documents "
- + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
- + " " + (*it)->options() + ";";
- else if ( (*it)->name().contains( "Hard Disk") &&
- homeDir.contains( (*it)->path() ) &&
- (*it)->path().length() > hardDiskHome.length() )
- hardDiskHome =
- (*it)->name() + "=" + homeDir + "/Documents "
- + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
- + " " + (*it)->options() + ";";
- }
- if ( !hardDiskHome.isEmpty() )
- s += hardDiskHome;
+ QListIterator<FileSystem> it ( fs );
+ QString s;
+ QString homeDir = getenv("HOME");
+ QString hardDiskHome;
+ for ( ; it.current(); ++it ) {
+ if ( (*it)->isRemovable() )
+ s += (*it)->name() + "=" + (*it)->path() + "/Documents "
+ + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
+ + " " + (*it)->options() + ";";
+ else if ( (*it)->disk() == "/dev/mtdblock1" ||
+ (*it)->disk() == "/dev/mtdblock/1" )
+ s += (*it)->name() + "=" + homeDir + "/Documents "
+ + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
+ + " " + (*it)->options() + ";";
+ else if ( (*it)->name().contains( "Hard Disk") &&
+ homeDir.contains( (*it)->path() ) &&
+ (*it)->path().length() > hardDiskHome.length() )
+ hardDiskHome =
+ (*it)->name() + "=" + homeDir + "/Documents "
+ + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
+ + " " + (*it)->options() + ";";
+ }
+ if ( !hardDiskHome.isEmpty() )
+ s += hardDiskHome;
- e << s;
+ e << s;
} else if ( msg == "sendSyncDate(QString)" ) {
- QString app;
- stream >> app;
- Config cfg( "qpe" );
- cfg.setGroup("SyncDate");
- QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
- e << app << cfg.readEntry( app );
- //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(),
- //cfg.readEntry( app ).latin1() );
+ QString app;
+ stream >> app;
+ Config cfg( "qpe" );
+ cfg.setGroup("SyncDate");
+ QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
+ e << app << cfg.readEntry( app );
+ //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(),
+ //cfg.readEntry( app ).latin1() );
} else if ( msg == "setSyncDate(QString,QString)" ) {
- QString app, date;
- stream >> app >> date;
- Config cfg( "qpe" );
- cfg.setGroup("SyncDate");
- cfg.writeEntry( app, date );
- //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1());
+ QString app, date;
+ stream >> app >> date;
+ Config cfg( "qpe" );
+ cfg.setGroup("SyncDate");
+ cfg.writeEntry( app, date );
+ //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1());
} else if ( msg == "startSync(QString)" ) {
- QString what;
- stream >> what;
- delete syncDialog; syncDialog = 0;
- syncDialog = new SyncDialog( this, "syncProgress", FALSE,
- WStyle_Tool | WStyle_Customize |
- Qt::WStyle_StaysOnTop );
- syncDialog->showMaximized();
- syncDialog->whatLabel->setText( "<b>" + what + "</b>" );
- connect( syncDialog->buttonCancel, SIGNAL( clicked() ),
- SLOT( cancelSync() ) );
- }
- else if ( msg == "stopSync()") {
- delete syncDialog; syncDialog = 0;
+ QString what;
+ stream >> what;
+ delete syncDialog; syncDialog = 0;
+ syncDialog = new SyncDialog( this, "syncProgress", FALSE,
+ WStyle_Tool | WStyle_Customize |
+ Qt::WStyle_StaysOnTop );
+ syncDialog->showMaximized();
+ syncDialog->whatLabel->setText( "<b>" + what + "</b>" );
+ connect( syncDialog->buttonCancel, SIGNAL( clicked() ),
+ SLOT( cancelSync() ) );
+ } else if ( msg == "stopSync()") {
+ delete syncDialog; syncDialog = 0;
} else if ( msg == "getAllDocLinks()" ) {
- loadDocs();
-
- QString contents;
-
- for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) {
- DocLnk *doc = it.current();
- QFileInfo fi( doc->file() );
- if ( !fi.exists() )
- continue;
-
- bool fake = !doc->linkFileKnown();
- if ( !fake ) {
- QFile f( doc->linkFile() );
- if ( f.open( IO_ReadOnly ) ) {
- QTextStream ts( &f );
- ts.setEncoding( QTextStream::UnicodeUTF8 );
- contents += ts.read();
- f.close();
- } else
- fake = TRUE;
- }
- if (fake) {
- contents += "[Desktop Entry]\n";
- contents += "Categories = " + Qtopia::Record::idsToString( doc->categories() ) + "\n";
- contents += "File = "+doc->file()+"\n";
- contents += "Name = "+doc->name()+"\n";
- contents += "Type = "+doc->type()+"\n";
- }
- contents += QString("Size = %1\n").arg( fi.size() );
- }
+ loadDocs();
+
+ QString contents;
+
+ for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) {
+ DocLnk *doc = it.current();
+ QFileInfo fi( doc->file() );
+ if ( !fi.exists() )
+ continue;
+
+ bool fake = !doc->linkFileKnown();
+ if ( !fake ) {
+ QFile f( doc->linkFile() );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ ts.setEncoding( QTextStream::UnicodeUTF8 );
+ contents += ts.read();
+ f.close();
+ } else
+ fake = TRUE;
+ }
+ if (fake) {
+ contents += "[Desktop Entry]\n";
+ contents += "Categories = " + Qtopia::Record::idsToString( doc->categories() ) + "\n";
+ contents += "File = "+doc->file()+"\n";
+ contents += "Name = "+doc->name()+"\n";
+ contents += "Type = "+doc->type()+"\n";
+ }
+ contents += QString("Size = %1\n").arg( fi.size() );
+ }
- //qDebug( "sending length %d", contents.length() );
- QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" );
- e << contents;
+ //qDebug( "sending length %d", contents.length() );
+ QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" );
+ e << contents;
- qDebug( "================ \n\n%s\n\n===============",
- contents.latin1() );
+ qDebug( "================ \n\n%s\n\n===============",
+ contents.latin1() );
- delete docsFolder;
- docsFolder = 0;
+ delete docsFolder;
+ docsFolder = 0;
}
}
void Launcher::cancelSync()
{
QCopEnvelope e( "QPE/Desktop", "cancelSync()" );
}
void Launcher::storageChanged()
{
if ( in_lnk_props ) {
got_lnk_change = TRUE;
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index 93bbcac..73de50d 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,14 +1,15 @@
0.3.4
+* "fill our business card now a clickable label"
* Several bugfixes regarding todo section.
0.3.3
* Changed the logo so it better scales to bigger display and also
made the "Today" string translatable.
* some am/pm fixes
* clickable labels now in libopie
0.3.2
* Autostart is now more configurable. You can decide how long
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 06cfa01..9e9d31f 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -126,31 +126,31 @@ void Today::setOwnerField(QString &message) {
}
/*
* Autostart, uses the new (opie only) autostart method in the launcher code.
* If registered against that today ist started on each resume.
*/
void Today::autoStart() {
Config cfg("today");
cfg.setGroup("Autostart");
int AUTOSTART = cfg.readNumEntry("autostart",1);
// qDebug(QString("%1").arg(AUTOSTART));
if (AUTOSTART) {
- QCopEnvelope e("QPE/System", "autoStart(QString, QString, QString)");
+ QCopEnvelope e("QPE/System", "autoStart(QString,QString,QString)");
e << QString("add");
e << QString("today");
e << AUTOSTART_TIMER;
} else {
qDebug("Nun in else bei autostart");
- QCopEnvelope e("QPE/System", "autoStart(QString, QString)");
+ QCopEnvelope e("QPE/System", "autoStart(QString,QString)");
e << QString("remove");
e << QString("today");
}
}
/*
* Repaint method. Reread all fields.
*/
void Today::draw() {
init();
getDates();
getMail();
@@ -412,32 +412,32 @@ void Today::getTodo() {
output = tr("There is <b> 1</b> active task: <br>" );
} else {
output = tr("There are <b> %1</b> active tasks: <br>").arg(count);
}
output += tmpout;
} else {
output = tr("No active tasks");
}
TodoField->setText(tr(output));
}
-
/*
* launch addressbook (personal card)
*/
void Today::editCard() {
QCopEnvelope w("QPE/System", "execute(QString)");
w << QString("addressbook");
+ // while( !QCopChannel::isRegistered("QPE/Addressbook"))
QCopEnvelope v("QPE/Addressbook", "editPersonalAndClose()");
}
/*
* launches datebook
*/
void Today::startDatebook() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("datebook");
}
/*