summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcher.cpp4
-rw-r--r--core/launcher/launcherview.cpp27
-rw-r--r--core/launcher/launcherview.h1
3 files changed, 13 insertions, 19 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
@@ -598,17 +598,19 @@ void Launcher::select( const AppLnk *appLnk )
void Launcher::properties( AppLnk *appLnk )
{
if ( appLnk->type() == "Folder" ) { // No tr
// Not supported: flat is simpler for the user
} else {
/* ### libqtopia FIXME also moving docLnks... */
LnkProperties prop(appLnk,0 );
- QPEApplication::execDialog( &prop );
+ if (QPEApplication::execDialog( &prop )==QDialog::Accepted && tabs->currentView()==tabs->docView()) {
+ tabs->docView()->updateTools();
+ }
}
}
void Launcher::storageChanged( const QList<FileSystem> & )
{
// ### update combo boxes if we had a combo box for the storage type
}
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
@@ -271,16 +271,17 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
hidden.setAutoDelete(TRUE);
ike = FALSE;
calculateGrid( Bottom );
connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer()));
}
LauncherIconView::~LauncherIconView()
{
+ odebug << "LauncherIconView::~LauncherIconView()" << oendl;
#if 0 // debuggery
QListIterator<AppLnk> it(hidden);
AppLnk* l;
while ((l=it.current())) {
++it;
//odebug << "" << l << ": hidden (should remove)" << oendl;
}
#endif
@@ -424,24 +425,17 @@ LauncherItem*LauncherIconView::findDocItem(const QString&fname)
}
return item;
}
void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,int width)
{
int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize();
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;
item->setEyePixmap(aPixmap);
}
void LauncherIconView::checkCallback()
{
if (!m_EyeCallBack) {
m_EyeCallBack = new LauncherThumbReceiver();
@@ -460,28 +454,26 @@ void LauncherIconView::addCheckItem(AppLnk* app)
}
void LauncherIconView::requestEyePix(const LauncherItem*item)
{
if (!item) return;
if (item->isEyeImage()) {
checkCallback();
int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize();
- m_itemCache[item->appLnk()->file()]=(LauncherItem*)item;
m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s);
}
}
void LauncherIconView::stopEyeTimer()
{
if (m_EyeCallBack) {
delete m_EyeCallBack;
m_EyeCallBack=0;
}
- m_itemCache.clear();
m_eyeTimer.stop();
}
void LauncherIconView::addItem(AppLnk* app, bool resort)
{
addCatsAndMimes(app);
if ( (tf.isEmpty() || tf.match(app->type()) >= 0)
&& (cf == 0 || app->categories().contains(cf)
@@ -699,40 +691,38 @@ void LauncherView::hideIcons()
icons->hide();
}
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;
}
}
}
void LauncherView::updateTools()
{
disconnect( typemb, SIGNAL(activated(int)),
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)));
+ }
// ### I want to remove this
icons->updateCategoriesAndMimeTypes();
QString prev;
// Type filter
QStringList types;
@@ -756,18 +746,19 @@ void LauncherView::updateTools()
typemb->clear();
typemb->insertStringList(types);
for (int i=0; i<typemb->count(); i++) {
if ( typemb->text(i) == prev ) {
typemb->setCurrentItem(i);
break;
}
}
- if ( prev.isNull() )
+ if ( prev.isNull() ) {
typemb->setCurrentItem(typemb->count()-1);
+ }
int pcat = catmb ? catmb->currentCategory() : -2;
if ( !catmb )
catmb = new CategorySelect(tools);
Categories cats( 0 );
cats.load( categoryFileName() );
QArray<int> vl( 0 );
catmb->setCategories( vl, "Document View", // No tr
@@ -803,16 +794,17 @@ void LauncherView::showType(int t)
void LauncherView::showCategory( int c )
{
icons->setCategoryFilter( c, TRUE );
}
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 );
break;
@@ -1041,16 +1033,17 @@ void LauncherView::itemPressed( int btn, QIconViewItem *item )
else if ( btn == ShiftButton )
emit rightPressed( appLnk );
item->setSelected(FALSE);
}
}
void LauncherView::removeAllItems()
{
+ odebug << "LauncherView::removeAllItems()" << oendl;
icons->clear();
}
bool LauncherView::removeLink(const QString& linkfile)
{
return icons->removeLink(linkfile);
}
@@ -1163,17 +1156,17 @@ void LauncherThumbReceiver::recieve( const QCString&str, const QByteArray&at )
void LauncherThumbReceiver::requestThumb(const QString&file,int width,int height)
{
PixmapInfo rItem;
rItem.file = file;
rItem.width = width;
rItem.height = height;
m_inThumbNail.append(rItem);
- QTimer::singleShot(0, this, SLOT(sendRequest()));
+ QTimer::singleShot(2, this, SLOT(sendRequest()));
}
void LauncherThumbReceiver::sendRequest()
{
if (m_inThumbNail.count()>0) {
QCopEnvelope env("QPE/opie-eye_slave", "pixmapInfos(PixmapInfos)" );
env << m_inThumbNail;
m_inThumbNail.clear();
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
@@ -235,12 +235,11 @@ private:
QPixmap bgPixmap;
QColor bgColor;
LauncherThumbReceiver*m_EyeCallBack;
#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY
QPixmap busyPix;
#endif
BusyIndicatorType busyType;
QTimer m_eyeTimer;
- QMap<QString,LauncherItem*> m_itemCache;
};
#endif // LAUNCHERVIEW_H