Setting the parent of MessageBoxManager to Widget has a dual effect of
centreing the QMessageBox's on Widget' window which we want, but also
giving ownership of MessageBoxManager to Widget, which causes Widget to
destroy it in Widget's destructor. Since the original MessageBoxManager
must outlive Widget to be used in Settings and when loading Profiles
before Widget is constructed, we don't want Widget to destroy it.
Instead of juggling MessageBoxManager's parent around dynamically when
Nexus changes the active Window, just construct a second one in Widget
to be used by all its children with the parent set on Widget, centreing
the window and allowing it to have ownership.
Settings and Profile still use the original parent-less
MessageBoxManager since they show popups before Widget is constructed.
The same user may have sent a message both in the group and 1:1, so
generically remove aliases that have no associated messages, rather than
aliases that were used in the group.
Similarly, generically remove authors that have no associated aliases.
The group itself is a chat so will be removed through existing query.
peers had combined meaning, both being referenced by history for which
chat a message was in, and being reference by aliases for who authored a
message. This means that peers had conceptually different sub-groups:
all friends are both a chat and an author, but self is an author but not
a chat. With the addition of group chats this is amplified by groups
themselves being chats but not authors, and group members being authors
but not chats. Instead of having four sub-groups all within peers,
splitting peers into chats and authors gives a clean mapping,
simplifying interactions with the data.
In the new chats and authors tables, store what used to be a public_key
string as a BLOB, since it’s inherently a 32-byte binary value in both
cases. Call the public_key a UUID for chats, since group IDs are not
defined as public keys by toxcore.
Even though the data change is quite minor, the upgrade is large because
of SQLite's lack of support for modifying foreign key constrains for
existing tables. This means when peers are moved to new tables, all
tables referencing peers need to be cloned with a new foreign key
constraint, as well as all tables referencing those, recursively.
Files are conceptually temporary, having extra conflict handling logic
is unnecessary, and having the test fail to run if it crashed on last
invocation is annoying.
Replace underlength resume_file_id's with arbitrary data. Loaded file IDs are
not used for anything at this time, but they should not be null nor invalid.
Any 32-byte value is valid, so use all 0's for consistency.
Fix#6553
The implicit cast in addNewFileMessage's argument causes a conversion from the
binary data of file_id to be interpreted as UTF8 characters. On null bytes or
invalid UTF8, the resulting QString can be empty or truncated. Empty IDs causes
null file_restart_id's to be inserted into the database.
Fixes the cause of #6553, but the database damage still needs to be healed.
"finished" is not a field in file_transfers. Bug has been present since
initially introduced in d9b39b3102.
Had no real effect since file transfers are inserted with initial state
CANCELLED, which is usually the case for a 0-length finished file, but
it still logged an SQL error.
warnings interface was only being linked to qtox_static, so were not being
applied to e.g. util. Link it to each library as well as qtox_static so that
they all inherit all the warnings.
We already deep copy all other data types. Especially with Qt types like
QByteArray, having a deep copy to start is important since it shallow
copies on any subsequent copy, so the callback provider only gets a
shallow copy in the QByteArray of the temporary data from SQLite.
* Pass MessageBoxManager instantiation around instead of relying on a singleton
* Mock MessageBoxManager for unit tests when needed, since they don't have a
QApplication which is required for creating QWidgets
* Remove GUI class, which didn't have a clear purpose
Widget is the only caller, let it set its own title. Wrap inherited setTitle to
prepend "qTox". Check for thread is not needed since it is only called
from Widget's slots.
Style already has themeChanged, which was unused. GUI's themeReload just
dispatches to Style, which is already piped to GUI classes. Give the signal
to Style itself so that classes can connect to that, rather than relying on
GUI's singleton.
CMAKE_OSX_DEPLOYMENT_TARGET has no effect when not building for macOS.
MACOSX_RPATH must be set explicitly for OpenAL to be found. It is default using newer cmake, but OpenAL is using cmake 2.6.