make "run associated application" obey security

svn path=/trunk/KDE/kdelibs/; revision=1081144
This commit is contained in:
Chani Armitage 2010-01-27 20:34:55 +00:00
parent b6ab41d131
commit 14c45f179f

View File

@ -1959,6 +1959,7 @@ void Applet::setAssociatedApplication(const QString &string)
QAction *runAssociatedApplication = d->actions->action("run associated application");
if (runAssociatedApplication) {
bool valid = AssociatedApplicationManager::self()->appletHasValidAssociatedApplication(this);
valid = valid && hasAuthorization("LaunchApp"); //obey security!
runAssociatedApplication->setVisible(valid);
runAssociatedApplication->setEnabled(valid);
}
@ -1971,6 +1972,7 @@ void Applet::setAssociatedApplicationUrls(const KUrl::List &urls)
QAction *runAssociatedApplication = d->actions->action("run associated application");
if (runAssociatedApplication) {
bool valid = AssociatedApplicationManager::self()->appletHasValidAssociatedApplication(this);
valid = valid && hasAuthorization("LaunchApp"); //obey security!
runAssociatedApplication->setVisible(valid);
runAssociatedApplication->setEnabled(valid);
}
@ -1988,7 +1990,9 @@ KUrl::List Applet::associatedApplicationUrls() const
void Applet::runAssociatedApplication()
{
AssociatedApplicationManager::self()->run(this);
if (hasAuthorization("LaunchApp")) {
AssociatedApplicationManager::self()->run(this);
}
}
bool Applet::hasValidAssociatedApplication() const