summaryrefslogtreecommitdiff
path: root/core/launcher/documentlist.cpp
Unidiff
Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp46
1 files changed, 24 insertions, 22 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 3e0a96c..92b8c25 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -22,6 +22,7 @@
22#include "mediadlg.h" 22#include "mediadlg.h"
23 23
24/* OPIE */
24#include <opie2/oglobal.h> 25#include <opie2/oglobal.h>
25 26#include <opie2/odebug.h>
26#include <qtopia/config.h> 27#include <qtopia/config.h>
27#include <qtopia/mimetype.h> 28#include <qtopia/mimetype.h>
@@ -34,5 +35,7 @@
34#include <qtopia/qcopenvelope_qws.h> 35#include <qtopia/qcopenvelope_qws.h>
35#endif 36#endif
37using namespace Opie::Core;
36 38
39/* QT */
37#include <qtimer.h> 40#include <qtimer.h>
38#include <qfileinfo.h> 41#include <qfileinfo.h>
@@ -48,5 +51,4 @@
48 51
49 52
50using namespace Opie::Core;
51AppLnkSet *DocumentList::appLnkSet = 0; 53AppLnkSet *DocumentList::appLnkSet = 0;
52 54
@@ -109,5 +111,5 @@ DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/,
109 cfg.setGroup( "DocTab" ); 111 cfg.setGroup( "DocTab" );
110 d->scanDocs = cfg.readBoolEntry( "Enable", true ); 112 d->scanDocs = cfg.readBoolEntry( "Enable", true );
111 qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); 113 odebug << "DocumentList::DocumentList() : scanDocs = " << d->scanDocs << "" << oendl;
112 114
113 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); 115 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
@@ -142,5 +144,5 @@ void DocumentList::start()
142void DocumentList::pause() 144void DocumentList::pause()
143{ 145{
144 //qDebug("pause %i", d->tid); 146 //odebug << "pause " << d->tid << "" << oendl;
145 killTimer( d->tid ); 147 killTimer( d->tid );
146 d->tid = 0; 148 d->tid = 0;
@@ -152,5 +154,5 @@ void DocumentList::resume()
152 if ( d->tid == 0 ) { 154 if ( d->tid == 0 ) {
153 d->tid = startTimer( 20 ); 155 d->tid = startTimer( 20 );
154 //qDebug("resumed %i", d->tid); 156 //odebug << "resumed " << d->tid << "" << oendl;
155 } 157 }
156} 158}
@@ -178,5 +180,5 @@ void DocumentList::resendWorker()
178void DocumentList::rescan() 180void DocumentList::rescan()
179{ 181{
180 //qDebug("rescan"); 182 //odebug << "rescan" << oendl;
181 pause(); 183 pause();
182 d->initialize(); 184 d->initialize();
@@ -233,5 +235,5 @@ void DocumentList::reloadAppLnks()
233 } 235 }
234 236
235 //qDebug("adding type %s", (*ittypes).latin1()); 237 //odebug << "adding type " << (*ittypes) << "" << oendl;
236 238
237 // ### our current launcher expects docs tab to be last 239 // ### our current launcher expects docs tab to be last
@@ -242,5 +244,5 @@ void DocumentList::reloadAppLnks()
242 } 244 }
243 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) { 245 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) {
244 //qDebug("removing type %s", (*ittypes).latin1()); 246 //odebug << "removing type " << (*ittypes) << "" << oendl;
245 d->serverGui->typeRemoved(*ittypes); 247 d->serverGui->typeRemoved(*ittypes);
246 } 248 }
@@ -275,5 +277,5 @@ void DocumentList::reloadDocLnks()
275void DocumentList::linkChanged( QString arg ) 277void DocumentList::linkChanged( QString arg )
276{ 278{
277 //qDebug( "linkchanged( %s )", arg.latin1() ); 279 //odebug << "linkchanged( " << arg << " )" << oendl;
278 280
279 if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) { 281 if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) {
@@ -288,5 +290,5 @@ void DocumentList::linkChanged( QString arg )
288 if ( ( doc->linkFileKnown() && doc->linkFile() == arg ) 290 if ( ( doc->linkFileKnown() && doc->linkFile() == arg )
289 || ( doc->fileKnown() && doc->file() == arg ) ) { 291 || ( doc->fileKnown() && doc->file() == arg ) ) {
290 //qDebug( "found old link" ); 292 //odebug << "found old link" << oendl;
291 DocLnk* dl = new DocLnk( arg ); 293 DocLnk* dl = new DocLnk( arg );
292 // add new one if it exists and matches the mimetype 294 // add new one if it exists and matches the mimetype
@@ -294,5 +296,5 @@ void DocumentList::linkChanged( QString arg )
294 // Existing link has been changed, send old link ref and a ref 296 // Existing link has been changed, send old link ref and a ref
295 // to the new link 297 // to the new link
296 //qDebug( "change case" ); 298 //odebug << "change case" << oendl;
297 if ( d->serverGui ) 299 if ( d->serverGui )
298 d->serverGui->documentChanged( *doc, *dl ); 300 d->serverGui->documentChanged( *doc, *dl );
@@ -301,5 +303,5 @@ void DocumentList::linkChanged( QString arg )
301 // Link has been removed or doesn't match the mimetypes any more 303 // Link has been removed or doesn't match the mimetypes any more
302 // so we aren't interested in it, so take it away from the list 304 // so we aren't interested in it, so take it away from the list
303 //qDebug( "removal case" ); 305 //odebug << "removal case" << oendl;
304 if ( d->serverGui ) 306 if ( d->serverGui )
305 d->serverGui->documentRemoved( *doc ); 307 d->serverGui->documentRemoved( *doc );
@@ -315,5 +317,5 @@ void DocumentList::linkChanged( QString arg )
315 if ( d->store( dl ) ) { 317 if ( d->store( dl ) ) {
316 // Add if it's a link we are interested in 318 // Add if it's a link we are interested in
317 //qDebug( "add case" ); 319 //odebug << "add case" << oendl;
318 add( *dl ); 320 add( *dl );
319 } 321 }
@@ -379,10 +381,10 @@ void DocumentList::sendAllDocLinks()
379 } 381 }
380 382
381 //qDebug( "sending length %d", contents.length() ); 383 //odebug << "sending length " << contents.length() << "" << oendl;
382#ifndef QT_NO_COP 384#ifndef QT_NO_COP
383 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); 385 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" );
384 e << contents; 386 e << contents;
385#endif 387#endif
386 //qDebug( "================ \n\n%s\n\n===============", contents.latin1() ); 388 //odebug << "================ \n\n" << contents << "\n\n===============" << oendl;
387 389
388 d->needToSendAllDocLinks = false; 390 d->needToSendAllDocLinks = false;
@@ -537,5 +539,5 @@ void DocumentListPrivate::estimatedPercentScanned()
537 } 539 }
538 540
539 // qDebug( "overallProgress: %f", overallProgress ); 541 // odebug << "overallProgress: " << overallProgress << "" << oendl;
540 542
541 if ( serverGui ) 543 if ( serverGui )
@@ -554,5 +556,5 @@ const QString DocumentListPrivate::nextFile()
554 } else { 556 } else {
555 QDir dir( docPaths[docPathsSearched] ); 557 QDir dir( docPaths[docPathsSearched] );
556 // qDebug("now using base path: %s", docPaths[docPathsSearched].latin1() ); 558 // odebug << "now using base path: " << docPaths[docPathsSearched] << "" << oendl;
557 docPathsSearched++; 559 docPathsSearched++;
558 if ( !dir.exists( ".Qtopia-ignore" ) ) { 560 if ( !dir.exists( ".Qtopia-ignore" ) ) {
@@ -588,5 +590,5 @@ const QString DocumentListPrivate::nextFile()
588 // go down a depth 590 // go down a depth
589 QDir dir( fi->filePath() ); 591 QDir dir( fi->filePath() );
590 // qDebug("now going in to path: %s", bn.latin1() ); 592 // odebug << "now going in to path: " << bn << "" << oendl;
591 if ( !dir.exists( ".Qtopia-ignore" ) ) { 593 if ( !dir.exists( ".Qtopia-ignore" ) ) {
592 if ( searchDepth < MAX_SEARCH_DEPTH - 1) { 594 if ( searchDepth < MAX_SEARCH_DEPTH - 1) {
@@ -629,5 +631,5 @@ const DocLnk *DocumentListPrivate::iterate()
629{ 631{
630 if ( state == Find ) { 632 if ( state == Find ) {
631 //qDebug("state Find"); 633 //odebug << "state Find" << oendl;
632 QString file = nextFile(); 634 QString file = nextFile();
633 while ( !file.isNull() ) { 635 while ( !file.isNull() ) {
@@ -651,5 +653,5 @@ const DocLnk *DocumentListPrivate::iterate()
651 653
652 if ( state == RemoveKnownFiles ) { 654 if ( state == RemoveKnownFiles ) {
653 //qDebug("state RemoveKnownFiles"); 655 //odebug << "state RemoveKnownFiles" << oendl;
654 const QList<DocLnk> &list = dls.children(); 656 const QList<DocLnk> &list = dls.children();
655 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) { 657 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) {
@@ -665,5 +667,5 @@ const DocLnk *DocumentListPrivate::iterate()
665 667
666 if ( state == MakeUnknownFiles ) { 668 if ( state == MakeUnknownFiles ) {
667 //qDebug("state MakeUnknownFiles"); 669 //odebug << "state MakeUnknownFiles" << oendl;
668 for (void* c; (c=dit->current()); ++(*dit) ) { 670 for (void* c; (c=dit->current()); ++(*dit) ) {
669 if ( c == MAGIC_NUMBER ) { 671 if ( c == MAGIC_NUMBER ) {
@@ -688,5 +690,5 @@ const DocLnk *DocumentListPrivate::iterate()
688 } 690 }
689 691
690 //qDebug("state Done"); 692 //odebug << "state Done" << oendl;
691 return NULL; 693 return NULL;
692} 694}