mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma-addons: use the package metadata to get the package name in qmlwallpapers plugin
much more reliable than chopping the path into pieces to figure out the package name. also because KGlobal::dirs()->findDirs() returns paths with trailing slash the previous method was returning empty string Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b9106628cd
commit
ae086cf0b8
2 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ QVariant WallpapersModel::data(const QModelIndex& index, int role) const
|
|||
Plasma::Package* p = m_packages[index.row()];
|
||||
switch (role) {
|
||||
case PackageNameRole:
|
||||
return KUrl(p->path()).fileName(KUrl::LeaveTrailingSlash);
|
||||
return p->metadata().pluginName();
|
||||
case Qt::DisplayRole:
|
||||
return p->metadata().name();
|
||||
case Qt::ToolTipRole:
|
||||
|
|
|
@ -173,7 +173,7 @@ QWidget* WallpaperQml::createConfigurationInterface(QWidget* parent)
|
|||
v.m_view->setItemDelegate(new BackgroundDelegate(v.m_view));
|
||||
if (m_package) {
|
||||
v.m_view->setCurrentIndex(m->indexForPackagePath(m_package->path()));
|
||||
m_packageName = KUrl(m_package->path()).fileName(KUrl::LeaveTrailingSlash);
|
||||
m_packageName = m_package->metadata().pluginName();
|
||||
}
|
||||
v.m_color->setColor(m_scene->backgroundBrush().color());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue