Sometimes QClipboard::text() unexpectedly freezes on macOS, no known
causes for that. But before we were requesting the clipboard text after
each change in any text field to update macOS global menu items.
Now we use Cocoa API directly to find out if there were any changes to
the clipboard content and query text through Qt only if we have changes.
That way it should almost never freeze (at least) or even really never.
Currently the build without implicitly included precompiled header
is not supported anyway (because Qt MOC source files do not include
stdafx.h, they include plain headers).
So when we decide to support building without implicitly included
precompiled headers we'll have to fix all the headers anyway.
Now you can type "endpoints" in Settings and choose a file with
a complete set of dc_options that will be used instead of built-in
or received through mtproto config till the end of current session.
Sometimes Text::_maxWidth was not accumulated correctly because
the intermediate text blocks had negative right bearing larger
than the whole width of the next text block, so the final computed
line width was less than some intermediate value. Now we accumulate
the _maxWidth value after each block making this value correct.
Now we use only new authorization keys for signing in. If we are
preparing to sign in and we see, that some of the authorization
keys were not generated in this launch, but were read from file, we
destroy all existing auth keys and generate a completely new set.
Some major platform-dependent file operations refactoring.
All methods like "open file", "open file with", "show in folder"
were moved to core/file_utilities module with platform-dependent
backends. All methods interacting with DesktopServices made async.
Now each platform-dependent module declares its interface in
platform/platform_module.h file and after that includes platform-
specific headers like platform/win/module_win.h with implementation.
Also removed the legacy WinRT platform-dependent implementations.
ShellExecute() call reenters Qt event loop, so each time we
schedule a delayed action (like destroying FileLoader) and after
that we call ShellExecute (in psOpenFile) we destroy it inside
this call and can't use it after.
So now we perform ShellExecute calls only delayed (using task queue).
When we choose a file from URL we don't get the filename.
In background image apply method we test for a theme / palette
file extensions. Now we don't crash there, but we still can't set
a .tdesktop-theme or .tdesktop-palette file from URL. Who cares :)
Special FileLoader destructor crash added to find the code path
leading to crashes that could be observed through the reports.
Looks like progress() signal handlers enter event loop somehow.
If the MTP::Instance is not started yet (we forgot our passcode),
the logout attempt was attempting to use mtproto from Intro::Widget
constructor before it was created. Now we create it before logout.
When we load previous messages in chat history we add all authors
of the messages to lastAuthors in regular groups (so that we can
suggest them in mention autocomplete). The same logic was (blindly)
applied to supergroups lastParticipants list which is used not only
for the mention autocomplete but also in Profile members list. That
way we were showing there users who could've already left the group.
Commit 8d354382a4 introduced a regression in RTL phrases display.
When an RTL line had trailing spaces we started displaying them in
front of the text still assuming counted line width value that did
not include those trailing spaces.
Line width is not including trailing spaces width because it is
allowed to fit in the line any number of spaces.
Also text block "left padding" entity was eliminated. If we have
some spaces in the start of the text block (for example a text block
after a link) we just add an empty word and mark those spaces as its
right padding.
Now base::lambda can be copied and can wrap any immutable lambda.
For mutable lambdas there is base::lambda_once (which you're
supposed to call only once to pass data through lambda captures,
for example by using std::unique_ptr). Generally base::lambda is
passed by value and base::lambda_once is passed by rvalue reference.
Some of MTP::Instance::Private fields access _instance in
destructors. All that cleanup should be performed before the
Instance::~Instance() (which invalidates _private) is called.