summaryrefslogtreecommitdiff
authorsandman <sandman>2002-12-30 15:12:34 (UTC)
committer sandman <sandman>2002-12-30 15:12:34 (UTC)
commit66bfb25fe226a69f1ca2218b56fb3df74409de2f (patch) (unidiff)
tree2350a583f4b663f1c92cc442145ea342b133e3c0
parenta0eca1c0925a6893fa8f3ebfacd6363f906189df (diff)
downloadopie-66bfb25fe226a69f1ca2218b56fb3df74409de2f.zip
opie-66bfb25fe226a69f1ca2218b56fb3df74409de2f.tar.gz
opie-66bfb25fe226a69f1ca2218b56fb3df74409de2f.tar.bz2
getting rid of some qDebugs to make the startup a bit more quiet
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/irserver.cpp6
-rw-r--r--core/launcher/launcherview.cpp1
2 files changed, 3 insertions, 4 deletions
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp
index 2147d0a..625cb60 100644
--- a/core/launcher/irserver.cpp
+++ b/core/launcher/irserver.cpp
@@ -1,52 +1,52 @@
1#include "irserver.h" 1#include "irserver.h"
2 2
3#include <qpe/qlibrary.h> 3#include <qpe/qlibrary.h>
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5 5
6#include <qtranslator.h> 6#include <qtranslator.h>
7#include <stdlib.h> 7#include <stdlib.h>
8 8
9#include "obexinterface.h" 9#include "obexinterface.h"
10 10
11#include <qdir.h> 11#include <qdir.h>
12 12
13IrServer::IrServer( QObject *parent, const char *name ) 13IrServer::IrServer( QObject *parent, const char *name )
14 : QObject( parent, name ) 14 : QObject( parent, name )
15{ 15{
16 lib = 0; 16 lib = 0;
17 iface = 0; 17 iface = 0;
18 QString path = QPEApplication::qpeDir() + "/plugins/obex/"; 18 QString path = QPEApplication::qpeDir() + "/plugins/obex/";
19 QDir dir( path, "lib*.so" ); 19 QDir dir( path, "lib*.so" );
20 QStringList list = dir.entryList(); 20 QStringList list = dir.entryList();
21 QStringList::Iterator it; 21 QStringList::Iterator it;
22 for ( it = list.begin(); it != list.end(); ++it ) { 22 for ( it = list.begin(); it != list.end(); ++it ) {
23 QLibrary *trylib = new QLibrary( path + *it ); 23 QLibrary *trylib = new QLibrary( path + *it );
24 qDebug("trying lib %s", (path + (*it)).latin1() ); 24 //qDebug("trying lib %s", (path + (*it)).latin1() );
25 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 25 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
26 lib = trylib; 26 lib = trylib;
27 qDebug("found obex lib" ); 27 //qDebug("found obex lib" );
28 QString lang = getenv( "LANG" ); 28 QString lang = getenv( "LANG" );
29 QTranslator * trans = new QTranslator(qApp); 29 QTranslator * trans = new QTranslator(qApp);
30 QString type = (*it).left( (*it).find(".") ); 30 QString type = (*it).left( (*it).find(".") );
31 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 31 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
32 qDebug("tr fpr obex: %s", tfn.latin1() ); 32 //qDebug("tr fpr obex: %s", tfn.latin1() );
33 if ( trans->load( tfn )) 33 if ( trans->load( tfn ))
34 qApp->installTranslator( trans ); 34 qApp->installTranslator( trans );
35 else 35 else
36 delete trans; 36 delete trans;
37 37
38 break; 38 break;
39 } else { 39 } else {
40 delete lib; 40 delete lib;
41 } 41 }
42 } 42 }
43 if ( !lib ) 43 if ( !lib )
44 qDebug("could not load IR plugin" ); 44 qDebug("could not load IR plugin" );
45} 45}
46 46
47IrServer::~IrServer() 47IrServer::~IrServer()
48{ 48{
49 if ( iface ) 49 if ( iface )
50 iface->release(); 50 iface->release();
51 delete lib; 51 delete lib;
52} 52}
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 95a1d4a..7117e0b 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -680,257 +680,256 @@ void LauncherView::updateTools()
680 for (QStringList::ConstIterator it = typelist.begin(); it!=typelist.end(); ++it) { 680 for (QStringList::ConstIterator it = typelist.begin(); it!=typelist.end(); ++it) {
681 QString t = *it; 681 QString t = *it;
682 if ( t.left(12) == "application/" ) { 682 if ( t.left(12) == "application/" ) {
683 MimeType mt(t); 683 MimeType mt(t);
684 const AppLnk* app = mt.application(); 684 const AppLnk* app = mt.application();
685 if ( app ) 685 if ( app )
686 t = app->name(); 686 t = app->name();
687 else 687 else
688 t = t.mid(12); 688 t = t.mid(12);
689 } else { 689 } else {
690 t[0] = t[0].upper(); 690 t[0] = t[0].upper();
691 } 691 }
692 types += tr("%1 files").arg(t); 692 types += tr("%1 files").arg(t);
693 } 693 }
694 types << tr("All types of file"); 694 types << tr("All types of file");
695 prev = typemb->currentText(); 695 prev = typemb->currentText();
696 typemb->clear(); 696 typemb->clear();
697 typemb->insertStringList(types); 697 typemb->insertStringList(types);
698 for (int i=0; i<typemb->count(); i++) { 698 for (int i=0; i<typemb->count(); i++) {
699 if ( typemb->text(i) == prev ) { 699 if ( typemb->text(i) == prev ) {
700 typemb->setCurrentItem(i); 700 typemb->setCurrentItem(i);
701 break; 701 break;
702 } 702 }
703 } 703 }
704 if ( prev.isNull() ) 704 if ( prev.isNull() )
705 typemb->setCurrentItem(typemb->count()-1); 705 typemb->setCurrentItem(typemb->count()-1);
706 706
707 Categories cats( 0 ); 707 Categories cats( 0 );
708 cats.load( categoryFileName() ); 708 cats.load( categoryFileName() );
709 QArray<int> vl( 0 ); 709 QArray<int> vl( 0 );
710 catmb->setCategories( vl, "Document View", // No tr 710 catmb->setCategories( vl, "Document View", // No tr
711 tr("Document View") ); 711 tr("Document View") );
712 catmb->setRemoveCategoryEdit( TRUE ); 712 catmb->setRemoveCategoryEdit( TRUE );
713 catmb->setAllCategories( TRUE ); 713 catmb->setAllCategories( TRUE );
714 714
715 connect(typemb, SIGNAL(activated(int)), this, SLOT(showType(int))); 715 connect(typemb, SIGNAL(activated(int)), this, SLOT(showType(int)));
716 connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int))); 716 connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int)));
717} 717}
718 718
719void LauncherView::sortBy(int s) 719void LauncherView::sortBy(int s)
720{ 720{
721 icons->setSortMethod((LauncherIconView::SortMethod)s); 721 icons->setSortMethod((LauncherIconView::SortMethod)s);
722} 722}
723 723
724void LauncherView::showType(int t) 724void LauncherView::showType(int t)
725{ 725{
726 if ( t >= (int)typelist.count() ) { 726 if ( t >= (int)typelist.count() ) {
727 icons->setTypeFilter("",TRUE); 727 icons->setTypeFilter("",TRUE);
728 } else { 728 } else {
729 QString ty = typelist[t]; 729 QString ty = typelist[t];
730 if ( !ty.contains('/') ) 730 if ( !ty.contains('/') )
731 ty += "/*"; 731 ty += "/*";
732 icons->setTypeFilter(ty,TRUE); 732 icons->setTypeFilter(ty,TRUE);
733 } 733 }
734} 734}
735 735
736void LauncherView::showCategory( int c ) 736void LauncherView::showCategory( int c )
737{ 737{
738 icons->setCategoryFilter( c, TRUE ); 738 icons->setCategoryFilter( c, TRUE );
739} 739}
740 740
741void LauncherView::setViewMode( ViewMode m ) 741void LauncherView::setViewMode( ViewMode m )
742{ 742{
743 if ( vmode != m ) { 743 if ( vmode != m ) {
744 bool bigIcons = m == Icon; 744 bool bigIcons = m == Icon;
745 icons->viewport()->setUpdatesEnabled( FALSE ); 745 icons->viewport()->setUpdatesEnabled( FALSE );
746 icons->setBigIcons( bigIcons ); 746 icons->setBigIcons( bigIcons );
747 switch ( m ) { 747 switch ( m ) {
748 case List: 748 case List:
749 icons->setItemTextPos( QIconView::Right ); 749 icons->setItemTextPos( QIconView::Right );
750 break; 750 break;
751 case Icon: 751 case Icon:
752 icons->setItemTextPos( QIconView::Bottom ); 752 icons->setItemTextPos( QIconView::Bottom );
753 break; 753 break;
754 } 754 }
755 icons->hideOrShowItems( FALSE ); 755 icons->hideOrShowItems( FALSE );
756 icons->viewport()->setUpdatesEnabled( TRUE ); 756 icons->viewport()->setUpdatesEnabled( TRUE );
757 vmode = m; 757 vmode = m;
758 } 758 }
759} 759}
760 760
761void LauncherView::setBackgroundType( BackgroundType t, const QString &val ) 761void LauncherView::setBackgroundType( BackgroundType t, const QString &val )
762{ 762{
763 if ( !bgCache ) 763 if ( !bgCache )
764 bgCache = new QMap<QString,BgPixmap*>; 764 bgCache = new QMap<QString,BgPixmap*>;
765 if ( bgCache->contains( bgName ) ) 765 if ( bgCache->contains( bgName ) )
766 (*bgCache)[bgName]->ref--; 766 (*bgCache)[bgName]->ref--;
767 767
768 switch ( t ) { 768 switch ( t ) {
769 case Ruled: { 769 case Ruled: {
770 bgName = QString("Ruled_%1").arg(colorGroup().background().name()); // No tr 770 bgName = QString("Ruled_%1").arg(colorGroup().background().name()); // No tr
771 QPixmap bg; 771 QPixmap bg;
772 if ( bgCache->contains( bgName ) ) { 772 if ( bgCache->contains( bgName ) ) {
773 (*bgCache)[bgName]->ref++; 773 (*bgCache)[bgName]->ref++;
774 bg = (*bgCache)[bgName]->pm; 774 bg = (*bgCache)[bgName]->pm;
775 } else { 775 } else {
776 bg.resize( width(), 9 ); 776 bg.resize( width(), 9 );
777 QPainter painter( &bg ); 777 QPainter painter( &bg );
778 for ( int i = 0; i < 3; i++ ) { 778 for ( int i = 0; i < 3; i++ ) {
779 painter.setPen( white ); 779 painter.setPen( white );
780 painter.drawLine( 0, i*3, width()-1, i*3 ); 780 painter.drawLine( 0, i*3, width()-1, i*3 );
781 painter.drawLine( 0, i*3+1, width()-1, i*3+1 ); 781 painter.drawLine( 0, i*3+1, width()-1, i*3+1 );
782 painter.setPen( colorGroup().background().light(105) ); 782 painter.setPen( colorGroup().background().light(105) );
783 painter.drawLine( 0, i*3+2, width()-1, i*3+2 ); 783 painter.drawLine( 0, i*3+2, width()-1, i*3+2 );
784 } 784 }
785 painter.end(); 785 painter.end();
786 bgCache->insert( bgName, new BgPixmap(bg) ); 786 bgCache->insert( bgName, new BgPixmap(bg) );
787 } 787 }
788 icons->setBackgroundPixmap( bg ); 788 icons->setBackgroundPixmap( bg );
789 break; 789 break;
790 } 790 }
791 791
792 case SolidColor: 792 case SolidColor:
793 icons->setBackgroundPixmap( QPixmap() ); 793 icons->setBackgroundPixmap( QPixmap() );
794 if ( val.isEmpty() ) { 794 if ( val.isEmpty() ) {
795 icons->setBackgroundColor( colorGroup().base() ); 795 icons->setBackgroundColor( colorGroup().base() );
796 } else { 796 } else {
797 icons->setBackgroundColor( val ); 797 icons->setBackgroundColor( val );
798 } 798 }
799 bgName = ""; 799 bgName = "";
800 break; 800 break;
801 801
802 case Image: 802 case Image:
803 bgName = val; 803 bgName = val;
804 if ( bgCache->contains( bgName ) ) { 804 if ( bgCache->contains( bgName ) ) {
805 (*bgCache)[bgName]->ref++; 805 (*bgCache)[bgName]->ref++;
806 icons->setBackgroundPixmap( (*bgCache)[bgName]->pm ); 806 icons->setBackgroundPixmap( (*bgCache)[bgName]->pm );
807 } else { 807 } else {
808 qDebug( "Loading image: %s", val.latin1() );
809 QPixmap bg( Resource::loadPixmap( val ) ); 808 QPixmap bg( Resource::loadPixmap( val ) );
810 if ( bg.isNull() ) { 809 if ( bg.isNull() ) {
811 QImageIO imgio; 810 QImageIO imgio;
812 imgio.setFileName( bgName ); 811 imgio.setFileName( bgName );
813 QSize ds = qApp->desktop()->size(); 812 QSize ds = qApp->desktop()->size();
814 QString param( "Scale( %1, %2, ScaleMin )" ); // No tr 813 QString param( "Scale( %1, %2, ScaleMin )" ); // No tr
815 imgio.setParameters( param.arg(ds.width()).arg(ds.height()).latin1() ); 814 imgio.setParameters( param.arg(ds.width()).arg(ds.height()).latin1() );
816 imgio.read(); 815 imgio.read();
817 bg = imgio.image(); 816 bg = imgio.image();
818 } 817 }
819 bgCache->insert( bgName, new BgPixmap(bg) ); 818 bgCache->insert( bgName, new BgPixmap(bg) );
820 icons->setBackgroundPixmap( bg ); 819 icons->setBackgroundPixmap( bg );
821 } 820 }
822 break; 821 break;
823 } 822 }
824 823
825 // remove unreferenced backgrounds. 824 // remove unreferenced backgrounds.
826 QMap<QString,BgPixmap*>::Iterator it = bgCache->begin(); 825 QMap<QString,BgPixmap*>::Iterator it = bgCache->begin();
827 while ( it != bgCache->end() ) { 826 while ( it != bgCache->end() ) {
828 QMap<QString,BgPixmap*>::Iterator curr = it; 827 QMap<QString,BgPixmap*>::Iterator curr = it;
829 ++it; 828 ++it;
830 if ( (*curr)->ref == 0 ) { 829 if ( (*curr)->ref == 0 ) {
831 delete (*curr); 830 delete (*curr);
832 bgCache->remove( curr ); 831 bgCache->remove( curr );
833 } 832 }
834 } 833 }
835 834
836 bgType = t; 835 bgType = t;
837 icons->viewport()->update(); 836 icons->viewport()->update();
838} 837}
839 838
840void LauncherView::setTextColor( const QColor &tc ) 839void LauncherView::setTextColor( const QColor &tc )
841{ 840{
842 textCol = tc; 841 textCol = tc;
843 QColorGroup cg = icons->colorGroup(); 842 QColorGroup cg = icons->colorGroup();
844 cg.setColor( QColorGroup::Text, tc ); 843 cg.setColor( QColorGroup::Text, tc );
845 icons->setPalette( QPalette(cg,cg,cg) ); 844 icons->setPalette( QPalette(cg,cg,cg) );
846 icons->viewport()->update(); 845 icons->viewport()->update();
847} 846}
848 847
849void LauncherView::setViewFont( const QFont &f ) 848void LauncherView::setViewFont( const QFont &f )
850{ 849{
851 icons->setFont( f ); 850 icons->setFont( f );
852} 851}
853 852
854void LauncherView::unsetViewFont( ) 853void LauncherView::unsetViewFont( )
855{ 854{
856 icons->unsetFont( ); 855 icons->unsetFont( );
857} 856}
858 857
859void LauncherView::resizeEvent(QResizeEvent *e) 858void LauncherView::resizeEvent(QResizeEvent *e)
860{ 859{
861 QVBox::resizeEvent( e ); 860 QVBox::resizeEvent( e );
862 if ( e->size().width() != e->oldSize().width() ) 861 if ( e->size().width() != e->oldSize().width() )
863 sort(); 862 sort();
864} 863}
865 864
866void LauncherView::populate( AppLnkSet *folder, const QString& typefilter ) 865void LauncherView::populate( AppLnkSet *folder, const QString& typefilter )
867{ 866{
868 icons->clear(); 867 icons->clear();
869 internalPopulate( folder, typefilter ); 868 internalPopulate( folder, typefilter );
870} 869}
871 870
872QString LauncherView::getAllDocLinkInfo() const 871QString LauncherView::getAllDocLinkInfo() const
873{ 872{
874 return icons->getAllDocLinkInfo(); 873 return icons->getAllDocLinkInfo();
875} 874}
876 875
877void LauncherView::selectionChanged() 876void LauncherView::selectionChanged()
878{ 877{
879 QIconViewItem* item = icons->currentItem(); 878 QIconViewItem* item = icons->currentItem();
880 if ( item && item->isSelected() ) { 879 if ( item && item->isSelected() ) {
881 AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); 880 AppLnk *appLnk = ((LauncherItem *)item)->appLnk();
882 if ( icons->inKeyEvent() ) // not for mouse press 881 if ( icons->inKeyEvent() ) // not for mouse press
883 emit clicked( appLnk ); 882 emit clicked( appLnk );
884 item->setSelected(FALSE); 883 item->setSelected(FALSE);
885 } 884 }
886} 885}
887 886
888void LauncherView::returnPressed( QIconViewItem *item ) 887void LauncherView::returnPressed( QIconViewItem *item )
889{ 888{
890 if ( item ) { 889 if ( item ) {
891 AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); 890 AppLnk *appLnk = ((LauncherItem *)item)->appLnk();
892 emit clicked( appLnk ); 891 emit clicked( appLnk );
893 } 892 }
894} 893}
895 894
896void LauncherView::itemClicked( int btn, QIconViewItem *item ) 895void LauncherView::itemClicked( int btn, QIconViewItem *item )
897{ 896{
898 if ( item ) { 897 if ( item ) {
899 AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); 898 AppLnk *appLnk = ((LauncherItem *)item)->appLnk();
900 if ( btn == LeftButton ) { 899 if ( btn == LeftButton ) {
901 // Make sure it's the item we execute that gets highlighted 900 // Make sure it's the item we execute that gets highlighted
902 icons->setCurrentItem( item ); 901 icons->setCurrentItem( item );
903 emit clicked( appLnk ); 902 emit clicked( appLnk );
904 } 903 }
905 item->setSelected(FALSE); 904 item->setSelected(FALSE);
906 } 905 }
907} 906}
908 907
909void LauncherView::itemPressed( int btn, QIconViewItem *item ) 908void LauncherView::itemPressed( int btn, QIconViewItem *item )
910{ 909{
911 if ( item ) { 910 if ( item ) {
912 AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); 911 AppLnk *appLnk = ((LauncherItem *)item)->appLnk();
913 if ( btn == RightButton ) 912 if ( btn == RightButton )
914 emit rightPressed( appLnk ); 913 emit rightPressed( appLnk );
915/* 914/*
916 else if ( btn == LeftButton ) 915 else if ( btn == LeftButton )
917 emit clicked( appLnk ); 916 emit clicked( appLnk );
918*/ 917*/
919 item->setSelected(FALSE); 918 item->setSelected(FALSE);
920 } 919 }
921} 920}
922 921
923void LauncherView::internalPopulate( AppLnkSet *folder, const QString& typefilter ) 922void LauncherView::internalPopulate( AppLnkSet *folder, const QString& typefilter )
924{ 923{
925 QListIterator<AppLnk> it( folder->children() ); 924 QListIterator<AppLnk> it( folder->children() );
926 icons->setTypeFilter(typefilter,FALSE); 925 icons->setTypeFilter(typefilter,FALSE);
927 926
928 while ( it.current() ) { 927 while ( it.current() ) {
929 // show only the icons for existing files 928 // show only the icons for existing files
930 if (QFile(it.current()->file()).exists() || ( it.current()->file().left(4) == "http" )) { 929 if (QFile(it.current()->file()).exists() || ( it.current()->file().left(4) == "http" )) {
931 icons->addItem(*it,FALSE); 930 icons->addItem(*it,FALSE);
932 } 931 }
933 else { 932 else {
934 //maybe insert some .desktop file deletion code later 933 //maybe insert some .desktop file deletion code later
935 //maybe dir specific 934 //maybe dir specific
936 } 935 }