- Differentiate between a profile being deleteable and writable:
- Disable the Edit key for read-only profiles, i.e. a '.profile' that
doesn't have write permissions for the user
- Disable the Delete key for a '.profile' that is in a directory that
isn't writable for the user (i.e. a .profile can be read-only, but
still deleteable by the user)
- Change the model selection mode to single selection, that simplifies
the code, besides it looks like editing more than one profile at the
same time hasn't worked for a while, and there are no complaints AFAICS;
remove the now redundant selectedProfiles() method.
- Show profile path as tooltip, for the fallback profile show
"Built-in/hardcoded"
- Add " [Read-only]" to the Default/fallback profile name
- Make the font of the current default profile bold to match the menu
in 'File -> New Tab'
- Change the text added to the current default profile to " default", i.e.
lowercase, to differentiate between it and the fallback profile, which
is called Default
Fix indentation in switch/case statements.
Now the 'File->New Tab' menu is updated when the default profile is
changed, i.e. the action font is made bold and the favourites icon
emblem is added to the profile icon.
A call to menu()->setDefaultAction() has been removed, as I don't see
what it serves exactly in the current code.
Reported by khindenburg in:
https://invent.kde.org/utilities/konsole/-/merge_requests/351
This happens because in ViewManager::sessionFinished(),
the 'view' is delayed deleted which means that it is not removed
from its containing splitter until the next event. However,
toggleActionsBasedOnState() is called immediately which makes its
decisions based on the current splitter state with the view still
present.
In order to avoid any possible object lifetime issues caused by
changing the way the view is deleted, or trying to remove it from the
view immediately, the call of toggleActionsBasedOnState() is instead
delayed until the view has been destroyed (and therefore removed from
its splitter).
This will fix most of the zsh themes reflow, still working on other
themes.
zsh command line position is different from other shells, it is not
where the cursor line is. Konsole is correcting this position.
If it does, then a random letter or number in the font name is underlined
and acts as an accelerator. There is no need for the "Font:" label to
have a buddy either, because the "Choose..." button will already have
one of its own.
- When we match child files/dirs of the current dir, either the item name
is the "filename", or if it's a child-dir/somefile, then filename starts
with "child-dir + '/'".
To test create a file foo and a dir bar with a bar-file inside it then:
- `ls`, foo and bar should be underlined
- `ls bar/*`, bar/bar-file should be underlined
- type bar..., before it would be underlined, after it won't be
- Capture QString by reference in lambda.
Only '.' and '..' could be valid hotspots, but '..........' isn't. The
latter is used by some CLI tools to indicate progress ...etc.
To test, in any dir use `ls -a`, Ctrl + clicking '.' and '..' should
open the current dir and parent of the current dir respectively.
Type .......... at the prompt, before it would get underlined, after no
hotspot will be created for it.
BUG: 432779
It seems there is no way around checking for the extension then falling
back to letting QMimeDataBase examine the file contents; e.g. a file
named konsolerc, doesn't have an extension, but it is still a text file.
We can just remove the files on disk and with the RemoveDeadEntries
option set to true KNS will check if the files still exist. If
not the entry will be marked as not installed.
While changing some functions with STL, I though it was possible to move
the line from source to destination, but it is causing a problem with
console programs status line (ex: htop).
BUG: 432005
This code did a frequent amount of resizing on the `univec` vector, and
the usage of the `disstrU` variable was kind of obscure (and
unnecessary). I also removed an unused include.
Where it was possible:
- 'For' to STL copy or fill (it is like using memcpy and memset, faster
than for, the compiler decides the best algo to perform the task);
- 'For' + 'if' to 'where', it is faster and cleanner to read.
Changes in: PlainTextDecoder.cpp, HTMLDecoder.cpp, ColorScheme.cpp and
ExtendedCharTable.cpp
Where it was possible:
- 'For' to STL copy or fill (it is like using memcpy and memset, faster
than for, the compiler decides the best algo to perform the task);
- qMin(qMax) to qBound.
Changes in: TeminalDisplay and TerminalColor
Unlimited to Fixed Size must have the fixed size information preserved.
Fixed Size to Unlimited must have all the information preserved.
All types to None all information must be erased.
While testing I found a bug in CompactHistoryScroll add function, it
should append before check the vector size and not after, it was
returning a Size > Max Size, not equal.
Another Bug found in fixed size history scroll, it was not properly
reflowing the last line, a position problem when adding and removing
lines to keep a fixed size.
Moving the fixed size history reflow code to compactHistoryScroll file.
Screen file will not handle history reflow, unlimited scroll is
completely different from fixed size scroll reflow.
QMimeDataBase will return "application/octet-stream" as the mime type
of something like "path/to/some/textfile.txt:123:123:", because we are
using methods from it that check only the file extension. That meant
some valid text files with line/column suffixes couldn't be opened.
Instead move the mime type check _after_ the file path has been cleaned.
Also account for mime types that aren't recognized, e.g. a text file with
no extension.
BUG: 431601
When this feature is turned off, it deletes some keys from Konsole's
config file. However this broke recently for two reasons:
1. The key names changed a few Frameworks releases ago
2. There are new keys that need to be deleted or else position gets
restored too
This commit fixes that bug by updating the condition to delete all the
config keys required to make the off state for this feature work again.
BUG: 427610
FIXED-IN: 20.12.2
(cherry picked from commit 8fa1c4b508b080f958a16d52a1e03bcf9e7e4495)
This allows sending signals to work again. Correct macos keytab so
Ctrl+C and Ctrl+V work. Add warning to show sending signals
require foreground process id to be set.
When activating a file filter hot spot, everything got opened with the text
editor specified in the profile settings, which is wrong e.g. with pdf or
png files. Check the mime type of the file path, based only on the extension
so as to keep things fast.
Also rename openWithSysDefaultEditor() to openWithSysDefaultApp(), which is
more accurate.
BUG: 431496
When using unlimited history and change to fixed history size, it will
move, limited by the fixed size, the history.
It will create a new CompactHistoryScroll, get the lines from the old
HistoryScrollFile, and delete the old HistoryScrollFile structure.