Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kpropertiesdialog.cpp
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | |||||
82 | extern "C" { | 82 | extern "C" { | ||
83 | # include <errno.h> | 83 | # include <errno.h> | ||
84 | # include <sys/xattr.h> | 84 | # include <sys/xattr.h> | ||
85 | } | 85 | } | ||
86 | #endif | 86 | #endif | ||
87 | 87 | | |||
88 | #include <kauthorized.h> | 88 | #include <kauthorized.h> | ||
89 | #include <KColorScheme> | 89 | #include <KColorScheme> | ||
90 | #include <KDialogJobUiDelegate> | ||||
90 | #include <kdirnotify.h> | 91 | #include <kdirnotify.h> | ||
91 | #include <kdiskfreespaceinfo.h> | 92 | #include <kdiskfreespaceinfo.h> | ||
92 | #include <kdesktopfile.h> | 93 | #include <kdesktopfile.h> | ||
93 | #include <kiconbutton.h> | 94 | #include <kiconbutton.h> | ||
94 | #include <kurlrequester.h> | 95 | #include <kurlrequester.h> | ||
95 | #include <klocalizedstring.h> | 96 | #include <klocalizedstring.h> | ||
96 | #include <kjobuidelegate.h> | 97 | #include <kjobuidelegate.h> | ||
97 | #include <kio/global.h> | 98 | #include <kio/global.h> | ||
Show All 12 Lines | |||||
110 | #include <kservice.h> | 111 | #include <kservice.h> | ||
111 | #include <ksharedconfig.h> | 112 | #include <ksharedconfig.h> | ||
112 | #include <kcombobox.h> | 113 | #include <kcombobox.h> | ||
113 | #include <kcompletion.h> | 114 | #include <kcompletion.h> | ||
114 | #include <klineedit.h> | 115 | #include <klineedit.h> | ||
115 | #include <kseparator.h> | 116 | #include <kseparator.h> | ||
116 | #include <ksqueezedtextlabel.h> | 117 | #include <ksqueezedtextlabel.h> | ||
117 | #include <kmimetypetrader.h> | 118 | #include <kmimetypetrader.h> | ||
118 | #include <krun.h> | 119 | #include <KIO/ApplicationLauncherJob> | ||
119 | #include <kio/desktopexecparser.h> | 120 | #include <kio/desktopexecparser.h> | ||
120 | #include <kacl.h> | 121 | #include <kacl.h> | ||
121 | #include <kconfiggroup.h> | 122 | #include <kconfiggroup.h> | ||
122 | #include <kmimetypeeditor.h> | 123 | #include <kmimetypeeditor.h> | ||
123 | #include <kshell.h> | 124 | #include <kshell.h> | ||
124 | #include <kcapacitybar.h> | 125 | #include <kcapacitybar.h> | ||
125 | #include <kfileitemlistproperties.h> | 126 | #include <kfileitemlistproperties.h> | ||
126 | #include <kwindowconfig.h> | 127 | #include <kwindowconfig.h> | ||
▲ Show 20 Lines • Show All 974 Lines • ▼ Show 20 Line(s) | 1093 | } else { // Directory | |||
1101 | d->m_sizeStopButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-cancel"))); | 1102 | d->m_sizeStopButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-cancel"))); | ||
1102 | 1103 | | |||
1103 | connect(d->m_sizeDetermineButton, &QAbstractButton::clicked, this, &KFilePropsPlugin::slotSizeDetermine); | 1104 | connect(d->m_sizeDetermineButton, &QAbstractButton::clicked, this, &KFilePropsPlugin::slotSizeDetermine); | ||
1104 | connect(d->m_sizeStopButton, &QAbstractButton::clicked, this, &KFilePropsPlugin::slotSizeStop); | 1105 | connect(d->m_sizeStopButton, &QAbstractButton::clicked, this, &KFilePropsPlugin::slotSizeStop); | ||
1105 | 1106 | | |||
1106 | sizelay->addWidget(d->m_sizeDetermineButton, 0); | 1107 | sizelay->addWidget(d->m_sizeDetermineButton, 0); | ||
1107 | sizelay->addWidget(d->m_sizeStopButton, 0); | 1108 | sizelay->addWidget(d->m_sizeStopButton, 0); | ||
1108 | 1109 | | |||
1109 | if (!QStandardPaths::findExecutable(QStringLiteral("filelight")).isEmpty()) { | 1110 | if (KService::serviceByDesktopName(QStringLiteral("org.kde.filelight"))) { | ||
1110 | d->m_sizeDetailsButton = new QPushButton(i18n("Explore in Filelight"), d->m_frame); | 1111 | d->m_sizeDetailsButton = new QPushButton(i18n("Explore in Filelight"), d->m_frame); | ||
1111 | d->m_sizeDetailsButton->setIcon(QIcon::fromTheme(QStringLiteral("filelight"))); | 1112 | d->m_sizeDetailsButton->setIcon(QIcon::fromTheme(QStringLiteral("filelight"))); | ||
1112 | connect(d->m_sizeDetailsButton, &QPushButton::clicked, this, &KFilePropsPlugin::slotSizeDetails); | 1113 | connect(d->m_sizeDetailsButton, &QPushButton::clicked, this, &KFilePropsPlugin::slotSizeDetails); | ||
1113 | sizelay->addWidget(d->m_sizeDetailsButton, 0); | 1114 | sizelay->addWidget(d->m_sizeDetailsButton, 0); | ||
1114 | } | 1115 | } | ||
1115 | 1116 | | |||
1116 | sizelay->addStretch(10); // so that the buttons don't grow horizontally | 1117 | sizelay->addStretch(10); // so that the buttons don't grow horizontally | ||
1117 | 1118 | | |||
▲ Show 20 Lines • Show All 327 Lines • ▼ Show 20 Line(s) | 1435 | { | |||
1445 | 1446 | | |||
1446 | d->m_sizeStopButton->setEnabled(false); | 1447 | d->m_sizeStopButton->setEnabled(false); | ||
1447 | d->m_sizeDetermineButton->setEnabled(true); | 1448 | d->m_sizeDetermineButton->setEnabled(true); | ||
1448 | } | 1449 | } | ||
1449 | 1450 | | |||
1450 | void KFilePropsPlugin::slotSizeDetails() | 1451 | void KFilePropsPlugin::slotSizeDetails() | ||
1451 | { | 1452 | { | ||
1452 | // Open the current folder in filelight | 1453 | // Open the current folder in filelight | ||
1453 | KRun::run((QStandardPaths::findExecutable(QStringLiteral("filelight"))), { properties->url() }, properties->window(), QStringLiteral("Filelight"), QStringLiteral("filelight")); | 1454 | KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("org.kde.filelight")); | ||
1455 | if (service) { | ||||
1456 | auto *job = new KIO::ApplicationLauncherJob(service); | ||||
1457 | job->setUrls({ properties->url() }); | ||||
1458 | job->start(); | ||||
broulik: Call this after setting everything up? | |||||
If you want. Makes no difference, the actual start of a KJob is always delayed. dfaure: If you want. Makes no difference, the actual start of a KJob is always delayed. | |||||
1459 | auto *delegate = new KDialogJobUiDelegate; | ||||
1460 | delegate->setAutoErrorHandlingEnabled(true); | ||||
1461 | job->setUiDelegate(delegate); | ||||
1462 | } | ||||
1454 | } | 1463 | } | ||
1455 | 1464 | | |||
1456 | KFilePropsPlugin::~KFilePropsPlugin() | 1465 | KFilePropsPlugin::~KFilePropsPlugin() | ||
1457 | { | 1466 | { | ||
1458 | delete d; | 1467 | delete d; | ||
1459 | } | 1468 | } | ||
1460 | 1469 | | |||
1461 | bool KFilePropsPlugin::supports(const KFileItemList & /*_items*/) | 1470 | bool KFilePropsPlugin::supports(const KFileItemList & /*_items*/) | ||
▲ Show 20 Lines • Show All 2550 Lines • Show Last 20 Lines |
Call this after setting everything up?