File tree 3 files changed +19
-2
lines changed
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,11 @@ void AccountManager::saveAccountState(AccountState *a)
220
220
void AccountManager::saveAccountHelper (Account *acc, QSettings &settings, bool saveCredentials)
221
221
{
222
222
settings.setValue (QLatin1String (versionC), maxAccountVersion);
223
- settings.setValue (QLatin1String (urlC), acc->_url .toString ());
223
+ if (acc->isPublicShareLink ()) {
224
+ settings.setValue (QLatin1String (urlC), acc->publicShareLinkUrl ().toString ());
225
+ } else {
226
+ settings.setValue (QLatin1String (urlC), acc->_url .toString ());
227
+ }
224
228
settings.setValue (QLatin1String (davUserC), acc->_davUser );
225
229
settings.setValue (QLatin1String (serverVersionC), acc->_serverVersion );
226
230
if (acc->_credentials ) {
Original file line number Diff line number Diff line change @@ -443,13 +443,24 @@ void Account::setUrl(const QUrl &url)
443
443
_url.setUserName (isPublicLink.captured (2 ));
444
444
setDavUser (isPublicLink.captured (2 ));
445
445
_isPublicLink = true ;
446
+ _publicShareLinkUrl = url;
446
447
} else {
447
448
_url = url;
448
449
}
449
450
450
451
_userVisibleUrl = url;
451
452
}
452
453
454
+ QUrl Account::url () const
455
+ {
456
+ return _url;
457
+ }
458
+
459
+ QUrl Account::publicShareLinkUrl () const
460
+ {
461
+ return _publicShareLinkUrl;
462
+ }
463
+
453
464
void Account::setUserVisibleHost (const QString &host)
454
465
{
455
466
_userVisibleUrl.setHost (host);
Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject
114
114
115
115
/* * Server url of the account */
116
116
void setUrl (const QUrl &url);
117
- QUrl url () const { return _url; }
117
+ QUrl url () const ;
118
+ QUrl publicShareLinkUrl () const ;
118
119
119
120
bool isPublicShareLink () const
120
121
{
@@ -331,6 +332,7 @@ protected Q_SLOTS:
331
332
#endif
332
333
QMap<QString, QVariant> _settingsMap;
333
334
QUrl _url;
335
+ QUrl _publicShareLinkUrl;
334
336
bool _isPublicLink = false ;
335
337
336
338
/* * If url to use for any user-visible urls.
You can’t perform that action at this time.
0 commit comments