[Pkg-owncloud-commits] [owncloud-client] 95/218: SetupPage: Fix crash caused by uninitialized Account object.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 17 14:30:51 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 9eec45f9c4fc04b56f712364c75332a451906b16
Author: Klaas Freitag <freitag at owncloud.com>
Date: Thu Sep 10 16:03:22 2015 +0200
SetupPage: Fix crash caused by uninitialized Account object.
Since the webdav path is read from account now, it needs to be
initialized first thing.
---
src/gui/wizard/owncloudsetuppage.cpp | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp
index 616caa0..d3ea76b 100644
--- a/src/gui/wizard/owncloudsetuppage.cpp
+++ b/src/gui/wizard/owncloudsetuppage.cpp
@@ -45,6 +45,7 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
_progressIndi(new QProgressIndicator (this))
{
_ui.setupUi(this);
+ _ocWizard = qobject_cast<OwncloudWizard *>(parent);
Theme *theme = Theme::instance();
setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(theme->appNameGUI())));
@@ -66,7 +67,6 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
connect(_ui.leUrl, SIGNAL(editingFinished()), SLOT(slotUrlEditFinished()));
addCertDial = new AddCertificateDialog(this);
- _ocWizard = qobject_cast<OwncloudWizard *>(parent);
connect(_ocWizard,SIGNAL(needCertificate()),this,SLOT(slotAskSSLClientCertificate()));
}
@@ -106,14 +106,16 @@ void OwncloudSetupPage::slotUrlChanged(const QString& url)
if (url.endsWith("index.php")) {
newUrl.chop(9);
}
- QString webDavPath = _ocWizard->account()->davPath();
- if (url.endsWith(webDavPath)) {
- newUrl.chop( webDavPath.length() );
- }
- if( webDavPath.endsWith(QLatin1Char('/')) ) {
- webDavPath.chop(1); // cut off the slash
- if( url.endsWith(webDavPath)) {
- newUrl.chop(webDavPath.length());
+ if( _ocWizard && _ocWizard->account() ) {
+ QString webDavPath = _ocWizard->account()->davPath();
+ if (url.endsWith(webDavPath)) {
+ newUrl.chop( webDavPath.length() );
+ }
+ if( webDavPath.endsWith(QLatin1Char('/')) ) {
+ webDavPath.chop(1); // cut off the slash
+ if( url.endsWith(webDavPath)) {
+ newUrl.chop(webDavPath.length());
+ }
}
}
if (newUrl != url) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list