mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
fix(cloudproviders): use a class static variable instead of a global one
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
02d62417da
commit
64b75c8f00
@ -22,7 +22,8 @@
|
||||
using namespace OCC;
|
||||
|
||||
GSimpleActionGroup *actionGroup = nullptr;
|
||||
int preferredTextWidth = 0;
|
||||
|
||||
int CloudProviderWrapper::preferredTextWidth = 0;
|
||||
|
||||
CloudProviderWrapper::CloudProviderWrapper(QObject *parent, Folder *folder, int folderId, CloudProvidersProviderExporter* cloudprovider) : QObject(parent)
|
||||
, _folder(folder)
|
||||
@ -207,7 +208,7 @@ void CloudProviderWrapper::slotSyncFinished(const SyncResult &result)
|
||||
static GMenuItem* addMenuItem(const QString text, const gchar *action)
|
||||
{
|
||||
QFontMetrics fm = QApplication::fontMetrics();
|
||||
preferredTextWidth = MAX (preferredTextWidth, (fm.boundingRect (text)).width ());
|
||||
CloudProviderWrapper::preferredTextWidth = MAX (CloudProviderWrapper::preferredTextWidth, (fm.boundingRect (text)).width ());
|
||||
return menu_item_new (text, action);
|
||||
}
|
||||
|
||||
|
||||
@ -29,6 +29,8 @@ class CloudProviderWrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static int preferredTextWidth;
|
||||
|
||||
explicit CloudProviderWrapper(QObject *parent = nullptr, Folder *folder = nullptr, int folderId = 0, CloudProvidersProviderExporter* cloudprovider = nullptr);
|
||||
~CloudProviderWrapper() override;
|
||||
CloudProvidersAccountExporter* accountExporter();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user