Skip to content

Commit

Permalink
Fix common facility engine, fix missing checkbox under windows
Browse files Browse the repository at this point in the history
  • Loading branch information
alphaonex86 committed Nov 11, 2013
1 parent f41f4b1 commit acdd620
Show file tree
Hide file tree
Showing 138 changed files with 7,520 additions and 6,412 deletions.
4 changes: 1 addition & 3 deletions CopyEngineManager.cpp
Expand Up @@ -5,7 +5,6 @@
\date 2010
\licence GPL3, see the file COPYING */

#include <QDebug>
#include <QMessageBox>

#include "CopyEngineManager.h"
Expand All @@ -14,7 +13,6 @@
CopyEngineManager::CopyEngineManager(OptionDialog *optionDialog)
{
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start");
connect(LanguagesManager::languagesManager, &LanguagesManager::newLanguageLoaded, &facilityEngine,&FacilityEngine::retranslate,Qt::DirectConnection);
this->optionDialog=optionDialog;
//setup the ui layout
PluginsManager::pluginsManager->lockPluginListEdition();
Expand Down Expand Up @@ -112,7 +110,7 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
connect(newItem.factory,&PluginInterface_CopyEngineFactory::debugInformation,this,&CopyEngineManager::debugInformation,Qt::QueuedConnection);
#endif // ULTRACOPIER_DEBUG
newItem.options=new LocalPluginOptions("CopyEngine-"+newItem.name);
newItem.factory->setResources(newItem.options,plugin.writablePath,plugin.path,&facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL);
newItem.factory->setResources(newItem.options,plugin.writablePath,plugin.path,&FacilityEngine::facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL);
newItem.optionsWidget=newItem.factory->options();
newItem.supportedProtocolsForTheSource=newItem.factory->supportedProtocolsForTheSource();
newItem.supportedProtocolsForTheDestination=newItem.factory->supportedProtocolsForTheDestination();
Expand Down
1 change: 0 additions & 1 deletion CopyEngineManager.h
Expand Up @@ -91,7 +91,6 @@ private slots:
QList<CopyEnginePlugin> pluginList;
OptionDialog *optionDialog;
bool isConnected;
FacilityEngine facilityEngine;
signals:
//void newCopyEngineOptions(QString,QString,QWidget *);
void addCopyEngine(QString name,bool canDoOnlyCopy) const;
Expand Down
12 changes: 12 additions & 0 deletions FacilityEngine.cpp
Expand Up @@ -15,6 +15,8 @@
#include <windows.h>
#endif

FacilityEngine FacilityEngine::facilityEngine;

FacilityEngine::FacilityEngine()
{
retranslate();
Expand Down Expand Up @@ -241,3 +243,13 @@ QString FacilityEngine::ultimateUrl() const
#endif

}

/// \brief Return the software name
QString FacilityEngine::softwareName() const
{
#ifdef ULTRACOPIER_MODE_SUPERCOPIER
return "Supercopier";
#else
return "Ultracopier";
#endif
}
4 changes: 4 additions & 0 deletions FacilityEngine.h
Expand Up @@ -42,6 +42,10 @@ class FacilityEngine : public FacilityInterface
QString simplifiedRemainingTime(const quint32 &seconds) const;
/// \brief Return ultimate url, empty is not found or already ultimate
QString ultimateUrl() const;
/// \brief Return the software name
QString softwareName() const;

static FacilityEngine facilityEngine;
private:
//undirect translated string
QString Translation_perSecond;
Expand Down
2 changes: 2 additions & 0 deletions LanguagesManager.cpp
Expand Up @@ -9,6 +9,7 @@
#include <QLibraryInfo>

#include "LanguagesManager.h"
#include "FacilityEngine.h"

/// \brief Create the manager and load the defaults variables
LanguagesManager::LanguagesManager()
Expand Down Expand Up @@ -175,6 +176,7 @@ void LanguagesManager::setCurrentLanguage(const QString &newLanguage)
}
}
currentLanguage=newLanguage;
FacilityEngine::facilityEngine.retranslate();
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"emit newLanguageLoaded()");
emit newLanguageLoaded(currentLanguage);
return;
Expand Down
3 changes: 1 addition & 2 deletions ThemesManager.cpp
Expand Up @@ -53,7 +53,6 @@ ThemesManager::ThemesManager()
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Default style: "+defaultStylePath);
currentStylePath=defaultStylePath;
connect(OptionEngine::optionEngine, &OptionEngine::newOptionValue, this, &ThemesManager::newOptionValue,Qt::QueuedConnection);
connect(LanguagesManager::languagesManager, &LanguagesManager::newLanguageLoaded, &facilityEngine,&FacilityEngine::retranslate,Qt::QueuedConnection);
}

/// \brief Destroy the themes manager
Expand Down Expand Up @@ -138,7 +137,7 @@ void ThemesManager::onePluginAdded(const PluginsAvailable &plugin)
newPlugin.factory=factory;

newPlugin.options=new LocalPluginOptions("Themes-"+newPlugin.plugin.name);
newPlugin.factory->setResources(newPlugin.options,newPlugin.plugin.writablePath,newPlugin.plugin.path,&facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL);
newPlugin.factory->setResources(newPlugin.options,newPlugin.plugin.writablePath,newPlugin.plugin.path,&FacilityEngine::facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL);
currentStylePath=newPlugin.plugin.path;
pluginList << newPlugin;
if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded())
Expand Down
1 change: 0 additions & 1 deletion ThemesManager.h
Expand Up @@ -60,7 +60,6 @@ class ThemesManager : public QObject
};
QList<PluginsAvailableThemes> pluginList;
int currentPluginIndex;
FacilityEngine facilityEngine;
bool stopIt;
signals:
/// \brief send this signal when the themes have changed
Expand Down
4 changes: 2 additions & 2 deletions Variable.h
Expand Up @@ -12,9 +12,9 @@
#define ULTRACOPIER_DEBUG_MAX_ALL_SIZE 128 ///< \brief Max size (in MB) after the console/file output is dropped
#define ULTRACOPIER_DEBUG_MAX_IMPORTANT_SIZE 150 ///< \brief Max size (in MB) after the console/file important output is dropped
/// \brief the version
#define ULTRACOPIER_VERSION "1.0.1.8"
#define ULTRACOPIER_VERSION "1.0.1.10"
/// \brief the windows version
#define ULTRACOPIER_WINDOWS_VERSION 1,0,1,8
#define ULTRACOPIER_WINDOWS_VERSION 1,0,1,10
// define if the version is portable or not
//#define ULTRACOPIER_VERSION_PORTABLE
//#define ULTRACOPIER_VERSION_PORTABLEAPPS
Expand Down
19 changes: 5 additions & 14 deletions lib/qt-tar-xz/xz_config.h
Expand Up @@ -18,18 +18,9 @@
/* #define XZ_DEC_ARMTHUMB */
/* #define XZ_DEC_SPARC */

#ifndef WIN32
# include <stdbool.h>
# define FUNC_DECL inline
#else
# define false 0
# define true 1
# define bool int
# define FUNC_DECL
#endif
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

#include "xz.h"

Expand Down Expand Up @@ -81,7 +72,7 @@

/* Inline functions to access unaligned unsigned 32-bit integers */
#ifndef get_unaligned_le32
static FUNC_DECL uint32_t XZ_FUNC get_unaligned_le32(const uint8_t *buf)
static inline uint32_t XZ_FUNC get_unaligned_le32(const uint8_t *buf)
{
return (uint32_t)buf[0]
| ((uint32_t)buf[1] << 8)
Expand All @@ -91,7 +82,7 @@ static FUNC_DECL uint32_t XZ_FUNC get_unaligned_le32(const uint8_t *buf)
#endif

#ifndef get_unaligned_be32
static FUNC_DECL uint32_t XZ_FUNC get_unaligned_be32(const uint8_t *buf)
static inline uint32_t XZ_FUNC get_unaligned_be32(const uint8_t *buf)
{
return (uint32_t)(buf[0] << 24)
| ((uint32_t)buf[1] << 16)
Expand All @@ -101,7 +92,7 @@ static FUNC_DECL uint32_t XZ_FUNC get_unaligned_be32(const uint8_t *buf)
#endif

#ifndef put_unaligned_le32
static FUNC_DECL void XZ_FUNC put_unaligned_le32(uint32_t val, uint8_t *buf)
static inline void XZ_FUNC put_unaligned_le32(uint32_t val, uint8_t *buf)
{
buf[0] = (uint8_t)val;
buf[1] = (uint8_t)(val >> 8);
Expand All @@ -111,7 +102,7 @@ static FUNC_DECL void XZ_FUNC put_unaligned_le32(uint32_t val, uint8_t *buf)
#endif

#ifndef put_unaligned_be32
static FUNC_DECL void XZ_FUNC put_unaligned_be32(uint32_t val, uint8_t *buf)
static inline void XZ_FUNC put_unaligned_be32(uint32_t val, uint8_t *buf)
{
buf[0] = (uint8_t)(val >> 24);
buf[1] = (uint8_t)(val >> 16);
Expand Down
20 changes: 10 additions & 10 deletions lib/qt-tar-xz/xz_dec_lzma2.c
Expand Up @@ -306,7 +306,7 @@ static void XZ_FUNC dict_limit(struct dictionary *dict, size_t out_max)
}

/* Return true if at least one byte can be written into the dictionary. */
static FUNC_DECL bool XZ_FUNC dict_has_space(const struct dictionary *dict)
static inline bool XZ_FUNC dict_has_space(const struct dictionary *dict)
{
return dict->pos < dict->limit;
}
Expand All @@ -317,7 +317,7 @@ static FUNC_DECL bool XZ_FUNC dict_has_space(const struct dictionary *dict)
* still empty. This special case is needed for single-call decoding to
* avoid writing a '\0' to the end of the destination buffer.
*/
static FUNC_DECL uint32_t XZ_FUNC dict_get(
static inline uint32_t XZ_FUNC dict_get(
const struct dictionary *dict, uint32_t dist)
{
size_t offset = dict->pos - dist - 1;
Expand All @@ -331,7 +331,7 @@ static FUNC_DECL uint32_t XZ_FUNC dict_get(
/*
* Put one byte into the dictionary. It is assumed that there is space for it.
*/
static FUNC_DECL void XZ_FUNC dict_put(struct dictionary *dict, uint8_t byte)
static inline void XZ_FUNC dict_put(struct dictionary *dict, uint8_t byte)
{
dict->buf[dict->pos++] = byte;

Expand Down Expand Up @@ -463,7 +463,7 @@ static bool XZ_FUNC rc_read_init(struct rc_dec *rc, struct xz_buf *b)
}

/* Return true if there may not be enough input for the next decoding loop. */
static FUNC_DECL bool XZ_FUNC rc_limit_exceeded(const struct rc_dec *rc)
static inline bool XZ_FUNC rc_limit_exceeded(const struct rc_dec *rc)
{
return rc->in_pos > rc->in_limit;
}
Expand All @@ -472,13 +472,13 @@ static FUNC_DECL bool XZ_FUNC rc_limit_exceeded(const struct rc_dec *rc)
* Return true if it is possible (from point of view of range decoder) that
* we have reached the end of the LZMA chunk.
*/
static FUNC_DECL bool XZ_FUNC rc_is_finished(const struct rc_dec *rc)
static inline bool XZ_FUNC rc_is_finished(const struct rc_dec *rc)
{
return rc->code == 0;
}

/* Read the next input byte if needed. */
static FUNC_DECL_ALWAYS void XZ_FUNC rc_normalize(struct rc_dec *rc)
static __always_inline void XZ_FUNC rc_normalize(struct rc_dec *rc)
{
if (rc->range < RC_TOP_VALUE) {
rc->range <<= RC_SHIFT_BITS;
Expand All @@ -497,7 +497,7 @@ static FUNC_DECL_ALWAYS void XZ_FUNC rc_normalize(struct rc_dec *rc)
* of the code generated by GCC 3.x decreases 10-15 %. (GCC 4.3 doesn't care,
* and it generates 10-20 % faster code than GCC 3.x from this file anyway.)
*/
static FUNC_DECL_ALWAYS int XZ_FUNC rc_bit(struct rc_dec *rc, uint16_t *prob)
static __always_inline int XZ_FUNC rc_bit(struct rc_dec *rc, uint16_t *prob)
{
uint32_t bound;
int bit;
Expand All @@ -519,7 +519,7 @@ static FUNC_DECL_ALWAYS int XZ_FUNC rc_bit(struct rc_dec *rc, uint16_t *prob)
}

/* Decode a bittree starting from the most significant bit. */
static FUNC_DECL_ALWAYS uint32_t XZ_FUNC rc_bittree(
static __always_inline uint32_t XZ_FUNC rc_bittree(
struct rc_dec *rc, uint16_t *probs, uint32_t limit)
{
uint32_t symbol = 1;
Expand All @@ -535,7 +535,7 @@ static FUNC_DECL_ALWAYS uint32_t XZ_FUNC rc_bittree(
}

/* Decode a bittree starting from the least significant bit. */
static FUNC_DECL_ALWAYS void XZ_FUNC rc_bittree_reverse(struct rc_dec *rc,
static __always_inline void XZ_FUNC rc_bittree_reverse(struct rc_dec *rc,
uint16_t *probs, uint32_t *dest, uint32_t limit)
{
uint32_t symbol = 1;
Expand All @@ -552,7 +552,7 @@ static FUNC_DECL_ALWAYS void XZ_FUNC rc_bittree_reverse(struct rc_dec *rc,
}

/* Decode direct bits (fixed fifty-fifty probability) */
static FUNC_DECL void XZ_FUNC rc_direct(
static inline void XZ_FUNC rc_direct(
struct rc_dec *rc, uint32_t *dest, uint32_t limit)
{
uint32_t mask;
Expand Down
20 changes: 6 additions & 14 deletions lib/qt-tar-xz/xz_lzma2.h
Expand Up @@ -11,14 +11,6 @@
#ifndef XZ_LZMA2_H
#define XZ_LZMA2_H

#ifndef WIN32
# define FUNC_DECL inline
# define FUNC_DECL_ALWAYS __always_inline
#else
# define FUNC_DECL
# define FUNC_DECL_ALWAYS
#endif

/* Range coder constants */
#define RC_SHIFT_BITS 8
#define RC_TOP_BITS 24
Expand Down Expand Up @@ -69,7 +61,7 @@ enum lzma_state {
#define LIT_STATES 7

/* Indicate that the latest symbol was a literal. */
static FUNC_DECL void XZ_FUNC lzma_state_literal(enum lzma_state *state)
static inline void XZ_FUNC lzma_state_literal(enum lzma_state *state)
{
if (*state <= STATE_SHORTREP_LIT_LIT)
*state = STATE_LIT_LIT;
Expand All @@ -80,25 +72,25 @@ static FUNC_DECL void XZ_FUNC lzma_state_literal(enum lzma_state *state)
}

/* Indicate that the latest symbol was a match. */
static FUNC_DECL void XZ_FUNC lzma_state_match(enum lzma_state *state)
static inline void XZ_FUNC lzma_state_match(enum lzma_state *state)
{
*state = *state < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH;
}

/* Indicate that the latest state was a long repeated match. */
static FUNC_DECL void XZ_FUNC lzma_state_long_rep(enum lzma_state *state)
static inline void XZ_FUNC lzma_state_long_rep(enum lzma_state *state)
{
*state = *state < LIT_STATES ? STATE_LIT_LONGREP : STATE_NONLIT_REP;
}

/* Indicate that the latest symbol was a short match. */
static FUNC_DECL void XZ_FUNC lzma_state_short_rep(enum lzma_state *state)
static inline void XZ_FUNC lzma_state_short_rep(enum lzma_state *state)
{
*state = *state < LIT_STATES ? STATE_LIT_SHORTREP : STATE_NONLIT_REP;
}

/* Test if the previous symbol was a literal. */
static FUNC_DECL bool XZ_FUNC lzma_state_is_literal(enum lzma_state state)
static inline bool XZ_FUNC lzma_state_is_literal(enum lzma_state state)
{
return state < LIT_STATES;
}
Expand Down Expand Up @@ -152,7 +144,7 @@ static FUNC_DECL bool XZ_FUNC lzma_state_is_literal(enum lzma_state state)
* Get the index of the appropriate probability array for decoding
* the distance slot.
*/
static FUNC_DECL uint32_t XZ_FUNC lzma_get_dist_state(uint32_t len)
static inline uint32_t XZ_FUNC lzma_get_dist_state(uint32_t len)
{
return len < DIST_STATES + MATCH_LEN_MIN
? len - MATCH_LEN_MIN : DIST_STATES - 1;
Expand Down
16 changes: 6 additions & 10 deletions plugins-alternative/Themes/Clean/Languages/de/translation.ts
Expand Up @@ -6,7 +6,7 @@
<message>
<location filename="../../interface.cpp" line="142"/>
<source>%1/%2 files, %3/%4</source>
<translation>%1/%2 dateien, %3/%4</translation>
<translation>%1/%2 Dateien, %3/%4</translation>
</message>
</context>
<context>
Expand All @@ -16,14 +16,10 @@
<source>Action:</source>
<translation>Aktion:</translation>
</message>
<message>
<source>In wait</source>
<translation type="obsolete">auf der Lauer</translation>
</message>
<message>
<location filename="../../interface.ui" line="44"/>
<source>Waiting</source>
<translation type="unfinished"></translation>
<translation>Warten</translation>
</message>
<message>
<location filename="../../interface.ui" line="78"/>
Expand All @@ -38,22 +34,22 @@
<message>
<location filename="../../interface.ui" line="96"/>
<source>Move file(s)</source>
<translation>Bewegen Sie Datei (en)</translation>
<translation>Datei (en) verschieben</translation>
</message>
<message>
<location filename="../../interface.ui" line="105"/>
<source>Move folder</source>
<translation>bewegen Sie Ordner</translation>
<translation>Ordner verschieben</translation>
</message>
<message>
<location filename="../../interface.ui" line="114"/>
<source>Copy file(s)</source>
<translation>Kopieren Sie die Datei (en)</translation>
<translation>Datei (en) kopieren</translation>
</message>
<message>
<location filename="../../interface.ui" line="123"/>
<source>Copy folder</source>
<translation>kopieren Sie das Verzeichnis</translation>
<translation>Ordner kopieren</translation>
</message>
</context>
</TS>

0 comments on commit acdd620

Please sign in to comment.