use the package path provided by the package structure; fewer hardcoded paths

svn path=/trunk/KDE/kdelibs/; revision=1112725
This commit is contained in:
Aaron J. Seigo 2010-04-08 23:47:05 +00:00
parent 55dba31bcf
commit fb00fcf42c

View File

@ -2603,7 +2603,8 @@ void AppletPrivate::init(const QString &packagePath)
// find where the Package is
QString path = packagePath;
if (path.isEmpty()) {
path = KStandardDirs::locate("data", "plasma/plasmoids/" + appletDescription.pluginName() + "/metadata.desktop");
path = q->packageStructure()->defaultPackageRoot() + '/' + appletDescription.pluginName() + "/metadata.desktop";
path = KStandardDirs::locate("data", path);
path.replace(QString("/metadata.desktop"),QString("/"));
} else if (!path.endsWith('/')) {
path.append('/');