baduhai / Koi

Koi - Theme scheduling for the KDE Plasma Desktop
GNU Lesser General Public License v3.0
270 stars 20 forks source link

[BUG] [SOLVED] Parsing for available styles creates hard (unwanted) dependencies resulting in segfault. #22

Closed cyclinggeorgian closed 4 years ago

cyclinggeorgian commented 4 years ago

Describe the bug In the "Get Stuff" block of the "utils.cpp" program is gathering information about available styles on the system. Program is looking for styles in the general system paths and in the user home directories. Program is expecting these paths to be present on the system. And if one of the paths doesn't exists that would lead Koi to segfault. Freshly compiled Koi crashes when not encountering Kvantum on the system. Or to be correct when not encountering following directories: /usr/share/Kvantum or QDir::homePath() + "/.config/Kvantum"

Parsing for Kvantum is the last step in the "Get Stuff" block of the utils.cpp code. Before that few other (system) Plasma styles are being parsed. And only reason that Koi is not segfaulting earlier is because all parsed system (!) paths before Kvantum are present on every system as default: /usr/share/plasma/desktoptheme /usr/share/color-schemes /usr/share/icons /usr/share/themes

While /usr/share/Kvantum is not a default Plasma style and not present on the system by default.

To Reproduce Steps to reproduce the behavior: compile and install Koi on the system. remove Kvantum specific direcotries: /usr/share/Kvantum or /home/username/.config/Kvantum start Koi.

As workaround you do not need to actually install Kvantum - just create one of the aforementioned directories.

Expected behavior Program intelligently disabling certain functionality (like in this case kvantum integration) instead of crashing.

Screenshots

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

cyclinggeorgian commented 4 years ago

for quick tests on openSuse Tumbleweed systems - i have built rpm: https://download.opensuse.org/repositories/home:/cyclingGeorgian:/kdelooks/openSUSE_Tumbleweed/x86_64/Koi-git.20200705.83258aa.0.1.1-1.1.x86_64.rpm

Da-Viper commented 4 years ago

i don't use opensuse but i ran the build in a vm it was showing the segmentation fault so i checked if the folder(s) exists for passing them into a stringlist , you can check in from here, https://github.com/Da-Viper/Koi/tree/master make sure it is the master branch, and build it

check if it fixes the error if yes i would make a pull request to upstream

cyclinggeorgian commented 4 years ago

i have rebuilt RPM and can confirm that fix has solved the problem.

cyclinggeorgian commented 4 years ago

i propose closing this issue once change is merged with upstream.

Da-Viper commented 4 years ago

i propose closing this issue once change is merged with upstream.

i don't know maybe the original author is busy with something else cause its been a while he has been active , that will cause it to take some time for it to be merged , how ever could you help me test the branch https://github.com/Da-Viper/Koi you will need cmake and extra cmake modules to build thanks

cyclinggeorgian commented 4 years ago

I wouldn't mind to help you test builds from Da-Viper branch. But i need more information on how can i help you. Let me know.. PS i thought you ware the original maintainer of the KOI codebase. May i ask who it is?

Da-Viper commented 4 years ago

the owner of this repo baduhai
he has not been active on github for a while now

I wouldn't mind to help you test builds from Da-Viper branch. But i need more information on how can i help you. Let me know.. basically checking stuff that is broken or does not work as intended , heads up i am currently cleaning the code base as some things there are no longer useful

cyclinggeorgian commented 4 years ago

basically checking stuff that is broken or does not work as intended... No problem at all... i have already changed source in mijn build for your (Da-Viper) branch. And i will be building new RPM every time you will be making new commits to your repo.... for now by hand, but i intend to automate this process... Having sad that - if i may, i would like to make a suggestion - if original author is not interested in maintaining the software would it not be more practical if some sort of announcement was made? And your branch would actually became a main development repository?.. preferably with "blessings" from original author, of course! It is not very efficient to trac issues here and fixing them in different repo. And to be honest doesn't look good for whole project as well... and in my opinion it is a very useful piece of software...would be shame if it does not get a traction with upstream Plasma dev community.

And i will be closing this issue, considering that you have fixed it in your repo...

heads up i am currently cleaning the code base as some things there are no longer useful very good to hear! i am convinced that clean and well maintained codebase will attract more devs to the project...

PS i just stumbled on this project while looking to enhance "Night Color" functionality of Plasma. Wishing that for my monitor to not only change a "warmth" but also to switch to dark theme. Normally i cannot work with dark theme...i don't know - age? :-)... but at night it is a must! So i do not know in what extend you are in touch with upstream Plasma devs. But i think this kind of project could very well compliment Night Color functionality and many would be interested in giving a helpful thought or two. Just look at Latte Dock software.

Da-Viper commented 4 years ago

to be honest i wanted to create another app entirely instead of modifying this one, but i was like why create another app that does
what this does with few extra features, so i started to contribute to this one.

if you look at the issue before the one you created that is what i planned for but there has been no response, maybe the author is busy on something else i don't know.

to match kde code base that would moving to cmake and using qml, but there is more to that following release cycles, using kdebugs, etc i tbh i am not really experienced in that right now but probably in the future it may happen.

baduhai commented 4 years ago

I'm sorry i've been so inactive on GH, I'm currently in the process of moving countries and starting a new job. As you can imagine, that can be quite the headache. I'll try to review pull requests and bug reports, but it's unlikely that I'll be very active with the development until the end of September. In the meanwhile if you'd like to have shiny new features that may or may not be merged into Koi, you can use @Da-Viper 's fork of Koi, he seems to be putting a lot of dev effort into it(and doing a good job at it too).

Da-Viper commented 4 years ago

@sputnik-devops There is a pull request currently on the merge request area i want you to help test it on opensuse.

also check if all the window decorations show up in the app. if not run it from the terminal, go to window decoration on the app, there should be a path output could you paste it here as it varies from distro to distro

baduhai commented 2 years ago

Huh, I think I ran into this bug again recently and fixed it. Check latest version and create a new issue if problem persists.