刷新我的新等离子体 - 重新分析源

时间:2016-11-26 14:46:12

标签: kde plasmoid

我正在学习如何开发Kde Plasma 5 plasmoids,并使用一个小小部件测试它,只需两个qmls。我读了一些信息来源,比如https://techbase.kde.orghttps://api.kde.org/frameworks/,并为我的测试等离子体创建了一个包结构和来源,如下所示:

$ ls -lR test
test:
total 8
drwxr-xr-x 3 alberto alberto 4096 nov 26 14:28 contents
-rw-r--r-- 1 alberto alberto  459 nov 26 14:28 metadata.desktop

test/contents:
total 4
drwxr-xr-x 2 alberto alberto 4096 nov 26 14:33 ui

test/contents/ui:
total 8
-rw-r--r-- 1 alberto alberto 275 nov 26 14:28 main.qml
-rw-r--r-- 1 alberto alberto 465 nov 26 14:33 RootContainer.qml

RootContainer只是窗口小部件的完整表示,并且只包含带有文本“prueba1”的标签。因此,正如我在文档中所读到的,我使用命令 plasmapkg2 来安装小部件,如下所示:

$ plasmapkg2 --install test
pluginname:  "org.matrixland.test"
Generated  "/home/xxx/.local/share/plasma/plasmoids//kpluginindex.json"  ( 3  plugins)
/home/xxx/Programación/proyectos/plasmoides/test instalado con éxito

然后,我可以在kde桌面上使用它,一切都很好。它显示在桌面上,带有文本标签。

但是现在,如果我更改标签文本“prueba2”,我将删除并重新安装插件,如下所示

$ plasmapkg2 --remove test 
Constructing a KPluginInfo object from old style JSON. Please use kcoreaddons_desktop_to_json() for "" instead of kservice_desktop_to_json() in your CMake code.
Calling KPluginInfo::property("X-KDE-PluginInfo-Name") is deprecated, use KPluginInfo::pluginName() in "/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/packagestructure/plasma_packagestructure_share.so" instead.
Constructing a KPluginInfo object from old style JSON. Please use kcoreaddons_desktop_to_json() for "" instead of kservice_desktop_to_json() in your CMake code.
Calling KPluginInfo::property("X-KDE-PluginInfo-Name") is deprecated, use KPluginInfo::pluginName() in "/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/packagestructure/plasma_packagestructure_share.so" instead.
Generated  "/home/xxx/.local/share/plasma/plasmoids//kpluginindex.json"  ( 2  plugins)
/home/xxx/Programación/proyectos/plasmoides/test desinstalado con éxito

>xxx@eleanor:~/Programación/proyectos/plasmoides$ plasmapkg2 --install test
pluginname:  "org.matrixland.test"
Generated  "/home/alberto/.local/share/plasma/plasmoids//kpluginindex.json"  ( 3  plugins)
/home/alberto/Programación/proyectos/plasmoides/test instalado con éxito

如果现在,我再次将它添加到桌面,我看到旧文本而不是新文本。我在 /home/xxx/.local/share/plasma/plasmoids/org.matrixland.test 目录中查看了源代码是最新的并刷新了,所以我无法猜到为什么我获取旧文本而不是新文本。

显然我的问题是我在qml中所做的任何更改都不会反映在窗口小部件中,而不仅仅是文本更改。我不知道我做错了什么,或者我是否必须做任何其他事情来更新小部件。有人可以帮我吗?

KDE and Qt version info

1 个答案:

答案 0 :(得分:2)

这是因为旧的QML已被高速缓存"仍然。您需要重新启动等离子外壳以查看更改。

killall plasmashell; kstart5 plasmashell

当我想要实时测试时,我使用this script重新安装applet。当我想快速测试时,我会将plasmoidviewer与:

一起使用
plasmoidviewer -a package -l bottomedge -f horizontal

就像在this script中一样。