Context properties are deprecated and will be removed in Qt 6.
QML singletons are the better option here, especially given that
UserModel and UserAppsModel already are singletons.
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
Deduplicate the Button code by moving it into a separate file.
Also use the same background code for the apps button since as far as I can tell it didn't behave any different
Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
Seems like Qt sometimes doesn't like the QML window's screen property to be set
to a C++ (QVariant) pointer value, so we use the index: Qt.application.screens[]
See Qt docs: https://doc.qt.io/qt-5/qml-qtquick-window-window.html#screen-prop
This fix returns the matching window's index from the QGuiApplication::screens()
list to the QML side, instead of the window pointer.
Steps to reproduce the crash with the previous code:
- Open the Tray menu and close it a few times,
or scroll randomly up and down in its activity list.
Tested with Qt 5.12.5
Signed-off-by: Michael Schuster <michael@schuster.ms>
This leads to simplifying the computation code quite a bit as well.
Indeed we're separating concern between what is window size dependent or
not and that shows.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This was leading to the same logic being duplicated several times. It's
fine to return the QScreen* on the QML side directly but wrapped into a
QVariant.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
The API is just more convenient there, the rect and point types on the
QML side are just pale shadow of their C++ counterparts.
Also improved a bit the constness of the Systray class.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
The top left corner of that screenRect is (0,0) or based on
(virtualX,virtualY) depending on the platform. This leads to easier
reduction in code duplication.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Make the codebase consistent, we already have a lot of implicit pointer comparisons.
Exception: Stay explicit on return's, example:
return _db != nullptr;
Signed-off-by: Michael Schuster <michael@schuster.ms>
Merging PR #2057 caused the Windows build to fail:
shell_integration\windows\OCUtil\RegistryUtil.cpp(43): error C2664: 'LSTATUS RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY)': cannot convert argument 3 from 'nullptr' to 'DWORD'
The previous implementation prior the PR supplied NULL as the argument 3 to RegOpenKeyEx,
so it was silently accepted and translated to zero, satisfying the DWORD's type requirement.
Signed-off-by: Michael Schuster <michael@schuster.ms>
When you try to open the local sync folder (by clicking on the
folder symbol) for an account that has no folder configured,
the client crashes.
This commit changes User::openLocalFolder() to do nothing in
case no local folder is configured.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
The app menu had a width based on the header button size which was
way too narrow to display its content.
This commit changes the width based on the contents (menu items) of
the menu, however, limiting the maximum width to half the window width.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
We keep NULL in the pure C files in src/csync/std and test/csync.
We also replace Doxygen documentation referring to "NULL" to
"\c nullptr" (formatted as code).
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
- src/CMakeLists.txt: Switch build order to build cmd before gui
- src/gui/CMakeLists.txt: Use the -executable option for a combined run of macdeployqt
Signed-off-by: Michael Schuster <michael@schuster.ms>
In order to build the new 2.7 releases (new QML dependencies) without manually
modifying the old Python script each time, rely on Qt's standard tool instead.
This should streamline the build systems for upcoming dependency changes.
Signed-off-by: Michael Schuster <michael@schuster.ms>
YAML files here use the .yml extension, not the .yaml extension.
Hence the GitHub workflow file is renamed.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>