Manuel Nickschas [Tue, 30 Oct 2018 19:07:44 +0000 (20:07 +0100)]
qtui: Disable web preview by default
Upon popular request, disable the web preview by default. This
feature tends to surprise unwitting new users that just happen
to hover over a questionable link, and the preview's functionality
is limited anyway with today's complex websites.
The web preview can still be enabled explicitly in chatview settings.
Existing configurations are unaffected by this change.
David ‘Bombe’ Roden [Mon, 22 Oct 2018 14:04:16 +0000 (16:04 +0200)]
Fix the order of the Davids
Manuel Nickschas [Mon, 15 Oct 2018 17:51:51 +0000 (19:51 +0200)]
Bump version for release
Manuel Nickschas [Mon, 15 Oct 2018 17:51:00 +0000 (19:51 +0200)]
Update ChangeLog
Manuel Nickschas [Sun, 14 Oct 2018 19:39:03 +0000 (21:39 +0200)]
common: Remove left-overs from signal handling rework
Remove some remnants of the old code that were missed when pushing
the reworked implementation.
Shane Synan [Sat, 6 Oct 2018 18:53:59 +0000 (13:53 -0500)]
client: For filter, prioritize exact, startsWith
When filtering buffer view results, prioritize exact string matches,
then prioritize startsWith matches, both case-insensitive. Within
these results, sort normally (e.g. alphabetical).
This gives weight to exact matches and the start of the string. When
no filter string is specified, sorting goes back to normal.
Search string: "car"
Before:
> acar
> bcar
> careful
> caring
> racecar
> car [hidden]
After:
> car [hidden]
> careful
> caring
> acar
> bcar
> racecar
Where [hidden] represents a buffer that's temporarily or permanently
hidden.
Shane Synan [Sat, 6 Oct 2018 17:48:20 +0000 (12:48 -0500)]
client: Sort network name case-insensitively
Set BufferViewFilter to sort case-insensitively. This results in
network names being sorted regardless of case. Channel/nickname
sorting is handled elsewhere.
Before:
> Alpha
> Freenode
> beta
After:
> Alpha
> beta
> Freenode
This probably matches expectations better, and hopefully doesn't
break existing workflows too much... https://xkcd.com/1172/
Manuel Nickschas [Fri, 5 Oct 2018 21:07:04 +0000 (23:07 +0200)]
common: Don't use unsafe functions when handling POSIX signals
The set of functions we're allowed to safely use in a POSIX signal
handler is very limited, and certainly does not include anything Qt.
While our previous implementation seemingly worked anyway as long as
all it did was quitting the application, we now start seeing issues
when doing a proper shutdown.
Fix this by providing a generic API for watching signal-like external
events that can be specialized for the various platforms we support.
Provide PosixSignalWatcher, which uses socket notification to safely
hand over control from the signal handler to the Qt event loop.
Also provide an implementation for Windows that still uses the
previous approach; since Windows doesn't support socketpair(), we
can't easily reuse the POSIX implementation. On the bright side, so
far we don't know if signal handlers on Windows face the same
limitations as on POSIX anyway...
Also on Windows we now support console events, i.e. Ctrl+C as well
as closing the console window.
Manuel Nickschas [Thu, 4 Oct 2018 10:52:42 +0000 (12:52 +0200)]
qtui: Don't parent dialogs created on the stack
Dialogs that are created on the stack should not have a parent,
lest they get double-deleted if the main window is destroyed while
such a dialog is still open.
Manuel Nickschas [Thu, 4 Oct 2018 10:19:54 +0000 (12:19 +0200)]
Revert "qtui: Don't create parented dialogs on the stack"
Auto-deleting dialogs is a bad idea if we're accessing the instance
after exec(). We could work around this in the affected cases,
however it may be easier and cleaner to create the dialogs on the
stack again, but don't parent them to avoid the crashes we intended
to fix with this commit.
This reverts commit
4e452ee828fdb411e6b1db07c18e02681a30ff27.
Manuel Nickschas [Sat, 29 Sep 2018 17:47:05 +0000 (19:47 +0200)]
common: Don't warn on unknown user in IrcChannel
When quitting a channel, the IrcChannel instance may still be
receiving pending events for IrcUsers that have already been removed.
Don't log a warning in this case, because it doesn't help and confuses
users.
Manuel Nickschas [Sat, 29 Sep 2018 17:38:43 +0000 (19:38 +0200)]
core: Fix quitting from networks on shutdown
The previous implementation relied on processEvents() to let the
QUIT command be sent to the IRC server. However, processEvents()
does not guarantee that it processes all events (also in other
threads), and indeed, the previous approach was not reliable.
Fix this by waiting for the networks to emit the disconnected()
signal after requesting the quit. There already is a 10 second
timeout in case the IRC server does not close the socket within
a reasonable time, so rely on that. Also ensure that connect requests
are ignored during shutdown.
With the CoreSession requesting a clean shutdown, we no longer need
a similar handling in CoreNetwork's dtor, so remove this.
See also GH-203 and GH-207, which were previous attempts on getting
this right.
Manuel Nickschas [Sat, 29 Sep 2018 15:31:42 +0000 (17:31 +0200)]
core: Allow clean shutdown of the core
Relying on things to happen while the core is being destroyed is
fragile (and does not work in practice), because events are no
longer delivered to objects that are scheduled for deletion.
Add an explicit call for shutting down the core, its sessions and
their networks. Wait for everything to be cleaned up properly before
quitting the session threads, and ultimately shutting down the main
event loop.
While we're at it, refactor SessionThread to follow the worker
pattern, rather than inheriting from QThread. This avoids accidentally
calling slots in the wrong thread. Ensure that all cross-thread
communication happens through queued signals. Simplify the API, too.
Manuel Nickschas [Sat, 29 Sep 2018 09:52:12 +0000 (11:52 +0200)]
qtui: Fix quit sequence and lifetime issues
Make use of the Singleton mixin for Client and GraphicalUi. Fix
ownership and explicitly construct and destroy the pseudo singletons.
Remove some static init methods in favor of initializing in the
constructor where possible. We still need delayed initialization
of the main UI however, so GraphicalUi::init() has to stay.
Simply calling QCoreApplication::quit() doesn't clean up properly,
because it immediately stops event processing, which means that
any deferred deletions won't be processed anymore.
Since we perform some important and asynchronous tasks during
shutdown, such as saving settings and properly unregistering from
IRC, we really want proper cleanup, though.
Fix this by relying on Quassel::quit() instead, and registering
appropriate quit handlers that shut down the client in orderly
and controlled fashion. Ensure that all open windows and dialogs
are closed prior to MainWin's destruction.
Core shutdown warrants a more complex approach, which will be
implemented in a follow-up commit.
Manuel Nickschas [Fri, 28 Sep 2018 20:54:15 +0000 (22:54 +0200)]
git: Update .gitignore
Actually hide project files from Qt Creator, as well as KDevelop.
Manuel Nickschas [Fri, 28 Sep 2018 20:28:33 +0000 (22:28 +0200)]
core: Use the Singleton mixin for the Core instance
Instead of implementing the instance pointer manually, use the
Singleton mixin.
Manuel Nickschas [Fri, 28 Sep 2018 20:24:33 +0000 (22:24 +0200)]
common: Prepare Quassel::quit() to be used more widely
In the future we want to use Quassel::quit() as the central entry
point for cleanly quitting the application, instead of relying
on QCoreApplication::quit(), which directly stops the event loop
and thus won't process any asynchronous cleanup tasks.
Make the slot public, and protect against multiple invocations.
Manuel Nickschas [Fri, 28 Sep 2018 19:41:31 +0000 (21:41 +0200)]
common: Use the Singleton mixin for the Quassel instance
Make use of the newly added Singleton mixon to remove the custom
handling of Quassel's instance pointer. Clearly define Quassel's
lifetime by making it a local instance in main(), rather than
relying on someone to call Quassel::instance() at the right time.
Now it is also clear that the instance is deleted after main()
returns (which was the case before, however there still was a no-op
Quassel::destroy() method too, which has now been removed). This
is fine, because Quassel does not own resources that should be deleted
before exiting the event loop.
Manuel Nickschas [Fri, 28 Sep 2018 19:17:32 +0000 (21:17 +0200)]
common: Provide Singleton mixin for handling pseudo singletons
We have several singleton and pseudo-singleton classes in Quassel.
A pseudo singleton can be constructed and destroyed in a controlled
manner, but can be accessed through a static instance pointer while
it is alive. As an example, QCoreApplication behaves like this.
In order to avoid duplication and unify the behavior of our singletons
in the future, provide a mixin. Classes can inherit from this and gain
an instance() method, as well as protection against multiple
instantiation and access outside of the object's lifetime.
Manuel Nickschas [Thu, 27 Sep 2018 22:56:35 +0000 (00:56 +0200)]
common: Don't warn when "closing" InternalPeer
InternalPeer may be closed legitimately like any other peer type.
Although for InternalPeer this just sets a flag, it should not
produce a warning claiming that the method is not implemented.
Also actually report the open status for InternalPeer. Ensure that
it is constructed in open state, otherwise a signalproxy cannot
be set.
Manuel Nickschas [Wed, 26 Sep 2018 22:09:26 +0000 (00:09 +0200)]
qtui: Don't create parented dialogs on the stack
Create dialogs in MainWin on the heap, rather than on the stack.
This avoids crashes when MainWin is destroyed while a dialog is
open (in which case a double free would happen).
Set the WA_DeleteOnClose attribute on affected dialogs so they will
be deleted upon close, rather than hanging around in memory until
shutdown.
Manuel Nickschas [Tue, 25 Sep 2018 22:47:14 +0000 (00:47 +0200)]
common: Avoid crash on SignalProxy destruction
Since SignalProxy itself attaches a slot, it will try to detach
itself on destruction, leading to a crash. Avoid this by checking
for self-detachment.
Daniel Albers [Mon, 24 Sep 2018 20:58:52 +0000 (22:58 +0200)]
Clean up translator attributions
Daniel Albers [Tue, 12 Sep 2017 22:06:01 +0000 (00:06 +0200)]
Remove empty translation files
- es_AR
- et_EE
- id_ID
- uz@Latn
- zh_TW
Daniel Albers [Wed, 20 Dec 2017 04:00:06 +0000 (05:00 +0100)]
Update quassel.pot
Daniel Albers [Tue, 5 Sep 2017 03:00:24 +0000 (05:00 +0200)]
Update translations from Transifex
27958 translated messages
Many thanks to:
- cs: Jaroslav Lichtblau <dragonlord@seznam.cz>
- da: Joe Hansen <joedalton2@yahoo.dk>
- de: Steve M <transifex@lostinweb.eu>
- el: Theofilos Intzoglou <int.teo@gmail.com>
- eo: Tinjo Kohen <tiffypet@yahoo.com>
- es: Chris Egeland <chris@chrisegeland.com>, Javier Llorente
<javier@opensuse.org>
- fi: Lasse Liehu <larso@gmx.com>
- fr: Guillaume Gay <guillaume.gay@gmail.com>, Olivier Caron
<crn.olivier@gmail.com>, Zoddo <transifex.com@zoddo.fr>
- hi: Raju Devidas Vindane <rajuvindane@gmail.com>
- ko: Tae-Hoon KWON <zerolaunch@naver.com>, Sungjin Kang <potopro@gmail.com>
- lt: Liudas Ališauskas <liudas.alisauskas@gmail.com>
- mr: Raju Devidas Vindane <rajuvindane@gmail.com>
- nb: Chris Egeland <chris@chrisegeland.com>, sandsmark
<inactive+sandsmark@transifex.com>
- nl: Joep Seuren <joepseuren1@gmail.com>
- pa: A S Alam <apreet.alam@gmail.com>
- pl: Miłosz Rachwał <transifex@milek7.pl>, derpella <matwa@poczta.pl>
- pt: Vitor Luis <ptirc@protonmail.com>
- pt_BR: André Marcelo Alvarenga <alvarenga@kde.org>, Lucas A. V. Dantas
<lucasdantas@yandex.com>
- ro: Arthur Țițeică <arthur.titeica@gmail.com>, Sergiu Bivol <sergiu@cip.md>
- ru: Svetlana Tkachenko <svetlana@members.fsf.org>, Viktor Suprun
<popsul1993@gmail.com>, Yaroslav Veremenko <yaroslav@veremenko.info>
- sl: Andrej Mernik <andrejm@ubuntu.si>
- tr: Demiray “tulliana” Muhterem <mdemiray@msn.com>, Volkan Gezer
<volkangezer@gmail.com>
- uk: Yuri Chornoivan <yurchor@ukr.net>
- zh_CN: leonfeng <chaofeng111@qq.com>
Daniel Albers [Thu, 29 Mar 2018 11:39:05 +0000 (13:39 +0200)]
Update Transifex URL
Manuel Nickschas [Mon, 17 Sep 2018 21:50:18 +0000 (23:50 +0200)]
qtui: Fix load/save states of SonnetSettingsPage
Call the base class functions to ensure that the changed state is
reset properly.
Unfortunately, the Sonnect::ConfigWidget does not allow for direct
comparison of settings, so toggling a setting will still not
reset the changed state; but at least loading or resetting now will.
Shane Synan [Fri, 14 Sep 2018 19:54:31 +0000 (14:54 -0500)]
core: Remove away-notify hack for non-spec server
Remove the AutoWho-on-JOIN hack for IRC servers that do not fully
comply with the "away-notify" spec by not sending ":AWAY :message"
when a user marked /away joins a channel.
Advantages:
* Less network traffic (no WHO for every nickname that joins)
* Less likely to expose other bugs where an IRC server returns
something unexpected causing auto-who output to go in the status
buffer
Disadvantages:
* On non-compliant IRC servers, Quassel will no longer accurately
know the away status of someone that joins a channel while /away
* On IRC servers that implement "away-notify" but not
"extended-join", Quassel will no longer learn the logged-in account
and realname for someone that joins a channel
(This will break showing realname, fallback avatar fetching)
Remove all functions related to automatic nickname WHO'ng as they are
no longer needed. Leaving them in wouldn't cause any issues other
than unnecessary work and code clutter.
Add a comment pointing to this commit in case someone decides to
resurrect this workaround.
See https://ircv3.net/specs/extensions/away-notify-3.1.html
And https://bugs.unrealircd.org/view.php?id=5144
Shane Synan [Fri, 14 Sep 2018 18:51:40 +0000 (13:51 -0500)]
core: Clean up AutoWho comments, variable names
Clean up AutoWho variable names using the "name" convention from
RFC 1459.
Clean up AutoWho comments likewise, referring to "name" instead of
"channel" where appropriate.
See https://tools.ietf.org/html/rfc1459#section-4.5.1
Shane Synan [Thu, 13 Sep 2018 06:34:44 +0000 (01:34 -0500)]
core: Cancel nickname AutoWho on IrcUser quit
Remove any queued AutoWho for <nickname> if <nickname> quits. This
avoids sending a needless AutoWho for <nickname> that'll only either
result in "No such nickname" if we're lucky, or random results for
non-extended WHO if <nickname> happens to match the realname/etc of
other IRC users.
This should fix any remaining cases of join/quit resulting in AutoWho
output in the Status Buffer for a network.
Shane Synan [Thu, 13 Sep 2018 07:00:17 +0000 (02:00 -0500)]
core: AutoWhoX, only search nickname by nickname
When running automatic WhoX, explicitly specify "n" to search by
nickname only. Don't rely on server defaults. This fixes an issue
with Quassel's autoWHO causing noise in the Status Buffer uncovered
by InspIRCd 3.0's implementation of WhoX that follows the spec.
Fix up incorrect attempt to escape "%" as "%%". Apparently,
QString::arg() doesn't need to escape this.
Before: WHO <nickname> %%chtsunfra,<unique_number>
After: WHO <nickname> n%chtsunfra,<unique_number>
See https://github.com/quakenet/snircd/blob/master/doc/readme.who
And https://doc.qt.io/qt-5/qstring.html#arg
Thanks to @genius3000 for reporting and tracking down this issue!
Fixes #1487
Shane Synan [Wed, 12 Sep 2018 23:57:44 +0000 (18:57 -0500)]
settings: Fix NetworkAddDlg states on type change
Add check for button states when changing between "Use preset" and
"Manually specify network settings".
This fixes the "OK" button remaining enabled when adding a network
and selecting manual, and also fixes re-enabling the "OK" after
switching back to presets.
Shane Synan [Wed, 12 Sep 2018 22:54:25 +0000 (17:54 -0500)]
util: Remove T separator from ISO 8601 (RFC 3339)
Remove the "T" separator when formatting ISO 8601 date/time to
strings. This improves readability without sacrificing machine
parsing, remaining compliant with RFC 3339.
Technically ISO 8601 specification states "T" can only be omitted,
but that makes readability even worse.
Example:
> Before: 2018-08-22T18:43:10-05:00
> After: 2018-08-22 18:43:10-05:00
..........^ (10th character)
NOTE: Qt's own ISO 8601 parsing of strings to QDateTime will not
handle this correctly. Custom format strings can be used, or just
replace the " " with "T" again.
See https://en.wikipedia.org/wiki/ISO_8601#cite_note-32
4.3.2 NOTE: By mutual agreement of the partners in information
interchange, the character [T] may be omitted in applications where
there is no risk of confusing a date and time of day representation
with others defined in this International Standard.
And https://www.ietf.org/rfc/rfc3339.txt
NOTE: ISO 8601 defines date and time separated by "T".
Applications using this syntax may choose, for the sake of
readability, to specify a full-date and full-time separated by
(say) a space character.
Fixes #1456
Manuel Nickschas [Mon, 10 Sep 2018 21:24:07 +0000 (23:24 +0200)]
qa: Don't return a const ref from Settings::localValue()
Stumbled on this by accident because one particular CI configuration
warned about Settings::localValue() returning a stack reference
(may happen if the default value (which is a const ref itself) is
returned).
Not sure why I don't see this warning in my own setup, but it's
legitimate; thus fix the issue.
Matt Schatz [Sun, 9 Sep 2018 18:27:37 +0000 (12:27 -0600)]
Change to an early continue for a NULL IrcUser
Commit
e9096505f07fc0c08a7c36f3680c1fde975d4f80 changed the behaviour
in joinIrcUsers() from skipping a NULL IrcUser or an already tracked
IrcUser to updating the usermodes of said IrcUser. The call to
addUserMode() will call isKnownUser() which will log a warning
of 'received IrcUser Nullpointer' and return false. This is safe
from crashing, but shouldn't be allowed to happen.
Manuel Nickschas [Wed, 5 Sep 2018 20:17:16 +0000 (22:17 +0200)]
qa: Avoid warning about missing field initializers
Some compiler setups throw a warning when default-brace-initializing
UiStyle::Format. Avoid this by explicitly constructing an instance.
Manuel Nickschas [Wed, 5 Sep 2018 21:12:04 +0000 (23:12 +0200)]
qa: Try to avoid fall-through warnings
GCC8 warns again about some intentional fallthroughs. Try to fix this
by adding comments.
Manuel Nickschas [Wed, 5 Sep 2018 20:11:56 +0000 (22:11 +0200)]
qa: Don't compile the expression match tests
Those are not used unless manually hacked in, and compiling them
causes warnings in some compiler setups, so don't compile the
tests at all.
They're still referenced in the CMakeLists.txt and can easily be
added back if desired. Longer term, they'll move into a real
test framework.
Manuel Nickschas [Wed, 5 Sep 2018 19:09:19 +0000 (21:09 +0200)]
clang-tidy: Avoid another bogus warning about a potential leak
False positive, fixed by assigning to an attribute. Seems like
clang-tidy really doesn't like ephemeral objects even if they
have a parent.
Manuel Nickschas [Wed, 5 Sep 2018 18:58:46 +0000 (20:58 +0200)]
clang-tidy: Avoid memory leak in MainWin
This one is legitimate: If no network is selected, the freshly
created ChannelListDlg instance is never deleted. Move instantiation
after the network ID check, so the dialog is shown (and self-deletes
on close). Set a parent for good measure, too.
Manuel Nickschas [Wed, 5 Sep 2018 18:53:24 +0000 (20:53 +0200)]
clang-tidy: Avoid another warning about potential memory leak
This is a false positive (since the newly created QFormLayout takes
a widget as its parent), however some slight rearrangement of
code shuts up clang-tidy without resorting to NOLINT.
Manuel Nickschas [Wed, 5 Sep 2018 18:39:12 +0000 (20:39 +0200)]
clang-tidy: Avoid potential memory leak in QtUi
Clean up the instance handling in QtUi (and GraphicalUi) to ensure
that a newly created QtUi instance is always assigned to the local
_instance variable. Otherwise, clang-tidy warns about a potential
memory leak (although this would not happen in practice).
Manuel Nickschas [Tue, 4 Sep 2018 23:13:11 +0000 (01:13 +0200)]
clang-tidy: Remove dead stores
Manuel Nickschas [Tue, 4 Sep 2018 22:37:25 +0000 (00:37 +0200)]
clang-tidy: Avoid warnings for calling virtual methods from ctor
MessageFilter and its derivatives call their idString() method
during construction in order to access their settings. This is fine,
but causes (legitimate) warnings in static analysis.
Make the scope explicit when calling idString() to avoid the warning,
and make it clear to readers that we're not interested in the derived
version.
Manuel Nickschas [Tue, 4 Sep 2018 21:47:44 +0000 (23:47 +0200)]
clang-tidy: Don't make methods virtual for no reason in SslServer
SslServer was calling virtual methods during construction, which is
dangerous. Turns out those methods don't even need to be virtual, so
unvirtualize them.
Manuel Nickschas [Tue, 4 Sep 2018 21:26:08 +0000 (23:26 +0200)]
clang-tidy: Add nullptr check
Manuel Nickschas [Tue, 4 Sep 2018 21:19:22 +0000 (23:19 +0200)]
clang-tidy: Avoid potential memory leak in BufferViewManager
Explicitly delete a freshly created BufferViewConfig in case it cannot
be added, rather than relying on QObject parentship - clang-tidy
warns about that. I'm rather sure that this is a false positive, but
better safe than sorry.
Simplify and clean-up related code a bit.
Manuel Nickschas [Mon, 3 Sep 2018 23:31:22 +0000 (01:31 +0200)]
clang-tidy: Reorder NetworkMO attributes to avoid excessive padding
Use a more optimal attribute order to avoid excessive padding in the
NetworkMO struct.
Manuel Nickschas [Mon, 3 Sep 2018 23:18:10 +0000 (01:18 +0200)]
clang-tidy: Reorder NetworkInfo attributes to avoid excessive padding
Use a more optimal attribute order to avoid excessive padding in the
NetworkInfo struct.
Remove the default constructor in favor of direct initialization.
Rewrite the comparison operator using a boolean expression instead
of a bunch of conditions.
alturiak [Mon, 3 Sep 2018 18:35:20 +0000 (20:35 +0200)]
cipher.cpp: Default to CBC instead of ECB
For security reasons (and compatibility to other irc-client's implementations), default to CBC for blowfish encryption.
Shane Synan [Mon, 3 Sep 2018 04:36:23 +0000 (23:36 -0500)]
common: Add "--debug-irc" to log raw IRC messages
Add "--debug-irc" command-line option to Core and Monolithic to log
raw IRC messages to the log at Debug level.
Check for raw IRC logging in CoreNetwork and IrcParser, logging
anything sent and received with the Network ID and "<<" for received,
">>" for sent.
Add "--debug-irc-id" to limit raw logging to a specific Network ID,
handy for cores with multiple networks. This option automatically
applies "--debug-irc".
These usually should be combined with "--loglevel Debug", though the
Monolithic build can show raw IRC messages in the "Debug Log" GUI
without setting that parameter.
CAUTION: "--debug-irc" will leak all IRC passwords in plain text via
any configured logging receivers (file, syslog, etc) and should not
be used on production servers without taking special care to limit
access to logging output.
Note: The ideal approach is to have the core maintain the most recent
raw IRC logs on a rotating basis, allowing any client to request this
portion of logs on demand. However, there's a lot more changes
involved, which might not be wise with the goal of stabilizing 0.13.
We should revisit this in the future.
Manuel Nickschas [Wed, 29 Aug 2018 20:11:46 +0000 (22:11 +0200)]
client: Don't store the list of properties in every PropertyMapItem
It's rather inefficient to store a QStringList in every item, since
it is the same for every type of item anyway. Use a pure virtual
accessor in the base class instead, and return a static QStringList
in every item type.
This prevents the usecase of adding properties dynamically after
creation, but we didn't use that feature anyway, so remove it.
Manuel Nickschas [Wed, 29 Aug 2018 19:02:41 +0000 (21:02 +0200)]
client: Don't send dataChanged() before actually changing the data
The PropertyMapItem didn't set a changed property before sending
the signal, so consumers synchronously reacting to dataChanged()
would still access the old value.
Not sure if this issue is the cause for some of the weird model
behavior we tend to see at times...
Shane Synan [Sat, 1 Sep 2018 21:37:32 +0000 (16:37 -0500)]
common: Port local nicks to NickHighlightMatcher
Port QtUiMessageProcessor nick highlights to NickHighlightMatcher
class, providing easy caching and simplifying expression handling.
This fixes nickname caching being reset when switching between
networks.
Add SIGNAL/SLOT traversal to pass on information about network
removal to clean up per-network nickname highlight caches, avoiding
memory leaks.
Shane Synan [Sat, 1 Sep 2018 21:36:45 +0000 (16:36 -0500)]
common: Port remote nicks to NickHighlightMatcher
Port HighlightRuleManager nick highlights to NickHighlightMatcher
class, providing easy caching and simplifying expression handling.
This fixes nickname caching being reset when switching between
networks.
Add SIGNAL/SLOT traversal to pass on information about network
removal to clean up per-network nickname highlight caches, avoiding
memory leaks.
Shane Synan [Sat, 1 Sep 2018 21:33:03 +0000 (16:33 -0500)]
common: Add auto-caching NickHighlightMatcher
Add NickHighlightMatcher class to unify handling of nick highlight
matching in Quassel, including automatically updating the expression
matcher instance as needed per network.
Cached ExpressionMatch objects are updated on demand after any change
in nickname configuration or active/configured nicks.
This lays the foundation for performance and readibility improvements
in future commits.
Shane Synan [Sat, 1 Sep 2018 21:30:51 +0000 (16:30 -0500)]
util: Remove unused and broken scopeMatch()
Remove scopeMatch() from util.cpp - not only is it no longer needed,
superseded by ExpressionMatch, the scopeMatch behavior broke previous
Quassel functionality.
Details: Channel names can begin with "!", and scopeMatch() does not
support escaping "!" in the beginning of rules. Escaping support
needs to be added.. but ExpressionMatch can now handle this. Let us
keep the ugly parser loops confined to one place...
Shane Synan [Sat, 1 Sep 2018 21:29:02 +0000 (16:29 -0500)]
client: Port old HighlightRule to ExpressionMatch
Port QtUiMessageProcessor HighlightRule objects to ExpressionMatch
class, providing easy caching and simplifying expression handling.
Migrate HighlightRule struct into a full-blown class for easier
management and greater assurance over automatic internal cache
management.
Port QtUiMessageProcessor to ExpressionMatch for nickname matching,
providing easy caching and simplifying expression handling.
Add tons of documentation comments, too, and fix up line lengths.
NOTE: Legacy highlight rules lack support for "sender", "ID", and
inverse rules. There's no technical reason for this, just lack of
developer time. Feel free to add support in the future! Just make
sure to not miss any part - I'd suggest simply replacing the legacy
LegacyHighlightRule class in QtUiMessageProcessor with the full one
from HighlightRuleManager, and don't forget to fix
> QtUiMessageProcessor::HighlightRule::operator!=()
...and...
> QtUiMessageProcessor::HighlightRule::determineExpressions()
Shane Synan [Sat, 1 Sep 2018 21:17:33 +0000 (16:17 -0500)]
common: Fix whitespace CTCP ignore invalid index
When constructing a CTCP ignore, check that splitting on whitespace
results in non-empty list before taking from the list. If it's
empty, fall back to assuming any valid sender, i.e. "*"/".*"
depending on whether the rule is set as wildcard or regex.
This fixes issues when receiving a CTCP with an invalid CTCP ignore
rule such as " ".
Shane Synan [Sat, 1 Sep 2018 21:40:21 +0000 (16:40 -0500)]
common: Port IgnoreListManager to ExpressionMatch
Port IgnoreListItem objects to ExpressionMatch class, providing easy
caching and simplifying expression handling.
Migrate IgnoreListItem struct into a full-blown class for easier
management and greater assurance over automatic internal cache
management.
Add tons of documentation comments, too, and fix up line lengths.
Thanks to @sandsmark for the initial efforts towards the
QRegularExpression migration; it helped a lot!
Shane Synan [Sat, 1 Sep 2018 21:02:00 +0000 (16:02 -0500)]
common: Port HighlightRule to ExpressionMatch
Port HighlightRule objects to ExpressionMatch class, providing easy
caching and simplifying expression handling.
Migrate HighlightRule struct into a full-blown class for easier
management and greater assurance over automatic internal cache
management.
Port HighlightRuleManager to ExpressionMatch for nickname matching,
providing easy caching and simplifying expression handling.
(Noticing a theme?)
Add tons of documentation comments, too, and fix up line lengths.
Shane Synan [Sat, 1 Sep 2018 20:53:16 +0000 (15:53 -0500)]
client: Handle newlines in Ignore rule scope edit
Handle "\n" and ";" as separator in scope rules. This fixes using
newlines in the Configure Ignore Rule dialog.
Make use of ExpressionMatch::trimMultiWildcardWhitespace() to handle
all of the arcane details, unifying code into one place.
Shane Synan [Sun, 2 Sep 2018 07:39:30 +0000 (02:39 -0500)]
common: Add ExpressionMatchTests unit tests
Add ExpressionMatchTests class to test the functionality of
ExpressionMatch, helping ensure it works across Qt 4 and Qt 5.
This is implemented as a series of Q_ASSERT()'s as Quassel does not
yet have an actual testing framework. Once a test framework is
settled on, this class can be migrated to unit tests.
To use ExpressionMatchTests:
1. Include it in "quassel.cpp"
2. Call ExpressionMatchTests::runTests() near end of Quassel::init()
// DEBUG: Run tests!
ExpressionMatchTests::runTests();
Shane Synan [Sun, 2 Sep 2018 16:52:12 +0000 (11:52 -0500)]
common: Add auto-caching ExpressionMatch class
Add ExpressionMatch class to unify handling of various search
expressions in Quassel, including automatically caching the regular
expression instances and providing Qt 4/5 compatibility.
The source expression depends on the matching mode:
* ExpressionMatch::MatchPhrase
Match the entire phrase, looking for whitespace or beginning/end
around either side of the phrase. No further processing.
* ExpressionMatch::MatchMultiPhrase
Same as MatchPhrase, but split the expression on newlines ("\n") and
treat as match successful if any phrase is found. This avoids having
to create multiple ExpressionMatch classes just to match multiple
phrases.
* ExpressionMatch::MatchWildcard
Split on ";" and newlines ("\n"), and apply basic wildcard globbing,
with "*" representing any characters and "?" a single character.
Prefixing a section with "!" turns it into an invert-match, negating
any other matching rules. If only invert-match rules exist, matching
is true unless an invert-rule applies. "\[...]" escapes the given
character.
* ExpressionMatch::MatchRegEx
Treat expression as a regular expression, inverting if prefixed with
"!" (and not escaped as "\!").
Cached regular expression objects are updated whenever changing any
parameters.
When Qt 4 support is dropped, the QT_VERSION macros can be adjusted.
This lays the foundation for performance and readibility improvements
in future commits.
Shane Synan [Thu, 23 Aug 2018 03:41:23 +0000 (22:41 -0500)]
client: Fix .ui reference to oxygen_icons.qrc
Fix ignorelisteditdlg.ui's reference to oxygen_icons.qrc, pointing it
to the new location.
Hannah von Reth [Thu, 30 Aug 2018 21:04:53 +0000 (23:04 +0200)]
We don't need dbus on Windows
Hannah von Reth [Thu, 30 Aug 2018 21:02:15 +0000 (23:02 +0200)]
Don't install clang on appveyor
Manuel Nickschas [Wed, 29 Aug 2018 20:35:18 +0000 (22:35 +0200)]
macos client: Fix copyright year in Info.plist
Davide `rainbow` Gerhard [Wed, 29 Aug 2018 14:37:06 +0000 (16:37 +0200)]
macos client: fix automatic GPU switching
see https://codereview.qt-project.org/#/c/73839/
Shane Synan [Thu, 23 Aug 2018 02:36:47 +0000 (21:36 -0500)]
core: Limit "User is away" to 1hr or when changed
Increase the "* User is away" silencing to one hour, and add tracking
for changes in away state. Only print the "* User is away" if away
state has changed since last away message (including removing and
applying the same away message), or if 1 hour has elapsed.
This reduces the spamming of "* User is away" when one often knows
that, yes, the user is away. Any change in away state or message
will still be shown.
Shane Synan [Thu, 23 Aug 2018 00:34:40 +0000 (19:34 -0500)]
common: Unify Date/Time formatting, UTC offset
Unify date/time formatting for the client UI, using
Qt::DateFormat::DefaultLocaleShortDate to respect the operating
system's configured locale. This avoids Qt's kind-of-weird default
date/time format that mixes numbers and named short months/days.
See https://doc.qt.io/qt-5/qt.html#DateFormat-enum
Modify AM/PM detection to use application locale, which currently
defaults to system locale. This avoids any inconsistencies should
Quassel later allow specifying an application-wide locale different
from the system locale.
In CTCP VERSION replies, always use UTC time in ISO8601 date format,
avoiding locale-specific replies and timezone differences. This
fixes client version statistic-tracking software from treating
different languages and different timezones as unique versions of
Quassel IRC.
In CTCP TIME replies, use local time in ISO8601 date format with
timezone offset. This provides a consistent format for others to
parse and still provides the timezone information.
Work around a Qt bug for the latter.
See https://bugreports.qt.io/browse/QTBUG-26161
And https://stackoverflow.com/questions/
18750569/qdatetime-isodate-with-timezone
Shane Synan [Wed, 22 Aug 2018 21:46:01 +0000 (16:46 -0500)]
settings: Fix defaults caching, cache key exists
Add separate cache of whether or not a settings key is persisted to
disk, separate from the cache of settings key values. Modify
localKeyExists() to make use of this cache, offering a potential
slight performance boost.
Fix caching of default values as actual settings values by always
checking if the key is persisted to disk, returning the default value
if not.
This fixes ChatMonitorSettings's "OperationMode" getting set to
"InvalidMode" by ChatMonitorFilter::_operationMode's reading of a
default "InvalidMode", then when loading settings,
ChatMonitorSettingsPage::settings["OperationMode"] would incorrectly
default to "InvalidMode" instead of "OptOut".
Test case:
1. Start with a fresh configuration.
2. Open Chat Monitor settings, skipping first-run wizard/etc
3. Check that "Opt Out" is the default mode
4. Via qDebug() prints, check that ChatMonitorFilter still sees the
default value as InvalidMode
Shane Synan [Wed, 22 Aug 2018 20:43:23 +0000 (15:43 -0500)]
settings: Unify ChatMonitor defaults
Sync ChatMonitor defaults among the three different places to specify
them. Add a comment to explain.
Unify on disabling showing read messages, enabling showing own
messages.
Shane Synan [Tue, 7 Aug 2018 17:01:39 +0000 (12:01 -0500)]
client: Fix duplicated query quit messages
Replace the .contains() check with std::binary_search on message
timestamps, passing a custom comparator that provides +/- 1000 ms of
fuzzy matching. If a quit message is received and doesn't exist
within this time range, it gets forwarded to the query, otherwise
discarded.
Remove the QMultiHash method that tracked quit nicknames. Each query
gets a unique MessageFilter, so there's no need to store and filter
that. This will need modified if e.g. adding an option for quit
messages in the Chat Monitor.
This fixes an existing bug made much worse with millisecond timestamp
precision. Before the 64-bit time changes, quit messages would only
be duplicated if they got split over the turn of a second, a rare
occurrence. Afterwards, they'd get duplicated if split over the turn
of a millisecond, a much more common occurrence.
Fixes regression from commit
6a63070246d89aa2a2474e3a9a1035fa889ad77e
Manuel Nickschas [Tue, 24 Jul 2018 21:20:45 +0000 (23:20 +0200)]
qtui: Properly render hovered-upon clickables
Additional formats given to QTextLayout::draw() are not cumulative.
Since we were using this feature for rendering both selections and
active (hovered-upon) clickables, things would break when both
overlapped. In particular, a highlighted *and* selected URL would
vanish while being hovered.
Fix this by explicitly calculating the range of affected formats
for both selections and active clickables, taking overlap into
account. Remove special handling in ContentsChatItem in favor of
the more generic solution.
Use the newly-introduced "hovered" message label to determine how
an active clickable should be rendered, rather than hardcoding
an underline.
Manuel Nickschas [Tue, 24 Jul 2018 21:19:27 +0000 (23:19 +0200)]
qss: Introduce new message label "hovered"
In order to make the appearance of hovered-upon URLs controllable
by stylesheet, add support for a new message label "hovered".
Extend the default stylesheet to underline hovered-upon URLs.
Manuel Nickschas [Tue, 24 Jul 2018 21:29:18 +0000 (23:29 +0200)]
qss: Disable color codes in highlighted messages in the default QSS
Colored text in highlighted messages may be hard to read due to
the changed background color. Disable overriding the highlight
text color in the default stylesheet.
Custom stylesheets can still enable color codes again by setting
the allow-foreground-override property to true.
Manuel Nickschas [Wed, 22 Aug 2018 23:46:43 +0000 (01:46 +0200)]
qa: Remove [[clang::fallthrough]] annotations again
These cause warnings in most compilers, so remove them again until
we can use C++17 and the official attribute.
Add comments, so we know the fallthroughs are intentional anyway.
Shane Synan [Wed, 22 Aug 2018 01:51:40 +0000 (20:51 -0500)]
core: Remove leftover getAuthUserName and SQL
Remove Storage::getAuthUserName(), including PostgreSQL and SQLite.
Remove the corresponding select_authusername.sql files, too.
This avoids unused code and may avoid confusion in the future. Any
time a username-for-ID is needed, Core::_authUserNames should be
consulted instead.
NOTE: Before using Core::_authUserNames, public functions should be
created and caching should always be done on core startup, instead of
only when --strict-ident mode is enabled.
Shane Synan [Tue, 7 Aug 2018 22:25:16 +0000 (17:25 -0500)]
settings: Reset Network SASL status on load
Explicitly reset IRCv3 capability-based network settings whenever
loading network IDs. This should help guard against situations where
setNetworkCapStates() does not get called with a NetworkId when
loading, resulting in the template text being left visible.
Shane Synan [Mon, 6 Aug 2018 21:31:48 +0000 (16:31 -0500)]
settings: Local Highlights, default Current nick
Re-enable nickname highlighting in Local Highlights by default. This
fixes the issue of upgrading the client before the core resulting in
loss of nickname highlighting.
Many other options were discussed, such as unifying these settings
(new UI work), automatically toggling/disabling local based on core
features, auto-importing, etc, and though all better approaches, they
will take a good bit more time to implement correctly. The focus is
on fixing client-side settings properly in 0.14+, with profiles
allowing for different settings per groups of clients, allowing
deprecation of local highlights entirely.
Partial revert of
f2e4560b71a1888599ca2153eee36a9b4136c902 and
5fcc2f000757bb7c2578e09c8fc8c86a288c3cb5
Shane Synan [Mon, 6 Aug 2018 21:30:33 +0000 (16:30 -0500)]
settings: Local Highlights, clean up nick case UI
Modify the Qt UI page to match the actual default. Not needed, but
it's nicer to see the result when designing.
Hannah von Reth [Mon, 6 Aug 2018 08:51:55 +0000 (10:51 +0200)]
Cleanup appveyor artifact upload
romibi [Fri, 3 Aug 2018 18:47:13 +0000 (20:47 +0200)]
Use Qt's font dialog instead of the (broken) native OSX one
Manuel Nickschas [Wed, 25 Jul 2018 20:26:59 +0000 (22:26 +0200)]
uisupport: Allow to disable spell checking
Apparently, Sonnet, when used standalone (i.e. not in KTextEdit),
does not honor its own setting to disable it by default.
Explicitly read the setting when initializing the highlighter, and
set its active state accordingly. Provide a context menu option
to enable/disable spell check on-the-fly as well.
Remove the bogus/unused checkbox in the InputWidget settings page;
there is a dedicated settings page for configuring spell checking.
Explicitly depend on Sonnet when building with KDE Frameworks
(it was transitively depended upon anyway), so we can be sure to
offer the Sonnet settings page even when using Frameworks.
Manuel Nickschas [Thu, 23 Aug 2018 00:08:50 +0000 (02:08 +0200)]
core: Fix build without SSL
Seems like an #ifdef was overlooked.
Manuel Nickschas [Wed, 22 Aug 2018 23:50:08 +0000 (01:50 +0200)]
qa: Remove bogus self-assignment
Mike Gilbert [Sat, 11 Aug 2018 19:06:00 +0000 (15:06 -0400)]
Set RUNTIME_OUTPUT_DIRECTORY instead of abusing OUTPUT_NAME
This resolves an error when building with ninja:
ninja: error: build.ninja:4374: multiple rules generate quasselcore
Hannah von Reth [Fri, 27 Jul 2018 08:32:56 +0000 (10:32 +0200)]
Use new blueprint repo craft-blueprints-quassel
Jan Alexander Steffens (heftig) [Thu, 19 Jul 2018 21:04:44 +0000 (23:04 +0200)]
QtUiStyle: Support more font weights
The chosen expression is more or less an inverse of the CSS weights to
QFont::Weight translation in the QssParser.
Jan Alexander Steffens (heftig) [Thu, 19 Jul 2018 21:00:52 +0000 (23:00 +0200)]
QssParser: Don't interpret `font: normal` as weight 0
It fell through to the unchecked int conversion.
Also handle "strikethrough" and don't forget to reset the underline
style.
Jan Alexander Steffens (heftig) [Thu, 19 Jul 2018 20:51:54 +0000 (22:51 +0200)]
QssParser: Interpret "oblique" as italic
This is better than nothing.
Manuel Nickschas [Thu, 21 Jun 2018 21:35:52 +0000 (23:35 +0200)]
Bump version for release
Manuel Nickschas [Thu, 21 Jun 2018 21:33:55 +0000 (23:33 +0200)]
Update ChangeLog
Michael Marley [Wed, 18 Jul 2018 00:09:15 +0000 (20:09 -0400)]
Update inxi to 3.0.18
Shane Synan [Tue, 17 Jul 2018 18:28:06 +0000 (13:28 -0500)]
client: Clarify highlight 'Channel' functionality
Modify 'Channel' column tooltip to mention 'channel/query', since
this actually refers to buffer name. As it's less likely someone
will want to set highlights on queries as they trigger notifications
by default, don't rename the column itself.
Shane Synan [Tue, 17 Jul 2018 18:03:52 +0000 (13:03 -0500)]
common: Empty highlight name matches all messages
Don't force core-side highlight rules to have non-empty names,
allowing for matching all messages by leaving the name empty.
Requires core and client support, but as this has not been in a
released version, and it's near release, backwards-compatibility
shouldn't be required.
Update tooltips to note this. (After cleanup, only a single change!)
This wasn't easily possible before as highlight names were the
identifier for the highlight rule. Now that we have IDs for
highlight rules, there's no need to force names to be non-empty.
NOTE: This could cause confusion, but the flexibility in not having
to use RegEx for the sake of matching every message seems worth the
risk of people unintentionally setting empty highlight rules that
match every message.
Local highlights are not changed as they don't have IDs.
Shane Synan [Tue, 17 Jul 2018 17:58:04 +0000 (12:58 -0500)]
client: Fix CoreHighlightSettings Sender resize
Set CoreHighlightSettingsPage::SenderColumn to ResizeToContents,
matching the other columns. This was likely missed when originally
adding this column.
Shane Synan [Tue, 17 Jul 2018 17:56:10 +0000 (12:56 -0500)]
client: Unify CoreHighlightSettingsPage tooltips
Move setting tooltips to a generic function, setupTableTooltips(), to
keep tooltips consistent. This fixes outdated tooltips in the
highlight ignore rules table and reduces duplication.
Add another function getTableTooltip() for getting the tooltips
themselves. Unfortunately, QTableWidgetItem does not inherit from
QWidget, so function overloading (or equivalent) is necessary. Alas,
std::variant is C++17...