Remove "Mirall" from class names

This commit is contained in:
Daniel Molkentin 2014-11-09 22:30:29 +01:00
parent 9ebc41ed6f
commit f2eadacf09
31 changed files with 131 additions and 131 deletions

View file

@ -378,7 +378,7 @@ restart_sync:
}
// Exclude lists
QString systemExcludeListFn = MirallConfigFile::excludeFileFromSystem();
QString systemExcludeListFn = ConfigFile::excludeFileFromSystem();
int loadedSystemExcludeList = false;
if (!systemExcludeListFn.isEmpty()) {
loadedSystemExcludeList = csync_add_exclude_list(_csync_ctx, systemExcludeListFn.toLocal8Bit());

View file

@ -43,7 +43,7 @@ AccountMigrator::AccountMigrator()
QStringList AccountMigrator::migrateFolderDefinitons()
{
MirallConfigFile cfg;
ConfigFile cfg;
QStringList re;
QString themePath = cfg.configPath();

View file

@ -119,7 +119,7 @@ Application::Application(int &argc, char **argv) :
qRegisterMetaType<Progress::Info>("Progress::Info");
MirallConfigFile cfg;
ConfigFile cfg;
_theme->setSystrayUseMonoIcons(cfg.monoIcons());
connect (_theme, SIGNAL(systrayUseMonoIconsChanged(bool)), SLOT(slotUseMonoIconsChanged(bool)));
@ -404,7 +404,7 @@ void Application::parseOptions(const QStringList &options)
} else if (option == QLatin1String("--confdir")) {
if (it.hasNext() && !it.peekNext().startsWith(QLatin1String("--"))) {
QString confDir = it.next();
MirallConfigFile::setConfDir( confDir );
ConfigFile::setConfDir( confDir );
} else {
showHelp();
}

View file

@ -70,7 +70,7 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
qsrand(QTime::currentTime().msec());
_timeSinceLastSync.start();
MirallConfigFile cfg;
ConfigFile cfg;
_syncResult.setStatus( SyncResult::NotYetStarted );
@ -274,7 +274,7 @@ void Folder::slotPollTimerTimeout()
}
bool forceSyncIntervalExpired =
quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval();
quint64(_timeSinceLastSync.elapsed()) > ConfigFile().forceSyncInterval();
bool syncAgainAfterFail = _consecutiveFailingSyncs > 0 && _consecutiveFailingSyncs < 3;
// There are several conditions under which we trigger a full-discovery sync:
@ -679,16 +679,16 @@ bool Folder::setIgnoredFiles()
{
bool ok = false;
MirallConfigFile cfgFile;
ConfigFile cfgFile;
csync_clear_exclude_list( _csync_ctx );
QString excludeList = cfgFile.excludeFile( MirallConfigFile::SystemScope );
QString excludeList = cfgFile.excludeFile( ConfigFile::SystemScope );
if( !excludeList.isEmpty() ) {
qDebug() << "==== added system ignore list to csync:" << excludeList.toUtf8();
if (csync_add_exclude_list( _csync_ctx, excludeList.toUtf8() ) == 0) {
ok = true;
}
}
excludeList = cfgFile.excludeFile( MirallConfigFile::UserScope );
excludeList = cfgFile.excludeFile( ConfigFile::UserScope );
if( !excludeList.isEmpty() ) {
qDebug() << "==== added user defined ignore list to csync:" << excludeList.toUtf8();
csync_add_exclude_list( _csync_ctx, excludeList.toUtf8() );
@ -787,7 +787,7 @@ void Folder::setDirtyNetworkLimits()
{
if (_engine) {
MirallConfigFile cfg;
ConfigFile cfg;
int downloadLimit = 0;
if (cfg.useDownloadLimit()) {
downloadLimit = cfg.downloadLimit() * 1000;

View file

@ -136,9 +136,9 @@ void FolderMan::registerFolderMonitor( Folder *folder )
if( !_folderWatchers.contains(folder->alias() ) ) {
FolderWatcher *fw = new FolderWatcher(folder->path(), this);
MirallConfigFile cfg;
fw->addIgnoreListFile( cfg.excludeFile(MirallConfigFile::SystemScope) );
fw->addIgnoreListFile( cfg.excludeFile(MirallConfigFile::UserScope) );
ConfigFile cfg;
fw->addIgnoreListFile( cfg.excludeFile(ConfigFile::SystemScope) );
fw->addIgnoreListFile( cfg.excludeFile(ConfigFile::UserScope) );
// Connect the folderChanged signal, which comes with the changed path,
// to the signal mapper which maps to the folder alias. The changed path
@ -185,7 +185,7 @@ int FolderMan::setupFolders()
unloadAllFolders();
MirallConfigFile cfg;
ConfigFile cfg;
QDir storageDir(cfg.configPath());
storageDir.mkpath(QLatin1String("folders"));
_folderConfigPath = cfg.configPath() + QLatin1String("folders");
@ -375,7 +375,7 @@ void FolderMan::slotSetFolderPaused( const QString& alias, bool paused )
if( f ) {
slotScheduleSync(alias);
// FIXME: Use MirallConfigFile
// FIXME: Use ConfigFile
QSettings settings(f->configFile(), QSettings::IniFormat);
settings.beginGroup(escapeAlias(f->alias()));
if (!paused) {

View file

@ -70,7 +70,7 @@ GeneralSettings::~GeneralSettings()
void GeneralSettings::loadMiscSettings()
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
_ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons());
_ui->desktopNotificationsCheckBox->setChecked(cfgFile.optionalDesktopNotifications());
}
@ -92,7 +92,7 @@ void GeneralSettings::slotUpdateInfo()
void GeneralSettings::saveMiscSettings()
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
bool isChecked = _ui->monoIconsCheckBox->isChecked();
cfgFile.setMonoIcons(isChecked);
Theme::instance()->setSystrayUseMonoIcons(isChecked);
@ -106,7 +106,7 @@ void GeneralSettings::slotToggleLaunchOnStartup(bool enable)
void GeneralSettings::slotToggleOptionalDesktopNotifications(bool enable)
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
cfgFile.setOptionalDesktopNotifications(enable);
}

View file

@ -36,9 +36,9 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) :
"Checked items will also be deleted if they prevent a directory from "
"being removed. This is useful for meta data."));
MirallConfigFile cfgFile;
readIgnoreFile(cfgFile.excludeFile(MirallConfigFile::SystemScope), true);
readIgnoreFile(cfgFile.excludeFile(MirallConfigFile::UserScope), false);
ConfigFile cfgFile;
readIgnoreFile(cfgFile.excludeFile(ConfigFile::SystemScope), true);
readIgnoreFile(cfgFile.excludeFile(ConfigFile::UserScope), false);
connect(this, SIGNAL(accepted()), SLOT(slotUpdateLocalIgnoreList()));
ui->removePushButton->setEnabled(false);
@ -79,8 +79,8 @@ void IgnoreListEditor::slotRemoveCurrentItem()
void IgnoreListEditor::slotUpdateLocalIgnoreList()
{
MirallConfigFile cfgFile;
QString ignoreFile = cfgFile.excludeFile(MirallConfigFile::UserScope);
ConfigFile cfgFile;
QString ignoreFile = cfgFile.excludeFile(ConfigFile::UserScope);
QFile ignores(ignoreFile);
if (ignores.open(QIODevice::WriteOnly)) {
for(int i = 0; i < ui->listWidget->count(); ++i) {
@ -136,10 +136,10 @@ void IgnoreListEditor::slotEditPattern(QListWidgetItem *item)
void IgnoreListEditor::readIgnoreFile(const QString &file, bool readOnly)
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
const QString disabledTip(tr("This entry is provided by the system at '%1' "
"and cannot be modified in this view.")
.arg(QDir::toNativeSeparators(cfgFile.excludeFile(MirallConfigFile::SystemScope))));
.arg(QDir::toNativeSeparators(cfgFile.excludeFile(ConfigFile::SystemScope))));
QFile ignores(file);
if (ignores.open(QIODevice::ReadOnly)) {

View file

@ -118,7 +118,7 @@ LogBrowser::LogBrowser(QWidget *parent) :
connect(showLogWindow, SIGNAL(triggered()), SLOT(close()));
addAction(showLogWindow);
MirallConfigFile cfg;
ConfigFile cfg;
cfg.restoreGeometry(this);
int lines = cfg.maxLogLines();
// qDebug() << "# ## Have " << lines << " Loglines!";
@ -132,7 +132,7 @@ LogBrowser::~LogBrowser()
void LogBrowser::closeEvent(QCloseEvent *)
{
MirallConfigFile cfg;
ConfigFile cfg;
cfg.saveGeometry(this);
}

View file

@ -75,7 +75,7 @@ NetworkSettings::~NetworkSettings()
void NetworkSettings::loadProxySettings()
{
// load current proxy settings
Mirall::MirallConfigFile cfgFile;
Mirall::ConfigFile cfgFile;
int type = cfgFile.proxyType();
switch (type) {
case QNetworkProxy::NoProxy:
@ -108,7 +108,7 @@ void NetworkSettings::loadProxySettings()
void NetworkSettings::loadBWLimitSettings()
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
_ui->downloadLimitRadioButton->setChecked(cfgFile.useDownloadLimit());
int uploadLimit = cfgFile.useUploadLimit();
if ( uploadLimit >= 1 ) {
@ -124,7 +124,7 @@ void NetworkSettings::loadBWLimitSettings()
void NetworkSettings::saveProxySettings()
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
if (_ui->noProxyRadioButton->isChecked()){
cfgFile.setProxyType(QNetworkProxy::NoProxy);
@ -150,7 +150,7 @@ void NetworkSettings::saveProxySettings()
void NetworkSettings::saveBWLimitSettings()
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
cfgFile.setUseDownloadLimit(_ui->downloadLimitRadioButton->isChecked());
if (_ui->uploadLimitRadioButton->isChecked()) {

View file

@ -129,7 +129,7 @@ void ownCloudGui::setupOverlayIcons()
#endif
}
// This should rather be in application.... or rather in MirallConfigFile?
// This should rather be in application.... or rather in ConfigFile?
void ownCloudGui::slotOpenSettingsDialog( bool openSettings )
{
// if account is set up, start the configuration wizard.
@ -377,7 +377,7 @@ void ownCloudGui::slotShowTrayMessage(const QString &title, const QString &msg)
void ownCloudGui::slotShowOptionalTrayMessage(const QString &title, const QString &msg)
{
MirallConfigFile cfg;
ConfigFile cfg;
if (cfg.optionalDesktopNotifications()) {
slotShowTrayMessage(title, msg);
}

View file

@ -74,13 +74,13 @@ ProtocolWidget::ProtocolWidget(QWidget *parent) :
_copyBtn->setEnabled(false);
connect(_copyBtn, SIGNAL(clicked()), SLOT(copyToClipboard()));
MirallConfigFile cfg;
ConfigFile cfg;
cfg.restoreGeometryHeader(_ui->_treeWidget->header());
}
ProtocolWidget::~ProtocolWidget()
{
MirallConfigFile cfg;
ConfigFile cfg;
cfg.saveGeometryHeader(_ui->_treeWidget->header() );
delete _ui;

View file

@ -291,7 +291,7 @@ void SelectiveSyncDialog::accept()
QStringList blackList = _treeView->createBlackList();
_folder->setSelectiveSyncBlackList(blackList);
// FIXME: Use MirallConfigFile
// FIXME: Use ConfigFile
QSettings settings(_folder->configFile(), QSettings::IniFormat);
settings.beginGroup(FolderMan::escapeAlias(_folder->alias()));
settings.setValue("blackList", blackList);

View file

@ -119,7 +119,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) :
effectiveWidth = qMin(effectiveWidth, maxWidth);
listWidget->setFixedWidth(effectiveWidth);
MirallConfigFile cfg;
ConfigFile cfg;
cfg.restoreGeometry(this);
}
@ -146,13 +146,13 @@ void SettingsDialog::setGeneralErrors(const QStringList &errors)
// close event is not being called here
void SettingsDialog::reject() {
MirallConfigFile cfg;
ConfigFile cfg;
cfg.saveGeometry(this);
QDialog::reject();
}
void SettingsDialog::accept() {
MirallConfigFile cfg;
ConfigFile cfg;
cfg.saveGeometry(this);
QDialog::accept();
}

View file

@ -90,7 +90,7 @@ SettingsDialogMac::SettingsDialogMac(ownCloudGui *gui, QWidget *parent)
connect(showLogWindow, SIGNAL(triggered()), gui, SLOT(slotToggleLogBrowser()));
addAction(showLogWindow);
MirallConfigFile cfg;
ConfigFile cfg;
cfg.restoreGeometry(this);
}
@ -116,7 +116,7 @@ void SettingsDialogMac::setGeneralErrors(const QStringList &errors)
void SettingsDialogMac::closeEvent(QCloseEvent *event)
{
MirallConfigFile cfg;
ConfigFile cfg;
cfg.saveGeometry(this);
MacPreferencesWindow::closeEvent(event);
}

View file

@ -140,14 +140,14 @@ void SocketApi::slotClearExcludesList()
void SocketApi::slotReadExcludes()
{
MirallConfigFile cfgFile;
ConfigFile cfgFile;
slotClearExcludesList();
QString excludeList = cfgFile.excludeFile( MirallConfigFile::SystemScope );
QString excludeList = cfgFile.excludeFile( ConfigFile::SystemScope );
if( !excludeList.isEmpty() ) {
qDebug() << "==== added system ignore list to socketapi:" << excludeList.toUtf8();
csync_exclude_load(excludeList.toUtf8(), &_excludes);
}
excludeList = cfgFile.excludeFile( MirallConfigFile::UserScope );
excludeList = cfgFile.excludeFile( ConfigFile::UserScope );
if( !excludeList.isEmpty() ) {
qDebug() << "==== added user defined ignore list to csync:" << excludeList.toUtf8();
csync_exclude_load(excludeList.toUtf8(), &_excludes);

View file

@ -41,14 +41,14 @@ OCUpdater::OCUpdater(const QUrl &url, QObject *parent) :
QObject(parent)
, _updateUrl(url)
, _state(Unknown)
, _accessManager(new MirallAccessManager(this))
, _accessManager(new AccessManager(this))
, _timer(new QTimer(this))
{
}
bool OCUpdater::performUpdate()
{
MirallConfigFile cfg;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
QString updateFile = settings.value(updateAvailableC).toString();
if (!updateFile.isEmpty() && QFile(updateFile).exists()) {
@ -107,7 +107,7 @@ void OCUpdater::setDownloadState(DownloadState state)
void OCUpdater::slotStartInstaller()
{
MirallConfigFile cfg;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
QString updateFile = settings.value(updateAvailableC).toString();
settings.setValue(autoUpdateAttemptedC, true);
@ -133,7 +133,7 @@ void OCUpdater::slotOpenUpdateUrl()
bool OCUpdater::updateSucceeded() const
{
MirallConfigFile cfg;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
qint64 targetVersionInt = Helper::stringVersionToInt(settings.value(updateTargetVersionC).toString());
@ -195,7 +195,7 @@ void NSISUpdater::slotDownloadFinished()
QFile::copy(_file->fileName(), _targetFile);
setDownloadState(DownloadComplete);
qDebug() << "Downloaded" << url.toString() << "to" << _targetFile;
MirallConfigFile cfg;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
settings.setValue(updateTargetVersionC, updateInfo().version());
settings.setValue(updateAvailableC, _targetFile);
@ -203,7 +203,7 @@ void NSISUpdater::slotDownloadFinished()
void NSISUpdater::versionInfoArrived(const UpdateInfo &info)
{
MirallConfigFile cfg;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
qint64 infoVersion = Helper::stringVersionToInt(info.version());
qint64 seenVersion = Helper::stringVersionToInt(settings.value(seenVersionC).toString());
@ -290,7 +290,7 @@ void NSISUpdater::showDialog(const UpdateInfo &info)
NSISUpdater::UpdateState NSISUpdater::updateStateOnStart()
{
MirallConfigFile cfg;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
QString updateFileName = settings.value(updateAvailableC).toString();
// has the previous run downloaded an update?
@ -339,7 +339,7 @@ bool NSISUpdater::handleStartup()
void NSISUpdater::slotSetSeenVersion()
{
MirallConfigFile cfg;
ConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
settings.setValue(seenVersionC, updateInfo().version());
}

View file

@ -25,7 +25,7 @@
namespace Mirall
{
MirallAccessManager::MirallAccessManager(QObject* parent)
AccessManager::AccessManager(QObject* parent)
: QNetworkAccessManager (parent)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && defined(Q_OS_MAC)
@ -42,7 +42,7 @@ MirallAccessManager::MirallAccessManager(QObject* parent)
}
QNetworkReply* MirallAccessManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
QNetworkReply* AccessManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
{
QNetworkRequest newRequest(request);
newRequest.setRawHeader(QByteArray("User-Agent"), Utility::userAgentString());
@ -55,7 +55,7 @@ QNetworkReply* MirallAccessManager::createRequest(QNetworkAccessManager::Operati
return QNetworkAccessManager::createRequest(op, newRequest, outgoingData);
}
void MirallAccessManager::slotProxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator)
void AccessManager::slotProxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator)
{
Q_UNUSED(authenticator);
qDebug() << Q_FUNC_INFO << proxy.type();
@ -65,7 +65,7 @@ void MirallAccessManager::slotProxyAuthenticationRequired(const QNetworkProxy &p
authenticator->setPassword(proxy.password());
}
}
void MirallAccessManager::slotAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator)
void AccessManager::slotAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator)
{
// do not handle 401 created by the networkjobs. We may want
// to eventually exempt some, but for now we need

View file

@ -20,12 +20,12 @@
namespace Mirall
{
class OWNCLOUDSYNC_EXPORT MirallAccessManager : public QNetworkAccessManager
class OWNCLOUDSYNC_EXPORT AccessManager : public QNetworkAccessManager
{
Q_OBJECT
public:
MirallAccessManager(QObject* parent = 0);
AccessManager(QObject* parent = 0);
protected:
QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest& request, QIODevice* outgoingData = 0) Q_DECL_OVERRIDE;

View file

@ -336,7 +336,7 @@ QSettings *Account::settingsWithGroup(const QString& group, QObject *parent)
{
if (_configFileName.isEmpty()) {
// cache file name
MirallConfigFile cfg;
ConfigFile cfg;
_configFileName = cfg.configFile();
}
QSettings *settings = new QSettings(_configFileName, QSettings::IniFormat, parent);

View file

@ -34,7 +34,7 @@ namespace Mirall {
class AbstractCredentials;
class Account;
class QuotaInfo;
class MirallAccessManager;
class AccessManager;
class OWNCLOUDSYNC_EXPORT AccountManager : public QObject {
Q_OBJECT

View file

@ -23,7 +23,7 @@ ClientProxy::ClientProxy(QObject *parent) :
{
}
QNetworkProxy ClientProxy::proxyFromConfig(const MirallConfigFile& cfg)
QNetworkProxy ClientProxy::proxyFromConfig(const ConfigFile& cfg)
{
QNetworkProxy proxy;
@ -41,7 +41,7 @@ QNetworkProxy ClientProxy::proxyFromConfig(const MirallConfigFile& cfg)
void ClientProxy::setupQtProxyFromConfig()
{
Mirall::MirallConfigFile cfg;
Mirall::ConfigFile cfg;
int proxyType = QNetworkProxy::DefaultProxy;
QNetworkProxy proxy;

View file

@ -22,7 +22,7 @@
namespace Mirall {
class MirallConfigFile;
class ConfigFile;
class OWNCLOUDSYNC_EXPORT ClientProxy : public QObject
{
@ -37,7 +37,7 @@ public slots:
void setupQtProxyFromConfig();
private:
QNetworkProxy proxyFromConfig(const MirallConfigFile& cfg);
QNetworkProxy proxyFromConfig(const ConfigFile& cfg);
const char* proxyTypeToCStr(QNetworkProxy::ProxyType type);
};

View file

@ -63,10 +63,10 @@ static const char downloadLimitC[] = "BWLimit/downloadLimit";
static const char maxLogLinesC[] = "Logging/maxLogLines";
QString MirallConfigFile::_confDir = QString::null;
bool MirallConfigFile::_askedUser = false;
QString ConfigFile::_confDir = QString::null;
bool ConfigFile::_askedUser = false;
MirallConfigFile::MirallConfigFile()
ConfigFile::ConfigFile()
{
// QDesktopServices uses the application name to create a config path
qApp->setApplicationName( Theme::instance()->appNameGUI() );
@ -82,7 +82,7 @@ MirallConfigFile::MirallConfigFile()
// qDebug() << Q_FUNC_INFO << "Loading config: " << config << " (URL is " << settings.value("url").toString() << ")";
}
void MirallConfigFile::setConfDir(const QString &value)
void ConfigFile::setConfDir(const QString &value)
{
QString dirPath = value;
if( dirPath.isEmpty() ) return;
@ -101,26 +101,26 @@ void MirallConfigFile::setConfDir(const QString &value)
}
}
bool MirallConfigFile::optionalDesktopNotifications() const
bool ConfigFile::optionalDesktopNotifications() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(optionalDesktopNoficationsC), true).toBool();
}
int MirallConfigFile::timeout() const
int ConfigFile::timeout() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(timeoutC), 300).toInt(); // default to 5 min
}
void MirallConfigFile::setOptionalDesktopNotifications(bool show)
void ConfigFile::setOptionalDesktopNotifications(bool show)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(optionalDesktopNoficationsC), show);
settings.sync();
}
void MirallConfigFile::saveGeometry(QWidget *w)
void ConfigFile::saveGeometry(QWidget *w)
{
#ifndef TOKEN_AUTH_ONLY
Q_ASSERT(!w->objectName().isNull());
@ -131,14 +131,14 @@ void MirallConfigFile::saveGeometry(QWidget *w)
#endif
}
void MirallConfigFile::restoreGeometry(QWidget *w)
void ConfigFile::restoreGeometry(QWidget *w)
{
#ifndef TOKEN_AUTH_ONLY
w->restoreGeometry(getValue(geometryC, w->objectName()).toByteArray());
#endif
}
void MirallConfigFile::saveGeometryHeader(QHeaderView *header)
void ConfigFile::saveGeometryHeader(QHeaderView *header)
{
#ifndef TOKEN_AUTH_ONLY
if(!header) return;
@ -151,7 +151,7 @@ void MirallConfigFile::saveGeometryHeader(QHeaderView *header)
#endif
}
void MirallConfigFile::restoreGeometryHeader(QHeaderView *header)
void ConfigFile::restoreGeometryHeader(QHeaderView *header)
{
#ifndef TOKEN_AUTH_ONLY
if(!header) return;
@ -163,7 +163,7 @@ void MirallConfigFile::restoreGeometryHeader(QHeaderView *header)
#endif
}
QVariant MirallConfigFile::getPolicySetting(const QString &setting, const QVariant& defaultValue) const
QVariant ConfigFile::getPolicySetting(const QString &setting, const QVariant& defaultValue) const
{
if (Utility::isWindows()) {
// check for policies first and return immediately if a value is found.
@ -184,7 +184,7 @@ QVariant MirallConfigFile::getPolicySetting(const QString &setting, const QVaria
return defaultValue;
}
QString MirallConfigFile::configPath() const
QString ConfigFile::configPath() const
{
#ifndef TOKEN_AUTH_ONLY
if( _confDir.isEmpty() ) {
@ -199,7 +199,7 @@ QString MirallConfigFile::configPath() const
return dir;
}
QString MirallConfigFile::configPathWithAppName() const
QString ConfigFile::configPathWithAppName() const
{
//HACK
return QFileInfo( configFile() ).dir().absolutePath().append("/");
@ -207,7 +207,7 @@ QString MirallConfigFile::configPathWithAppName() const
static const QLatin1String exclFile("sync-exclude.lst");
QString MirallConfigFile::excludeFile(Scope scope) const
QString ConfigFile::excludeFile(Scope scope) const
{
// prefer sync-exclude.lst, but if it does not exist, check for
// exclude.lst for compatibility reasons in the user writeable
@ -225,14 +225,14 @@ QString MirallConfigFile::excludeFile(Scope scope) const
}
return fi.absoluteFilePath();
} else if (scope != UserScope) {
return MirallConfigFile::excludeFileFromSystem();
return ConfigFile::excludeFileFromSystem();
} else {
Q_ASSERT(false);
return QString(); // unreachable
}
}
QString MirallConfigFile::excludeFileFromSystem()
QString ConfigFile::excludeFileFromSystem()
{
QFileInfo fi;
#ifdef Q_OS_WIN
@ -257,23 +257,23 @@ QString MirallConfigFile::excludeFileFromSystem()
return fi.absoluteFilePath();
}
QString MirallConfigFile::configFile() const
QString ConfigFile::configFile() const
{
return configPath() + Theme::instance()->configFileName();
}
bool MirallConfigFile::exists()
bool ConfigFile::exists()
{
QFile file( configFile() );
return file.exists();
}
QString MirallConfigFile::defaultConnection() const
QString ConfigFile::defaultConnection() const
{
return Theme::instance()->appName();
}
void MirallConfigFile::storeData(const QString& group, const QString& key, const QVariant& value)
void ConfigFile::storeData(const QString& group, const QString& key, const QVariant& value)
{
const QString con(group.isEmpty() ? defaultConnection() : group);
QSettings settings(configFile(), QSettings::IniFormat);
@ -283,7 +283,7 @@ void MirallConfigFile::storeData(const QString& group, const QString& key, const
settings.sync();
}
QVariant MirallConfigFile::retrieveData(const QString& group, const QString& key) const
QVariant ConfigFile::retrieveData(const QString& group, const QString& key) const
{
const QString con(group.isEmpty() ? defaultConnection() : group);
QSettings settings(configFile(), QSettings::IniFormat);
@ -292,7 +292,7 @@ QVariant MirallConfigFile::retrieveData(const QString& group, const QString& key
return settings.value(key);
}
void MirallConfigFile::removeData(const QString& group, const QString& key)
void ConfigFile::removeData(const QString& group, const QString& key)
{
const QString con(group.isEmpty() ? defaultConnection() : group);
QSettings settings(configFile(), QSettings::IniFormat);
@ -301,7 +301,7 @@ void MirallConfigFile::removeData(const QString& group, const QString& key)
settings.remove(key);
}
bool MirallConfigFile::dataExists(const QString& group, const QString& key) const
bool ConfigFile::dataExists(const QString& group, const QString& key) const
{
const QString con(group.isEmpty() ? defaultConnection() : group);
QSettings settings(configFile(), QSettings::IniFormat);
@ -310,13 +310,13 @@ bool MirallConfigFile::dataExists(const QString& group, const QString& key) cons
return settings.contains(key);
}
QByteArray MirallConfigFile::caCerts( )
QByteArray ConfigFile::caCerts( )
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value( QLatin1String(caCertsKeyC) ).toByteArray();
}
void MirallConfigFile::setCaCerts( const QByteArray & certs )
void ConfigFile::setCaCerts( const QByteArray & certs )
{
QSettings settings(configFile(), QSettings::IniFormat);
@ -324,7 +324,7 @@ void MirallConfigFile::setCaCerts( const QByteArray & certs )
settings.sync();
}
int MirallConfigFile::remotePollInterval( const QString& connection ) const
int ConfigFile::remotePollInterval( const QString& connection ) const
{
QString con( connection );
if( connection.isEmpty() ) con = defaultConnection();
@ -340,7 +340,7 @@ int MirallConfigFile::remotePollInterval( const QString& connection ) const
return remoteInterval;
}
void MirallConfigFile::setRemotePollInterval(int interval, const QString &connection )
void ConfigFile::setRemotePollInterval(int interval, const QString &connection )
{
QString con( connection );
if( connection.isEmpty() ) con = defaultConnection();
@ -355,7 +355,7 @@ void MirallConfigFile::setRemotePollInterval(int interval, const QString &connec
settings.sync();
}
quint64 MirallConfigFile::forceSyncInterval(const QString& connection) const
quint64 ConfigFile::forceSyncInterval(const QString& connection) const
{
uint pollInterval = remotePollInterval(connection);
@ -372,7 +372,7 @@ quint64 MirallConfigFile::forceSyncInterval(const QString& connection) const
return interval;
}
bool MirallConfigFile::skipUpdateCheck( const QString& connection ) const
bool ConfigFile::skipUpdateCheck( const QString& connection ) const
{
QString con( connection );
if( connection.isEmpty() ) con = defaultConnection();
@ -384,7 +384,7 @@ bool MirallConfigFile::skipUpdateCheck( const QString& connection ) const
return value.toBool();
}
void MirallConfigFile::setSkipUpdateCheck( bool skip, const QString& connection )
void ConfigFile::setSkipUpdateCheck( bool skip, const QString& connection )
{
QString con( connection );
if( connection.isEmpty() ) con = defaultConnection();
@ -397,20 +397,20 @@ void MirallConfigFile::setSkipUpdateCheck( bool skip, const QString& connection
}
int MirallConfigFile::maxLogLines() const
int ConfigFile::maxLogLines() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value( QLatin1String(maxLogLinesC), DEFAULT_MAX_LOG_LINES ).toInt();
}
void MirallConfigFile::setMaxLogLines( int lines )
void ConfigFile::setMaxLogLines( int lines )
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(maxLogLinesC), lines);
settings.sync();
}
void MirallConfigFile::setProxyType(int proxyType,
void ConfigFile::setProxyType(int proxyType,
const QString& host,
int port, bool needsAuth,
const QString& user,
@ -431,7 +431,7 @@ void MirallConfigFile::setProxyType(int proxyType,
settings.sync();
}
QVariant MirallConfigFile::getValue(const QString& param, const QString& group,
QVariant ConfigFile::getValue(const QString& param, const QString& group,
const QVariant& defaultValue) const
{
QVariant systemSetting;
@ -463,91 +463,91 @@ QVariant MirallConfigFile::getValue(const QString& param, const QString& group,
return settings.value(param, systemSetting);
}
void MirallConfigFile::setValue(const QString& key, const QVariant &value)
void ConfigFile::setValue(const QString& key, const QVariant &value)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(key, value);
}
int MirallConfigFile::proxyType() const
int ConfigFile::proxyType() const
{
return getValue(QLatin1String(proxyTypeC)).toInt();
}
QString MirallConfigFile::proxyHostName() const
QString ConfigFile::proxyHostName() const
{
return getValue(QLatin1String(proxyHostC)).toString();
}
int MirallConfigFile::proxyPort() const
int ConfigFile::proxyPort() const
{
return getValue(QLatin1String(proxyPortC)).toInt();
}
bool MirallConfigFile::proxyNeedsAuth() const
bool ConfigFile::proxyNeedsAuth() const
{
return getValue(QLatin1String(proxyNeedsAuthC)).toBool();
}
QString MirallConfigFile::proxyUser() const
QString ConfigFile::proxyUser() const
{
return getValue(QLatin1String(proxyUserC)).toString();
}
QString MirallConfigFile::proxyPassword() const
QString ConfigFile::proxyPassword() const
{
QByteArray pass = getValue(proxyPassC).toByteArray();
return QString::fromUtf8(QByteArray::fromBase64(pass));
}
int MirallConfigFile::useUploadLimit() const
int ConfigFile::useUploadLimit() const
{
return getValue(useUploadLimitC, QString::null, 0).toInt();
}
bool MirallConfigFile::useDownloadLimit() const
bool ConfigFile::useDownloadLimit() const
{
return getValue(useDownloadLimitC, QString::null, false).toBool();
}
void MirallConfigFile::setUseUploadLimit(int val)
void ConfigFile::setUseUploadLimit(int val)
{
setValue(useUploadLimitC, val);
}
void MirallConfigFile::setUseDownloadLimit(bool enable)
void ConfigFile::setUseDownloadLimit(bool enable)
{
setValue(useDownloadLimitC, enable);
}
int MirallConfigFile::uploadLimit() const
int ConfigFile::uploadLimit() const
{
return getValue(uploadLimitC, QString::null, 10).toInt();
}
int MirallConfigFile::downloadLimit() const
int ConfigFile::downloadLimit() const
{
return getValue(downloadLimitC, QString::null, 80).toInt();
}
void MirallConfigFile::setUploadLimit(int kbytes)
void ConfigFile::setUploadLimit(int kbytes)
{
setValue(uploadLimitC, kbytes);
}
void MirallConfigFile::setDownloadLimit(int kbytes)
void ConfigFile::setDownloadLimit(int kbytes)
{
setValue(downloadLimitC, kbytes);
}
bool MirallConfigFile::monoIcons() const
bool ConfigFile::monoIcons() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(monoIconsC), false).toBool();
}
void MirallConfigFile::setMonoIcons(bool useMonoIcons)
void ConfigFile::setMonoIcons(bool useMonoIcons)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(monoIconsC), useMonoIcons);

View file

@ -27,10 +27,10 @@ namespace Mirall {
class AbstractCredentials;
class OWNCLOUDSYNC_EXPORT MirallConfigFile
class OWNCLOUDSYNC_EXPORT ConfigFile
{
public:
MirallConfigFile();
ConfigFile();
enum Scope { UserScope, SystemScope };

View file

@ -148,7 +148,7 @@ QList<QNetworkCookie> CookieJar::removeExpired(const QList<QNetworkCookie> &cook
QString CookieJar::storagePath() const
{
MirallConfigFile cfg;
ConfigFile cfg;
return cfg.configPath() + "/cookies.db";
}

View file

@ -42,7 +42,7 @@ QString DummyCredentials::user() const
QNetworkAccessManager* DummyCredentials::getQNAM() const
{
return new MirallAccessManager;
return new AccessManager;
}
bool DummyCredentials::ready() const

View file

@ -19,7 +19,7 @@
namespace Mirall
{
class HttpConfigFile : public MirallConfigFile
class HttpConfigFile : public ConfigFile
{
public:
QString user() const;

View file

@ -81,17 +81,17 @@ const char userC[] = "user";
const char authenticationFailedC[] = "owncloud-authentication-failed";
} // ns
class HttpCredentialsAccessManager : public MirallAccessManager {
class HttpCredentialsAccessManager : public AccessManager {
public:
HttpCredentialsAccessManager(const HttpCredentials *cred, QObject* parent = 0)
: MirallAccessManager(parent), _cred(cred) {}
: AccessManager(parent), _cred(cred) {}
protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) Q_DECL_OVERRIDE {
QByteArray credHash = QByteArray(_cred->user().toUtf8()+":"+_cred->password().toUtf8()).toBase64();
QNetworkRequest req(request);
req.setRawHeader(QByteArray("Authorization"), QByteArray("Basic ") + credHash);
//qDebug() << "Request for " << req.url() << "with authorization" << QByteArray::fromBase64(credHash);
return MirallAccessManager::createRequest(op, req, outgoingData);
return AccessManager::createRequest(op, req, outgoingData);
}
private:
const HttpCredentials *_cred;
@ -172,7 +172,7 @@ QString HttpCredentials::password() const
QNetworkAccessManager* HttpCredentials::getQNAM() const
{
MirallAccessManager* qnam = new HttpCredentialsAccessManager(this);
AccessManager* qnam = new HttpCredentialsAccessManager(this);
connect( qnam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
this, SLOT(slotAuthentication(QNetworkReply*,QAuthenticator*)));

View file

@ -169,7 +169,7 @@ QString ShibbolethCredentials::user() const
QNetworkAccessManager* ShibbolethCredentials::getQNAM() const
{
QNetworkAccessManager* qnam(new MirallAccessManager);
QNetworkAccessManager* qnam(new AccessManager);
connect(qnam, SIGNAL(finished(QNetworkReply*)),
this, SLOT(slotReplyFinished(QNetworkReply*)));
return qnam;

View file

@ -72,11 +72,11 @@ const char authenticationFailedC[] = "owncloud-authentication-failed";
} // ns
class TokenCredentialsAccessManager : public MirallAccessManager {
class TokenCredentialsAccessManager : public AccessManager {
public:
friend class TokenCredentials;
TokenCredentialsAccessManager(const TokenCredentials *cred, QObject* parent = 0)
: MirallAccessManager(parent), _cred(cred) {}
: AccessManager(parent), _cred(cred) {}
protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) {
if (_cred->user().isEmpty() || _cred->password().isEmpty() || _cred->_token.isEmpty()) {
@ -90,7 +90,7 @@ protected:
req.setRawHeader("Cookie", _cred->_token.toUtf8()); // analogous to neon in syncContextPreStart
return MirallAccessManager::createRequest(op, req, outgoingData);
return AccessManager::createRequest(op, req, outgoingData);
}
private:
const TokenCredentials *_cred;
@ -149,7 +149,7 @@ QString TokenCredentials::password() const
QNetworkAccessManager* TokenCredentials::getQNAM() const
{
MirallAccessManager* qnam = new TokenCredentialsAccessManager(this);
AccessManager* qnam = new TokenCredentialsAccessManager(this);
connect( qnam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
this, SLOT(slotAuthentication(QNetworkReply*,QAuthenticator*)));

View file

@ -344,7 +344,7 @@ int OwncloudPropagator::httpTimeout()
if (!timeout) {
timeout = qgetenv("OWNCLOUD_TIMEOUT").toUInt();
if (timeout == 0) {
MirallConfigFile cfg;
ConfigFile cfg;
timeout = cfg.timeout();
}