-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal libcloudproviders support #7210
Conversation
@jnweiger maybe take a look at the linux-packaging related parts. |
Since this is a minimal implementation, what about 2.6.1. ? :) |
@guruz I'm up for targeting 2.6.1, the main cost is setting up the build. Since it's a new feature I went with 2.7 by default. |
Notes on testing: I noticed my system gtk on ubuntu 18.04 does not use libcloudproviders. That's unfortunate and required a custom build of gtk with
|
@ckamm You probably discussed this before but just wondering... loading with dlopen/QPlugin might have advantages for building (...but disavtanges for maintainability)? |
|
||
if(WITH_LIBCLOUDPROVIDERS AND NOT LIBCLOUDPROVIDERS_POSSIBLE) | ||
message(FATAL_ERROR "Trying to enable libcloudproviders but dependencies are missing") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a runtime dep? If not, why doesn't libcloudproviders doesn't pull it in already? Is it a distro bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No distro bug - it's just that we also need access to gio functions if we want to work with cloudproviders. I'll add a comment saying "to enable the cloudproviders feature we need the cloudproviders and gio-2.0 libraries"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it odd to couple this so strongly here, I would do this way more naively:
Search for both, enable feature if both are found. No need for microoptimizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you use this to make it "switchable".
Suggestion: use OPTION()
for that.
src/gui/CMakeLists.txt
Outdated
@@ -189,6 +189,8 @@ IF( WIN32 ) | |||
ENDIF() | |||
ENDIF() | |||
|
|||
include(libcloudproviders/libcloudproviders.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather unusual.
Usually you would probably put it in CMakeLists.txt file, add it as a subdirectory and define a static target in there (with include dirs and linked libraries) against which you then can link the application.
The way you did it works as well of course.
Unfortunate complication: libcloudproviders < 0.3.0 crashes when unexporting an account. I've not found a way to determine library version or work around it in code. only enable if target has >=0.3.0 - I've added a build-time version check, but that will not guarantee runtime dependency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
LibCloudProviders *_q = nullptr; | ||
|
||
public slots: | ||
void updateExportedFolderList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, you could have used Q_PRIVATE_SLOT
in LibCloudProviders
then LibCloudProvidersPrivate wouldn't need to be a QObject.
The conversation here mentions crashyness, is this relevant for us? |
@guruz I read this as "if you enable libcloudproviders support in gtk, some qt applications using GtkFileChooserDialog may crash" - which is probably a bug with how it's integrated into gtk, I doubt it applies to our use here. |
@ckamm If you're saying that we won't cause this indirectly by depending on this library then great. |
- Add it as an optional dependency for linux builds, controlled by WITH_LIBCLOUDPROVIDERS, which is enabled automatically if the dependencies are available. Note that >=0.3.0 is required. - Add code to export sync folders through the library and to add a minimal "Settings..." menu action. - Set up cloud provider registration by installing a file into a path like /usr/share/cloud-providers/. - DBus name and path are derived from APPLICATION_REV_DOMAIN by default and may be overridden with APPLICATION_CLOUDPROVIDERS_DBUS_NAME and APPLICATION_CLOUDPROVIDERS_DBUS_PATH if necessary.
Add it as an optional dependency for linux builds,
controlled by WITH_LIBCLOUDPROVIDERS, which is enabled automatically
if the dependencies are available.
Add code to export sync folders through the library and to add a
minimal "Settings..." menu action.
Set up cloud provider registration by installing a file into a
path like /usr/share/cloud-providers/.
DBus name and path are derived from APPLICATION_REV_DOMAIN by default
and may be overridden with APPLICATION_CLOUDPROVIDERS_DBUS_NAME and
APPLICATION_CLOUDPROVIDERS_DBUS_PATH if necessary.
For #7209