Skip to content

Commit 80a4c48

Browse files
committed
2.2.6
1 parent 9c8a4fb commit 80a4c48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2
-27081
lines changed

App/App.cpp

+1-28
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
#include <QSharedMemory>
99
#include <QMessageBox>
1010
#include "App.h"
11-
#include "Tray.h"
12-
#include "Logger.h"
1311
#include "NativeRect.h"
1412
#include "Font.h"
1513
#include "../Win/WinFull.h"
1614
#include "../Win/WinPin.h"
17-
#include "../Lib/QHotKey/qhotkey.h"
1815
#include "../Tool/ToolMain.h"
1916
#include "../Tool/ToolSub.h"
2017
#include "../Tool/ColorCtrl.h"
@@ -23,42 +20,21 @@ namespace {
2320
std::unique_ptr<App> app;
2421
QList<QRect> screens;
2522
QList<QRect> windows;
26-
QSharedMemory* smSingleApp;
2723
}
2824
void App::init()
2925
{
30-
new Logger(qApp);
3126
initConfig();
3227
start();
3328
}
3429
void App::dispose()
3530
{
36-
app.reset();
37-
if (smSingleApp->isAttached()) {
38-
smSingleApp->detach();//如果是最后一个进程,则会自动删除共享内存
39-
}
31+
app.reset();
4032
}
4133
void App::start()
4234
{
4335
NativeRect::init();
4436
WinFull::init();
4537
}
46-
bool App::singleAppLock()
47-
{
48-
smSingleApp = new QSharedMemory("ScreenCapture", qApp);
49-
bool flag{ false };
50-
if (smSingleApp->attach(QSharedMemory::ReadOnly)) {
51-
smSingleApp->detach();
52-
flag = false;
53-
}
54-
else if (smSingleApp->create(1)) {
55-
flag = true;
56-
}
57-
if (!flag) {
58-
QMessageBox::warning(nullptr, "Warning", "ScreenCapture is already running.");
59-
}
60-
return flag;
61-
}
6238
void App::initConfig()
6339
{
6440
QString jsonStr = R"888({
@@ -408,12 +384,9 @@ void App::initConfig()
408384
}
409385
QJsonObject jsonObject = document.object();
410386
auto lang = jsonObject["defaultLang"].toString();
411-
Tray::initData(jsonObject["tray"].toObject(), lang);
412387
WinPin::initData(jsonObject["winPin"].toArray(), lang);
413388
ToolMain::initData(jsonObject["toolMain"].toArray(), lang);
414389
ToolSub::initData(jsonObject["toolSub"].toObject(), lang);
415390
ColorCtrl::initData(jsonObject["colorCtrl"].toObject(), lang);
416391
Font::initData(jsonObject["icon"].toObject());
417-
auto hotkey = new QHotkey(QKeySequence(jsonObject["hotKey"].toString()), true,qApp);
418-
QObject::connect(hotkey, &QHotkey::activated, &App::start);
419392
}

App/Logger.cpp

-38
This file was deleted.

App/Logger.h

-11
This file was deleted.

App/Res.rc

0 Bytes
Binary file not shown.

App/Tray.cpp

-80
This file was deleted.

App/Tray.h

-20
This file was deleted.

0 commit comments

Comments
 (0)