author | kergoth <kergoth> | 2002-01-31 18:35:48 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-31 18:35:48 (UTC) |
commit | 2802e5a2b474101a50bf95e707061ca5542876fd (patch) (unidiff) | |
tree | a1015514ef9e48df091903cccf0d3174e272f663 /core/launcher | |
parent | 48a922e687e82dc8ebe2bc3cb17dcaa8dcae62bd (diff) | |
download | opie-2802e5a2b474101a50bf95e707061ca5542876fd.zip opie-2802e5a2b474101a50bf95e707061ca5542876fd.tar.gz opie-2802e5a2b474101a50bf95e707061ca5542876fd.tar.bz2 |
*** empty log message ***
-rw-r--r-- | core/launcher/launcher.pro | 2 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 27 |
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 | |||
@@ -3,12 +3,13 @@ TEMPLATE = app | |||
3 | CONFIG = qt warn_on release | 3 | CONFIG = qt warn_on release |
4 | 4 | ||
5 | DESTDIR = $(OPIEDIR)/bin | 5 | DESTDIR = $(OPIEDIR)/bin |
6 | 6 | ||
7 | HEADERS = background.h \ | 7 | HEADERS = background.h \ |
8 | desktop.h \ | 8 | desktop.h \ |
9 | qprocess.h \ | ||
9 | info.h \ | 10 | info.h \ |
10 | appicons.h \ | 11 | appicons.h \ |
11 | taskbar.h \ | 12 | taskbar.h \ |
12 | sidething.h \ | 13 | sidething.h \ |
13 | mrulist.h \ | 14 | mrulist.h \ |
14 | stabmon.h \ | 15 | stabmon.h \ |
@@ -43,12 +44,13 @@ HEADERS = background.h \ | |||
43 | $(OPIEDIR)/rsync/config_rsync.h \ | 44 | $(OPIEDIR)/rsync/config_rsync.h \ |
44 | $(OPIEDIR)/rsync/qrsync.h | 45 | $(OPIEDIR)/rsync/qrsync.h |
45 | # quicklauncher.h \ | 46 | # quicklauncher.h \ |
46 | 47 | ||
47 | SOURCES = background.cpp \ | 48 | SOURCES = background.cpp \ |
48 | desktop.cpp \ | 49 | desktop.cpp \ |
50 | qprocess.cpp qprocess_unix.cpp \ | ||
49 | info.cpp \ | 51 | info.cpp \ |
50 | appicons.cpp \ | 52 | appicons.cpp \ |
51 | taskbar.cpp \ | 53 | taskbar.cpp \ |
52 | sidething.cpp \ | 54 | sidething.cpp \ |
53 | mrulist.cpp \ | 55 | mrulist.cpp \ |
54 | stabmon.cpp \ | 56 | stabmon.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 | |||
@@ -209,16 +209,14 @@ public: | |||
209 | int compare(const AppLnk* a, const AppLnk* b) | 209 | int compare(const AppLnk* a, const AppLnk* b) |
210 | { | 210 | { |
211 | switch (sortmeth) { | 211 | switch (sortmeth) { |
212 | case Name: | 212 | case Name: |
213 | return a->name().compare(b->name()); | 213 | return a->name().compare(b->name()); |
214 | case Date: { | 214 | case Date: { |
215 | QFileInfo fa(a->linkFile()); | 215 | QFileInfo fa(a->linkFileKnown() ? a->linkFile() : a->file()); |
216 | if ( !fa.exists() ) fa.setFile(a->file()); | 216 | QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file()); |
217 | QFileInfo fb(b->linkFile()); | ||
218 | if ( !fb.exists() ) fb.setFile(b->file()); | ||
219 | return fa.lastModified().secsTo(fb.lastModified()); | 217 | return fa.lastModified().secsTo(fb.lastModified()); |
220 | } | 218 | } |
221 | case Type: | 219 | case Type: |
222 | return a->type().compare(b->type()); | 220 | return a->type().compare(b->type()); |
223 | } | 221 | } |
224 | return 0; | 222 | return 0; |
@@ -359,43 +357,52 @@ void LauncherIconView::hideOrShowItems(bool resort) | |||
359 | hidden.setAutoDelete(TRUE); | 357 | hidden.setAutoDelete(TRUE); |
360 | LauncherItem* item = (LauncherItem*)firstItem(); | 358 | LauncherItem* item = (LauncherItem*)firstItem(); |
361 | while (item) { | 359 | while (item) { |
362 | links.append(item->takeAppLnk()); | 360 | links.append(item->takeAppLnk()); |
363 | item = (LauncherItem*)item->nextItem(); | 361 | item = (LauncherItem*)item->nextItem(); |
364 | } | 362 | } |
363 | bool oldAutoArrange = autoArrange(); | ||
364 | setAutoArrange( FALSE ); | ||
365 | clear(); | 365 | clear(); |
366 | QListIterator<AppLnk> it(links); | 366 | QListIterator<AppLnk> it(links); |
367 | AppLnk* l; | 367 | AppLnk* l; |
368 | while ((l=it.current())) { | 368 | while ((l=it.current())) { |
369 | addItem(l,FALSE); | 369 | addItem(l,FALSE); |
370 | ++it; | 370 | ++it; |
371 | } | 371 | } |
372 | if ( resort ) | 372 | if ( resort ) |
373 | sort(); | 373 | sort(); |
374 | setAutoArrange( oldAutoArrange ); | ||
374 | } | 375 | } |
375 | 376 | ||
376 | bool LauncherIconView::removeLink(const QString& linkfile) | 377 | bool LauncherIconView::removeLink(const QString& linkfile) |
377 | { | 378 | { |
378 | LauncherItem* item = (LauncherItem*)firstItem(); | 379 | LauncherItem* item = (LauncherItem*)firstItem(); |
380 | AppLnk* l; | ||
381 | bool did = FALSE; | ||
382 | DocLnk dl(linkfile); | ||
379 | while (item) { | 383 | while (item) { |
380 | if ( item->appLnk()->linkFile() == linkfile ) { | 384 | l = item->appLnk(); |
385 | if ( l->linkFileKnown() && l->linkFile() == linkfile || l->file() == linkfile | ||
386 | || dl.isValid() && dl.file() == l->file() ) { | ||
381 | delete item; | 387 | delete item; |
382 | return TRUE; | 388 | did = TRUE; |
383 | } | 389 | } |
384 | item = (LauncherItem*)item->nextItem(); | 390 | item = (LauncherItem*)item->nextItem(); |
385 | } | 391 | } |
386 | QListIterator<AppLnk> it(hidden); | 392 | QListIterator<AppLnk> it(hidden); |
387 | AppLnk* l; | ||
388 | while ((l=it.current())) { | 393 | while ((l=it.current())) { |
389 | ++it; | 394 | ++it; |
390 | if ( l->linkFile() == linkfile ) { | 395 | if ( l->linkFileKnown() && l->linkFile() == linkfile |
396 | || l->file() == linkfile | ||
397 | || dl.isValid() && dl.file() == l->file() ) { | ||
391 | hidden.removeRef(l); | 398 | hidden.removeRef(l); |
392 | return TRUE; | 399 | did = TRUE; |
393 | } | 400 | } |
394 | } | 401 | } |
395 | return FALSE; | 402 | return did; |
396 | } | 403 | } |
397 | 404 | ||
398 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) | 405 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) |
399 | : QVBox( parent, name, fl ) | 406 | : QVBox( parent, name, fl ) |
400 | { | 407 | { |
401 | icons = new LauncherIconView( this ); | 408 | icons = new LauncherIconView( this ); |