зеркало из https://github.com/nextcloud/desktop.git
Merge pull request #1763 from nextcloud/tintou/cloudprovider-valid-dbus-path
Make sure that the libcloudprovider integration is using a valid D-Bus path
This commit is contained in:
Коммит
e7b5cc8974
|
@ -52,8 +52,8 @@ void CloudProviderManager::registerSignals()
|
|||
CloudProviderManager::CloudProviderManager(QObject *parent) : QObject(parent)
|
||||
{
|
||||
_map = new QMap<QString, CloudProviderWrapper*>();
|
||||
QString busName = QString(LIBCLOUDPROVIDERS_DBUS_BUS_NAME);
|
||||
g_bus_own_name (G_BUS_TYPE_SESSION, busName.toAscii().data(), G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, on_name_acquired, nullptr, this, nullptr);
|
||||
_folder_index = 0;
|
||||
g_bus_own_name (G_BUS_TYPE_SESSION, LIBCLOUDPROVIDERS_DBUS_BUS_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, on_name_acquired, nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
void CloudProviderManager::slotFolderListChanged(const Folder::Map &folderMap)
|
||||
|
@ -72,7 +72,7 @@ void CloudProviderManager::slotFolderListChanged(const Folder::Map &folderMap)
|
|||
while (j.hasNext()) {
|
||||
j.next();
|
||||
if (!_map->contains(j.key())) {
|
||||
auto *cpo = new CloudProviderWrapper(this, j.value(), _providerExporter);
|
||||
auto *cpo = new CloudProviderWrapper(this, j.value(), _folder_index++, _providerExporter);
|
||||
_map->insert(j.key(), cpo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ public slots:
|
|||
|
||||
private:
|
||||
QMap<QString, CloudProviderWrapper*> *_map;
|
||||
unsigned int _folder_index;
|
||||
};
|
||||
|
||||
#endif // CLOUDPROVIDERMANAGER_H
|
||||
|
|
|
@ -33,13 +33,13 @@ using namespace OCC;
|
|||
|
||||
GSimpleActionGroup *actionGroup = nullptr;
|
||||
|
||||
CloudProviderWrapper::CloudProviderWrapper(QObject *parent, Folder *folder, CloudProvidersProviderExporter* cloudprovider) : QObject(parent)
|
||||
CloudProviderWrapper::CloudProviderWrapper(QObject *parent, Folder *folder, int folderId, CloudProvidersProviderExporter* cloudprovider) : QObject(parent)
|
||||
, _folder(folder)
|
||||
{
|
||||
GMenuModel *model;
|
||||
GActionGroup *action_group;
|
||||
_recentlyChanged = new QList<QPair<QString, QString>>();
|
||||
QString accountName = QString("Account%1Folder%2").arg(folder->alias(), folder->accountState()->account()->id());
|
||||
QString accountName = QString("Folder/%1").arg(folderId);
|
||||
|
||||
_cloudProvider = CLOUD_PROVIDERS_PROVIDER_EXPORTER(cloudprovider);
|
||||
_cloudProviderAccount = cloud_providers_account_exporter_new(_cloudProvider, accountName.toUtf8().data());
|
||||
|
|
|
@ -38,7 +38,7 @@ class CloudProviderWrapper : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CloudProviderWrapper(QObject *parent = nullptr, Folder *folder = nullptr, CloudProvidersProviderExporter* cloudprovider = nullptr);
|
||||
explicit CloudProviderWrapper(QObject *parent = nullptr, Folder *folder = nullptr, int folderId = 0, CloudProvidersProviderExporter* cloudprovider = nullptr);
|
||||
~CloudProviderWrapper();
|
||||
CloudProvidersAccountExporter* accountExporter();
|
||||
Folder* folder();
|
||||
|
|
Загрузка…
Ссылка в новой задаче