Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to support hiding search, timeline and fstab devices #4

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ysalmon
Copy link

@ysalmon ysalmon commented Jul 14, 2018

My first attempt at QML.
It does not work as intended, but I do not understand why.
Possible causes :

  • I did not get the currentIndex right and this skews the meaning of the different options for showing devices
  • I did not get the QRegExp right, but I think the (?!) idiom is conform to https://doc.qt.io/archives/qt-4.8/qregexp.html#assertions
  • the data in url and path have invisible garbage at the beginning which prevents the regexp from matching.

Note that due to the increase in the number of options, I departed from your "combinatorial" filter selection scheme to an "incremental" one.

@ysalmon
Copy link
Author

ysalmon commented Jul 14, 2018

I refactored the code to use https://github.com/oKcerG/SortFilterProxyModel instead of a succession of SortFilterModel, but I do not know how to include such a submodule properly. The module's documentation indicates to add some include directive to a .pro file, but we do not have a .pro file

@dfaust
Copy link
Owner

dfaust commented Jul 15, 2018

Hm, when running this, I get a bunch of errors, like property var xxx must be followed by a colon - don't you?
Also RegExpFilter is unknown. Where does it come from?

SortFilterProxyModel looks interesting, but I don't think we can use it. It is built with C++ and I really don't want to open that can of worms.

@ysalmon
Copy link
Author

ysalmon commented Jul 15, 2018

No, when I execute make, I do not get any error, which is very frustrating because there are obviously errors.

@ysalmon
Copy link
Author

ysalmon commented Jul 15, 2018

Running the applet with plasmoidviewer only gives

 plasmoidviewer --applet org.kde.placesWidget
QML debugging is enabled. Only use this in a safe environment.
qml: View QML loaded
org.kde.plasmaquick: Applet preload policy set to 1
Warning: all files used by qml by the plasmoid should be in ui/. The file in the path "file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/code/LayoutManager.js" was expected at QUrl("file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/LayoutManager.js")
Warning: all files used by qml by the plasmoid should be in ui/. The file in the path "file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/code/FolderTools.js" was expected at QUrl("file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/FolderTools.js")
Toolbox not loading, toolbox package is either invalid or disabled.
qml: New Containment: ContainmentInterface(0x55d1778e02a0)
Constructing a KPluginInfo object from old style JSON. Please use kcoreaddons_desktop_to_json() for "/home/yann/Documents/Programmes/plasma-applet-places-widget/build" instead of kservice_desktop_to_json() in your CMake code.

So no error message, despite the applet not actually being active in the previewer.

@dfaust
Copy link
Owner

dfaust commented Jul 15, 2018

The errors appear only when executing the applet, make just copies the files. Try sudo make install && plasmoidviewer --applet org.kde.placesWidget

@ysalmon
Copy link
Author

ysalmon commented Jul 18, 2018

So, after much work understanding SortFilterModel and package installation procedures (is there a serious Plasma QML library documentation somewhere ? All I can find is unclear wikis with broken links and a website about the Plasma classes which merely states that "the definition of this is in this .cpp file"…), I managed to make it work at least for search and timeline places. Concerning devices, I am now using version 2.1 of PlasmaCore that has a filterCallback feature which should allow to specify a finer criterion. Alas this part does not work yet.

@dfaust
Copy link
Owner

dfaust commented Feb 19, 2019

I just released version 1.3 of plasma-applet-places-widget with the ability to filter timeline and search items. So now only the fstab filter remains. I haven't really thought about that, yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants