Commit Graph

48 Commits

Author SHA1 Message Date
Kurt Hindenburg
cf260af00b Remove unused variable 2019-12-22 12:01:13 -05:00
Mariusz Glebocki
52d2720007 Revert "GIT_SILENT: minor qstring optimization"
This reverts commit f96deb39aa.

This was anti-optimization.
QStringLiteral is a QString created at build time. Initialization of
QString with it has no overhead.
QLatin1String is 8 bit C string wrapper which needs run-time conversion
to 16 bit encoding used in QString.
2019-12-17 21:04:14 -05:00
Ahmad Samir
c83bb19a68 Port away from deprecated foreach, use for-range instead, first take
The code compiles and konsole loads and seems to work as before.
2019-11-24 19:24:12 +02:00
Laurent Montel
f96deb39aa GIT_SILENT: minor qstring optimization 2019-09-07 13:33:09 +02:00
Laurent Montel
ef1beaab86 Remove unused includes 2019-08-23 08:09:17 +02:00
Kurt Hindenburg
2e72701806 Change Q_FOREACH to correct for usage 2019-03-03 19:45:18 -05:00
Tomaz Canabrava
d77b991f3a Revert "Refactor Profile and ColorScheme"
This commit breaks sessionProfileCommandReceived
causing crashes in programs such as nvim.
I'm reverting it for now while I can't dig deeper.

This reverts commit 99f233b9a1.
2018-09-25 17:22:08 +02:00
Tomaz Canabrava
99f233b9a1 Refactor Profile and ColorScheme
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.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13854
2018-09-23 19:07:00 +02:00
Harald Sitter
97d9ed9436 add knewstuff support for color schemes
Summary:
schemes are supplied by `Konsole Color Scheme` category on store.kde.org

https://store.kde.org/p/1216368/

- new manager helpers to unload a theme and check a file's name validity
- new Get New.. button to start the KNS download dialog
- upon KNS completion we'll attempt to load all installed files as schemes
- for KNS entities which failed to load anything we'll show a warning as
  the theme is malformed
- for removal we'll first try to remove schemes through KNS to avoid its
  registry going out of sync with the on-disk "installedness" of an entity
- properly disable copying of the scheme manager (needs to be private)

FEATURE: 18.04.0
CHANGELOG: Support for downloading color schemes from the KDE store

Test Plan:
category is T8053 (can also use `KDE Color Scheme KDE4` for testing)

- get new -> install scheme -> close -> shows up in list
- remove from list -> get new -> not listed as installed
- install random stuff from kde color scheme category -> close ->
  warning should be displayed
- install scheme -> get new -> remove scheme via dialog -> close ->
  not listed as installed

Reviewers: hindenburg

Subscribers: #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D10766
2018-02-28 10:49:10 +01:00
Kurt Hindenburg
a7c3bda7a5 Use QFileInfo::completeBaseName() instead of baseName()
This fixes some infinite loops and other issues when file names have
multiple dots in their file name.

Patch by ahmadsamir

BUG: 343071
Differential Revision: https://phabricator.kde.org/D10439
2018-02-12 09:39:07 -05:00
Kurt Hindenburg
0d95c7f46b Add a way to reset changes to system-wide color schemes
If an user has alter the system-side color schemes, Konsole saves
thoses changes in the user's local folder.  This patch allows that
local user file to be deleted, thus resetting the color scheme to the
default system-wide file.

Patch by ahmadsamir

BUG: 369481
FIXED-IN: 18.04
Differential Revision: https://phabricator.kde.org/D9568
2018-01-23 09:34:27 -05:00
Kurt Hindenburg
2a2a56d73c modernize use nullptr 2017-07-15 23:28:32 -04:00
Kurt Hindenburg
1da83f1ef3 uncrustify using kf5 config 2017-05-28 11:33:46 -04:00
Kurt Hindenburg
eade05a4bd Do not specify Qt modules in includes 2017-04-26 21:33:34 -04:00
Kurt Hindenburg
5648ec1a1a Use QLatin1* to handle casts from ascii 2017-04-16 14:16:21 -04:00
Kurt Hindenburg
accf076104 Use member initializer lists in constructors 2017-04-11 12:07:34 -04:00
Kurt Hindenburg
dfafff97d4 remove QDebug/qWarning and use QCDebug 2017-03-31 21:06:18 -04:00
Kurt Hindenburg
2b586e6ff8 use auto 2017-03-28 11:25:26 -04:00
Kurt Hindenburg
f5418597f6 includes cleanup 2016-06-19 19:02:26 -04:00
Kurt Hindenburg
145310d896 Use QStringLiteral and QLatin1String 2015-10-15 15:32:34 -04:00
Kurt Hindenburg
dc5ba8c695 add QList::reserve() 2015-10-12 09:46:10 -04:00
Kurt Hindenburg
1893ee5ad0 Remove old KDE3 code
This includes reading the old color .schema files
2015-10-03 21:30:35 -04:00
Kurt Hindenburg
54713c23fc comment out the 2nd line of a qDebug also 2014-11-27 13:21:13 -05:00
Kurt Hindenburg
44457f8e37 Fix write locations for konsole's files
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation
apparently doesn't include an / at the end.
2014-10-28 08:53:44 -04:00
Hrvoje Senjan
9ecc27aadb Fixup commit 15d09f9, QStandardPaths can't use wildcards directly 2014-10-18 22:24:18 +02:00
Montel Laurent
5d4cda3e2f kdelibs4support-- 2014-10-18 13:03:41 +02:00
Montel Laurent
8182ac8edc Port to QDebug 2014-10-17 09:09:20 +02:00
Michal Humpula
15d09f9161 port from KStandardDirs to QStandardPaths
REVIEW: 120498
2014-10-11 14:34:15 +02:00
Kurt Hindenburg
b6429eadec port from K_GLOBAL_STATIC to Q_GLOBAL_STATIC
Patch by Michal Humpula michal humpula hudrydum cz

REVIEW: 120496
2014-10-05 10:01:00 -04:00
Alex Richardson
7162996e1d Port away from Q_WS_X11 2014-04-10 15:27:51 +02:00
Alex Richardson
a83db71590 Port to KF5/Qt5
TerminalDisplayAccessible is disabled for Qt5 currently since I don't
have any experience with accessible stuff and it is more complicated
than just changing a few includes

REVIEW: 111937
2013-08-20 23:34:35 +02:00
Alex Richardson
ab5e15b1b7 Revert "Port to KF5/Qt5"
This reverts commit 4adfbe84bd.

This work will go into a new branch instead
2013-08-13 23:26:19 +02:00
Alex Richardson
4adfbe84bd Port to KF5/Qt5
To build for KF5 pass the option -DQT5_BUILD=ON to CMake

TerminalDisplayAccessible is disabled for Qt5 currently since I don't
have any experience with accessible stuff and it is more complicated
than just changing a few includes

REVIEW: 111937
2013-08-13 21:26:59 +02:00
Kurt Hindenburg
b41a9253e6 Prevent infinite loop when Scheme name has / in it
A fix to prevent an infinite loop if user puts / in ColorScheme name;
Konsole will create a sub-folder in that case.

More code will have to go in to prevent the users from doing that.

FIXED-IN: 4.11
BUG: 315086
2013-04-06 15:23:54 -04:00
Kurt Hindenburg
7a2a5beb00 Correct spelling errors/word usage
All these are in the comments - no code changes
2013-01-09 22:07:11 -05:00
Kurt Hindenburg
983efbc5a8 Add braces around if/else for readability 2012-12-19 23:41:09 -05:00
Jekyll Wu
1a26982427 "#ifdef(XYZ)" -> "#if defined(XYZ)"
Use one form consistently in all code
2012-11-20 11:42:12 +08:00
Jekyll Wu
001a353a46 Remove code for per-color transparency
That per-color transparency looks like a heritage of the pesudo
transparency in the KDE3 era. It is basically not used in current code.
2012-05-21 14:47:10 +08:00
Kurt Hindenburg
bee9aa8f78 minor style fixes - remove empty lines start/end code blocks 2012-05-13 10:08:05 -04:00
Kurt Hindenburg
5b083640ce whitespace and style fixes
Use 'git diff -w --ignore-all-space' to see non-whitespace changes
2012-04-05 11:08:53 -04:00
Jekyll Wu
f7681ede01 use the qDeleteAll algorithm to delete objects 2012-04-05 07:23:17 +08:00
Jekyll Wu
2b7a5b2cfc Fix the memory leak when adding & deleting colorschems
TODO: should use smart pointer to reduce manual memory management?
2012-04-05 05:26:48 +08:00
Jekyll Wu
d51fe86819 QList<String> ==> QStringList 2012-04-05 04:32:02 +08:00
Kurt Hindenburg
d42633e54d add explicit to constructors with 1 parameter 2012-03-18 16:42:31 -04:00
Jekyll Wu
f4fb943132 Most of time we only need <KLocalizedString> instead of <KLocale> 2012-03-07 06:48:26 +08:00
Jekyll Wu
9e8c17641e Migrate KDE3 schemas into KDE4 colorschemes automatically on loaded
REVIEW: 104118
2012-03-01 22:40:23 +08:00
Jekyll Wu
35e9cd847a Enable looking up colors in the X11 color database.
FEATURE:138740
FIXED-IN:4.9.0
2012-03-01 00:12:57 +08:00
Jekyll Wu
2f7a0965f5 Move class ColorSchemeMananger into its own file
class KDE3ColorSchemeReader is also moved since it is supposed to an
compatibility helpr of which class ColorScheme does not need to know,
and eventualy it should be removed
2012-02-29 22:31:56 +08:00