mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Show a warning when running as the root user
Summary: Now that Dolphin can be run as the root user again, let's show a warning. Test Plan: When run with the root user account: {F5882057} Reviewers: #dolphin, markg, elvisangelaccio Reviewed By: markg, elvisangelaccio Subscribers: acooligan, anthonyfieroni, chinmoyr, kfm-devel, rikmills, emmanuelp, zzag, nicolasfella, elvisangelaccio, Fuchs, mmustac, markg Tags: #dolphin Differential Revision: https://phabricator.kde.org/D12732
This commit is contained in:
parent
316e476b37
commit
621cd24acf
|
@ -108,6 +108,14 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
|
|||
m_messageWidget->setCloseButtonVisible(true);
|
||||
m_messageWidget->hide();
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
if (getuid() == 0) {
|
||||
|
||||
// We must be logged in as the root user; show a big scary warning
|
||||
showMessage(i18n("Running Dolphin as root can be dangerous. Please be careful."), Warning);
|
||||
}
|
||||
#endif
|
||||
|
||||
m_view = new DolphinView(url, this);
|
||||
connect(m_view, &DolphinView::urlChanged,
|
||||
m_urlNavigator, &KUrlNavigator::setLocationUrl);
|
||||
|
|
Loading…
Reference in a new issue