Skip to content

Commit

Permalink
fix: [vault] the translate error
Browse files Browse the repository at this point in the history
The qt translator can not identify the macro name space, so
do not use the macro.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-211801.html
  • Loading branch information
GongHeng2017 authored and deepin-bot[bot] committed Jul 27, 2023
1 parent ddf19a9 commit fab843d
Show file tree
Hide file tree
Showing 46 changed files with 223 additions and 226 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <unistd.h>

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

QVariant VaultDBusUtils::vaultManagerDBusCall(QString function, const QVariant &vaule)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#define DPVAULT_END_NAMESPACE }
#define DPVAULT_USE_NAMESPACE using namespace dfmplugin_vault;

DPVAULT_BEGIN_NAMESPACE

namespace dfmplugin_vault {
enum VaultState {
kUnknow = 0,
kNotExisted,
Expand Down Expand Up @@ -154,6 +153,6 @@ inline constexpr char kAppSessionPath[] { "/org/deepin/dde/SessionManager1" };
inline constexpr char kAppSessionService[] { "com.deepin.SessionManager" };
inline constexpr char kAppSessionPath[] { "/com/deepin/SessionManager" };
#endif
DPVAULT_END_NAMESPACE
}

#endif // DFMPLUGIN_VAULT_GLOBAL_H
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <dfm-framework/event/event.h>

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

void VaultEventCaller::sendItemActived(quint64 windowId, const QUrl &url)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Q_DECLARE_METATYPE(bool *)

DPF_USE_NAMESPACE
DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultEventReceiver::VaultEventReceiver(QObject *parent)
: QObject(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

USING_IO_NAMESPACE
DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultFileIteratorPrivate::VaultFileIteratorPrivate(const QUrl &url,
const QStringList &nameFilters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "fileutils/vaultfilewatcher.h"

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultFileWatcherPrivate::VaultFileWatcherPrivate(const QUrl &fileUrl, VaultFileWatcher *qq)
: AbstractFileWatcherPrivate(fileUrl, qq)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

DWIDGET_USE_NAMESPACE
DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultFileInfoPrivate::VaultFileInfoPrivate(const QUrl &url, VaultFileInfo *qq)
: q(qq)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <QSharedPointer>

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultFileIterator::VaultFileIterator(const QUrl &url, const QStringList &nameFilters, QDir::Filters filters, QDirIterator::IteratorFlags flags)
: AbstractDirIterator(VaultHelper::vaultToLocalUrl(url), nameFilters, filters, flags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <dfm-base/base/schemefactory.h>

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultFileWatcher::VaultFileWatcher(const QUrl &url, QObject *parent)
: AbstractFileWatcher(new VaultFileWatcherPrivate(VaultHelper::vaultToLocalUrl(url), this), parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#include <QMenu>

DPVAULT_USE_NAMESPACE
DFMBASE_USE_NAMESPACE
using namespace dfmplugin_vault;

AbstractMenuScene *VaultComputerMenuCreator::create()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <QList>

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

static const char *const kWorkSpaceScene = "WorkspaceMenu";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "utils/vaulthelper.h"
#include "utils/pathmanager.h"

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

InterfaceActiveVault::InterfaceActiveVault(QObject *parent)
: QObject(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
}
#define signals public

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

OperatorCenter::OperatorCenter(QObject *parent)
: QObject(parent), strCryfsPassword(""), strUserKey(""), standOutput("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <QDir>
#include <QSettings>

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultConfig::VaultConfig(const QString &filePath)
: currentFilePath(filePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

inline constexpr int kArgumentsNum { 3 };

DPVAULT_USE_NAMESPACE
DFMBASE_USE_NAMESPACE
using namespace dfmplugin_vault;

FileEncryptHandle::FileEncryptHandle(QObject *parent)
: QObject(parent), d(new FileEncryptHandlerPrivate(this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include <QObject>
#include <QDBusMessage>

DPVAULT_BEGIN_NAMESPACE

namespace dfmplugin_vault {
class FileEncryptHandlerPrivate;
class FileEncryptHandle : public QObject
{
Expand Down Expand Up @@ -50,7 +49,6 @@ public slots:
private:
FileEncryptHandlerPrivate *d = nullptr;
};

DPVAULT_END_NAMESPACE
}

#endif // VAULTHANDLE_H
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class QMutex;
class QProcess;
class QThread;

DPVAULT_BEGIN_NAMESPACE

namespace dfmplugin_vault {
class FileEncryptHandle;
class FileEncryptHandlerPrivate
{
Expand Down Expand Up @@ -74,7 +73,6 @@ class FileEncryptHandlerPrivate
CryfsVersionInfo cryfsVersion { CryfsVersionInfo(-1, -1, -1) };
VaultState curState { kUnknow };
};

DPVAULT_END_NAMESPACE
}

#endif // VAULTHANDLE_P_H
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <dfm-io/dfmio_utils.h>

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

PathManager::PathManager(QObject *parent)
: QObject(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <QDBusConnection>

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

PolicyManager::VaultPageMark PolicyManager::recordVaultPageMark;
bool PolicyManager::vaultVisiable = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <QUrl>

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

ServiceManager::ServiceManager(QObject *parent)
: QObject(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ constexpr char kVaultGroup[] = { "Vault/AutoLock" };
constexpr char kVaultAutoLockKey[] { "AutoLock" };

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultAutoLock::VaultAutoLock(QObject *parent)
: QObject(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <QApplication>

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultEntryFileEntity::VaultEntryFileEntity(const QUrl &url)
: AbstractEntryFileEntity(url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Q_DECLARE_METATYPE(QList<QUrl> *)

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;
DFMGLOBAL_USE_NAMESPACE
DFMBASE_USE_NAMESPACE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include <QObject>
#include <QFileDevice>

DPVAULT_BEGIN_NAMESPACE

namespace dfmplugin_vault {
class VaultFileHelper : public QObject
{
Q_OBJECT
Expand Down Expand Up @@ -70,6 +70,6 @@ class VaultFileHelper : public QObject
private:
explicit VaultFileHelper(QObject *parent = nullptr);
};
DPVAULT_END_NAMESPACE
}

#endif // VAULTFILEHELPER_H
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Q_DECLARE_METATYPE(QList<QUrl> *)

DFMBASE_USE_NAMESPACE
DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

QUrl VaultHelper::rootUrl()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Q_DECLARE_METATYPE(BasicViewFieldFunc)
DFMBASE_USE_NAMESPACE
DPF_USE_NAMESPACE
DCORE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultVisibleManager::VaultVisibleManager(QObject *parent)
: QObject(parent)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/filemanager/dfmplugin-vault/vault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Q_DECLARE_METATYPE(QString *)
Q_DECLARE_METATYPE(Qt::DropAction *)

DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

void Vault::initialize()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Q_DECLARE_METATYPE(const char *)
using namespace PolkitQt1;
DFMBASE_USE_NAMESPACE
DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultActiveFinishedView::VaultActiveFinishedView(QWidget *parent)
: QWidget(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

DGUI_USE_NAMESPACE
DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultActiveSaveKeyFileView::VaultActiveSaveKeyFileView(QWidget *parent)
: QWidget(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <QGridLayout>
#include <QVBoxLayout>

DPVAULT_USE_NAMESPACE
DWIDGET_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultActiveSetUnlockMethodView::VaultActiveSetUnlockMethodView(QWidget *parent)
: QWidget(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <QSpacerItem>

DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultActiveStartView::VaultActiveStartView(QWidget *parent)
: QWidget(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <QTimer>

DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultRemoveByPasswordView::VaultRemoveByPasswordView(QWidget *parent)
: QWidget(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define MAX_KEY_LENGTH (32) //!凭证最大值,4的倍数

DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultRemoveByRecoverykeyView::VaultRemoveByRecoverykeyView(QWidget *parent)
: QWidget(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

DWIDGET_USE_NAMESPACE
DFMBASE_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultRemoveProgressView::VaultRemoveProgressView(QWidget *parent)
: QWidget(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <QVBoxLayout>

DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

PasswordRecoveryView::PasswordRecoveryView(QWidget *parent)
: QFrame(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define MAX_KEY_LENGTH (32)

DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

RecoveryKeyView::RecoveryKeyView(QWidget *parent)
: QFrame(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
using namespace PolkitQt1;

DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

constexpr char kVaultTRoot[] = "dfmvault:///";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ constexpr int kToolTipShowDuration = 3000;

DFMBASE_USE_NAMESPACE
DWIDGET_USE_NAMESPACE
DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

UnlockView::UnlockView(QWidget *parent)
: QFrame(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <QMouseEvent>
#include <QWindow>

DPVAULT_USE_NAMESPACE
using namespace dfmplugin_vault;

VaultActiveView::VaultActiveView(QWidget *parent)
: VaultPageBase(parent)
Expand Down
Loading

0 comments on commit fab843d

Please sign in to comment.