summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-09 20:19:53 (UTC)
committer alwin <alwin>2004-11-09 20:19:53 (UTC)
commitc7b97ac140de31282dba2463a00f434c7a5bba69 (patch) (unidiff)
tree3be0a497f30d2265359e99dbc0951ab0b594e865
parent439b89dbda8afb2deeb0461dcd249a3e80131825 (diff)
downloadopie-c7b97ac140de31282dba2463a00f434c7a5bba69.zip
opie-c7b97ac140de31282dba2463a00f434c7a5bba69.tar.gz
opie-c7b97ac140de31282dba2463a00f434c7a5bba69.tar.bz2
- removed code which let qpe crash when generating image icons
- when edit properties of an document item it will reread the table of categories
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp18
-rw-r--r--core/launcher/launcherview.cpp127
-rw-r--r--core/launcher/launcherview.h1
3 files changed, 70 insertions, 76 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 010a2e9..5ec1cf8 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -359,8 +359,8 @@ void LauncherTabWidget::setBusy(bool on)
359 for ( int i = 0; i < categoryBar->count(); i++ ) { 359 for ( int i = 0; i < categoryBar->count(); i++ ) {
360 if (categoryBar->tab(i)) { 360 if (categoryBar->tab(i)) {
361 LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view; 361 LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view;
362 view->setBusy( FALSE ); 362 view->setBusy( FALSE );
363 } else { 363 } else {
364 odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl; 364 odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl;
365 } 365 }
366 } 366 }
@@ -603,5 +603,7 @@ void Launcher::properties( AppLnk *appLnk )
603/* ### libqtopia FIXME also moving docLnks... */ 603/* ### libqtopia FIXME also moving docLnks... */
604 LnkProperties prop(appLnk,0 ); 604 LnkProperties prop(appLnk,0 );
605 605
606 QPEApplication::execDialog( &prop ); 606 if (QPEApplication::execDialog( &prop )==QDialog::Accepted && tabs->currentView()==tabs->docView()) {
607 tabs->docView()->updateTools();
608 }
607 } 609 }
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 72313e3..ff26133 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -133,3 +133,3 @@ LauncherItem::~LauncherItem()
133 if ( liv->busyItem() == this ) 133 if ( liv->busyItem() == this )
134 liv->setBusy(FALSE); 134 liv->setBusy(FALSE);
135 delete app; 135 delete app;
@@ -278,2 +278,3 @@ LauncherIconView::~LauncherIconView()
278{ 278{
279 odebug << "LauncherIconView::~LauncherIconView()" << oendl;
279#if 0 // debuggery 280#if 0 // debuggery
@@ -431,10 +432,3 @@ void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,in
431 if (s!=width) return; 432 if (s!=width) return;
432 LauncherItem*item = 0; 433 LauncherItem*item = findDocItem(aFile);
433 QMap<QString,LauncherItem*>::Iterator it;
434 if ( ( it = m_itemCache.find(aFile))!=m_itemCache.end()) {
435 item = it.data();
436 m_itemCache.remove(it);
437 } else {
438 item = findDocItem(aFile);
439 }
440 if (!item||!item->isEyeImage()) return; 434 if (!item||!item->isEyeImage()) return;
@@ -467,3 +461,2 @@ void LauncherIconView::requestEyePix(const LauncherItem*item)
467 int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); 461 int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize();
468 m_itemCache[item->appLnk()->file()]=(LauncherItem*)item;
469 m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s); 462 m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s);
@@ -478,3 +471,2 @@ void LauncherIconView::stopEyeTimer()
478 } 471 }
479 m_itemCache.clear();
480 m_eyeTimer.stop(); 472 m_eyeTimer.stop();
@@ -704,19 +696,16 @@ void LauncherView::setToolsEnabled(bool y)
704 if ( !y != !tools ) { 696 if ( !y != !tools ) {
705 if ( y ) { 697 if ( y ) {
706 tools = new QHBox(this); 698 tools = new QHBox(this);
707 699 // Type filter
708 // Type filter 700 typemb = new QComboBox(tools);
709 typemb = new QComboBox(tools); 701 QSizePolicy p = typemb->sizePolicy();
710 QSizePolicy p = typemb->sizePolicy(); 702 p.setHorData(QSizePolicy::Expanding);
711 p.setHorData(QSizePolicy::Expanding); 703 typemb->setSizePolicy(p);
712 typemb->setSizePolicy(p); 704 // Category filter
713 705 updateTools();
714 // Category filter 706 tools->show();
715 updateTools(); 707 } else {
716 tools->show(); 708 delete tools;
717 709 tools = 0;
718 } else { 710 }
719 delete tools;
720 tools = 0;
721 }
722 } 711 }
@@ -728,4 +717,5 @@ void LauncherView::updateTools()
728 this, SLOT(showType(int)) ); 717 this, SLOT(showType(int)) );
729 if ( catmb ) disconnect( catmb, SIGNAL(signalSelected(int)), 718 if ( catmb ) {
730 this, SLOT(showCategory(int)) ); 719 disconnect( catmb, SIGNAL(signalSelected(int)),this,SLOT(showCategory(int)));
720 }
731 721
@@ -740,14 +730,14 @@ void LauncherView::updateTools()
740 for (QStringList::ConstIterator it = typelist.begin(); it!=typelist.end(); ++it) { 730 for (QStringList::ConstIterator it = typelist.begin(); it!=typelist.end(); ++it) {
741 QString t = *it; 731 QString t = *it;
742 if ( t.left(12) == "application/" ) { 732 if ( t.left(12) == "application/" ) {
743 MimeType mt(t); 733 MimeType mt(t);
744 const AppLnk* app = mt.application(); 734 const AppLnk* app = mt.application();
745 if ( app ) 735 if ( app )
746 t = app->name(); 736 t = app->name();
747 else 737 else
748 t = t.mid(12); 738 t = t.mid(12);
749 } else { 739 } else {
750 t[0] = t[0].upper(); 740 t[0] = t[0].upper();
751 } 741 }
752 types += t; 742 types += t;
753 } 743 }
@@ -758,9 +748,10 @@ void LauncherView::updateTools()
758 for (int i=0; i<typemb->count(); i++) { 748 for (int i=0; i<typemb->count(); i++) {
759 if ( typemb->text(i) == prev ) { 749 if ( typemb->text(i) == prev ) {
760 typemb->setCurrentItem(i); 750 typemb->setCurrentItem(i);
761 break; 751 break;
752 }
762 } 753 }
754 if ( prev.isNull() ) {
755 typemb->setCurrentItem(typemb->count()-1);
763 } 756 }
764 if ( prev.isNull() )
765 typemb->setCurrentItem(typemb->count()-1);
766 757
@@ -768,3 +759,3 @@ void LauncherView::updateTools()
768 if ( !catmb ) 759 if ( !catmb )
769 catmb = new CategorySelect(tools); 760 catmb = new CategorySelect(tools);
770 Categories cats( 0 ); 761 Categories cats( 0 );
@@ -773,3 +764,3 @@ void LauncherView::updateTools()
773 catmb->setCategories( vl, "Document View", // No tr 764 catmb->setCategories( vl, "Document View", // No tr
774 tr("Document View") ); 765 tr("Document View") );
775 catmb->setRemoveCategoryEdit( TRUE ); 766 catmb->setRemoveCategoryEdit( TRUE );
@@ -780,3 +771,3 @@ void LauncherView::updateTools()
780 if ( typemb->currentText() != prev ) 771 if ( typemb->currentText() != prev )
781 showType( typemb->currentItem() ); 772 showType( typemb->currentItem() );
782 773
@@ -794,8 +785,8 @@ void LauncherView::showType(int t)
794 if ( t >= (int)typelist.count() ) { 785 if ( t >= (int)typelist.count() ) {
795 icons->setTypeFilter("",TRUE); 786 icons->setTypeFilter("",TRUE);
796 } else { 787 } else {
797 QString ty = typelist[t]; 788 QString ty = typelist[t];
798 if ( !ty.contains('/') ) 789 if ( !ty.contains('/') )
799 ty += "/*"; 790 ty += "/*";
800 icons->setTypeFilter(ty,TRUE); 791 icons->setTypeFilter(ty,TRUE);
801 } 792 }
@@ -810,17 +801,18 @@ void LauncherView::setViewMode( ViewMode m )
810{ 801{
802 odebug << "LauncherView::setViewMode( ViewMode m )" << oendl;
811 if ( vmode != m ) { 803 if ( vmode != m ) {
812 bool bigIcons = m == Icon; 804 bool bigIcons = m == Icon;
813 icons->viewport()->setUpdatesEnabled( FALSE ); 805 icons->viewport()->setUpdatesEnabled( FALSE );
814 icons->setBigIcons( bigIcons ); 806 icons->setBigIcons( bigIcons );
815 switch ( m ) { 807 switch ( m ) {
816 case List: 808 case List:
817 icons->setItemTextPos( QIconView::Right ); 809 icons->setItemTextPos( QIconView::Right );
818 break; 810 break;
819 case Icon: 811 case Icon:
820 icons->setItemTextPos( QIconView::Bottom ); 812 icons->setItemTextPos( QIconView::Bottom );
821 break; 813 break;
822 } 814 }
823 icons->hideOrShowItems( FALSE ); 815 icons->hideOrShowItems( FALSE );
824 icons->viewport()->setUpdatesEnabled( TRUE ); 816 icons->viewport()->setUpdatesEnabled( TRUE );
825 vmode = m; 817 vmode = m;
826 } 818 }
@@ -1048,2 +1040,3 @@ void LauncherView::removeAllItems()
1048{ 1040{
1041 odebug << "LauncherView::removeAllItems()" << oendl;
1049 icons->clear(); 1042 icons->clear();
@@ -1170,3 +1163,3 @@ void LauncherThumbReceiver::requestThumb(const QString&file,int width,int height
1170 m_inThumbNail.append(rItem); 1163 m_inThumbNail.append(rItem);
1171 QTimer::singleShot(0, this, SLOT(sendRequest())); 1164 QTimer::singleShot(2, this, SLOT(sendRequest()));
1172} 1165}
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index 94c367c..6d94539 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -242,3 +242,2 @@ private:
242 QTimer m_eyeTimer; 242 QTimer m_eyeTimer;
243 QMap<QString,LauncherItem*> m_itemCache;
244}; 243};