From 4b5e5310930181d0e0ff3a6e3117abbef0aff756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=AC=E5=B1=B1=E8=99=8E?= Date: Thu, 27 Oct 2022 11:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E5=95=86=E4=B8=9A=E6=AE=8B=E7=95=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alignwin.cpp | 35 ------ alignwin.h | 21 ---- alignwin.ui | 181 ------------------------------ cceditor/ccnotepad.cpp | 7 +- jsondeploy.cpp | 30 +---- main.cpp | 16 ++- netregister.cpp | 214 ------------------------------------ netregister.h | 35 ------ rcglobal.h | 156 ++------------------------ userdatacommand.h | 74 ------------- userregister.cpp | 120 -------------------- userregister.h | 27 ----- userregister.ui | 242 ----------------------------------------- workerthread.cpp | 20 ---- workerthread.h | 19 ---- workthreadctl.cpp | 29 ----- workthreadctl.h | 20 ---- 17 files changed, 22 insertions(+), 1224 deletions(-) delete mode 100755 alignwin.cpp delete mode 100755 alignwin.h delete mode 100755 alignwin.ui delete mode 100755 netregister.cpp delete mode 100755 netregister.h delete mode 100755 userdatacommand.h delete mode 100755 userregister.cpp delete mode 100755 userregister.h delete mode 100755 userregister.ui delete mode 100755 workerthread.cpp delete mode 100755 workerthread.h delete mode 100755 workthreadctl.cpp delete mode 100755 workthreadctl.h diff --git a/alignwin.cpp b/alignwin.cpp deleted file mode 100755 index 64c4f3e..0000000 --- a/alignwin.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "alignwin.h" - -AlignWin::AlignWin(QWidget *parent) - : QWidget(parent) -{ - ui.setupUi(this); -} - -AlignWin::~AlignWin() -{} - -void AlignWin::slot_ok() -{ - bool ok = true; - bool ok1 = true; - int leftStart = ui.leftStart->text().toInt(&ok) - 1; - int leftEnd = ui.leftEnd->text().toInt(&ok1) - 1; - - if(!ok || !ok1) - { - return; - } - - if((leftStart < 0) || (leftStart > leftEnd)) - { - return; - } - - int type = 0; - - //0最简单的,两边错开分别单独显示,对方一侧做对齐行展示 - emit alignLine(type, leftStart, leftEnd); - - close(); -} diff --git a/alignwin.h b/alignwin.h deleted file mode 100755 index 3083bf3..0000000 --- a/alignwin.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include -#include "ui_alignwin.h" - -class AlignWin : public QWidget -{ - Q_OBJECT - -public: - AlignWin(QWidget *parent = nullptr); - ~AlignWin(); - -signals: - void alignLine(int type, int start, int end); - -private slots: - void slot_ok(); -private: - Ui::AlignWinClass ui; -}; diff --git a/alignwin.ui b/alignwin.ui deleted file mode 100755 index ea7155e..0000000 --- a/alignwin.ui +++ /dev/null @@ -1,181 +0,0 @@ - - - AlignWinClass - - - - 0 - 0 - 400 - 136 - - - - - 400 - 150 - - - - Pull Open - - - - :/Resources/img/main.png:/Resources/img/main.png - - - - - - - 400 - 150 - - - - Pull Open Line Set - - - - - - Pull out the section with insufficient comparison results. - - - - - - - - - Start LineNum: - - - - - - - 11 - - - - - - - End LineNum: - - - - - - - 11 - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Ok - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Close - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - pushButton - clicked() - AlignWinClass - slot_ok() - - - 132 - 78 - - - 158 - 106 - - - - - pushButton_2 - clicked() - AlignWinClass - close() - - - 301 - 83 - - - 353 - 110 - - - - - - slot_ok() - - diff --git a/cceditor/ccnotepad.cpp b/cceditor/ccnotepad.cpp index 31af96f..e8f627c 100755 --- a/cceditor/ccnotepad.cpp +++ b/cceditor/ccnotepad.cpp @@ -14,7 +14,6 @@ #include "hexfilegoto.h" #include "qscilexertext.h" #include "styleset.h" -#include "userregister.h" #include "qtlangset.h" #include "columnedit.h" @@ -5443,11 +5442,7 @@ void CCNotePad::slot_toMistyRose() //鑾峰彇娉ㄥ唽鐮 void CCNotePad::slot_register() { - UserRegister* pWin = new UserRegister(this); - pWin->setAttribute(Qt::WA_DeleteOnClose); - connect(pWin, &UserRegister::signSendRegisterKey, this, &CCNotePad::signSendRegisterKey); - connect(this, &CCNotePad::signRegisterReplay, pWin, &UserRegister::slot_registerReplay); - pWin->exec(); + } void CCNotePad::slot_langFormat() diff --git a/jsondeploy.cpp b/jsondeploy.cpp index 9cc1a5d..dfff36c 100755 --- a/jsondeploy.cpp +++ b/jsondeploy.cpp @@ -1,5 +1,4 @@ 锘#include "jsondeploy.h" -#include "netregister.h" #include #include #include @@ -13,7 +12,7 @@ //鏇挎崲JsonDeploy.h鐨勭被銆備笉浣跨敤鏁版嵁搴擄紝鐩存帴鍐欎竴涓枃浠跺氨琛屻 - +static int version_num = 24; //鏁版嵁搴撴枃浠舵槸鍚﹀瓨鍦ㄣ傚鏋滃垵濮嬪寲澶辫触锛屽垯涓嶅瓨鍦 bool JsonDeploy::s_isExistDb = false; @@ -261,49 +260,24 @@ void JsonDeploy::init() #endif #endif QString str; - addKeyValueToLongSets("recentdir", str); - addKeyValueToLongSets("recentfile", str); + addKeyValueToLongSets("recentopenfile", str); - //鏄惁瀵规瘮闅愯棌鏂囦欢 - addKeyValueToNumSets("cmphidefile", 0); - //瀵规瘮鎵鏈夌被鍨嬫枃浠1; 2 鍙姣斿凡鐭ユ敮鎸佺殑鏂囦欢绫诲瀷 - addKeyValueToNumSets("cmpallfile", 1); //tab鐨勯暱搴︼紝榛樿涓4 addKeyValueToNumSets("tablens", 4); //space replace tab绌烘牸鏇挎崲tab锛岄粯璁1涓簍rue,0涓篺alse addKeyValueToNumSets("tabnouse", 1); - //缃戠粶鍥炲鍥炴潵鐨勬秷鎭痠d - addKeyValueToNumSets("msgid", 1); - addKeyValueToSets("url", "0"); addKeyValueToSets("mac", "0"); addKeyValueToNumSets("padtimes", 0); addKeyValueToNumSets("serverip", 0); - //hex涓媗cs鍜屼竴瀵逛竴瀵规瘮妯″紡 - addKeyValueToNumSets("hexmode", 1); - //鏄惁楂樹寒涓嶅悓澶勮儗鏅 addKeyValueToNumSets("hexhigh", 1); //鏄惁楂樹寒涓嶅悓澶勮儗鏅 addKeyValueToNumSets("version", version_num); - //鐩綍瀵规瘮妯″紡锛0鎱1蹇傞粯璁ゆ參閫 - addKeyValueToNumSets("dirmode", 0); - - //璺宠繃鐩綍銆傞粯璁や笉璺宠繃0 涓嶈烦杩 1 璺宠繃 - addKeyValueToNumSets("isskipdir", 0); - addKeyValueToSets("skipdir", ".svn:.vs"); - - //璺宠繃鏂囦欢鍚庣紑銆傞粯璁や笉璺宠繃0 涓嶈烦杩 1 璺宠繃 - addKeyValueToNumSets("isskipext", 0); - addKeyValueToSets("skipext", ".sln:.vcxproj"); - - //璺宠繃鏂囦欢鍚庣紑銆傞粯璁や笉璺宠繃0 涓嶈烦杩 1 璺宠繃 - addKeyValueToNumSets("isskipprefix", 0); - addKeyValueToSets("skipprefix", "ui_"); //鐨偆id addKeyValueToNumSets(SKIN_KEY, 1); diff --git a/main.cpp b/main.cpp index 87b1fc6..6e77e74 100755 --- a/main.cpp +++ b/main.cpp @@ -259,7 +259,7 @@ int main(int argc, char *argv[]) shared.create(32); #elif defined (Q_OS_MAC) { - //mac涓嬮潰涓嶉渶瑕侊紝鏈変粬鑷韩鐨勬満鍒朵繚璇併傚綋绋嬪簭宸茬粡鍦ㄢ渽鏃讹紝鍐嶆墦寮绋嬪簭锛岀郴缁熶細鑷姩璋冪敤宸茬粡瀛樺湪鐨勭▼搴忓嚭鐜 + //mac涓嬮潰涓嶉渶瑕侊紝鏈変粬鑷韩鐨勬満鍒朵繚璇併傚綋绋嬪簭宸茬粡鍦ㄧ嚎鏃讹紝鍐嶆墦寮绋嬪簭锛岀郴缁熶細鑷姩璋冪敤宸茬粡瀛樺湪鐨勭▼搴忓嚭鐜 //涓嶉渶瑕佷娇鐢ㄧ被浼糽inux涓嬮潰鐨勬満鍒躲 shared.create(32); nppShared.create(32); @@ -292,13 +292,17 @@ drop_old: pMainNotepad->setShareMem(&shared); pMainNotepad->show(); - - pMainNotepad->syncCurSkinToMenu(id); - - //杩欓噷涓嶈兘缁檖arent锛屽惁鍒欎細瀵艰嚧鐖跺瓙瀵硅薄涓嶅湪鍚屼竴涓嚎绋嬬殑閿欒 - NetRegister *pNetReg = new NetRegister(nullptr); +#ifdef uos + QFont font("Noto Sans CJK JP,9,-1,5,50,0,0,0,0,0,Regular", 9); + QApplication::setFont(font); +#endif +#ifdef Q_OS_MAC + //杩欓噷鐨勫瓧浣撳ぇ灏忥紝鍔″繀瑕佸拰鏌ユ壘缁撴灉妗嗙殑楂樺害鍖归厤锛屽惁鍒欎細缁撴瀯瀛椾綋鎷ユ尋 + QFont font("Courier New,11,-1,5,50,0,0,0,0,0,Regular", 11); + QApplication::setFont(font); +#endif #ifdef Q_OS_WIN //HWND hwnd = ::FindWindowA("Qt5QWindowIcon", "CCNotebook"); diff --git a/netregister.cpp b/netregister.cpp deleted file mode 100755 index d131fb6..0000000 --- a/netregister.cpp +++ /dev/null @@ -1,214 +0,0 @@ -锘#include "netregister.h" -#include "jsondeploy.h" - -#include "donate.h" -#include "doctypelistview.h" -#include "rcglobal.h" - -#include -#include -#include -#include - -//5 1.3 -//6 1.4 20211027鏃 -#define uos -#if defined(Q_OS_MAC) - #undef uos -#endif - -#if defined(Q_OS_WIN) -#undef uos -#endif - -#ifdef uos -QString loadFontFromFile(QString path,int code) -{ - QString font; - static QMap codelist; - - if(codelist.contains(code)) - { - return codelist.value(code); - } - - int loadedFontID = QFontDatabase::addApplicationFont(path); - QStringList loadedFontFamilies = QFontDatabase::applicationFontFamilies(loadedFontID); - if(!loadedFontFamilies.empty()) - { - if ((code == 0) && loadedFontFamilies.size() >=7) - { - font = loadedFontFamilies.at(6); - } - else - { - font = loadedFontFamilies.at(0); - } - } - - codelist.insert(code,font); - - return font; -} -#endif - -RC_LINE_FORM getLineEndType(QString line) -{ - if (line.endsWith("\r\n")) - { - return DOS_LINE; - } - else if (line.endsWith("\n")) - { - return UNIX_LINE; - } - else if (line.endsWith("\r")) - { - return MAC_LINE; - } - - return UNKNOWN_LINE; -} - - RC_LINE_FORM getLineEndType(const LineNode& lines) -{ - if (lines.lineText.isEmpty()) - { - return UNKNOWN_LINE; - } - - return getLineEndType((lines.lineText.last().text)); -} - -NetRegister::NetRegister(QObject *parent): QObject(parent) -{ -#ifdef uos - //QString fontName = loadFontFromFile("/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",0); - QFont font("Noto Sans CJK JP,9,-1,5,50,0,0,0,0,0,Regular",9); - //qDebug() << "font name uos" << fontName; - QApplication::setFont(font); -#endif -#ifdef Q_OS_MAC - //杩欓噷鐨勫瓧浣撳ぇ灏忥紝鍔″繀瑕佸拰鏌ユ壘缁撴灉妗嗙殑楂樺害鍖归厤锛屽惁鍒欎細缁撴瀯瀛椾綋鎷ユ尋 - QFont font("Courier New,11,-1,5,50,0,0,0,0,0,Regular",11); - // qDebug() << "font name mac"; - QApplication::setFont(font); - // qDebug() << QApplication::font().toString(); -#endif -#ifdef Q_OS_WIN -#if 0 //涓嶅湪杩欓噷鍋氫簡锛岄伩鍏嶅奖鍝嶅惎鍔ㄩ熷害銆備篃涓嶆柟渚垮脊鍑烘秷鎭 - QFont srcFont = QApplication::font(); - //qDebug() << QApplication::font().toString(); - //win11鍙戠幇瀛椾綋鏄シ浣撱傛娴嬪苟璁剧疆涓涓 - if (QString("SimSun") != srcFont.family()) - { - - if (!setAppFont(QString("SimSun"))) - { - if (!setAppFont(QString("Courier"))) - { - if (!setAppFont(QString("Times New Roman"))) - { - //璁╃敤鎴峰畨瑁呭瓧浣撱傝繖閲屽彲浠ュ脊鍑簈message,杩欓噷杩樻槸鍦ㄤ富绾跨▼涓 - QMessageBox::warning(nullptr, tr("Font Lost"), tr("Please Install System Font [Courier/SimSun/Times New Roman].The interface font will display exceptions")); - } - } - } - } -#endif -#endif - //qDebug() << QApplication::font().toString(); - JsonDeploy::init(); -} - - - - - - - -//閫鍑哄仛鍥炴敹宸ヤ綔銆傞氱煡socket鍋滄鐩戝惉 -void NetRegister::quit() -{ - JsonDeploy::close(); -} - - -NetRegister::~NetRegister() -{ - quit(); -} - -QStringList NetRegister::getLocalMac() -{ - QStringList mac_list; - QString strMac; - QList ifaces = QNetworkInterface::allInterfaces(); - for (int i = 0; i < ifaces.count(); i++) - { - QNetworkInterface iface = ifaces.at(i); - //杩囨护鎺夋湰鍦板洖鐜湴鍧銆佹病鏈夊紑鍚殑鍦板潃 - if (iface.flags().testFlag(QNetworkInterface::IsUp) && \ - iface.flags().testFlag(QNetworkInterface::IsRunning) && \ - iface.flags().testFlag(QNetworkInterface::CanBroadcast) && \ - !iface.flags().testFlag(QNetworkInterface::IsLoopBack)) - { - //杩囨护鎺夎櫄鎷熷湴鍧 - if (!(iface.humanReadableName().contains("VMware", Qt::CaseInsensitive))) - { - strMac = iface.hardwareAddress(); - if (!strMac.isEmpty() && strMac.compare("00:00:00:00:00:00") != 0) - { - strMac.replace(":", ""); - mac_list.append(strMac); - break; - } - } - } - } - //瀹炲湪娌℃湁鎵惧埌鍚堥傜殑锛屽氨鏀惧鏉′欢閫夌涓涓 - if (mac_list.isEmpty() && !ifaces.isEmpty()) - { - for (int i = 0; i < ifaces.count(); i++) - { - QNetworkInterface iface = ifaces.at(i); - //杩囨护鎺夋湰鍦板洖鐜湴鍧銆佹病鏈夊紑鍚殑鍦板潃 - if (!iface.flags().testFlag(QNetworkInterface::IsLoopBack)) - { - //杩囨护鎺夎櫄鎷熷湴鍧 - if (!(iface.humanReadableName().contains("VMware", Qt::CaseInsensitive))) - { - strMac = iface.hardwareAddress(); - if (!strMac.isEmpty() && strMac.compare("00:00:00:00:00:00") != 0) - { - strMac.replace(":", ""); - mac_list.append(strMac); - break; - } - } - } - } - } - return mac_list; -} - -QString NetRegister::getLocalFirstMac() -{ - QString key("mac"); - QString v = JsonDeploy::getKeyValueFromSets(key); - - if (v.isEmpty() || v == "0") - { - - QStringList macList = getLocalMac(); - if (!macList.isEmpty()) - { - JsonDeploy::updataKeyValueFromSets(key, macList[0]); - return macList[0]; - } - return QString(); - } - - return v; -} - diff --git a/netregister.h b/netregister.h deleted file mode 100755 index e56aadf..0000000 --- a/netregister.h +++ /dev/null @@ -1,35 +0,0 @@ -锘#pragma once - -#include -#include - - -class CompareDirs; -class CompareWin; -class chatSocket; - -#if defined(Q_OS_MAC) -const int VERIFY_CODE = 12; -#elif defined(Q_OS_UNIX) -const int VERIFY_CODE = 9; -#elif defined(Q_OS_WIN) -const int VERIFY_CODE = 8; //楠岃瘉娉ㄥ唽.windows 8 linux 9 MAC 12 (10,11缁欎簡鎴戠殑鍐欎綔锛 -#endif -static short version_num = 23; - - -//杩欎釜绫诲畬鍏ㄧ畝鍖栦簡锛屽彧淇濇姢缃戠粶楠岃瘉鐨勫姛鑳姐傚叾浣橴I鎿嶄綔鏀惧叆鍒癱cnotepad涓幓浜 - -class NetRegister : public QObject -{ - Q_OBJECT - -public: - NetRegister(QObject *parent = Q_NULLPTR); - virtual ~NetRegister(); - static QString getLocalFirstMac(); - -private: - static QStringList getLocalMac(); - void quit(); -}; diff --git a/rcglobal.h b/rcglobal.h index 3988f3b..12681e5 100755 --- a/rcglobal.h +++ b/rcglobal.h @@ -31,16 +31,6 @@ enum RC_ITEM_STATUS RC_EXPANDED, }; -enum BLOCKSTATUS { - UNKNOWN_BLOCK = 0, - EQUAL_BLOCK = 1, - UNEQUAL_BLOCK, - PAD_BLOCK, - //EMPTY_BLOCK, - LAST_PAD_EMPTY_BLOCK, // 鏈鍚庝竴涓敤浜庡榻愮殑绌鸿 - TEMP_INSERT_BLOCK -}; - /* 鏄斁缃湪block涓殑userState锛-1鏄繚鐣欒锛屽洜涓-1鏄粯璁ゆ病鏈夋椂鐨勫硷紝鏍囪瘑鏂版彃鍏ヨ */ enum RC_LINE_FORM { @@ -52,35 +42,6 @@ enum RC_LINE_FORM MAC_LINE, }; -typedef struct equalLineInfo_ { - int index;//鐩哥瓑琛屽簭鍙凤紝宸﹀彸鍊 - int leftLineNums; - int rightLineNums; -}EqualLineInfo; - - -typedef struct noequalblock_ { - - int startBlockNums; //寮濮嬬殑鍧楀彿銆傚乏鍙充袱杈归兘鏄竴鏍风殑 - int blockLens;//宸﹀彸闀垮害銆傜悊璁轰笂浜岃呮槸鐩哥瓑鐨,鏁呭彧闇瑕佷竴涓 - bool isDeleted; //鏄惁宸茬粡琚悓姝ャ傚嵆琚垹闄よ繃浜嗭紝涓嬫璺宠繃杩欎釜 - int type; // - noequalblock_() - { - type = UNKNOWN_BLOCK; - } - noequalblock_(int start, int lens) - { - startBlockNums = start; - blockLens = lens; - isDeleted = false; - type = UNKNOWN_BLOCK; - } - bool operator==(const noequalblock_& other) - { - return (startBlockNums == other.startBlockNums); - } -}NoEqualBlock; enum CODE_ID { UNKOWN = -2,//鍏跺疄搴旇鏄疉NSI涓殑闈濭BK缂栫爜銆傛殏鏃朵笉鑰冭檻鍏跺畠鍥藉璇█缂栫爜锛屽垯鐩存帴鎸夌収ASCII杩涜瀛楄妭澶勭悊 @@ -100,91 +61,6 @@ enum CODE_ID { CODE_END //鏈鍚庝竴涓爣蹇,鍦║I涓婃槸鏄剧ず涓涓猆NKNOWN锛岃繖鏄竴涓壒娈 }; -/*浣滅敤锛氳繖涓被涓昏缁熻宸﹀彸涓嶅悓鐨勫潡锛岀粰鐣岄潰涓婄殑鈥滀笂涓閮ㄥ垎鈥濆拰鈥滀笅涓閮ㄥ垎鈥濇潵浣跨敤銆 -*/ -typedef struct BlocksInfo_ { - -public: - BlocksInfo_() - { - startLine = 0; - endLine = 0; - } - - BlocksInfo_(bool equal_, int startLine_, int endLine_, int actualNums_) - { - equal = equal_; - actualNums = actualNums_; - startLine = startLine_; - endLine = endLine_; - } - -public: - bool equal;//鐩稿悓true锛屼笉鍚宖alse - int actualNums;//瀹為檯鏁版嵁琛屾暟 - int startLine; //璧风偣鍧楃殑琛屽彿鐮 - int endLine;//缁堢偣鍧楋紝涓嶅寘鍚鍧 -}BlocksInfo; - - - -//姣忎竴灏忔鐨勫瓧绗︼紝涓昏鏄皢鐩哥瓑鍜屼笉绛夌殑瀛楃娈靛垎寮 -typedef struct SectionNode_ { - bool equal; //鏄惁鐩哥瓑 - QString text; - //QByteArray text; -}SectionNode; - - -//姣忎竴灏忔鐨勪簩杩涘埗瀛楄妭锛屼富瑕佹槸灏嗙浉绛夊拰涓嶇瓑鐨勪簩杩涘埗瀛楃娈靛垎寮 -typedef struct BinSectionNode_ { - bool equal; //鏄惁鐩哥瓑 - QVector bytes; -}BinSectionNode; - -typedef struct BinUnequalPos_ { - int start; - int end; -}BinUnequalPos; - -//姣忎竴琛岀殑鏁版嵁缁撴瀯銆傛瘡涓琛屽寘鍚澶氱浉绛夋垨涓嶇浉绛夌殑灏忔 -typedef struct LineNode_ { - int lineNums;//琛岀殑鍙风爜 - bool totalEqual;//鏄惁瀹屽叏鐩哥瓑 - QVector lineText; - LineNode_() - { - totalEqual = false; - } - void clear() - { - totalEqual = false; - lineText.clear(); - } -}LineNode; - -extern RC_LINE_FORM getLineEndType(QString line); - -extern RC_LINE_FORM getLineEndType(const LineNode& lines); - - -#ifdef Q_OS_UNIX -extern QString loadFontFromFile(QString path,int code=0); -#endif - -typedef struct ModifyRecords_ { - int position;//褰撳墠淇敼浣嶇疆 - int modificationType;//1锛氬鍔 2 鍒犻櫎 - int length;//淇敼鐨勯暱搴 - int linesAdded;//澧炲姞澶氬皯琛屻傛涓哄鍔狅紝璐熸暟涓哄噺灏 - bool isInPaste;//鏄惁鍦ㄦ嫹璐濅腑锛屽湪鐨勮瘽鍓嶉潰涓涓垹闄や笉鑳藉仛澶勭悊锛岃绛夊埌鍚庣画娣诲姞娑堟伅 - ModifyRecords_(int position_, int type_, int length_, int linesAdded_) :position(position_), modificationType(type_), length(length_), linesAdded(linesAdded_) - { - isInPaste = false; - } -}ModifyRecords; - - typedef struct fileAttriNode_ { QString relativePath;//涓嶅甫/鑰屼笖涓嶅甫鏈澶栧眰鐩綍璺緞 @@ -208,15 +84,6 @@ typedef struct fileAttriNode_ { }fileAttriNode; -struct WalkFileInfo { - int direction; - QTreeWidgetItem* root; - QString path; - WalkFileInfo(int dire_, QTreeWidgetItem* root_, QString path_) :direction(dire_), root(root_), path(path_) - { - - } -}; const int MARGIN_NONE = 0; @@ -242,22 +109,17 @@ enum WORK_STATUS class BlockUserData; -struct OperatorInfo { - int startLineNums; //寮濮嬭鍙 - int lineLens;//宸﹀彸闀垮害銆傜悊璁轰笂浜岃呮槸鐩哥瓑鐨,鏁呭彧闇瑕佷竴涓 - int type; - QList lineLength; //姣忎竴琛岀殑闀垮害 - QList lineContents;// 姣忎竴琛岀殑鍐呭 - QList lineExternInfo; //姣忎竴琛岀殑棰濆淇℃伅 - NoEqualBlock noEqualBlockInfo; - int noEqualindex; + +struct WalkFileInfo { + int direction; + QTreeWidgetItem* root; + QString path; + WalkFileInfo(int dire_, QTreeWidgetItem* root_, QString path_) :direction(dire_), root(root_), path(path_) + { + + } }; - -enum OperRecordStatus { - RC_OPER_SYNC = 1,//鍚屾瀵艰嚧 - RC_OPER_EDIT,//缂栬緫瀵艰嚧 -}; const int Item_RelativePath = Qt::ToolTipRole; const int Item_Index = Qt::UserRole + 1; const int DIR_ITEM_MAXSIZE_FILE = Qt::UserRole + 2; diff --git a/userdatacommand.h b/userdatacommand.h deleted file mode 100755 index 556c316..0000000 --- a/userdatacommand.h +++ /dev/null @@ -1,74 +0,0 @@ -锘#pragma once -#include "command.h" -#include "rcglobal.h" -#include "blockuserdata.h" -#include - - -class CompareWin; - - -enum USER_DATA_OPER_TYPE { - DEL_USER_DATA = 1, - ADD_USER_DATA -}; - -//璁板綍undo涓巖edo鐨勬搷浣滆褰曠殑userdata鐩稿叧鎿嶄綔 -class UserDataOperRecords { -public: - RC_DIRECTION dir; - - int operType; //1DEL_USER_DATA 2ADD_USER_DATA - - QList userData; - - UserDataOperRecords(RC_DIRECTION dir_) :dir(dir_), isLastOne(false) - { - - } - - ~UserDataOperRecords() - { - for (int j = 0; j < userData.size(); ++j) - { - delete userData.at(j); - } - userData.clear(); - } - - UserDataOperRecords() = default; - UserDataOperRecords(const UserDataOperRecords& other) = delete; - - //璁板綍鏄惁鏄渶鍚庝竴涓搷浣滐紝鍥犱负鏈鍚庝竴涓鍋氫竴涓澶栫殑鎿嶄綔 - bool isLastOne; - -}; - -class UserDataCommand :public Command -{ - -public: - UserDataCommand(CompareWin* operWin); - virtual ~UserDataCommand(); - - virtual int getOperIndex()override; - virtual void undo()override; - - - virtual QString desc()override; - void setDesc(QString v); - - void setOperIndex(int v); - void addRecord(UserDataOperRecords* v); - -private: - CompareWin* m_operWin; - QList m_record; - int m_index; - QString m_desc; - - UserDataCommand(const UserDataCommand& o) = delete; - UserDataCommand& operator=(const UserDataCommand& o) = delete; - -}; - diff --git a/userregister.cpp b/userregister.cpp deleted file mode 100755 index 62b1af5..0000000 --- a/userregister.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include "userregister.h" -#include "jsondeploy.h" - -#include -#include - -UserRegister::UserRegister(QWidget *parent) - : QDialog(parent), m_isNetReplayCome(-1) -{ - ui.setupUi(this); - JsonDeploy::init(); - - int status = JsonDeploy::getKeyValueFromNumSets(SOFT_STATUS); - - m_regeisterStatus = status; - - if (0 == status) - { - ui.status->setText(tr("Free Trial")); - } - else if (1 == status) - { - ui.status->setText(tr("Registered Version")); - } - else if (2 == status) - { - ui.status->setText(tr("License Expired")); - } - else if (3 == status) - { - ui.status->setText(tr("License Error")); - } - - QString mac = JsonDeploy::getKeyValueFromSets("mac"); - ui.machineId->setText(mac); - - QString softKey = JsonDeploy::getKeyValueFromSets(SOFT_KEY); - if (!softKey.isEmpty() && softKey != "0") - { - ui.licenceKey->setText(softKey); - } - -} - -UserRegister::~UserRegister() -{ - JsonDeploy::close(); -} - -//鏈嶅姟鍣ㄨ繑鍥炶屾潵鐨勬敞鍐岄獙璇佹秷鎭 -void UserRegister::slot_registerReplay(int code) -{ - if (code == 1) - { - //濡傛灉鏄鐗堬紝缁欏嚭姝g増鎻愮ず銆 - ui.status->setText(tr("Registered Version")); - - m_regeisterStatus = 1; - } - else - { - - } - m_isNetReplayCome = code; -} - -void UserRegister::slot_register() -{ - if (m_regeisterStatus == 1) - { - QMessageBox::warning(this, tr("Licence Key"), tr("It is already a registered version.")); - return; - } - - if (ui.licenceKey->text().isEmpty()) - { - QMessageBox::warning(this, tr("Licence Key"), tr("Please scanning the donation, Write your email address in the message area.\nYou will get the registration code!")); - } - else - { - QString key = ui.licenceKey->text(); - if (key.size() != 12) - { - QMessageBox::warning(this, tr("Licence Key"), tr("Please enter the correct registration code!")); - return; - } - - emit signSendRegisterKey(key); - - //QMessageBox::information(this, tr("Licence Key"), tr("Processing succeeded. We will process your registration code in the background. It may take 1-3 days.")); - - QString oldKey = JsonDeploy::getKeyValueFromSets(SOFT_KEY); - if (oldKey.isEmpty() || oldKey == "0" || oldKey != key) - { - JsonDeploy::updataKeyValueFromSets(SOFT_KEY, key); - } - - QEventLoop loop(this); - QTimer::singleShot(5000, &loop, SLOT(quit()));//鍒涘缓鍗曟瀹氭椂鍣紝妲藉嚱鏁颁负浜嬩欢寰幆鐨勯鍑哄嚱鏁 - loop.exec(QEventLoop::ExcludeUserInputEvents); - - //琛ㄧず鏉ヤ簡娑堟伅 - if (m_isNetReplayCome != -1) - { - if (m_isNetReplayCome == 1) - { - QMessageBox::information(this, tr("Licence Key"), tr("Congratulations on your successful registration.")); - } - else - { - QMessageBox::information(this, tr("Licence Key"), tr("Registration failed. Please try again later.")); -} - } - else - { - QMessageBox::information(this, tr("Licence Key"), tr("Registration failed. Please try again later.")); - } - - } -} diff --git a/userregister.h b/userregister.h deleted file mode 100755 index 6786fd9..0000000 --- a/userregister.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include -#include "ui_userregister.h" - -class UserRegister : public QDialog -{ - Q_OBJECT - -public: - UserRegister(QWidget *parent = nullptr); - ~UserRegister(); - -signals: - void signSendRegisterKey(QString key); - -public slots: - void slot_registerReplay(int code); -private slots: - void slot_register(); - - -private: - Ui::UserRegisterClass ui; - int m_isNetReplayCome; - int m_regeisterStatus; -}; diff --git a/userregister.ui b/userregister.ui deleted file mode 100755 index ae7a4ba..0000000 --- a/userregister.ui +++ /dev/null @@ -1,242 +0,0 @@ - - - UserRegisterClass - - - - 0 - 0 - 609 - 395 - - - - - 650 - 400 - - - - UserRegister - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - :/Resources/img/6688.png - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - :/Resources/img/register.png - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - true - - - Status - - - - - - Status - - - - - - - false - - - true - - - - - - - Machine Id - - - - - - - false - - - true - - - - - - - Licence Key - - - - - - - 35 - - - 22874567148 - - - - - - - - - - - - Register - - - - - - - Close - - - - - - - - - <html><head/><body><p>Wechat scans the appreciation code on the left.</p><p>Leave your contact email in the donation message.</p><p>We will send you the registration code later.</p><p><br/></p></body></html> - - - - - - - - - - - - - - clostBt - clicked() - UserRegisterClass - close() - - - 617 - 220 - - - 632 - 256 - - - - - registerBt - clicked() - UserRegisterClass - slot_register() - - - 416 - 220 - - - 437 - 235 - - - - - - slot_register() - - diff --git a/workerthread.cpp b/workerthread.cpp deleted file mode 100755 index fa4652c..0000000 --- a/workerthread.cpp +++ /dev/null @@ -1,20 +0,0 @@ -锘#include "workerthread.h" - - -WorkerThread::WorkerThread(QObject *parent) - : QObject(parent) -{ -} - -WorkerThread::~WorkerThread() -{ -} - -/* 杩欎釜鍑芥暟鏄繍琛屽湪澶氱嚎绋嬮噷闈 */ -void WorkerThread::doWork(std::function fun, void *parameter) -{ - //浠庡闈紶閫掍竴涓嚱鏁拌繘鏉ワ紝鎵ц - int ret = fun(parameter); - - emit resultReady(ret); -} \ No newline at end of file diff --git a/workerthread.h b/workerthread.h deleted file mode 100755 index 84c3057..0000000 --- a/workerthread.h +++ /dev/null @@ -1,19 +0,0 @@ -锘#pragma once - -#include -#include - -class WorkerThread : public QObject -{ - Q_OBJECT - -public: - WorkerThread(QObject *parent=nullptr); - ~WorkerThread(); - -signals: - void resultReady(int); - -public slots: - void doWork(std::function fun, void * parameter); -}; diff --git a/workthreadctl.cpp b/workthreadctl.cpp deleted file mode 100755 index 49e000e..0000000 --- a/workthreadctl.cpp +++ /dev/null @@ -1,29 +0,0 @@ -锘#include "workthreadctl.h" -#include "workerthread.h" - -WorkThreadCtl::WorkThreadCtl(QObject *parent): QObject(parent) -{ - WorkerThread *worker = new WorkerThread; - worker->moveToThread(&workerThread); - - connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater); - - connect(this, &WorkThreadCtl::operate, worker, &WorkerThread::doWork); - - //connect(worker, &WorkerThread::resultReady, this, &WorkThreadCtl::handleResults); - - workerThread.start(); -} - -WorkThreadCtl::~WorkThreadCtl() -{ - workerThread.quit(); - workerThread.wait(); -} - - -//鎻愪氦淇″彿锛屾墽琛屾Ы鍑芥暟鍦ㄥ绾跨▼涓 -void WorkThreadCtl::commitTask(std::function fun, void * parameter) -{ - operate(fun, parameter); -} diff --git a/workthreadctl.h b/workthreadctl.h deleted file mode 100755 index 9399d9f..0000000 --- a/workthreadctl.h +++ /dev/null @@ -1,20 +0,0 @@ -锘#pragma once - -#include -#include - -class WorkThreadCtl : public QObject -{ - Q_OBJECT - -public: - WorkThreadCtl(QObject *parent=nullptr); - ~WorkThreadCtl(); - - void commitTask(std::function fun, void *); - -signals: - void operate(std::function fun, void *); -private: - QThread workerThread; -};