Skip to content

Commit eb65844

Browse files
refactor: remove EventLogUtils references from main application and archive management
- Removed EventLogUtils logging calls from main.cpp, archivemanager.cpp, and mainwindow.cpp to streamline the codebase. - Deleted associated enum values from eventlogutils.h to clean up unused code. This change simplifies the logging mechanism and reduces dependencies on EventLogUtils. TASK: https://pms.uniontech.com/task-view-388231.html
1 parent 24242ba commit eb65844

File tree

4 files changed

+0
-80
lines changed

4 files changed

+0
-80
lines changed

src/main.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <QString>
2929
#include <QByteArray>
3030
#include "common/dbusadpator.h"
31-
#include "eventlogutils.h"
3231
#ifdef DTKWIDGET_CLASS_DWaterMarkHelper
3332
#include <DWaterMarkHelper>
3433
DWIDGET_USE_NAMESPACE
@@ -365,26 +364,6 @@ int main(int argc, char *argv[])
365364
// 无参数打开应用
366365
w.show();
367366
}
368-
QObject::connect(&app, &DApplication::aboutToQuit,[=](){
369-
QString strOpenFile;
370-
if(!listTransFiles.isEmpty())
371-
strOpenFile = listTransFiles[0];
372-
if(strOpenFile.isEmpty()) {
373-
QJsonObject obj{
374-
{"tid", EventLogUtils::closeCompressWnd},
375-
{"operate", "closeCompressWnd"},
376-
{"describe", QString("Close Compress Window.")}
377-
};
378-
EventLogUtils::get().writeLogs(obj);
379-
} else {
380-
QJsonObject obj{
381-
{"tid", EventLogUtils::closeCompressWnd},
382-
{"operate", "closeCompressWnd"},
383-
{"describe", QString("Close Compress Window. Close compress file : ") + strOpenFile}
384-
};
385-
EventLogUtils::get().writeLogs(obj);
386-
}
387-
});
388367
PERF_PRINT_END("POINT-01");
389368

390369
return app.exec();

src/source/archivemanager/archivemanager.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "pluginmanager.h"
1111
#include "singlejob.h"
1212
#include "batchjob.h"
13-
#include "eventlogutils.h"
1413

1514
#include <QMimeDatabase>
1615
#include <QFileInfo>
@@ -103,12 +102,6 @@ bool ArchiveManager::createArchive(const QList<FileEntry> &files, const QString
103102
bool ArchiveManager::loadArchive(const QString &strArchiveFullPath, UiTools::AssignPluginType eType)
104103
{
105104
qDebug() << "Starting loadArchive operation for file:" << strArchiveFullPath;
106-
QJsonObject obj{
107-
{"tid", EventLogUtils::LoadCompressFile},
108-
{"operate", "LoadCompressFile"},
109-
{"describe", QString("Load Compress File : ") + strArchiveFullPath}
110-
};
111-
EventLogUtils::get().writeLogs(obj);
112105
// 重新加载首先释放之前的interface
113106
if (m_pInterface != nullptr) {
114107
qDebug() << "Clearing previous archive interface";
@@ -141,12 +134,6 @@ bool ArchiveManager::loadArchive(const QString &strArchiveFullPath, UiTools::Ass
141134
bool ArchiveManager::addFiles(const QString &strArchiveFullPath, const QList<FileEntry> &listAddEntry, const CompressOptions &stOptions)
142135
{
143136
qDebug() << "Starting addFiles operation for archive:" << strArchiveFullPath;
144-
QJsonObject obj{
145-
{"tid", EventLogUtils::AddCompressFile},
146-
{"operate", "AddCompressFile"},
147-
{"describe", QString("Add File to package: ") + strArchiveFullPath}
148-
};
149-
EventLogUtils::get().writeLogs(obj);
150137
// workaround:
151138
// pzip 仅支持新建压缩,目前先将zip 追加时显式指定使用 libzip 插件
152139
UiTools::AssignPluginType eType = UiTools::APT_Auto;
@@ -182,12 +169,6 @@ bool ArchiveManager::addFiles(const QString &strArchiveFullPath, const QList<Fil
182169
bool ArchiveManager::extractFiles(const QString &strArchiveFullPath, const QList<FileEntry> &files, const ExtractionOptions &stOptions, UiTools::AssignPluginType eType)
183170
{
184171
qDebug() << "Starting extractFiles operation for archive:" << strArchiveFullPath;
185-
QJsonObject obj{
186-
{"tid", EventLogUtils::ExtractCompressFile},
187-
{"operate", "ExtractCompressFile"},
188-
{"describe", QString("Decompress the package : ") + strArchiveFullPath}
189-
};
190-
EventLogUtils::get().writeLogs(obj);
191172
if (nullptr == m_pInterface) {
192173
qDebug() << "Creating interface for extraction";
193174
m_pInterface = UiTools::createInterface(strArchiveFullPath, false, eType);
@@ -236,12 +217,6 @@ bool ArchiveManager::extractFiles(const QString &strArchiveFullPath, const QList
236217
bool ArchiveManager::extractFiles2Path(const QString &strArchiveFullPath, const QList<FileEntry> &listSelEntry, const ExtractionOptions &stOptions)
237218
{
238219
qDebug() << "Starting extractFiles2Path operation for archive:" << strArchiveFullPath;
239-
QJsonObject obj{
240-
{"tid", EventLogUtils::ExtractSingleFile},
241-
{"operate", "ExtractSingleFile"},
242-
{"describe", QString("Extract file from the compressed package : ") + strArchiveFullPath}
243-
};
244-
EventLogUtils::get().writeLogs(obj);
245220
if (nullptr == m_pInterface) {
246221
qDebug() << "Creating interface for extraction to path";
247222
m_pInterface = UiTools::createInterface(strArchiveFullPath);
@@ -271,12 +246,6 @@ bool ArchiveManager::extractFiles2Path(const QString &strArchiveFullPath, const
271246
bool ArchiveManager::deleteFiles(const QString &strArchiveFullPath, const QList<FileEntry> &listSelEntry)
272247
{
273248
qDebug() << "Starting deleteFiles operation for archive:" << strArchiveFullPath;
274-
QJsonObject obj{
275-
{"tid", EventLogUtils::DelCompressFile},
276-
{"operate", "DelCompressFile"},
277-
{"describe", QString("Delete file from package : ") + strArchiveFullPath}
278-
};
279-
EventLogUtils::get().writeLogs(obj);
280249
if (nullptr == m_pInterface) {
281250
qDebug() << "Creating interface for deletion";
282251
m_pInterface = UiTools::createInterface(strArchiveFullPath);
@@ -306,12 +275,6 @@ bool ArchiveManager::deleteFiles(const QString &strArchiveFullPath, const QList<
306275
bool ArchiveManager::renameFiles(const QString &strArchiveFullPath, const QList<FileEntry> &listSelEntry)
307276
{
308277
qDebug() << "Starting renameFiles operation for archive:" << strArchiveFullPath;
309-
QJsonObject obj{
310-
{"tid", EventLogUtils::RenameCompressFile},
311-
{"operate", "RenameCompressFile"},
312-
{"describe", QString("Rename file from package : ") + strArchiveFullPath}
313-
};
314-
EventLogUtils::get().writeLogs(obj);
315278
if (nullptr == m_pInterface) {
316279
qDebug() << "Creating interface for renaming";
317280
m_pInterface = UiTools::createInterface(strArchiveFullPath);
@@ -368,12 +331,6 @@ bool ArchiveManager::batchExtractFiles(const QStringList &listFiles, const QStri
368331
bool ArchiveManager::openFile(const QString &strArchiveFullPath, const FileEntry &stEntry, const QString &strTempExtractPath, const QString &strProgram)
369332
{
370333
qDebug() << "Starting openFile operation for archive:" << strArchiveFullPath;
371-
QJsonObject obj{
372-
{"tid", EventLogUtils::OpenCompressFile},
373-
{"operate", "OpenCompressFile"},
374-
{"describe", QString("Open file from package : ") + strArchiveFullPath}
375-
};
376-
EventLogUtils::get().writeLogs(obj);
377334
if (nullptr == m_pInterface) {
378335
qDebug() << "Creating interface for opening file";
379336
m_pInterface = UiTools::createInterface(strArchiveFullPath);

src/source/common/eventlogutils.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ class EventLogUtils
1818
Start = 1000000003,
1919
Quit = 1000000004
2020
};
21-
enum CompressTID {
22-
LoadCompressFile = 1000200040,
23-
OpenCompressFile = 1000200041,
24-
ExtractCompressFile = 1000200042,
25-
ExtractSingleFile = 1000200043,
26-
closeCompressWnd = 1000200044,
27-
AddCompressFile = 1000200045,
28-
DelCompressFile = 1000200046,
29-
RenameCompressFile = 1000200047
30-
};
3121
enum REPORTMODE
3222
{
3323
BROADCAST = 1,

src/source/mainwindow.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,12 +1356,6 @@ void MainWindow::slotJobFinished(ArchiveJob::JobType eJobType, PluginFinishType
13561356
void MainWindow::slotUncompressClicked(const QString &strUncompressPath)
13571357
{
13581358
qDebug() << "Starting extraction to path:" << strUncompressPath;
1359-
QJsonObject obj{
1360-
{"tid", EventLogUtils::ExtractCompressFile},
1361-
{"operate", "ExtractCompressFile"},
1362-
{"describe", QString("Extract Compress File: ") + strUncompressPath}
1363-
};
1364-
EventLogUtils::get().writeLogs(obj);
13651359
m_operationtype = Operation_Extract; //解压操作
13661360

13671361
QString strArchiveFullPath = m_pUnCompressPage->archiveFullPath();

0 commit comments

Comments
 (0)