Summary: | Kappfinder shouldnt show already existing elements on menu | ||
---|---|---|---|
Product: | [Applications] kappfinder | Reporter: | Ismail Donmez <ismail> |
Component: | general | Assignee: | Matthias Hoelzer-Kluepfel <hoelzer> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | bastian, tokoe |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Patch against latest cvs
Better patch against latest cvs |
Description
Ismail Donmez
2003-04-18 11:00:27 UTC
I do not think this is a wishlist but a normal bug. Kappfinder supposed to find non-existing programs on menu not already existing ones... Created attachment 1449 [details]
Patch against latest cvs
Fixes the problem.
Created attachment 1455 [details]
Better patch against latest cvs
Do not crash when de/select all. Show the right installed application count.
Remove some obsolete things..
Can you please review/apply this patch? Does it work with the new implemented XDG Desktop Menu specification? Isn't it planned to integrate kappfinder into kmenuedit? Tobias told me he was waiting for Bastian to finish XDG work. Patches don't look right to me. Will look into it later this week. Apart from that someone (Tobias?) may want to add categories to the .desktop files installed by kappfinder so that they can be installed to the new XDG locations later on. Patches are done before XDG introduced in KDE. its a bug, not a wishlist. Subject: kdebase/kappfinder CVS commit by waba: Don't show already installed applications. (BR57413) CCMAIL: 57413-done@bugs.kde.org M +31 -2 toplevel.cpp 1.17 --- kdebase/kappfinder/toplevel.cpp #1.16:1.17 @@ -30,4 +30,5 @@ #include <kmessagebox.h> #include <kprogress.h> +#include <kservice.h> #include <kservicegroup.h> #include <kstandarddirs.h> @@ -64,7 +65,10 @@ TopLevel::TopLevel( const QString &destD mListView->setMinimumSize( 300, 300 ); mListView->setRootIsDecorated( true ); + mListView->setAllColumnsShowFocus( true ); + mListView->setSelectionMode(QListView::NoSelection); layout->addWidget( mListView ); mProgress = new KProgress( this ); + mProgress->setPercentageVisible( false ); layout->addWidget( mProgress ); @@ -167,4 +171,5 @@ void TopLevel::slotScan() mScanButton->setEnabled( false ); + mProgress->setPercentageVisible( true ); mProgress->setTotalSteps( count ); mProgress->setValue( 0 ); @@ -174,9 +179,29 @@ void TopLevel::slotScan() QStringList::Iterator it; for ( it = mTemplates.begin(); it != mTemplates.end(); ++it ) { - KDesktopFile desktop( *it, true ); - // eye candy mProgress->setProgress( mProgress->progress() + 1 ); + QString desktopName = *it; + int i = desktopName.findRev('/'); + desktopName = desktopName.mid(i+1); + i = desktopName.findRev('.'); + if (i != -1) + desktopName = desktopName.left(i); + + bool found; + found = KService::serviceByDesktopName(desktopName); + if (found) + continue; + + found = KService::serviceByMenuId("kde-"+desktopName+".desktop"); + if (found) + continue; + + found = KService::serviceByMenuId("gnome-"+desktopName+".desktop"); + if (found) + continue; + + KDesktopFile desktop( *it, true ); + // copy over the desktop file, if exists if ( scanDesktopFile( mAppCache, *it, mDestDir ) ) { @@ -223,4 +248,6 @@ void TopLevel::slotScan() // stop scanning mProgress->setValue( 0 ); + mProgress->setPercentageVisible( false ); + mScanButton->setEnabled( true ); @@ -255,4 +282,6 @@ void TopLevel::slotCreate() decorateDirs( mDestDir ); + KService::rebuildKSycoca(this); + QString message( i18n( "%n application was added to the KDE menu system.", "%n applications were added to the KDE menu system.", mAdded ) ); |