Commit graph

270 commits

Author SHA1 Message Date
Ivailo Monev
610ce35050 kdecore: log debug messages for KLockFile
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-31 20:14:41 +03:00
Ivailo Monev
825763d73f kio: drop the feature to delay MIME type determination
it shall be delayed without the feature (which it was anyway)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-27 17:10:04 +03:00
Ivailo Monev
198997f5e1 kdecore: interrupt lock attempts from KLockFile destructor
every while loop should have interrupt point, this one did not

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 14:39:15 +03:00
Ivailo Monev
7f261aca95 kdecore: new KTemporaryFile::urlPath() method
based on the bits in kparts/part.cpp

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 22:52:30 +03:00
Ivailo Monev
c31499dd07 generic: drop messages handler support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-20 20:17:56 +03:00
Ivailo Monev
713c9394d7 kdecore: drop message box feature of KDebug
tho it can be fixed (by not using queued up message boxes) I am not into
supporting such feature

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-20 19:40:13 +03:00
Ivailo Monev
1d7883f245 kdecore: replace QDateTime::currentDateTime().time() with QTime::currentTime()
QTime::currentTime() is slightly faster

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-04 22:20:34 +03:00
Ivailo Monev
0c5d00727e generic: remove redundant Q_OS_UNIX definition checks
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-15 09:28:30 +02:00
Ivailo Monev
2308c97882 kdecore: logging to file optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-14 21:59:10 +02:00
Ivailo Monev
4c861f57e4 kdecore: remove compat bits
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-11-05 00:21:56 +02:00
Ivailo Monev
614568e372 kdecore: fix runtime assert about accessing global static after its destruction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-10-23 12:37:06 +03:00
Ivailo Monev
ca2afde49f kdecore: use qHash() to make lock name
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-20 12:13:01 +03:00
Ivailo Monev
88394f1a7f kdecore: use QCryptographicHash::hash() to make lock name
converting the file to hex can result in way too long file name and
infinite loop in KLockFile::lock()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-20 12:04:51 +03:00
Ivailo Monev
c4ae9e0460 kdecore: save lock files in the global temporary directory
O_CLOEXEC won't do it but saving the locks in /tmp or other directory that
is purged across reboot will remove stale locks

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 21:16:04 +03:00
Ivailo Monev
85d6590693 kdecore: remove unused system signal header inclusion in klockfile_unix source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 01:06:54 +03:00
Ivailo Monev
95a8be4470 kdecore: rewrite KLockFile
the PID check was racy, bonus points for not writing data at all to the
lock and not reading it meaning less disk I/O

oh, yes - by using O_CLOEXEC the lock is stale-safe

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 00:46:42 +03:00
Ivailo Monev
7cb0785160 kdecore: add note about QDialog::exec() to the alarm() call in KDebugMessageBoxDevice::writeData()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-29 00:24:31 +03:00
Ivailo Monev
ac69de425c kdecore: create the global KDirWatch instance on demand
Q_GLOBAL_STATIC() no longer creates instance on demand

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 20:59:11 +03:00
Ivailo Monev
cc6903476e kdecore: new KDirWatch methods to get and set the poll interval
requires the following commit from the Katie repo:
4795a577bff4f9db89c77195df763575a602bcc3

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 20:58:06 +03:00
Ivailo Monev
625373ffa8 kdecore: drop KDateTime
with the rewrite (see f452e2e50b),
KDateTime is just glue-code for compatibility now. the exception is
KDateTime::isNightTime() (written by me) which is used only in one place
(kde-workspace/plasma/dataengines/weather/ions/wetter.com/ion_wettercom.cpp)
and can be moved there

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-14 22:35:08 +03:00
Ivailo Monev
6bf6169caf kdecore: return QByteArray from kBacktrace()
to avoid conversion from QString to QByteArray when possible, the trace is
handled as array of latin1-encoded strings anyway

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-04 08:14:53 +03:00
Ivailo Monev
f452e2e50b kdecore: reimplement KDateTime via QDateTime
KDateTime shall be used only for storing date and time while KLocale
shall be used to display such, not even going to test what KDateTime
does because it is basically a few methods on top of QDateTime now.

and because QDateTime knows not much about calendar systems while
KLocale supports several it makes sense for KDateTime to not be used for
displaying date and time thus the TODOs for KLocale are simply removed

note that KLocale still uses its own parser and formatter which means
that the change affects only KDateTime and its uses, not KLocale

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 07:51:13 +03:00
Ivailo Monev
f90c94dae7 kdecore: strip the trailing slash when passing the URL path to kPathDirectory() from KUrl::upUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-10 06:52:30 +03:00
Ivailo Monev
12ebcb3268 kdecore: remove redundant KUrl::List::size() calls
these are constructors, initial size is zero

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-04 19:30:35 +03:00
Ivailo Monev
bce72b0b24 kdecore: safety-net for KUrl::upUrl(), also append trailing slash from KUrl::directory()
relative paths are tricky

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 20:39:14 +03:00
Ivailo Monev
a051b1b284 kdecore: append trailing slash from kPathDirectory() function
while it does not matter for comparison, for KUrl::setFileName() to produce
correct results it has to be there after KUrl::upUrl()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 17:09:54 +03:00
Ivailo Monev
85205ccecf kio: log KRecentDirs and KRecentDocument actions
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 11:28:00 +03:00
Ivailo Monev
5409d7035e kdecore: do not append trailing slash to the path if the path is / from KDirWatch::addDir()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 09:22:39 +03:00
Ivailo Monev
3e1a64459e kdecore: check if debug messages are disabled globally from KDebugConfig::areaDevice()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 23:55:46 +03:00
Ivailo Monev
43dc4568db kdecore: remove unused QMimeData inclusion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 23:17:47 +03:00
Ivailo Monev
bf62c2b69d generic: consistent RFC references
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 23:02:40 +03:00
Ivailo Monev
bd990c2ae8 kdecore: return empty string if there is no slash in the input of kPathDirectory()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 21:52:43 +03:00
Ivailo Monev
4f1050a5ac kdecore: KUrl optimizations
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 21:24:18 +03:00
Ivailo Monev
eac8fd79cc kdecore: re-use KUrl::AdjustPathOption for KUrl::fileName() and KUrl::directory()
so that it is clear that the options shall affect only the result, also for
local files the correct thing can be done regardless of the trailing slash
as is done in KUrl::upUrl()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 20:47:38 +03:00
Ivailo Monev
06ce034a80 kdecore: remove declaration of non-existing KUrl::join() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 17:00:27 +03:00
Ivailo Monev
5bf76a5f3a kdecore: compare the clean paths of local file URLs
things are getting complicated for local files but that is how it should be

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 07:36:59 +03:00
Ivailo Monev
9f5081f9f8 kdecore: rename variables for consistency
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 06:12:01 +03:00
Ivailo Monev
b83771b4c2 kdecore: handle local file paths with and without trailing slash in KUrl::upUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 05:42:51 +03:00
Ivailo Monev
181e119ecc kdecore: KUrl::equals() rework to use KUrl::url() for the comparison
same thing (all URL components are compared) except the trailing slash
option can be re-used for it essentially adding one more option (to add
trailing slash when comparing)

also fixed and tested KUrl::upUrl() for some cases

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 01:30:23 +03:00
Ivailo Monev
180f34d2e3 kdecore: fix null/empty KUrl comparison and test it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 00:34:45 +03:00
Ivailo Monev
b1c7c3b392 kdecore: move KUrl code where it belongs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 00:10:11 +03:00
Ivailo Monev
47d0b5a297 kdecore: remove unused KUrl metadata
was used to pass the referrer and while it is still possible to
reimplement it realisticly speaking it is impossible to preserve the
referrer (and other HTTP(S) header metadata) because it will be lost in
transition in some cicumstances such as when drag-n-drop is done to
application unaware of application/x-kio-metadata

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 21:13:59 +03:00
Ivailo Monev
e4a4798d60 kdecore: remove redundant KUrl::fromMimeDataByteArray() method
calls KUrl constructor with the unmodified str argument in both cases

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 19:54:51 +03:00
Ivailo Monev
2c6f00f690 kdecore: remove reference to non-existing KUrl::setExportAsText() and KUrl::List::setExportAsText() methods
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 19:48:15 +03:00
Ivailo Monev
03bd3652c3 kdecore: compiler warning fix
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 19:36:10 +03:00
Ivailo Monev
865711ae83 kdecore: KUrl::url() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 18:51:15 +03:00
Ivailo Monev
40da298881 kdecore: never output file:// for local files
there is a fix for that legacy thing

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 18:15:06 +03:00
Ivailo Monev
cb8a624390 kdecore: fix recursion due to kCheckLocalFile()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 17:47:18 +03:00
Ivailo Monev
54ee8ee1cd kdecore: clarfication on the note in KUrl test
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 16:50:36 +03:00
Ivailo Monev
d63bb71869 kdecore: rename constant for consistency
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 16:36:45 +03:00