Commit graph

8319 commits

Author SHA1 Message Date
Ivailo Monev
b57c20755a handle list of map/hash(s) as special case in QJsonDocumentPrivate::variantToJson()
apparently JSON does support mixed types in arrays but QJsonDocument does
not

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 20:37:58 +03:00
Ivailo Monev
7c840afcb1 always use the custom line-reading code in QFile::readLineData()
sequential or not read() is read(), positioning should be done before that.
it is also faster than calling QFile::readData() multiple times which was
done for non-sequential files (regular files)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 15:53:02 +03:00
Ivailo Monev
7ad0934eae getSettingsPath() function optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 15:14:38 +03:00
Ivailo Monev
c0e446a031 simplify QSettings value setters and getters
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 15:14:26 +03:00
Ivailo Monev
8f57ac6334 remove unused qjsondocument header inclusion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 11:43:47 +03:00
Ivailo Monev
1c185797eb rework QSettings to use QString instead of QVariant
as optimization for the common use case

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 00:12:50 +03:00
Ivailo Monev
b72c37176a translations update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-03 05:14:17 +03:00
Ivailo Monev
e1b60d98b9 adapt QDateTimeEdit to locale changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 13:44:29 +03:00
Ivailo Monev
90137d4df9 use custom widget for the time of QDateTimeEdit
unsuitable for timers (time intervals) but displays localized time,
for reference:
a973169ee4

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 11:05:08 +03:00
Ivailo Monev
d76eb99a8e update the QDateTimeEdit button text on date change
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 10:19:36 +03:00
Ivailo Monev
747eb83bed correct assignment in QDateTimeParser::parseFormat()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 08:51:35 +03:00
Ivailo Monev
c1eb4855ef unexport QDateTimeParser
no longer required by QDateTimeEdit and the related classes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 08:51:07 +03:00
Ivailo Monev
a973169ee4 emulate plurals for QDateTimeEdit
QDateTimeEdit is used mostly for timers so the plurals will fit nicely,
writing other QDateTimeEdit-like widgets to use QLineEdit or QComboBox
for partciluar purposes would be piece of cake

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 06:29:03 +03:00
Ivailo Monev
260f37c25e remove non-operational QDateTimeParser bits
with the QDateTimeEdit rewrite (see the previous commit) the parser has
only one mode

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 05:35:26 +03:00
Ivailo Monev
24690f5507 reimplement QDateTimeEdit
no date/time parsing and it has different look based on what is being
edited:
https://ibb.co/w6hTwCk

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-02 04:16:01 +03:00
Ivailo Monev
9688b3520f assume the time spec of QDate and QTime is Qt::LocalTime in QLocale::toString() methods
for compat

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-01 09:21:53 +03:00
Ivailo Monev
c888e37af5 add note about the tst_QFileInfo::fileTimes() test
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-01 09:20:52 +03:00
Ivailo Monev
fb2849a589 return different status based on the error from trc tool
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-01 05:16:06 +00:00
Ivailo Monev
db07b8b18f implement -fuzzy and -obsolete options for trc tool
-fuzzy to be used (potentially) by Katana

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-01 05:07:04 +00:00
Ivailo Monev
b79d6326b9 format qmimedata source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-01 01:53:01 +00:00
Ivailo Monev
67f7b1029d QMimeData::formats() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-01 01:49:14 +03:00
Ivailo Monev
0fc9e64535 mark the warning case in QTranslator::loadFromData() as unlikely
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-01 01:48:47 +03:00
Ivailo Monev
086386f904 optimize generateItem() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 10:53:44 +00:00
Ivailo Monev
cc9c887917 optimize QFontEngine::getGlyphPositions() and its callers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 10:40:14 +00:00
Ivailo Monev
9045a97c30 ignore the transformation when loading fonts from QFontEngineFT
no transformation is set (outline scaling is done by
QFreetypeFace::addGlyphToPath()) thus the transformation can be ignored and
potentially speeding up loading a bit (glyphs are cached anyway tho)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 10:16:57 +00:00
Ivailo Monev
a8afa46dfb const-ify the argument of QFontEngine::loadKerningPairs()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 10:05:54 +00:00
Ivailo Monev
ce16761842 do not link the KtGui component to KtXml
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 09:55:35 +00:00
Ivailo Monev
6666303f27 shush compiler warning
the QString length is checked by the above QString::isEmpty() call but the
compiler knows not what it does

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 02:25:45 +00:00
Ivailo Monev
bdd67963ec drop QVarLengthArray<T> and replace it with QStdVector<T> internally
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-30 20:59:14 +00:00
Ivailo Monev
4474d26443 partially revert a551f78d11
fixes Plasma::RunnerContext test failure

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-30 17:58:35 +00:00
Ivailo Monev
30d532b8a0 output GMT from QLocale::toString() when the QDateTime spec is Qt::LocalTime
note that because QTime and QDate carry no information how the objects
came to be (the time spec) it is next to impossible (without other
changes) to figure out if the time zone string should be GMT/UTC or the
local time zone abbreviation, bad design?

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 08:14:25 +03:00
Ivailo Monev
204ebd8b63 initialize QLabelPrivate member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 02:30:14 +03:00
Ivailo Monev
0c143f2e1d get rid of QWidgetItemV2
round 2, see 6d3fe9312c

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 02:12:59 +03:00
Ivailo Monev
a343e9db24 handle QDateTimeParser::TimeZoneSection enum in QDateTimeEditPrivate::convertToPublic()
introduced in:
3c69bcc12b

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-11 04:29:03 +03:00
Ivailo Monev
d9282d28b2 update URL TLDs table data
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-10 03:19:40 +03:00
Ivailo Monev
64fa389d77 do not warn if XDG_RUNTIME_DIR is not set
happens often enough, if current user is changed via `sudo` for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-08 04:25:00 +03:00
Ivailo Monev
33f7ac320f implement debug operator for QPalette
beware that it will dump quite a lot of data, something along the lines of:
QPalette(
  -> group=Active, role=WindowText, brush=QBrush(QColor(ARGB 1, 0.878431, 0.870588, 0.858824) , SolidPattern )  )
  -> group=Active, role=Button, brush=QBrush(QColor(ARGB 1, 0.25098, 0.247059, 0.243137) , SolidPattern )  )
  -> group=Active, role=Light, brush=QBrush(QColor(ARGB 1, 0.310628, 0.304158, 0.304158) , SolidPattern )  )
  -> group=Active, role=Midlight, brush=QBrush(QColor(ARGB 1, 0.257237, 0.251865, 0.251865) , SolidPattern )  )
  -> group=Active, role=Dark, brush=QBrush(QColor(ARGB 1, 0.0915999, 0.0896773, 0.0896773) , SolidPattern )  )
  -> group=Active, role=Mid, brush=QBrush(QColor(ARGB 1, 0.162005, 0.158633, 0.158633) , SolidPattern )  )
  -> group=Active, role=Text, brush=QBrush(QColor(ARGB 1, 0.878431, 0.870588, 0.858824) , SolidPattern )  )
  -> group=Active, role=BrightText, brush=QBrush(QColor(ARGB 1, 1, 1, 1) , SolidPattern )  )
  -> group=Active, role=ButtonText, brush=QBrush(QColor(ARGB 1, 0.909804, 0.901961, 0.890196) , SolidPattern )  )
  -> group=Active, role=Base, brush=QBrush(QColor(ARGB 0, 0, 0, 0) , SolidPattern )  )
  -> group=Active, role=Window, brush=QBrush(QColor(ARGB 1, 0.188235, 0.184314, 0.184314) , SolidPattern )  )
  -> group=Active, role=Shadow, brush=QBrush(QColor(ARGB 1, 0.066392, 0.0650034, 0.0650034) , SolidPattern )  )
  -> group=Active, role=Highlight, brush=QBrush(QColor(ARGB 1, 0.0941176, 0.282353, 0.501961) , SolidPattern )  )
  -> group=Active, role=HighlightedText, brush=QBrush(QColor(ARGB 1, 1, 1, 1) , SolidPattern )  )
  -> group=Active, role=Link, brush=QBrush(QColor(ARGB 1, 0.313725, 0.556863, 0.847059) , SolidPattern )  )
  -> group=Active, role=LinkVisited, brush=QBrush(QColor(ARGB 1, 0.556863, 0.47451, 0.647059) , SolidPattern )  )
  -> group=Active, role=AlternateBase, brush=QBrush(QColor(ARGB 1, 0.141176, 0.137255, 0.137255) , SolidPattern )  )
  -> group=Active, role=NoRole, brush=QBrush(QColor(ARGB 1, 0, 0, 0) , SolidPattern )  )
  -> group=Active, role=ToolTipBase, brush=QBrush(QColor(ARGB 1, 0.0627451, 0.188235, 0.313725) , SolidPattern )  )
  -> group=Active, role=ToolTipText, brush=QBrush(QColor(ARGB 1, 0.768627, 0.819608, 0.878431) , SolidPattern )  )
  -> group=Disabled, role=WindowText, brush=QBrush(QColor(ARGB 1, 0.377111, 0.372473, 0.368856) , SolidPattern )  )
  -> group=Disabled, role=Button, brush=QBrush(QColor(ARGB 1, 0.220218, 0.21677, 0.213336) , SolidPattern )  )
  -> group=Disabled, role=Light, brush=QBrush(QColor(ARGB 1, 0.293324, 0.287205, 0.287205) , SolidPattern )  )
  -> group=Disabled, role=Midlight, brush=QBrush(QColor(ARGB 1, 0.238911, 0.233921, 0.233921) , SolidPattern )  )
  -> group=Disabled, role=Dark, brush=QBrush(QColor(ARGB 1, 0.0803693, 0.0786908, 0.0786908) , SolidPattern )  )
  -> group=Disabled, role=Mid, brush=QBrush(QColor(ARGB 1, 0.142214, 0.139239, 0.139239) , SolidPattern )  )
  -> group=Disabled, role=Text, brush=QBrush(QColor(ARGB 1, 0.878431, 0.870588, 0.858824) , SolidPattern )  )
  -> group=Disabled, role=BrightText, brush=QBrush(QColor(ARGB 1, 1, 1, 1) , SolidPattern )  )
  -> group=Disabled, role=ButtonText, brush=QBrush(QColor(ARGB 1, 0.422553, 0.417899, 0.412055) , SolidPattern )  )
  -> group=Disabled, role=Base, brush=QBrush(QColor(ARGB 0, 0, 0, 0) , SolidPattern )  )
  -> group=Disabled, role=Window, brush=QBrush(QColor(ARGB 1, 0.165164, 0.161715, 0.161715) , SolidPattern )  )
  -> group=Disabled, role=Shadow, brush=QBrush(QColor(ARGB 1, 0.0583505, 0.0571298, 0.0571298) , SolidPattern )  )
  -> group=Disabled, role=Highlight, brush=QBrush(QColor(ARGB 1, 0.165164, 0.161715, 0.161715) , SolidPattern )  )
  -> group=Disabled, role=HighlightedText, brush=QBrush(QColor(ARGB 1, 0.377111, 0.372473, 0.368856) , SolidPattern )  )
  -> group=Disabled, role=Link, brush=QBrush(QColor(ARGB 1, 0.167926, 0.240345, 0.329473) , SolidPattern )  )
  -> group=Disabled, role=LinkVisited, brush=QBrush(QColor(ARGB 1, 0.242588, 0.215061, 0.26804) , SolidPattern )  )
  -> group=Disabled, role=AlternateBase, brush=QBrush(QColor(ARGB 1, 0.123873, 0.120424, 0.120424) , SolidPattern )  )
  -> group=Disabled, role=NoRole, brush=QBrush(QColor(ARGB 1, 0, 0, 0) , SolidPattern )  )
  -> group=Disabled, role=ToolTipBase, brush=QBrush(QColor(ARGB 1, 0.0627451, 0.188235, 0.313725) , SolidPattern )  )
  -> group=Disabled, role=ToolTipText, brush=QBrush(QColor(ARGB 1, 0.768627, 0.819608, 0.878431) , SolidPattern )  )
  -> group=Inactive, role=WindowText, brush=QBrush(QColor(ARGB 1, 0.878431, 0.870588, 0.858824) , SolidPattern )  )
  -> group=Inactive, role=Button, brush=QBrush(QColor(ARGB 1, 0.25098, 0.247059, 0.243137) , SolidPattern )  )
  -> group=Inactive, role=Light, brush=QBrush(QColor(ARGB 1, 0.310628, 0.304158, 0.304158) , SolidPattern )  )
  -> group=Inactive, role=Midlight, brush=QBrush(QColor(ARGB 1, 0.257237, 0.251865, 0.251865) , SolidPattern )  )
  -> group=Inactive, role=Dark, brush=QBrush(QColor(ARGB 1, 0.0915999, 0.0896773, 0.0896773) , SolidPattern )  )
  -> group=Inactive, role=Mid, brush=QBrush(QColor(ARGB 1, 0.162005, 0.158633, 0.158633) , SolidPattern )  )
  -> group=Inactive, role=Text, brush=QBrush(QColor(ARGB 1, 0.878431, 0.870588, 0.858824) , SolidPattern )  )
  -> group=Inactive, role=BrightText, brush=QBrush(QColor(ARGB 1, 1, 1, 1) , SolidPattern )  )
  -> group=Inactive, role=ButtonText, brush=QBrush(QColor(ARGB 1, 0.909804, 0.901961, 0.890196) , SolidPattern )  )
  -> group=Inactive, role=Base, brush=QBrush(QColor(ARGB 0, 0, 0, 0) , SolidPattern )  )
  -> group=Inactive, role=Window, brush=QBrush(QColor(ARGB 1, 0.188235, 0.184314, 0.184314) , SolidPattern )  )
  -> group=Inactive, role=Shadow, brush=QBrush(QColor(ARGB 1, 0.066392, 0.0650034, 0.0650034) , SolidPattern )  )
  -> group=Inactive, role=Highlight, brush=QBrush(QColor(ARGB 1, 0.0980087, 0.224735, 0.373404) , SolidPattern )  )
  -> group=Inactive, role=HighlightedText, brush=QBrush(QColor(ARGB 1, 0.878431, 0.870588, 0.858824) , SolidPattern )  )
  -> group=Inactive, role=Link, brush=QBrush(QColor(ARGB 1, 0.313725, 0.556863, 0.847059) , SolidPattern )  )
  -> group=Inactive, role=LinkVisited, brush=QBrush(QColor(ARGB 1, 0.556863, 0.47451, 0.647059) , SolidPattern )  )
  -> group=Inactive, role=AlternateBase, brush=QBrush(QColor(ARGB 1, 0.141176, 0.137255, 0.137255) , SolidPattern )  )
  -> group=Inactive, role=NoRole, brush=QBrush(QColor(ARGB 1, 0, 0, 0) , SolidPattern )  )
  -> group=Inactive, role=ToolTipBase, brush=QBrush(QColor(ARGB 1, 0.0627451, 0.188235, 0.313725) , SolidPattern )  )
  -> group=Inactive, role=ToolTipText, brush=QBrush(QColor(ARGB 1, 0.768627, 0.819608, 0.878431) , SolidPattern )  )
)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 23:22:40 +03:00
Ivailo Monev
97c4c460f8 replace local constant with the enum for in QPalette data stream operator
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 22:35:56 +03:00
Ivailo Monev
41ce90510b implement debug operator for QRegExp
to properly log KDirLister name filters for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 20:26:48 +03:00
Ivailo Monev
5e99c6ae1a use QSTACKARRAY() macro in QString::replace()
so that the array is zero-initialized

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 09:00:23 +03:00
Ivailo Monev
f6029fe81f replace QVarLengthArray<T> with QStdVector<T> in QTextEngine
will happen everywhere eventually

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 04:19:16 +03:00
Ivailo Monev
cb095129da include qhash header in qstdcontainers_p header
for qHash() function reference

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 04:18:25 +03:00
Ivailo Monev
2d90bcd80a save and restore the device position in QSvgIOHandler::option()
that will shush gwenview

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 03:31:52 +03:00
Ivailo Monev
6769d04ee2 do not recurse into sub-directories from QStatInfo::dirInfos()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 09:47:06 +03:00
Ivailo Monev
55dcf19183 compare the clean paths of QStatInfo
to match what QFileInfo does

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 09:46:23 +03:00
Ivailo Monev
e7f4a300ec QFileSystemWatcher optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 08:46:10 +03:00
Ivailo Monev
2c70d06992 convert path to QByteArray via QFile::encodeName() in QStatInfo::dirInfos()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 08:09:54 +03:00
Ivailo Monev
75d4dc82b5 register socket error and state enums as metatypes
makes no sense to have to register types externally that the socket classes
use (connect) internally

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-28 19:31:34 +03:00
Ivailo Monev
e42586803b pass the size of the QByteArray object to QString::fromLocal8Bit() in QFile::decodeName()
for paths with spaces

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-24 19:44:33 +03:00
Ivailo Monev
e922f43863 add leading slashes for any URL with file scheme
for the case of KUrl and anything using it - it can start with a
environment variable reference (such as $HOME) instead of leading slash

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-24 14:15:52 +03:00