libsync: Remove some Theme dependency

Theme will eventually be moved to the GUI

Theme::appNameGUI and QApplicaiton::applicationName are the same, it is currently
set in the constructor of ConfigFile
This commit is contained in:
Olivier Goffart 2015-06-15 17:38:12 +02:00
parent 7f0735a955
commit 2e177590a6
4 changed files with 8 additions and 10 deletions

View file

@ -16,7 +16,6 @@
#include <QNetworkProxyFactory>
#include "connectionvalidator.h"
#include "theme.h"
#include "account.h"
#include "networkjobs.h"
#include "clientproxy.h"

View file

@ -15,7 +15,6 @@
#include "syncengine.h"
#include "account.h"
#include "theme.h"
#include "owncloudpropagator.h"
#include "syncjournaldb.h"
#include "syncjournalfilerecord.h"
@ -33,6 +32,7 @@
#include <climits>
#include <assert.h>
#include <QCoreApplication>
#include <QDebug>
#include <QSslSocket>
#include <QDir>
@ -104,7 +104,7 @@ QString SyncEngine::csyncErrorToString(CSYNC_STATUS err)
errStr = tr("CSync failed to load the journal file. The journal file is corrupted.");
break;
case CSYNC_STATUS_NO_MODULE:
errStr = tr("<p>The %1 plugin for csync could not be loaded.<br/>Please verify the installation!</p>").arg(Theme::instance()->appNameGUI());
errStr = tr("<p>The %1 plugin for csync could not be loaded.<br/>Please verify the installation!</p>").arg(qApp->applicationName());
break;
case CSYNC_STATUS_TREE_ERROR:
errStr = tr("CSync got an error while processing internal trees.");
@ -128,7 +128,7 @@ QString SyncEngine::csyncErrorToString(CSYNC_STATUS err)
errStr = tr("CSync failed to lookup proxy or server.");
break;
case CSYNC_STATUS_SERVER_AUTH_ERROR:
errStr = tr("CSync failed to authenticate at the %1 server.").arg(Theme::instance()->appNameGUI());
errStr = tr("CSync failed to authenticate at the %1 server.").arg(qApp->applicationName());
break;
case CSYNC_STATUS_CONNECT_ERROR:
errStr = tr("CSync failed to connect to the network.");
@ -149,7 +149,7 @@ QString SyncEngine::csyncErrorToString(CSYNC_STATUS err)
errStr = tr("CSync tried to create a directory that already exists.");
break;
case CSYNC_STATUS_OUT_OF_SPACE:
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
errStr = tr("CSync: No space on %1 server available.").arg(qApp->applicationName());
break;
case CSYNC_STATUS_UNSUCCESSFUL:
errStr = tr("CSync unspecified error.");

View file

@ -15,7 +15,7 @@
#include "utility.h"
#include "version.h"
#include "theme.h"
#include "config.h"
// Note: This file must compile without QtGui
#include <QCoreApplication>
@ -130,7 +130,7 @@ QString Utility::octetsToString( qint64 octets )
}
// Qtified version of get_platforms() in csync_owncloud.c
QString Utility::platform()
static QLatin1String platform()
{
#if defined(Q_OS_WIN)
return QLatin1String("Windows");
@ -156,10 +156,10 @@ QString Utility::platform()
QByteArray Utility::userAgentString()
{
QString re = QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
.arg(Utility::platform())
.arg(platform())
.arg(QLatin1String(MIRALL_STRINGIFY(MIRALL_VERSION)));
const QString appName = Theme::instance()->appName();
QLatin1String appName(APPLICATION_SHORTNAME);
// this constant "ownCloud" is defined in the default OEM theming
// that is used for the standard client. If it is changed there,

View file

@ -32,7 +32,6 @@ namespace Utility
OWNCLOUDSYNC_EXPORT void setupFavLink( const QString &folder );
OWNCLOUDSYNC_EXPORT bool writeRandomFile( const QString& fname, int size = -1);
OWNCLOUDSYNC_EXPORT QString octetsToString( qint64 octets );
OWNCLOUDSYNC_EXPORT QString platform();
OWNCLOUDSYNC_EXPORT QByteArray userAgentString();
OWNCLOUDSYNC_EXPORT bool hasLaunchOnStartup(const QString &appName);
OWNCLOUDSYNC_EXPORT void setLaunchOnStartup(const QString &appName, const QString& guiName, bool launch);