summaryrefslogtreecommitdiff
Side-by-side diff
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)
for ( int i = 0; i < categoryBar->count(); i++ ) {
- if (categoryBar->tab(i)) {
- LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view;
- view->setBusy( FALSE );
- } else {
- odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl;
- }
+ if (categoryBar->tab(i)) {
+ LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view;
+ view->setBusy( FALSE );
+ } else {
+ odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl;
+ }
}
@@ -603,5 +603,7 @@ void Launcher::properties( AppLnk *appLnk )
/* ### libqtopia FIXME also moving docLnks... */
- LnkProperties prop(appLnk,0 );
+ LnkProperties prop(appLnk,0 );
- QPEApplication::execDialog( &prop );
+ if (QPEApplication::execDialog( &prop )==QDialog::Accepted && tabs->currentView()==tabs->docView()) {
+ tabs->docView()->updateTools();
+ }
}
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()
if ( liv->busyItem() == this )
- liv->setBusy(FALSE);
+ liv->setBusy(FALSE);
delete app;
@@ -278,2 +278,3 @@ LauncherIconView::~LauncherIconView()
{
+ odebug << "LauncherIconView::~LauncherIconView()" << oendl;
#if 0 // debuggery
@@ -431,10 +432,3 @@ void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,in
if (s!=width) return;
- LauncherItem*item = 0;
- QMap<QString,LauncherItem*>::Iterator it;
- if ( ( it = m_itemCache.find(aFile))!=m_itemCache.end()) {
- item = it.data();
- m_itemCache.remove(it);
- } else {
- item = findDocItem(aFile);
- }
+ LauncherItem*item = findDocItem(aFile);
if (!item||!item->isEyeImage()) return;
@@ -467,3 +461,2 @@ void LauncherIconView::requestEyePix(const LauncherItem*item)
int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize();
- m_itemCache[item->appLnk()->file()]=(LauncherItem*)item;
m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s);
@@ -478,3 +471,2 @@ void LauncherIconView::stopEyeTimer()
}
- m_itemCache.clear();
m_eyeTimer.stop();
@@ -704,19 +696,16 @@ void LauncherView::setToolsEnabled(bool y)
if ( !y != !tools ) {
- if ( y ) {
- tools = new QHBox(this);
-
- // Type filter
- typemb = new QComboBox(tools);
- QSizePolicy p = typemb->sizePolicy();
- p.setHorData(QSizePolicy::Expanding);
- typemb->setSizePolicy(p);
-
- // Category filter
- updateTools();
- tools->show();
-
- } else {
- delete tools;
- tools = 0;
- }
+ if ( y ) {
+ tools = new QHBox(this);
+ // Type filter
+ typemb = new QComboBox(tools);
+ QSizePolicy p = typemb->sizePolicy();
+ p.setHorData(QSizePolicy::Expanding);
+ typemb->setSizePolicy(p);
+ // Category filter
+ updateTools();
+ tools->show();
+ } else {
+ delete tools;
+ tools = 0;
+ }
}
@@ -728,4 +717,5 @@ void LauncherView::updateTools()
this, SLOT(showType(int)) );
- if ( catmb ) disconnect( catmb, SIGNAL(signalSelected(int)),
- this, SLOT(showCategory(int)) );
+ if ( catmb ) {
+ disconnect( catmb, SIGNAL(signalSelected(int)),this,SLOT(showCategory(int)));
+ }
@@ -740,14 +730,14 @@ void LauncherView::updateTools()
for (QStringList::ConstIterator it = typelist.begin(); it!=typelist.end(); ++it) {
- QString t = *it;
- if ( t.left(12) == "application/" ) {
- MimeType mt(t);
- const AppLnk* app = mt.application();
- if ( app )
- t = app->name();
- else
- t = t.mid(12);
- } else {
- t[0] = t[0].upper();
- }
- types += t;
+ QString t = *it;
+ if ( t.left(12) == "application/" ) {
+ MimeType mt(t);
+ const AppLnk* app = mt.application();
+ if ( app )
+ t = app->name();
+ else
+ t = t.mid(12);
+ } else {
+ t[0] = t[0].upper();
+ }
+ types += t;
}
@@ -758,9 +748,10 @@ void LauncherView::updateTools()
for (int i=0; i<typemb->count(); i++) {
- if ( typemb->text(i) == prev ) {
- typemb->setCurrentItem(i);
- break;
+ if ( typemb->text(i) == prev ) {
+ typemb->setCurrentItem(i);
+ break;
+ }
}
+ if ( prev.isNull() ) {
+ typemb->setCurrentItem(typemb->count()-1);
}
- if ( prev.isNull() )
- typemb->setCurrentItem(typemb->count()-1);
@@ -768,3 +759,3 @@ void LauncherView::updateTools()
if ( !catmb )
- catmb = new CategorySelect(tools);
+ catmb = new CategorySelect(tools);
Categories cats( 0 );
@@ -773,3 +764,3 @@ void LauncherView::updateTools()
catmb->setCategories( vl, "Document View", // No tr
- tr("Document View") );
+ tr("Document View") );
catmb->setRemoveCategoryEdit( TRUE );
@@ -780,3 +771,3 @@ void LauncherView::updateTools()
if ( typemb->currentText() != prev )
- showType( typemb->currentItem() );
+ showType( typemb->currentItem() );
@@ -794,8 +785,8 @@ void LauncherView::showType(int t)
if ( t >= (int)typelist.count() ) {
- icons->setTypeFilter("",TRUE);
+ icons->setTypeFilter("",TRUE);
} else {
- QString ty = typelist[t];
- if ( !ty.contains('/') )
- ty += "/*";
- icons->setTypeFilter(ty,TRUE);
+ QString ty = typelist[t];
+ if ( !ty.contains('/') )
+ ty += "/*";
+ icons->setTypeFilter(ty,TRUE);
}
@@ -810,17 +801,18 @@ void LauncherView::setViewMode( ViewMode m )
{
+ odebug << "LauncherView::setViewMode( ViewMode m )" << oendl;
if ( vmode != m ) {
- bool bigIcons = m == Icon;
- icons->viewport()->setUpdatesEnabled( FALSE );
- icons->setBigIcons( bigIcons );
- switch ( m ) {
- case List:
- icons->setItemTextPos( QIconView::Right );
+ bool bigIcons = m == Icon;
+ icons->viewport()->setUpdatesEnabled( FALSE );
+ icons->setBigIcons( bigIcons );
+ switch ( m ) {
+ case List:
+ icons->setItemTextPos( QIconView::Right );
break;
case Icon:
- icons->setItemTextPos( QIconView::Bottom );
+ icons->setItemTextPos( QIconView::Bottom );
break;
- }
- icons->hideOrShowItems( FALSE );
- icons->viewport()->setUpdatesEnabled( TRUE );
- vmode = m;
+ }
+ icons->hideOrShowItems( FALSE );
+ icons->viewport()->setUpdatesEnabled( TRUE );
+ vmode = m;
}
@@ -1048,2 +1040,3 @@ void LauncherView::removeAllItems()
{
+ odebug << "LauncherView::removeAllItems()" << oendl;
icons->clear();
@@ -1170,3 +1163,3 @@ void LauncherThumbReceiver::requestThumb(const QString&file,int width,int height
m_inThumbNail.append(rItem);
- QTimer::singleShot(0, this, SLOT(sendRequest()));
+ QTimer::singleShot(2, this, SLOT(sendRequest()));
}
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:
QTimer m_eyeTimer;
- QMap<QString,LauncherItem*> m_itemCache;
};