Skip to content

Commit 2fe336f

Browse files
committed
Use AccountPtr in serverVersionChanged signal instead of raw pointer
Signed-off-by: Claudio Cambra <[email protected]>
1 parent 35f3a95 commit 2fe336f

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

src/gui/application.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ void Application::slotAccountStateAdded(AccountState *accountState)
503503
connect(accountState->account().data(), &Account::serverVersionChanged,
504504
_folderManager.data(), &FolderMan::slotServerVersionChanged);
505505

506-
_gui->slotTrayMessageIfServerUnsupported(accountState->account().data());
506+
_gui->slotTrayMessageIfServerUnsupported(accountState->account());
507507
}
508508

509509
void Application::slotCleanup()

src/gui/folderman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ void FolderMan::slotForwardFolderSyncStateChange()
10491049
}
10501050
}
10511051

1052-
void FolderMan::slotServerVersionChanged(Account *account)
1052+
void FolderMan::slotServerVersionChanged(const OCC::AccountPtr &account)
10531053
{
10541054
// Pause folders if the server version is unsupported
10551055
if (account->serverVersionUnsupported()) {

src/gui/folderman.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ private slots:
294294
// FolderMan::folderSyncStateChange(Folder*) signal.
295295
void slotForwardFolderSyncStateChange();
296296

297-
void slotServerVersionChanged(OCC::Account *account);
297+
void slotServerVersionChanged(const OCC::AccountPtr &account);
298298

299299
/**
300300
* A file whose locks were being monitored has become unlocked.

src/gui/owncloudgui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void ownCloudGui::slotAccountStateChanged()
252252
slotComputeOverallSyncStatus();
253253
}
254254

255-
void ownCloudGui::slotTrayMessageIfServerUnsupported(Account *account)
255+
void ownCloudGui::slotTrayMessageIfServerUnsupported(const AccountPtr &account)
256256
{
257257
if (account->serverVersionUnsupported()) {
258258
slotShowTrayMessage(

src/gui/owncloudgui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public slots:
9494
void slotHelp();
9595
void slotOpenPath(const QString &path);
9696
void slotAccountStateChanged();
97-
void slotTrayMessageIfServerUnsupported(OCC::Account *account);
97+
void slotTrayMessageIfServerUnsupported(const OCC::AccountPtr &account);
9898

9999

100100
/**

src/libsync/account.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ void Account::setServerVersion(const QString &version)
730730

731731
auto oldServerVersion = _serverVersion;
732732
_serverVersion = version;
733-
emit serverVersionChanged(this, oldServerVersion, version);
733+
emit serverVersionChanged(sharedFromThis(), oldServerVersion, version);
734734
}
735735

736736
void Account::writeAppPasswordOnce(QString appPassword){

src/libsync/account.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public slots:
341341
// e.g. when the approved SSL certificates changed
342342
void wantsAccountSaved(const OCC::AccountPtr &acc);
343343

344-
void serverVersionChanged(OCC::Account *account, const QString &newVersion, const QString &oldVersion);
344+
void serverVersionChanged(const OCC::AccountPtr &account, const QString &newVersion, const QString &oldVersion);
345345

346346
void accountChangedAvatar();
347347
void accountChangedDisplayName();

0 commit comments

Comments
 (0)