Removed obsolete class MirallWebDav

This commit is contained in:
Klaas Freitag 2012-04-15 14:06:27 +02:00
parent c04315805f
commit ccd93036fb
5 changed files with 3 additions and 128 deletions

View file

@ -52,7 +52,6 @@ mirall/statusdialog.cpp
mirall/owncloudwizard.cpp
mirall/owncloudsetupwizard.cpp
mirall/owncloudinfo.cpp
mirall/mirallwebdav.cpp
mirall/theme.cpp
mirall/miralltheme.cpp
mirall/owncloudtheme.cpp
@ -71,7 +70,6 @@ set(mirall_HEADERS
mirall/folderwatcher.h
mirall/folderwizard.h
mirall/gitfolder.h
mirall/mirallwebdav.h
mirall/owncloudfolder.h
mirall/owncloudinfo.h
mirall/owncloudsetupwizard.h

View file

@ -220,23 +220,8 @@ void FolderWizardTargetPage::slotCreateRemoteFolder()
const QString folder = _ui.OCFolderLineEdit->text();
if( folder.isEmpty() ) return;
qDebug() << "creating folder on ownCloud: " << folder;
_ownCloudDirCheck->mkdirRequest( folder );
#if 0
QString url = cfgFile.ownCloudUrl( cfgFile.defaultConnection(), true );
url.append( folder );
qDebug() << "creating folder on ownCloud: " << url;
MirallWebDAV *webdav = new MirallWebDAV(this);
connect( webdav, SIGNAL(webdavFinished(QNetworkReply*)),
SLOT(slotCreateRemoteFolderFinished(QNetworkReply*)));
webdav->httpConnect( url, cfgFile.ownCloudUser(), cfgFile.ownCloudPasswd() );
if( webdav->mkdir( url ) ) {
qDebug() << "WebDAV mkdir request successfully started";
} else {
qDebug() << "WebDAV mkdir request failed";
}
#endif
}
void FolderWizardTargetPage::slotCreateRemoteFolderFinished( QNetworkReply *reply )

View file

@ -1,50 +0,0 @@
/*
* Copyright (C) by Klaas Freitag <freitag@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "mirallwebdav.h"
#include <QtCore>
#include <QtNetwork>
#include <QObject>
MirallWebDAV::MirallWebDAV(QObject *parent) :
QObject(parent)
{
_webdav = new QWebdav;
connect( _webdav, SIGNAL(webdavFinished(QNetworkReply*)), this,
SIGNAL(webdavFinished(QNetworkReply*)) );
}
void MirallWebDAV::httpConnect( const QString& str, const QString& user, const QString& passwd)
{
_host = str;
if( !_host.endsWith( "webdav.php")) {
_host.append( "/files/webdav.php");
}
_webdav->init( _host, user, passwd );
}
bool MirallWebDAV::mkdir( const QString& dir )
{
bool re = true;
QNetworkReply *reply = _webdav->mkdir( dir );
if( reply->error() != QNetworkReply::NoError ) {
qDebug() << "WebDAV Mkdir failed.";
re = false;
}
return re;
}

View file

@ -1,47 +0,0 @@
/*
* Copyright (C) by Klaas Freitag <freitag@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#ifndef MIRALLWEBDAV_H
#define MIRALLWEBDAV_H
#include <QObject>
#include <qwebdav.h>
class MirallWebDAV : public QObject
{
Q_OBJECT
public:
explicit MirallWebDAV(QObject *parent = 0);
void httpConnect( const QString& url, const QString&, const QString& );
bool mkdir( const QString& dir );
protected:
signals:
void webdavFinished( QNetworkReply* );
public slots:
private:
QString _host;
QString _user;
QString _passwd;
QString _error;
QWebdav *_webdav;
};
#endif // MIRALLWEBDAV_H

View file

@ -18,7 +18,6 @@
#include <QDesktopServices>
#include "mirall/owncloudsetupwizard.h"
#include "mirall/mirallwebdav.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/owncloudinfo.h"
#include "mirall/folderman.h"
@ -75,6 +74,7 @@ OwncloudSetupWizard::OwncloudSetupWizard( FolderMan *folderMan, Theme *theme, QO
_ocInfo = new ownCloudInfo;
connect(_ocInfo,SIGNAL(ownCloudInfoFound(QString,QString)),SLOT(slotOwnCloudFound(QString,QString)));
connect(_ocInfo,SIGNAL(noOwncloudFound(QNetworkReply*)),SLOT(slotNoOwnCloudFound(QNetworkReply*)));
connect(_ocInfo,SIGNAL(webdavColCreated(QNetworkReply*)),SLOT(slotCreateRemoteFolderFinished(QNetworkReply*)));
}
OwncloudSetupWizard::~OwncloudSetupWizard()
@ -358,18 +358,7 @@ bool OwncloudSetupWizard::createRemoteFolder( const QString& folder )
url.append( folder );
qDebug() << "creating folder on ownCloud: " << url;
MirallWebDAV *webdav = new MirallWebDAV(this);
connect( webdav, SIGNAL(webdavFinished(QNetworkReply*)),
SLOT(slotCreateRemoteFolderFinished(QNetworkReply*)));
webdav->httpConnect( url, cfgFile.ownCloudUser(), cfgFile.ownCloudPasswd() );
if( webdav->mkdir( url ) ) {
qDebug() << "WebDAV mkdir request successfully started";
return true;
} else {
qDebug() << "WebDAV mkdir request failed";
return false;
}
_ocInfo->mkdirRequest( url );
}
void OwncloudSetupWizard::slotCreateRemoteFolderFinished( QNetworkReply *reply )