lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
***BOGO*** Re: Dolphin Patch ?
- Date: Sat, 28 Jun 2008 13:11:49 +0200
- From: Peter Penz <peter.penz@xxxxxx>
- Subject: ***BOGO*** Re: Dolphin Patch ?
Hi Andreas,
thanks for the patch!
On Saturday, 28. June 2008 01:36:47 Andreas Scherf wrote:
> Hello,
> i changed one thing in the selection part of the dolphin main window.
> Everytime 2 files/dirs are selected dolphin searches for "kompare".
> I think that we could test this only once to safe time. If somebody
> install/removes compare while running dolphin he couldn't use kompare.
> But i think the runtime costs are reduced. Ok ?
I'm not sure: the runtime costs for comparing are decreased, but the runtime
costs for starting up Dolphin has been increased now.
I'd suggest doing it like this:
instead of the original code (which does an unnecessary comparison anyway):
if (selectedUrlsCount == 2) {
const bool kompareInstalled
= !KGlobal::dirs()->findExe("kompare").isEmpty();
compareFilesAction->setEnabled(selectedUrlsCount == 2 && kompareInstalled);
}
I'd suggest something like this:
if (selectedUrlsCount == 2) {
compareFilesAction->setEnabled(isKompareInstalled());
}
bool DolphinMainWindow::isKompareInstalled() const
{
static bool initialized = false;
static bool installed = false;
if (!initialized) {
installed= !KGlobal::dirs()->findExe("kompare").isEmpty();
initialized = true;
}
return installed;
}
What do you think?
Peter
> Andreas
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<