Refactor Profile and ColorScheme
AcceptedPublic

Authored by tcanabrava on Jul 2 2018, 3:57 PM.

Details

Summary

There's no point in returning null if we have a default
and we would check for null and query for the default
in all cases that we used it.

Export the private header ColorScheme

It's going to be used from Parts and App

Add ColorScheme() to the Profile

The profile used to hold the ColorScheme name, but if you
want to query for the ColorScheme you had to call ViewManager
but there's a class ColorSchemeManager that ViewManager used to call

Just make things simple:

  • Profile has a colorScheme that it queries from the ColorSchemeManager
  • Use profile->colorScheme() when you wanna something from the

colorScheme at the profile.

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tcanabrava created this revision.Jul 2 2018, 3:57 PM
Restricted Application added a project: Konsole. · View Herald TranscriptJul 2 2018, 3:57 PM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
tcanabrava requested review of this revision.Jul 2 2018, 3:57 PM

I appear to have forgotten about this one - I'll look at it now

hindenburg accepted this revision.Sep 23 2018, 3:31 PM
This revision is now accepted and ready to land.Sep 23 2018, 3:31 PM
hindenburg retitled this revision from Return the default ColorScheme in case of a failure to Refactor Profile and ColorScheme.Sep 23 2018, 3:33 PM

Can you rebase this please? It applies cleanly but won't land for some reason.

This revision was automatically updated to reflect the committed changes.
hindenburg reopened this revision.Sep 28 2018, 2:05 PM

This was reverted by Tomaz

This commit breaks sessionProfileCommandReceived
 causing crashes in programs such as nvim.
 I'm reverting it for now while I can't dig deeper.

As I'm sure you've notice it is often difficult to test everything in Konsole. Perhaps creating smaller patches and separating cosmetic and functionally changes would make it easier.

This revision is now accepted and ready to land.Sep 28 2018, 2:05 PM

I'll add a backtrace as soon as I test this again. since I'm succeeding in my konsole code cleanup I'll get this back on track.