[Pkg-owncloud-commits] [owncloud-client] 162/498: libsync: Remove some Theme dependency

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 2e177590a68412f5cfa2ad92677f0f74f6e0e23e
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Jun 15 17:38:12 2015 +0200

    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
---
 src/libsync/connectionvalidator.cpp | 1 -
 src/libsync/syncengine.cpp          | 8 ++++----
 src/libsync/utility.cpp             | 8 ++++----
 src/libsync/utility.h               | 1 -
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/libsync/connectionvalidator.cpp b/src/libsync/connectionvalidator.cpp
index 1c8036f..80be8f8 100644
--- a/src/libsync/connectionvalidator.cpp
+++ b/src/libsync/connectionvalidator.cpp
@@ -16,7 +16,6 @@
 #include <QNetworkProxyFactory>
 
 #include "connectionvalidator.h"
-#include "theme.h"
 #include "account.h"
 #include "networkjobs.h"
 #include "clientproxy.h"
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index e37e10d..1f22580 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -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.");
diff --git a/src/libsync/utility.cpp b/src/libsync/utility.cpp
index 42da7d6..a9cb284 100644
--- a/src/libsync/utility.cpp
+++ b/src/libsync/utility.cpp
@@ -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,
diff --git a/src/libsync/utility.h b/src/libsync/utility.h
index 56c241d..272dc89 100644
--- a/src/libsync/utility.h
+++ b/src/libsync/utility.h
@@ -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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list