backport of r1081144:

make "run associated application" obey security

svn path=/branches/KDE/4.4/kdelibs/; revision=1081145
This commit is contained in:
Chani Armitage 2010-01-27 20:35:52 +00:00
parent 0fa82befaf
commit f77cf8c3e0

View File

@ -1970,6 +1970,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);
}
@ -1982,6 +1983,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);
}
@ -1999,7 +2001,9 @@ KUrl::List Applet::associatedApplicationUrls() const
void Applet::runAssociatedApplication()
{
AssociatedApplicationManager::self()->run(this);
if (hasAuthorization("LaunchApp")) {
AssociatedApplicationManager::self()->run(this);
}
}
bool Applet::hasValidAssociatedApplication() const