Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kpropertiesdialog.cpp
Show First 20 Lines • Show All 379 Lines • ▼ Show 20 Line(s) | 373 | #endif | |||
---|---|---|---|---|---|
380 | 380 | | |||
381 | return true; | 381 | return true; | ||
382 | } | 382 | } | ||
383 | 383 | | |||
384 | bool KPropertiesDialog::showDialog(const KFileItemList &_items, QWidget *parent, | 384 | bool KPropertiesDialog::showDialog(const KFileItemList &_items, QWidget *parent, | ||
385 | bool modal) | 385 | bool modal) | ||
386 | { | 386 | { | ||
387 | if (_items.count() == 1) { | 387 | if (_items.count() == 1) { | ||
388 | const KFileItem item = _items.first(); | 388 | const KFileItem &item = _items.first(); | ||
389 | if (item.entry().count() == 0 && item.localPath().isEmpty()) // this remote item wasn't listed by a slave | 389 | if (item.entry().count() == 0 && item.localPath().isEmpty()) // this remote item wasn't listed by a slave | ||
390 | // Let's stat to get more info on the file | 390 | // Let's stat to get more info on the file | ||
391 | { | 391 | { | ||
392 | return KPropertiesDialog::showDialog(item.url(), parent, modal); | 392 | return KPropertiesDialog::showDialog(item.url(), parent, modal); | ||
393 | } else { | 393 | } else { | ||
394 | return KPropertiesDialog::showDialog(_items.first(), parent, modal); | 394 | return KPropertiesDialog::showDialog(_items.first(), parent, modal); | ||
395 | } | 395 | } | ||
396 | } | 396 | } | ||
▲ Show 20 Lines • Show All 2321 Lines • ▼ Show 20 Line(s) | |||||
2718 | } | 2718 | } | ||
2719 | 2719 | | |||
2720 | bool KChecksumsPlugin::supports(const KFileItemList &items) | 2720 | bool KChecksumsPlugin::supports(const KFileItemList &items) | ||
2721 | { | 2721 | { | ||
2722 | if (items.count() != 1) { | 2722 | if (items.count() != 1) { | ||
2723 | return false; | 2723 | return false; | ||
2724 | } | 2724 | } | ||
2725 | 2725 | | |||
2726 | const KFileItem item = items.first(); | 2726 | const KFileItem &item = items.first(); | ||
2727 | return item.isFile() && !item.localPath().isEmpty() && item.isReadable() && !item.isDesktopFile() && !item.isLink(); | 2727 | return item.isFile() && !item.localPath().isEmpty() && item.isReadable() && !item.isDesktopFile() && !item.isLink(); | ||
2728 | } | 2728 | } | ||
2729 | 2729 | | |||
2730 | void KChecksumsPlugin::slotInvalidateCache() | 2730 | void KChecksumsPlugin::slotInvalidateCache() | ||
2731 | { | 2731 | { | ||
2732 | d->m_md5 = QString(); | 2732 | d->m_md5 = QString(); | ||
2733 | d->m_sha1 = QString(); | 2733 | d->m_sha1 = QString(); | ||
2734 | d->m_sha256 = QString(); | 2734 | d->m_sha256 = QString(); | ||
▲ Show 20 Lines • Show All 348 Lines • ▼ Show 20 Line(s) | |||||
3083 | // return i18n ("U&RL"); | 3083 | // return i18n ("U&RL"); | ||
3084 | // } | 3084 | // } | ||
3085 | 3085 | | |||
3086 | bool KUrlPropsPlugin::supports(const KFileItemList &_items) | 3086 | bool KUrlPropsPlugin::supports(const KFileItemList &_items) | ||
3087 | { | 3087 | { | ||
3088 | if (_items.count() != 1) { | 3088 | if (_items.count() != 1) { | ||
3089 | return false; | 3089 | return false; | ||
3090 | } | 3090 | } | ||
3091 | const KFileItem item = _items.first(); | 3091 | const KFileItem &item = _items.first(); | ||
3092 | // check if desktop file | 3092 | // check if desktop file | ||
3093 | if (!item.isDesktopFile()) { | 3093 | if (!item.isDesktopFile()) { | ||
3094 | return false; | 3094 | return false; | ||
3095 | } | 3095 | } | ||
3096 | 3096 | | |||
3097 | // open file and check type | 3097 | // open file and check type | ||
3098 | bool isLocal; | 3098 | bool isLocal; | ||
3099 | QUrl url = item.mostLocalUrl(isLocal); | 3099 | QUrl url = item.mostLocalUrl(isLocal); | ||
▲ Show 20 Lines • Show All 284 Lines • ▼ Show 20 Line(s) | 3370 | { | |||
3384 | d->m_freeSpaceBar->show(); | 3384 | d->m_freeSpaceBar->show(); | ||
3385 | } | 3385 | } | ||
3386 | 3386 | | |||
3387 | bool KDevicePropsPlugin::supports(const KFileItemList &_items) | 3387 | bool KDevicePropsPlugin::supports(const KFileItemList &_items) | ||
3388 | { | 3388 | { | ||
3389 | if (_items.count() != 1) { | 3389 | if (_items.count() != 1) { | ||
3390 | return false; | 3390 | return false; | ||
3391 | } | 3391 | } | ||
3392 | const KFileItem item = _items.first(); | 3392 | const KFileItem &item = _items.first(); | ||
3393 | // check if desktop file | 3393 | // check if desktop file | ||
3394 | if (!item.isDesktopFile()) { | 3394 | if (!item.isDesktopFile()) { | ||
3395 | return false; | 3395 | return false; | ||
3396 | } | 3396 | } | ||
3397 | 3397 | | |||
3398 | // open file and check type | 3398 | // open file and check type | ||
3399 | bool isLocal; | 3399 | bool isLocal; | ||
3400 | QUrl url = item.mostLocalUrl(isLocal); | 3400 | QUrl url = item.mostLocalUrl(isLocal); | ||
▲ Show 20 Lines • Show All 496 Lines • ▼ Show 20 Line(s) | |||||
3897 | } | 3897 | } | ||
3898 | 3898 | | |||
3899 | bool KDesktopPropsPlugin::supports(const KFileItemList &_items) | 3899 | bool KDesktopPropsPlugin::supports(const KFileItemList &_items) | ||
3900 | { | 3900 | { | ||
3901 | if (_items.count() != 1) { | 3901 | if (_items.count() != 1) { | ||
3902 | return false; | 3902 | return false; | ||
3903 | } | 3903 | } | ||
3904 | 3904 | | |||
3905 | const KFileItem item = _items.first(); | 3905 | const KFileItem &item = _items.first(); | ||
3906 | 3906 | | |||
3907 | // check if desktop file | 3907 | // check if desktop file | ||
3908 | if (!item.isDesktopFile()) { | 3908 | if (!item.isDesktopFile()) { | ||
3909 | return false; | 3909 | return false; | ||
3910 | } | 3910 | } | ||
3911 | 3911 | | |||
3912 | // open file and check type | 3912 | // open file and check type | ||
3913 | bool isLocal; | 3913 | bool isLocal; | ||
Show All 13 Lines |