summaryrefslogtreecommitdiff
path: root/core/launcher
Side-by-side diff
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.pro2
-rw-r--r--core/launcher/launcherview.cpp27
2 files changed, 19 insertions, 10 deletions
diff --git a/core/launcher/launcher.pro b/core/launcher/launcher.pro
index 0078faf..32cb95f 100644
--- a/core/launcher/launcher.pro
+++ b/core/launcher/launcher.pro
@@ -1,20 +1,21 @@
TEMPLATE = app
CONFIG = qt warn_on release
DESTDIR = $(OPIEDIR)/bin
HEADERS = background.h \
desktop.h \
+ qprocess.h \
info.h \
appicons.h \
taskbar.h \
sidething.h \
mrulist.h \
stabmon.h \
inputmethods.h \
systray.h \
wait.h \
shutdownimpl.h \
launcher.h \
launcherview.h \
@@ -37,24 +38,25 @@ HEADERS = background.h \
$(OPIEDIR)/rsync/stream.h \
$(OPIEDIR)/rsync/sumset.h \
$(OPIEDIR)/rsync/trace.h \
$(OPIEDIR)/rsync/types.h \
$(OPIEDIR)/rsync/util.h \
$(OPIEDIR)/rsync/whole.h \
$(OPIEDIR)/rsync/config_rsync.h \
$(OPIEDIR)/rsync/qrsync.h
# quicklauncher.h \
SOURCES = background.cpp \
desktop.cpp \
+ qprocess.cpp qprocess_unix.cpp \
info.cpp \
appicons.cpp \
taskbar.cpp \
sidething.cpp \
mrulist.cpp \
stabmon.cpp \
inputmethods.cpp \
systray.cpp \
wait.cpp \
shutdownimpl.cpp \
launcher.cpp \
launcherview.cpp \
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index ed39720..e8741a2 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -203,28 +203,26 @@ public:
if ( sortmeth != m ) {
sortmeth = m;
sort();
}
}
int compare(const AppLnk* a, const AppLnk* b)
{
switch (sortmeth) {
case Name:
return a->name().compare(b->name());
case Date: {
- QFileInfo fa(a->linkFile());
- if ( !fa.exists() ) fa.setFile(a->file());
- QFileInfo fb(b->linkFile());
- if ( !fb.exists() ) fb.setFile(b->file());
+ QFileInfo fa(a->linkFileKnown() ? a->linkFile() : a->file());
+ QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file());
return fa.lastModified().secsTo(fb.lastModified());
}
case Type:
return a->type().compare(b->type());
}
return 0;
}
protected:
void styleChange( QStyle &old )
{
@@ -353,55 +351,64 @@ void LauncherIconView::updateCategoriesAndMimeTypes()
void LauncherIconView::hideOrShowItems(bool resort)
{
hidden.setAutoDelete(FALSE);
QList<AppLnk> links=hidden;
hidden.clear();
hidden.setAutoDelete(TRUE);
LauncherItem* item = (LauncherItem*)firstItem();
while (item) {
links.append(item->takeAppLnk());
item = (LauncherItem*)item->nextItem();
}
+ bool oldAutoArrange = autoArrange();
+ setAutoArrange( FALSE );
clear();
QListIterator<AppLnk> it(links);
AppLnk* l;
while ((l=it.current())) {
addItem(l,FALSE);
++it;
}
if ( resort )
sort();
+ setAutoArrange( oldAutoArrange );
}
bool LauncherIconView::removeLink(const QString& linkfile)
{
LauncherItem* item = (LauncherItem*)firstItem();
+ AppLnk* l;
+ bool did = FALSE;
+ DocLnk dl(linkfile);
while (item) {
- if ( item->appLnk()->linkFile() == linkfile ) {
+ l = item->appLnk();
+ if ( l->linkFileKnown() && l->linkFile() == linkfile || l->file() == linkfile
+ || dl.isValid() && dl.file() == l->file() ) {
delete item;
- return TRUE;
+ did = TRUE;
}
item = (LauncherItem*)item->nextItem();
}
QListIterator<AppLnk> it(hidden);
- AppLnk* l;
while ((l=it.current())) {
++it;
- if ( l->linkFile() == linkfile ) {
+ if ( l->linkFileKnown() && l->linkFile() == linkfile
+ || l->file() == linkfile
+ || dl.isValid() && dl.file() == l->file() ) {
hidden.removeRef(l);
- return TRUE;
+ did = TRUE;
}
}
- return FALSE;
+ return did;
}
LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
: QVBox( parent, name, fl )
{
icons = new LauncherIconView( this );
setFocusProxy(icons);
QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold );
int dw = QApplication::desktop()->width();
icons->setItemsMovable( FALSE );
icons->setAutoArrange( TRUE );