Review Request 127979: [WIP] Implement color scheme selection from these installed in the system using KColorSchemeManager

Aleix Pol Gonzalez aleixpol at kde.org
Sat May 28 01:35:25 UTC 2016



> On May 21, 2016, 9:31 p.m., Aleix Pol Gonzalez wrote:
> > shell/thememanager.h, line 37
> > <https://git.reviewboard.kde.org/r/127979/diff/1/?file=465304#file465304line37>
> >
> >     Maybe it should be called `ColorSchemeManager`? I'd also change other `Theme` uses for `ColorScheme`.
> 
> Alexander Zhigalin wrote:
>     Why?

Because it's swapping the currently loaded KColorScheme instance.


> On May 21, 2016, 9:31 p.m., Aleix Pol Gonzalez wrote:
> > shell/thememanager.cpp, line 55
> > <https://git.reviewboard.kde.org/r/127979/diff/1/?file=465305#file465305line55>
> >
> >     Why isn't it a `Q_GLOBAL_STATIC(ThemeManager, object)`? Also usually static members have a `s_` prefix. I suggest: `s_themeManager`.
> 
> Alexander Zhigalin wrote:
>     Digikam heritage, will look there when the thing will get working.

Please do.


> On May 21, 2016, 9:31 p.m., Aleix Pol Gonzalez wrote:
> > shell/thememanager.cpp, line 137
> > <https://git.reviewboard.kde.org/r/127979/diff/1/?file=465305#file465305line137>
> >
> >     The only reason we are passing the QApplication is so that `d->manager` has a parent?
> >     
> >     I'd rather manage it within ThemeManager by using QScopedPointer or such. `d->manager` can be initialized the first time it's used. Or `this`.
> 
> Alexander Zhigalin wrote:
>     >The only reason we are passing the QApplication is so that d->manager has a parent?
>     
>     I think KColorSchemeManager wants the main application object as his parent.
>     >I'd rather manage it within ThemeManager by using QScopedPointer or such. d->manager can be initialized the first time it's used. Or this.
>     
>     Can you please explain?

http://api.kde.org/frameworks-api/frameworks5-apidocs/frameworks/kconfigwidgets/html/classKColorSchemeManager.html

If KColorSchemeManager needed a QApplication, it would request a QApplication. Also the QApplication is a global object after all, so I don't see a reason why it would need it as mandatory.


> On May 21, 2016, 9:31 p.m., Aleix Pol Gonzalez wrote:
> > shell/thememanager.cpp, line 155
> > <https://git.reviewboard.kde.org/r/127979/diff/1/?file=465305#file465305line155>
> >
> >     Again QScopedPointer.
> 
> Alexander Zhigalin wrote:
>     Again, explain please.

In modern C++ it's preferred to use smart pointers rather than managing memory explicitly (i.e. one shouldn't need to write `delete`, as a rough naif rule).

Some pointers (badumts!): https://wiki.qt.io/Smart_Pointers


- Aleix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127979/#review95679
-----------------------------------------------------------


On May 20, 2016, 9:44 p.m., Alexander Zhigalin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127979/
> -----------------------------------------------------------
> 
> (Updated May 20, 2016, 9:44 p.m.)
> 
> 
> Review request for KDevelop and Kevin Funk.
> 
> 
> Bugs: 279592
>     http://bugs.kde.org/show_bug.cgi?id=279592
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> [WIP] Implement color scheme selection from these installed in the system using KColorSchemeManager
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt ec521ab8f5dcdd1cc175809f56169259e241ea34 
>   shell/CMakeLists.txt 752c435b81d60e6bf9d438a0367662a8be346a33 
>   shell/mainwindow.h 8340064ee7e1a3b95695b430270cc848ac69eeac 
>   shell/mainwindow.cpp cf1b15d99365a1274f49bbde18bf3c5c17ba7ccb 
>   shell/mainwindow_p.cpp 70b56db7bed09aeea7a0e57307fb870f65471574 
>   shell/thememanager.h PRE-CREATION 
>   shell/thememanager.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/127979/diff/
> 
> 
> Testing
> -------
> 
> Not tested yet
> 
> 
> Thanks,
> 
> Alexander Zhigalin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160528/a5c17fdf/attachment-0001.html>


More information about the KDevelop-devel mailing list