Skip to content

Commit 2e17759

Browse files
committed
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
1 parent 7f0735a commit 2e17759

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/libsync/connectionvalidator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <QNetworkProxyFactory>
1717

1818
#include "connectionvalidator.h"
19-
#include "theme.h"
2019
#include "account.h"
2120
#include "networkjobs.h"
2221
#include "clientproxy.h"

src/libsync/syncengine.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include "syncengine.h"
1717
#include "account.h"
18-
#include "theme.h"
1918
#include "owncloudpropagator.h"
2019
#include "syncjournaldb.h"
2120
#include "syncjournalfilerecord.h"
@@ -33,6 +32,7 @@
3332
#include <climits>
3433
#include <assert.h>
3534

35+
#include <QCoreApplication>
3636
#include <QDebug>
3737
#include <QSslSocket>
3838
#include <QDir>
@@ -104,7 +104,7 @@ QString SyncEngine::csyncErrorToString(CSYNC_STATUS err)
104104
errStr = tr("CSync failed to load the journal file. The journal file is corrupted.");
105105
break;
106106
case CSYNC_STATUS_NO_MODULE:
107-
errStr = tr("<p>The %1 plugin for csync could not be loaded.<br/>Please verify the installation!</p>").arg(Theme::instance()->appNameGUI());
107+
errStr = tr("<p>The %1 plugin for csync could not be loaded.<br/>Please verify the installation!</p>").arg(qApp->applicationName());
108108
break;
109109
case CSYNC_STATUS_TREE_ERROR:
110110
errStr = tr("CSync got an error while processing internal trees.");
@@ -128,7 +128,7 @@ QString SyncEngine::csyncErrorToString(CSYNC_STATUS err)
128128
errStr = tr("CSync failed to lookup proxy or server.");
129129
break;
130130
case CSYNC_STATUS_SERVER_AUTH_ERROR:
131-
errStr = tr("CSync failed to authenticate at the %1 server.").arg(Theme::instance()->appNameGUI());
131+
errStr = tr("CSync failed to authenticate at the %1 server.").arg(qApp->applicationName());
132132
break;
133133
case CSYNC_STATUS_CONNECT_ERROR:
134134
errStr = tr("CSync failed to connect to the network.");
@@ -149,7 +149,7 @@ QString SyncEngine::csyncErrorToString(CSYNC_STATUS err)
149149
errStr = tr("CSync tried to create a directory that already exists.");
150150
break;
151151
case CSYNC_STATUS_OUT_OF_SPACE:
152-
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
152+
errStr = tr("CSync: No space on %1 server available.").arg(qApp->applicationName());
153153
break;
154154
case CSYNC_STATUS_UNSUCCESSFUL:
155155
errStr = tr("CSync unspecified error.");

src/libsync/utility.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "utility.h"
1616

1717
#include "version.h"
18-
#include "theme.h"
18+
#include "config.h"
1919

2020
// Note: This file must compile without QtGui
2121
#include <QCoreApplication>
@@ -130,7 +130,7 @@ QString Utility::octetsToString( qint64 octets )
130130
}
131131

132132
// Qtified version of get_platforms() in csync_owncloud.c
133-
QString Utility::platform()
133+
static QLatin1String platform()
134134
{
135135
#if defined(Q_OS_WIN)
136136
return QLatin1String("Windows");
@@ -156,10 +156,10 @@ QString Utility::platform()
156156
QByteArray Utility::userAgentString()
157157
{
158158
QString re = QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
159-
.arg(Utility::platform())
159+
.arg(platform())
160160
.arg(QLatin1String(MIRALL_STRINGIFY(MIRALL_VERSION)));
161161

162-
const QString appName = Theme::instance()->appName();
162+
QLatin1String appName(APPLICATION_SHORTNAME);
163163

164164
// this constant "ownCloud" is defined in the default OEM theming
165165
// that is used for the standard client. If it is changed there,

src/libsync/utility.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ namespace Utility
3232
OWNCLOUDSYNC_EXPORT void setupFavLink( const QString &folder );
3333
OWNCLOUDSYNC_EXPORT bool writeRandomFile( const QString& fname, int size = -1);
3434
OWNCLOUDSYNC_EXPORT QString octetsToString( qint64 octets );
35-
OWNCLOUDSYNC_EXPORT QString platform();
3635
OWNCLOUDSYNC_EXPORT QByteArray userAgentString();
3736
OWNCLOUDSYNC_EXPORT bool hasLaunchOnStartup(const QString &appName);
3837
OWNCLOUDSYNC_EXPORT void setLaunchOnStartup(const QString &appName, const QString& guiName, bool launch);

0 commit comments

Comments
 (0)