mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-28 07:54:49 +03:00
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:
parent
7f0735a955
commit
2e177590a6
4 changed files with 8 additions and 10 deletions
|
@ -16,7 +16,6 @@
|
||||||
#include <QNetworkProxyFactory>
|
#include <QNetworkProxyFactory>
|
||||||
|
|
||||||
#include "connectionvalidator.h"
|
#include "connectionvalidator.h"
|
||||||
#include "theme.h"
|
|
||||||
#include "account.h"
|
#include "account.h"
|
||||||
#include "networkjobs.h"
|
#include "networkjobs.h"
|
||||||
#include "clientproxy.h"
|
#include "clientproxy.h"
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
#include "syncengine.h"
|
#include "syncengine.h"
|
||||||
#include "account.h"
|
#include "account.h"
|
||||||
#include "theme.h"
|
|
||||||
#include "owncloudpropagator.h"
|
#include "owncloudpropagator.h"
|
||||||
#include "syncjournaldb.h"
|
#include "syncjournaldb.h"
|
||||||
#include "syncjournalfilerecord.h"
|
#include "syncjournalfilerecord.h"
|
||||||
|
@ -33,6 +32,7 @@
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
#include <QDir>
|
#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.");
|
errStr = tr("CSync failed to load the journal file. The journal file is corrupted.");
|
||||||
break;
|
break;
|
||||||
case CSYNC_STATUS_NO_MODULE:
|
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;
|
break;
|
||||||
case CSYNC_STATUS_TREE_ERROR:
|
case CSYNC_STATUS_TREE_ERROR:
|
||||||
errStr = tr("CSync got an error while processing internal trees.");
|
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.");
|
errStr = tr("CSync failed to lookup proxy or server.");
|
||||||
break;
|
break;
|
||||||
case CSYNC_STATUS_SERVER_AUTH_ERROR:
|
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;
|
break;
|
||||||
case CSYNC_STATUS_CONNECT_ERROR:
|
case CSYNC_STATUS_CONNECT_ERROR:
|
||||||
errStr = tr("CSync failed to connect to the network.");
|
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.");
|
errStr = tr("CSync tried to create a directory that already exists.");
|
||||||
break;
|
break;
|
||||||
case CSYNC_STATUS_OUT_OF_SPACE:
|
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;
|
break;
|
||||||
case CSYNC_STATUS_UNSUCCESSFUL:
|
case CSYNC_STATUS_UNSUCCESSFUL:
|
||||||
errStr = tr("CSync unspecified error.");
|
errStr = tr("CSync unspecified error.");
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "theme.h"
|
#include "config.h"
|
||||||
|
|
||||||
// Note: This file must compile without QtGui
|
// Note: This file must compile without QtGui
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
@ -130,7 +130,7 @@ QString Utility::octetsToString( qint64 octets )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Qtified version of get_platforms() in csync_owncloud.c
|
// Qtified version of get_platforms() in csync_owncloud.c
|
||||||
QString Utility::platform()
|
static QLatin1String platform()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
return QLatin1String("Windows");
|
return QLatin1String("Windows");
|
||||||
|
@ -156,10 +156,10 @@ QString Utility::platform()
|
||||||
QByteArray Utility::userAgentString()
|
QByteArray Utility::userAgentString()
|
||||||
{
|
{
|
||||||
QString re = QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
|
QString re = QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
|
||||||
.arg(Utility::platform())
|
.arg(platform())
|
||||||
.arg(QLatin1String(MIRALL_STRINGIFY(MIRALL_VERSION)));
|
.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
|
// this constant "ownCloud" is defined in the default OEM theming
|
||||||
// that is used for the standard client. If it is changed there,
|
// that is used for the standard client. If it is changed there,
|
||||||
|
|
|
@ -32,7 +32,6 @@ namespace Utility
|
||||||
OWNCLOUDSYNC_EXPORT void setupFavLink( const QString &folder );
|
OWNCLOUDSYNC_EXPORT void setupFavLink( const QString &folder );
|
||||||
OWNCLOUDSYNC_EXPORT bool writeRandomFile( const QString& fname, int size = -1);
|
OWNCLOUDSYNC_EXPORT bool writeRandomFile( const QString& fname, int size = -1);
|
||||||
OWNCLOUDSYNC_EXPORT QString octetsToString( qint64 octets );
|
OWNCLOUDSYNC_EXPORT QString octetsToString( qint64 octets );
|
||||||
OWNCLOUDSYNC_EXPORT QString platform();
|
|
||||||
OWNCLOUDSYNC_EXPORT QByteArray userAgentString();
|
OWNCLOUDSYNC_EXPORT QByteArray userAgentString();
|
||||||
OWNCLOUDSYNC_EXPORT bool hasLaunchOnStartup(const QString &appName);
|
OWNCLOUDSYNC_EXPORT bool hasLaunchOnStartup(const QString &appName);
|
||||||
OWNCLOUDSYNC_EXPORT void setLaunchOnStartup(const QString &appName, const QString& guiName, bool launch);
|
OWNCLOUDSYNC_EXPORT void setLaunchOnStartup(const QString &appName, const QString& guiName, bool launch);
|
||||||
|
|
Loading…
Reference in a new issue