Skip to content
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

Merged
merged 1 commit into from
Jun 7, 2019
Merged

Minimal libcloudproviders support #7210

merged 1 commit into from
Jun 7, 2019

Conversation

ckamm
Copy link
Contributor

@ckamm ckamm commented May 27, 2019

  • 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

@ckamm ckamm added this to the 2.7.0 milestone May 27, 2019
@ckamm ckamm requested review from ogoffart and jnweiger May 27, 2019 11:38
@ckamm ckamm self-assigned this May 27, 2019
@ckamm
Copy link
Contributor Author

ckamm commented May 27, 2019

@jnweiger maybe take a look at the linux-packaging related parts.

@guruz
Copy link
Contributor

guruz commented May 27, 2019

Since this is a minimal implementation, what about 2.6.1. ? :)

@ckamm
Copy link
Contributor Author

ckamm commented May 27, 2019

@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.

@ckamm
Copy link
Contributor Author

ckamm commented May 27, 2019

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 --enable-cloudproviders. I then run nautilus with LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libcloudproviders.so.0.2.5 LD_LIBRARY_PATH=mygtk/gtk/.libs nautilus.

  • The ownCloud sync folders should show up in the location picker on the left
  • The right-click menu of these entries should have a "Settings..." entry.
  • Clicking it should open the oC settings window.

@guruz
Copy link
Contributor

guruz commented May 27, 2019

@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()
Copy link
Member

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?

Copy link
Contributor Author

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"

Copy link
Member

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.

Copy link
Member

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.

@@ -189,6 +189,8 @@ IF( WIN32 )
ENDIF()
ENDIF()

include(libcloudproviders/libcloudproviders.cmake)
Copy link
Member

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.

@ckamm
Copy link
Contributor Author

ckamm commented May 28, 2019

Screenshot:
image

@ckamm
Copy link
Contributor Author

ckamm commented May 28, 2019

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.

@ckamm ckamm force-pushed the libcloudproviders branch from 696b5cd to 72fbeb3 Compare May 28, 2019 08:39
@ckamm ckamm requested a review from dschmidt May 28, 2019 08:40
Copy link
Contributor

@ogoffart ogoffart left a 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();
Copy link
Contributor

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.

@guruz
Copy link
Contributor

guruz commented Jun 4, 2019

The conversation here mentions crashyness, is this relevant for us?
https://bugs.archlinux.org/task/62502

@ckamm
Copy link
Contributor Author

ckamm commented Jun 4, 2019

@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.

@guruz
Copy link
Contributor

guruz commented Jun 4, 2019

@ckamm If you're saying that we won't cause this indirectly by depending on this library then great.
(And only gtk compiled with the library will cause the crash)

@ckamm ckamm force-pushed the libcloudproviders branch from 72fbeb3 to 524bf64 Compare June 5, 2019 08:53
- 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.
@ckamm ckamm force-pushed the libcloudproviders branch from 524bf64 to f377d91 Compare June 5, 2019 09:08
@ckamm ckamm changed the base branch from master to 2.6 June 5, 2019 09:08
@ckamm ckamm modified the milestones: 2.7.0, 2.6.0 Jun 5, 2019
@guruz
Copy link
Contributor

guruz commented Jun 5, 2019

FYI @hefee @dragotin

@ckamm ckamm merged commit 2c0a379 into 2.6 Jun 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the libcloudproviders branch June 7, 2019 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants