mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: checkDesktopFile() function optimization
KFileItem::isRegularFile() is a simple mode (member) check while KFileItem::mostLocalUrl() does some dirty work Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5301a82e4c
commit
4051004a5e
2 changed files with 5 additions and 9 deletions
|
@ -902,7 +902,6 @@ bool KUrlNavigator::showFullPath() const
|
|||
return d->m_showFullPath;
|
||||
}
|
||||
|
||||
|
||||
void KUrlNavigator::setActive(bool active)
|
||||
{
|
||||
if (active != d->m_active) {
|
||||
|
@ -1024,9 +1023,6 @@ void KUrlNavigator::setFocus()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void KUrlNavigator::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
if (isUrlEditable() && (event->key() == Qt::Key_Escape)) {
|
||||
|
|
|
@ -750,6 +750,11 @@ QString KFileItem::iconName() const
|
|||
*/
|
||||
static bool checkDesktopFile(const KFileItem &item, bool _determineMimeType)
|
||||
{
|
||||
// only regular files
|
||||
if (!item.isRegularFile()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// only local files
|
||||
bool isLocal = false;
|
||||
const KUrl url = item.mostLocalUrl(isLocal);
|
||||
|
@ -757,11 +762,6 @@ static bool checkDesktopFile(const KFileItem &item, bool _determineMimeType)
|
|||
return false;
|
||||
}
|
||||
|
||||
// only regular files
|
||||
if (!item.isRegularFile()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// only if readable
|
||||
if (!item.isReadable()) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue