From 414b261c0d28fc546e39bfef123a5925fb0764af Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Fri, 18 Oct 2013 20:49:22 +0200 Subject: [PATCH] Improved tool extraction code in InitializationThread. Also implemented better exception handling. --- etc/Translation/Blank.ts | 12 +-- etc/Translation/LameXP_DE.ts | 8 +- etc/Translation/LameXP_ES.ts | 8 +- etc/Translation/LameXP_FR.ts | 8 +- etc/Translation/LameXP_IT.ts | 4 +- etc/Translation/LameXP_KR.ts | 8 +- etc/Translation/LameXP_PL.ts | 14 ++-- etc/Translation/LameXP_RU.ts | 8 +- etc/Translation/LameXP_SV.ts | 14 ++-- etc/Translation/LameXP_TW.ts | 8 +- etc/Translation/LameXP_UK.ts | 8 +- etc/Translation/LameXP_ZH.ts | 8 +- res/localization/LameXP_DE.qm | Bin 86565 -> 86383 bytes res/localization/LameXP_ES.qm | Bin 88889 -> 88699 bytes res/localization/LameXP_FR.qm | Bin 90227 -> 90031 bytes res/localization/LameXP_KR.qm | Bin 65896 -> 65738 bytes res/localization/LameXP_PL.qm | Bin 87523 -> 87293 bytes res/localization/LameXP_RU.qm | Bin 66567 -> 66365 bytes res/localization/LameXP_SV.qm | Bin 81953 -> 81769 bytes res/localization/LameXP_TW.qm | Bin 59486 -> 59332 bytes res/localization/LameXP_UK.qm | Bin 90156 -> 89934 bytes res/localization/LameXP_ZH.qm | Bin 59440 -> 59286 bytes src/Config.h | 4 +- src/Dialog_MainWindow.cpp | 1 - src/Global.h | 10 +++ src/LockedFile.cpp | 37 ++++----- src/LockedFile.h | 4 +- src/Main.cpp | 12 ++- src/Thread_Initialization.cpp | 137 +++++++++++++++++++--------------- 29 files changed, 166 insertions(+), 147 deletions(-) diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index c353c453..784bec78 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -3290,24 +3290,24 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. - + Executable '%1' requires Qt v%2, but found Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. - - - Executable '%1' requires Windows 2000 or later. + + + Executable '%1' requires Windows XP or later. diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 13a623ca..b0536c8d 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -2586,14 +2586,14 @@ Executable '%1' requires Qt v%2, but found Qt v%3. Programm '%1' benötigt Qt v%2, aber Qt v%3 wurde gefunden. - - Executable '%1' requires Windows 2000 or later. - Programm '%1' benötigt Windows 2000 oder neuer. - Executable '%1' was built for Qt '%2', but found Qt '%3'. Programm '%1' wurde für Qt '%2' erzeugt, aber Qt '%3' gefunden. + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index 6e5a6f9c..4dba2614 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -2585,14 +2585,14 @@ Executable '%1' requires Qt v%2, but found Qt v%3. El ejecutable '%1'requiere Qt v%2, pero se ha encontrado v%3. - - Executable '%1' requires Windows 2000 or later. - El ejecutable '%1'requiere Windows 2000 o superior. - Executable '%1' was built for Qt '%2', but found Qt '%3'. El ejecutable '%1'fue creado con Qt '%2', pero se ha encontrado Qt '%3'. + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index b2523fc2..26fa1b13 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -2596,14 +2596,14 @@ Ouvrir le dossier récursivement... Executable '%1' requires Qt v%2, but found Qt v%3. L'éxécutable %1 nécessite Qt v%2, mais Qt v%3 trouvé. - - Executable '%1' requires Windows 2000 or later. - L'exécutable '%1' nécessite Windows 2000 ou supérieur. - Executable '%1' was built for Qt '%2', but found Qt '%3'. L'exécutable '%1' a été construit pour Qt '%2', mais a trouvé Qt '%3'. + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index 97e85ca9..b1476db2 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -2587,11 +2587,11 @@ - Executable '%1' requires Windows 2000 or later. + Executable '%1' was built for Qt '%2', but found Qt '%3'. - Executable '%1' was built for Qt '%2', but found Qt '%3'. + Executable '%1' requires Windows XP or later. diff --git a/etc/Translation/LameXP_KR.ts b/etc/Translation/LameXP_KR.ts index 6b442d59..bbf1d5af 100644 --- a/etc/Translation/LameXP_KR.ts +++ b/etc/Translation/LameXP_KR.ts @@ -2568,14 +2568,14 @@ Executable '%1' requires Qt v%2, but found Qt v%3. '%1'의 실행은 Qt v%2가 요구됩니다. 하지만 Qt v%3이 발견되었습니다. - - Executable '%1' requires Windows 2000 or later. - '%1'의 실행은 윈도우 2000 또는 상위 버전이 필요합니다. - Executable '%1' was built for Qt '%2', but found Qt '%3'. '%1'의 실행은 Qt '%2'용으로 제작되었습니다. 하지만 Qt v%3이 발견되었습니다. + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts index 0b93eb51..3c7156ba 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -3327,25 +3327,25 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. Plik wykonywalny '%1' nie działa w trybie kompatybilności z Windows. - + Executable '%1' requires Qt v%2, but found Qt v%3. Plik wykonywalny '%1' wymaga Qt v%2, znaleziono jednak Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. Plik wykonywalny "%1" został skompilowany dla Qt "%2", znaleziono "%3". - - - Executable '%1' requires Windows 2000 or later. - Plik wykonywalny '%1' wymaga do uruchomienia Windows 2000 lub nowszego. + + + Executable '%1' requires Windows XP or later. + diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts index 8dab2bc4..99f7058f 100644 --- a/etc/Translation/LameXP_RU.ts +++ b/etc/Translation/LameXP_RU.ts @@ -2610,14 +2610,14 @@ Executable '%1' requires Qt v%2, but found Qt v%3. Исполняемому файлу '%1' требуется версия Qt v%2, но найдена версия v%3. - - Executable '%1' requires Windows 2000 or later. - Исполняемому файлу '%1'требуется Windows 2000 или новее. - Executable '%1' was built for Qt '%2', but found Qt '%3'. Исполняемый файл '%1' был собран для Qt '%2', но найдена версия Qt '%3'. + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts index f0b58993..c93276de 100644 --- a/etc/Translation/LameXP_SV.ts +++ b/etc/Translation/LameXP_SV.ts @@ -3310,25 +3310,25 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. EXE-filen '%1' stöder inte Windows kompatibilitetsläge. - + Executable '%1' requires Qt v%2, but found Qt v%3. EXE-filen '%1' kräver Qt v%2, du har Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. EXE-filen '%1' är byggd för Qt '%2', du har Qt '%3'. - - - Executable '%1' requires Windows 2000 or later. - EXE-filen '%1' kräver Windows 2000 eller senare. + + + Executable '%1' requires Windows XP or later. + diff --git a/etc/Translation/LameXP_TW.ts b/etc/Translation/LameXP_TW.ts index 9873cfdc..fd59f825 100644 --- a/etc/Translation/LameXP_TW.ts +++ b/etc/Translation/LameXP_TW.ts @@ -2567,14 +2567,14 @@ Executable '%1' requires Qt v%2, but found Qt v%3. 可執行文件 '%1' 需要 Qt v%2, 但發現 Qt v%3. - - Executable '%1' requires Windows 2000 or later. - 可執行文件 '%1' 需要 Windows 2000 或更高版本. - Executable '%1' was built for Qt '%2', but found Qt '%3'. 可執行文件 '%1'為Qt '%2',但發現Qt'%3'. + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts index cfacc0e5..f1c5badf 100644 --- a/etc/Translation/LameXP_UK.ts +++ b/etc/Translation/LameXP_UK.ts @@ -2604,14 +2604,14 @@ Executable '%1' requires Qt v%2, but found Qt v%3. Додаток '%1' вимагає для роботи Qt v%2, але знайдено Qt v%3. - - Executable '%1' requires Windows 2000 or later. - Додаток '%1' вимагає для роботи Windows 2000 або пізніші версії ОС. - Executable '%1' was built for Qt '%2', but found Qt '%3'. Додаток '%1' був створений для Qt '%2', але знайдено Qt '%3'. + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/etc/Translation/LameXP_ZH.ts b/etc/Translation/LameXP_ZH.ts index 25b23c66..3783a5ed 100644 --- a/etc/Translation/LameXP_ZH.ts +++ b/etc/Translation/LameXP_ZH.ts @@ -2567,14 +2567,14 @@ Executable '%1' requires Qt v%2, but found Qt v%3. 可执行文件 '%1' 需要 Qt v%2, 但发现 Qt v%3。 - - Executable '%1' requires Windows 2000 or later. - 可执行文件 '%1' 需要 Windows 2000 或更高版本。 - Executable '%1' was built for Qt '%2', but found Qt '%3'. 可执行文件 '%1'由Qt '%2'创建,但发现Qt'%3'。 + + Executable '%1' requires Windows XP or later. + + ShellIntegration diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index 1b7eaf1cd859918f53b8f3bf52e4c4a81d757b49..b82fdbe86830e9dff9df72dd4be05fc604b1cd29 100644 GIT binary patch delta 322 zcmV-I0logEqy_Jy1&|a0Sg{os0Raq?Edd?^Ec%m80X70ORg;AQUII9ZljQ+^8Y+hY z6ul<^0A`f|6*>|C04^p07l7da0WKGleFDA$H^7rU13v*WlYIkr0yc${^#hjyN|TKQ zF98XYy#(e0Ftd}T1*a(}1WY|M004(E1W<>S005`m1Xg`~00Awj1Z*2l0063#1afte z00BGTvvmdr0Rk@5lYIvt0V0!~2jR1Z2sHr;GW`aDtqTg-+0W31hA~ UJobZn6t{X50Zu8mc0K{G6We}ccmMzZ delta 451 zcmW+vPe@a79RGfQd)v&R8~ei`X}wF0k-oicZ7%8Q$wSekORY=Na!-3O-tcX&CG^4} zGCdT*VpW?{rKoh zAc**lhA_m2K2io#ENP=foMboB^c!DXyp}|NHw-Ynf`Jh)fN&Lq^9O*!78z`lrB#w_ zWB7{<+fz22pc7jiPw6EW#SV43Ll(=?y1g0MfK4xlJf_riNTqldk1 zHW)GkE`hQ52O962!LQWn+hxglTI_FoQ%kN!s0J`Q=UUxY0S8abjN7_MU#EMXCjK+e zJR1x*spS*A;& z)q@gxXR@Gx3VA3(1xmm}9K>_-R+9%AG^XqT|oxDZQL~T#)(jl~|b9 l diff --git a/res/localization/LameXP_ES.qm b/res/localization/LameXP_ES.qm index f18e57646d14859e966dd1a587834df174dd7beb..4efe025f88e639759ea5c8f4dded0bd7c07b07d6 100644 GIT binary patch delta 321 zcmV-H0lxmZwgvmN1&|a0Sg{os0Ra?~Edd_^8k0={HUd1ylZ63Z0zsIQS006H)1Xg`~00A|{1Z*2l006Qk1afte z00Bhuvvmds0RaP(eFq)_G5nLA2jR1Z2sQx;Lk5AZ(f|QBl9R;=o&q_glVu9F0yB2A z9Sbi40YH;Y4QBxoleG=j0zF=njSjXFK9UQa9)|z`chd`^-);Z_G(@vi4+a4OKw^_! z5T^k}vjq{a0s#_}wG%H991m!j5C8yE4G(Ep#{dC60h9F;b`Lyo59oA>004?#X#fF6 T0)u)Kw|W!-7BRO*Mgj8_jdNYq delta 431 zcmW+vT}V@L96i7P?l$LGTl3yb1G`U4q}pwhErq*HXa$bgwZSC%JkG81s3UDm_Ed`Y@8w+NKtQlD|xTA7hXPxJt50V$hX z03~0UIfs*IgAHes2(59^x$7)mih<7gO`|4Cu3wG^t2?0cU0iiN7wv;QR9hCUr%lBj z6!epmp4-;_s^_za$vk_c?2mW3i%oMt{*(K~*EFd0x7qD=kmxwhSA8pVX#Vk)#J@^i z@aT^B&NCm->+z-rK7jNJAJk1B(*xf9sYk%$>nYI1bsKUkwO~7$RLkNs0cy(57ly1%gJFJBgk5*jHPF5tR*-s1`CNKH7Nb5^l&CWsfIL7 SQ!`n0^ybt^wla~VTIDbK6?|C05H-47l7da0Xl<|eFDD$Fq1t4J_0$clYIkr0z>1I^#hgyHGGqe z1TF$Mfs?%i<^nyTlcfcx0UDD{1{V<@1Z*2l006Rr1afte00Bx8vvmdr0RlT+lYIvs z0ybikod@Bwh6pYJ2>}Lytr`0zT%GMGa>G7L%004?NX#fFBK7(=;w{jE#fHk+SN&&?c DZS`Jv delta 448 zcmZ3#pY`(r)(Ikv5gSFt7?~`sChIcFF^u21e7G&9xl*jGTMf8rNQ8V6=HMc`N69#?O;OxwbJ`%-GD!t;fV< zzi6^8Z#v_p$xC^!GoG4U%eP(d6Zc%Xb_Ry>)7*>h=P@u^W^H!m2U_5|ZL+Vxa>l)z zzY45lV)9rtd8x3TkZlTo#!LYQh9F7)%!uO*j84^)p9+`r-Qa&w(#gQkWuD2v=>4lX zOJsYN2xEgOW6t!~o{XyXc?>TZk{MDNih(ebp#;cMUPfs=g#z5?i)lRX1I0^sVCeFJs^=ev{j1C|2arjv~X zF9AK1y#(e0!!1H1_uEF3zK~Z9|2^O zod@Bwh6pYJ2@?i^tbcp}}W(#Qm0PJA1aullFv$FEG4m)9LIsgCw delta 395 zcmV;60d)S#fduG+1dtQ~Sg{os0RfzoEdd?^;Z~DP0XG4qlZ63a0oaq}0e%|aWdRhu zCjbCZuK^W05&!@wBmozI;Q#>Q7n6Mgz5?kmlRX1I0^xv@eFJs^=uwmP1C|2bJd=$C zF9Fk&y#(e0^!q|1_uEFp_6?F9|8K4 zod@9uok>0b0NtjueF!fB38@Bwth*%uLM?od;kG4Qv_@qP5=O| zjs$XbkpKZdva@vt1_1&xbCZ1s9s(`Slbr|IvwjFI0SY#$27#^800A==leGz#0T+`^ z3a$b#NVEM4CISLAu9GDVW&%F&lZ_450yuz^We&CyIhG5Z9)|z`c$W*J-);Z_FZQ!7 z4+a4OJ1CPi5T^khv)vG`0s=kylZ_K55;KGkXqgZI08_#bX;{Yq0XQp@#S?Z9H>?ln dbcp}}iM?q60YI#SN))$B6afw`w>ClntrPQ2XZ`>H delta 506 zcmXXjDuXT_auFX$ZA1bs2vHEhi-?MfJ&1@{ym>JvDflZgd^7XSH{Z<81M9an>#7%} z$DLisq&pNsAB$e0BiPRpTU5p=mOMz`@%-+{5PBN{0QC@d4!Qy2fZZ3r0>)OT#GbO@ z6eTSw7JWh`%N!euP}6dggrIEBvHoS++kTRzUsJjLBO92a$&L;8V6m<0s{kyRZMVOufYSSV zkCQ(cwo%A+AAi?BxN3~0K2h1@clYI-v$tFT$DccuiI;!_t<><$btRUZKZ=V0iwy-Z zvt$8)AdJzgMDJzYyQzEebI`1&(P3U4!Hx?vPyi7O&^V@Hmb25KfD9_nS+0!ps>0u` zdC)nJf%Gp#$a6=IPt^a~S?)T;`)~{Y2sVz$=z=_L6tlU!ECza_0a26B7>XwA;<%#D d6y|j?wo8&Ev7m|hY*E(CoeXww1~d59^9PR+kX8Ty diff --git a/res/localization/LameXP_RU.qm b/res/localization/LameXP_RU.qm index 1bdbc4627c8747c453b2b11b5ba996198ead59ac..bc11ca25bf9c888bea4158f557d07e275b01972d 100644 GIT binary patch delta 335 zcmV-V0kHmuhy=Zc1dtQ~kdYO}0^(7T-5&uhk^L_LB$F)xMgs1QlXU@R0^rh<-2oQ? zB$M?4egf@(lXU_%0^?zmtpZL0>|m4q0*)HrWdi|YWdHza9s>_9z5oE;eghkQ{r~{s za+9S4o&x67lSKr6BIaKNOg%FI0A7RyR(*T`0OQC6Y#UAh0DVdXa&?ga0P%~Hj{0082HlU)q%0_{VSO$~nmEVIoGHUa|g>yrf#E)wPM4``VX001>H4{2D(008P- hlSL3-59!4Z=yZty09%r2008oVv$7Cr-?QEDDif(5fYty2 delta 452 zcmW-YUuaTs9L3M?=T|41T$zrjf!&PgY0g=WK{#^5{^1-1ZG&JD&Dw>b;AVT7Mo?Kn zW4CWcJ#37im*55=1U=N-)&a=lnuv9AhQ)A^wzA%7LQ?06%0E_2cOs{Q+Q=c2Cw#J$evl@zcM!zreR$RSO{xrC$1lp^wmC0vrAl##9V;_JWA4lBd%C~}2o4F5MdZYongQb^l zts*kq)d|C057%y7l7da0UZ&OeFDA$CH9j&13v*ulYIkr0wmXy^#hgy7^0Jn z1TF#^Ws|)G<^mtNlcfcxDMkcLJu?6RgDC`1hm`;Tqa_4ZeS81`9Ipgy8%_WKrO*U& zb&&u8Dh{)C1_l8F9nF({2Oa_$WRsl-;j@MaEddH4u?B&y(f|P-ev`ckp8-XaT?)1W z8osj?3oZfzAkLFT4QByPldTQb0wY+Hg$}n7E(@I=hX4R>=L@3WZU6xrh_g)(1_1&k z#FJGJrUEBnv;7dS0s%OatrIR19_$ZjnGgT~Oyv)0SjPYXBOR0N6Lt?Gq7UeFi2wk9 Y(`f(!D)@tP6t{8|0j3zY$Sna`5*x*3NdN!< delta 443 zcmV;s0Yv`k{sf_b1&|a0Sg{or0RkKdlPv)s0m_q20X707k&}f1UIHh8ljQ+^8XAcK z6ul<^0A$?(6*>|C057%y7l7da0Ug1UeFDA$CZ>};13v-!lYIkr0wsr&^#hgy8B&vt z1TF#_6_dRL<^mvTlcfcxDfR?RJu?6RgDC`1hm`;Tqa_4ZeS81`9bW`&8%_WKrO*U& zb&&u8D!#LI1_l8F9(|L22Oa_%6qB6?;Rl^bJ^%q2qO*MnE&&Q6VFrP%(f|P;E|awh zp8@rgRSLEO8*Z}=3oZfzA%2rR4QB!Vlcf#T0wf5NeGaz~-V2=`hX4R>=L@3WZU6xs zII~3$1_1&lbdyaGrUEDtv-J?K0s-igr4ud^ADjC lb0Ak~Ze(wFb09J>Ffbr*av*GBbY*gvPAmZzw-7A>SrVT&g2?~? diff --git a/res/localization/LameXP_TW.qm b/res/localization/LameXP_TW.qm index f585e2502e9808264136066c7352f2524690aece..496f8b134bd43e33cb14e69601b71ceb38a619d7 100644 GIT binary patch delta 317 zcmV-D0mA;?&;!KJ1CSH}NU;?b0RqU%lPv)s0cMj;0XG2;lZ63Z0?^8n1%LlRX1I0?Ck*eFJs^&w-Qm1C|2DvXhMj zF98XYy#(e0%j1)!1*R&?k_1dWGXMZx#RO1?l>h*Ae*{*2d;kE+-2`kKP5=OQs04C# zkpKYFy0di#1_1)fjgx%`9|1;_od@Bwh6pYJ2|)&dtj{007AJlT8o*0Vb185T^k- zv-J?J0s_&llcf_c5l#2b_1P7($J>_-iZ*dE delta 399 zcmV;A0dW4r&ja4j1CSH}P_Y#j0RqWflPv)s0r-1&|lRX1I0?HzjeFJs^&=ZsO1C|2EM3apK zF9DmAy#(e0%ypBc1*R&@Bm_)7GXMZx#RO1?l>h*Ae*{*2d;kE-Zv<=`P5=OQs04C# zkpKYGOtW0b0LHSjeF!fB3DX9Ftj{007B`lSL2z z0l1Sz5T^mlv+WSB0s_)NlbsVU5#SGKnGgT~H|P&(SjPYW&dZbC6Lt^IW)J9ei2wjw zOKAWA)AX}q6t>2bgW4W1R{&`MZUAHeZvb}ya{wR!G5|0DFaR(BAYv9~^qSamNM|en tE(ibs000I6001wO(ApUlS7~l!Z+CMbGB7YOAa8OYY+-a|a+h}-}G diff --git a/res/localization/LameXP_UK.qm b/res/localization/LameXP_UK.qm index 1cf1825173ac8460e290648949b25afa6284833a..96408eeffb93e9288bb82ec283b3033a5ca0c976 100644 GIT binary patch delta 327 zcmV-N0l5CGzy;2}1&|a0P_Y#k0RaS)Edd?^IrNiF0X70bQImxMUIIoeljQ+^8aIIf z6ul<^0B(Z;6*>|C05ZA(7l7da0XqAWeFDA$MKqH=13v*IlYIkr0z>7K^#hjyCX zF98{oy#(e0J*AVS1*a(_1WY|M0055h1W<>S006La1Xg`~00BCe1Z*2l006U01afte z00Bvmvvmdr0RlU(lYIvs0yg@Sod@Bwh6pVI3P0NhfvwU20X$Tby$PNIJ~NYD3bq0` zhO-q5E&>8RzLP}_W&%jEldTQb0zu%Dg$}n75(}LkhX4S0xeKD-ZU6x}HnU9+1_1&@ z{F7A>rUFLgv;7dR0s=?8ldTgj5B9&mTVw_=Q8&pJ-a2q1hssI|Kw%pF(I$ZK5(aK>0-pLN2CdRrm*}=Q z?uucXq%+I1W2@j_dC2YfTUPiN#coK={_4msXY^wLkN)tv*{1;S%bYcCS|itZ>|j5D znc>pJW5D!?IpJ_1ot_cH8KjPNsX8~E)l>{Ha@aH)Lg?yTaNK#j0jRgihsNg=Z#H@;){2C{64^gfjnUE>*-OYKB{1A z1n*YXQkWRXK^_V)3`LlNGN=#+?Y~vl_$bFfv{EY4XJ|C03&t*7l7da0LlTAeFDD$8k0Q(J_5;blYIks0ZWth1C|2Dj+2c9 zE&|8tlf4Ay0?WITr3I!c%WecrJu?6RUKs>Xhm`;Tbj1W#eS81_$-M+@8%_WKcIpIj zb&&u7(tfjb1_uEFYm003K`X#fDz OB(r)HlE$;1+mZ}#qHD+i delta 402 zcmV;D0d4-4&jYZ~1CSH}V6hbz0RqW7lPv)s0oapG0X728ag&7sUINi1ljQ+^8pss^ z6ul<^07(-86*>|C03&t*7l7da0Lqh-eFDD$tdl(hJ_5=DlYIks0o{}J1C|2EAd`&* zE&|AVlf4Ay0?bX5r3I!c%m4&TJu?6RUKs>Xhm`;Tbj1W#eS81_%1;Dr8%_WKcIpIj zb&&u7(-50b0LG59eF!%J38Myqt z003K`X#fDzwzF~+lE#y7+8!@g0BHbj0Av7f0Cxa$03ZM|05AYB05AX`Visofn%Htk wXDl!R2mk;800sa6056lg+8GsBX>Me1cXJ>zFfcG6Z*m}PVRU73v+dfc48f3uq5uE@ diff --git a/src/Config.h b/src/Config.h index 4d234a5a..097c248b 100644 --- a/src/Config.h +++ b/src/Config.h @@ -33,8 +33,8 @@ #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 9 #define VER_LAMEXP_TYPE Alpha -#define VER_LAMEXP_PATCH 2 -#define VER_LAMEXP_BUILD 1394 +#define VER_LAMEXP_PATCH 3 +#define VER_LAMEXP_BUILD 1398 #define VER_LAMEXP_CONFG 1348 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index f058ffe9..9a353203 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -35,7 +35,6 @@ #include "Dialog_CueImport.h" #include "Dialog_LogView.h" #include "Thread_FileAnalyzer.h" -#include "Thread_FileAnalyzer_ST.h" #include "Thread_MessageHandler.h" #include "Model_MetaInfo.h" #include "Model_Settings.h" diff --git a/src/Global.h b/src/Global.h index a1d45259..ae866f42 100644 --- a/src/Global.h +++ b/src/Global.h @@ -250,3 +250,13 @@ while(0) #error We should not enabled SSE or SSE2 in release builds! #endif #endif + +//Helper macro for throwing exceptions +#define THROW(MESSAGE) throw std::runtime_error((MESSAGE)) +#define THROW_FMT(FORMAT, ...) do \ +{ \ + char error_msg[512]; \ + _snprintf_s(error_msg, 512, _TRUNCATE, (FORMAT), __VA_ARGS__); \ + throw std::runtime_error(error_msg); \ +} \ +while(0) diff --git a/src/LockedFile.cpp b/src/LockedFile.cpp index 588f07bc..09f6b5c9 100644 --- a/src/LockedFile.cpp +++ b/src/LockedFile.cpp @@ -32,6 +32,7 @@ #include #include #include +#include //Windows includes #define NOMINMAX @@ -40,13 +41,6 @@ /////////////////////////////////////////////////////////////////////////////// -#define THROW(STR) \ -{ \ - char error_msg[512]; \ - strcpy_s(error_msg, 512, STR); \ - throw error_msg; \ -} - // WARNING: Passing file descriptors into Qt does NOT work with dynamically linked CRT! #ifdef QT_NODLL static const bool g_useFileDescr = 1; @@ -91,15 +85,14 @@ static QByteArray fileHash(QFile &file) /////////////////////////////////////////////////////////////////////////////// -LockedFile::LockedFile(const QString &resourcePath, const QString &outPath, const QByteArray &expectedHash) +LockedFile::LockedFile(QResource *const resource, const QString &outPath, const QByteArray &expectedHash) { m_fileHandle = NULL; - QResource resource(resourcePath); //Make sure the resource is valid - if(!resource.isValid()) + if(!(resource->isValid() && resource->data())) { - THROW(QString("Resource '%1' is invalid!").arg(QFileInfo(resourcePath).absoluteFilePath().replace(QRegExp("^:/"), QString())).toUtf8().constData()); + THROW_FMT("The resource at %p is invalid!", resource); } QFile outFile(outPath); @@ -116,16 +109,16 @@ LockedFile::LockedFile(const QString &resourcePath, const QString &outPath, cons //Write data to file if(outFile.isOpen() && outFile.isWritable()) { - if(outFile.write(reinterpret_cast(resource.data()), resource.size()) != resource.size()) + if(outFile.write(reinterpret_cast(resource->data()), resource->size()) != resource->size()) { QFile::remove(QFileInfo(outFile).canonicalFilePath()); - THROW(QString("File '%1' could not be written!").arg(QFileInfo(outFile).fileName()).toUtf8().constData()); + THROW_FMT("File '%s' could not be written!", QFileInfo(outFile).fileName().toUtf8().constData()); } outFile.close(); } else { - THROW(QString("File '%1' could not be created!").arg(QFileInfo(outFile).fileName()).toUtf8().constData()); + THROW_FMT("File '%s' could not be created!", QFileInfo(outFile).fileName().toUtf8().constData()); } //Now lock the file! @@ -141,9 +134,7 @@ LockedFile::LockedFile(const QString &resourcePath, const QString &outPath, cons if((m_fileHandle == NULL) || (m_fileHandle == INVALID_HANDLE_VALUE)) { QFile::remove(QFileInfo(outFile).canonicalFilePath()); - char error_msg[512]; - strcpy_s(error_msg, 512, QString("File '%1' could not be locked!").arg(QFileInfo(outFile).fileName()).toLatin1().constData()); - throw error_msg; + THROW_FMT("File '%s' could not be locked!", QFileInfo(outFile).fileName().toUtf8().constData()); } //Open file for reading @@ -172,7 +163,7 @@ LockedFile::LockedFile(const QString &resourcePath, const QString &outPath, cons else { QFile::remove(m_filePath); - THROW(QString("File '%1' could not be read!").arg(QFileInfo(outFile).fileName()).toLatin1().constData()); + THROW_FMT("File '%s' could not be read!", QFileInfo(outFile).fileName().toUtf8().constData()); } //Compare hashes @@ -181,7 +172,7 @@ LockedFile::LockedFile(const QString &resourcePath, const QString &outPath, cons qWarning("\nFile checksum error:\n A = %s\n B = %s\n", expectedHash.constData(), hash.constData()); LAMEXP_CLOSE(m_fileHandle); QFile::remove(m_filePath); - THROW(QString("File '%1' is corruputed, take care!").arg(QFileInfo(resourcePath).absoluteFilePath().replace(QRegExp("^:/"), QString())).toLatin1().constData()); + THROW_FMT("File '%s' is corruputed, take care!", QFileInfo(outFile).fileName().toUtf8().constData()); } } @@ -194,9 +185,7 @@ LockedFile::LockedFile(const QString &filePath) //Make sure the file exists, before we try to lock it if(!existingFile.exists()) { - char error_msg[256]; - strcpy_s(error_msg, 256, QString("File '%1' does not exist!").arg(existingFile.fileName()).toLatin1().constData()); - throw error_msg; + THROW_FMT("File '%s' does not exist!", existingFile.fileName().toUtf8().constData()); } //Remember file path @@ -214,7 +203,7 @@ LockedFile::LockedFile(const QString &filePath) //Locked successfully? if((m_fileHandle == NULL) || (m_fileHandle == INVALID_HANDLE_VALUE)) { - THROW(QString("File '%1' could not be locked!").arg(existingFile.fileName()).toLatin1().constData()); + THROW_FMT("File '%s' could not be locked!", existingFile.fileName().toUtf8().constData()); } } @@ -232,6 +221,6 @@ void LockedFile::selfTest() { if(!QKeccakHash::selfTest()) { - qFatal("QKeccakHash self-test has failed!"); + THROW("QKeccakHash self-test has failed!"); } } diff --git a/src/LockedFile.h b/src/LockedFile.h index 60b224e1..4485bd88 100644 --- a/src/LockedFile.h +++ b/src/LockedFile.h @@ -23,10 +23,12 @@ #include +class QResource; + class LockedFile { public: - LockedFile(const QString &resourcePath, const QString &outPath, const QByteArray &expectedHash = QByteArray()); + LockedFile(QResource *const resource, const QString &outPath, const QByteArray &expectedHash = QByteArray()); LockedFile(const QString &filePath); ~LockedFile(void); diff --git a/src/Main.cpp b/src/Main.cpp index bbbd9a1b..435bdd6f 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -243,17 +243,21 @@ static int _main(int argc, char* argv[]) iResult = lamexp_main(argc, argv); lamexp_finalization(); } + catch(const std::runtime_error &error) + { + fflush(stdout); fflush(stderr); + fprintf(stderr, "\nGURU MEDITATION !!!\n\nException error:\n%s\n", error); + lamexp_fatal_exit(L"Unhandeled C++ exception error, application will exit!"); + } catch(char *error) { - fflush(stdout); - fflush(stderr); + fflush(stdout); fflush(stderr); fprintf(stderr, "\nGURU MEDITATION !!!\n\nException error message: %s\n", error); lamexp_fatal_exit(L"Unhandeled C++ exception error, application will exit!"); } catch(int error) { - fflush(stdout); - fflush(stderr); + fflush(stdout); fflush(stderr); fprintf(stderr, "\nGURU MEDITATION !!!\n\nException error code: 0x%X\n", error); lamexp_fatal_exit(L"Unhandeled C++ exception error, application will exit!"); } diff --git a/src/Thread_Initialization.cpp b/src/Thread_Initialization.cpp index 01e7c5e9..b0b052ce 100644 --- a/src/Thread_Initialization.cpp +++ b/src/Thread_Initialization.cpp @@ -35,6 +35,7 @@ #include #include #include +#include /* helper macros */ #define PRINT_CPU_TYPE(X) case X: qDebug("Selected CPU is: " #X) @@ -50,18 +51,23 @@ static const size_t BUFF_SIZE = 512; class ExtractorTask : public QRunnable { public: - ExtractorTask(const QDir &appDir, const QString &toolName, const QString &toolShortName, const QByteArray &toolHash, const unsigned int toolVersion, const QString &toolTag) + ExtractorTask(QResource *const toolResource, const QDir &appDir, const QString &toolName, const QByteArray &toolHash, const unsigned int toolVersion, const QString &toolTag) : m_appDir(appDir), m_toolName(toolName), - m_toolShortName(toolShortName), m_toolHash(toolHash), m_toolVersion(toolVersion), - m_toolTag(toolTag) + m_toolTag(toolTag), + m_toolResource(toolResource) { /* Nothing to do */ } + ~ExtractorTask(void) + { + delete m_toolResource; + } + static void clearFlags(void) { QMutexLocker lock(&s_mutex); @@ -91,16 +97,27 @@ protected: { if(!getExcept()) doExtract(); } - catch(char *errorMsg) + catch(const std::runtime_error &e) { QMutexLocker lock(&s_mutex); if(!s_bExcept) { s_bExcept = true; - strncpy_s(s_errMsg, BUFF_SIZE, errorMsg, _TRUNCATE); - lock.unlock(); - qWarning("ExtractorTask error:\n%s", errorMsg); + strncpy_s(s_errMsg, BUFF_SIZE, e.what(), _TRUNCATE); } + lock.unlock(); + qWarning("ExtractorTask exception error:\n%s\n\n", e.what()); + } + catch(...) + { + QMutexLocker lock(&s_mutex); + if(!s_bExcept) + { + s_bExcept = true; + strncpy_s(s_errMsg, BUFF_SIZE, "Unknown exception error!", _TRUNCATE); + } + lock.unlock(); + qWarning("ExtractorTask encountered an unknown exception!"); } } @@ -109,28 +126,31 @@ protected: LockedFile *lockedFile = NULL; unsigned int version = m_toolVersion; - QFileInfo customTool(QString("%1/tools/%2/%3").arg(m_appDir.canonicalPath(), QString::number(lamexp_version_build()), m_toolShortName)); + QFileInfo toolFileInfo(m_toolName); + const QString toolShortName = QString("%1.%2").arg(toolFileInfo.baseName().toLower(), toolFileInfo.suffix().toLower()); + + QFileInfo customTool(QString("%1/tools/%2/%3").arg(m_appDir.canonicalPath(), QString::number(lamexp_version_build()), toolShortName)); if(customTool.exists() && customTool.isFile()) { - qDebug("Setting up file: %s <- %s", m_toolShortName.toLatin1().constData(), m_appDir.relativeFilePath(customTool.canonicalFilePath()).toLatin1().constData()); + qDebug("Setting up file: %s <- %s", toolShortName.toLatin1().constData(), m_appDir.relativeFilePath(customTool.canonicalFilePath()).toLatin1().constData()); lockedFile = new LockedFile(customTool.canonicalFilePath()); version = UINT_MAX; s_bCustom = true; } else { - qDebug("Extracting file: %s -> %s", m_toolName.toLatin1().constData(), m_toolShortName.toLatin1().constData()); - lockedFile = new LockedFile(QString(":/tools/%1").arg(m_toolName), QString("%1/lxp_%2").arg(lamexp_temp_folder2(), m_toolShortName), m_toolHash); + qDebug("Extracting file: %s -> %s", m_toolName.toLatin1().constData(), toolShortName.toLatin1().constData()); + lockedFile = new LockedFile(m_toolResource, QString("%1/lxp_%2").arg(lamexp_temp_folder2(), toolShortName), m_toolHash); } if(lockedFile) { - lamexp_register_tool(m_toolShortName, lockedFile, version, &m_toolTag); + lamexp_register_tool(toolShortName, lockedFile, version, &m_toolTag); } } private: + QResource *const m_toolResource; const QDir m_appDir; const QString m_toolName; - const QString m_toolShortName; const QByteArray m_toolHash; const unsigned int m_toolVersion; const QString m_toolTag; @@ -142,9 +162,9 @@ private: }; QMutex ExtractorTask::s_mutex; +char ExtractorTask::s_errMsg[BUFF_SIZE] = {'\0'}; volatile bool ExtractorTask::s_bExcept = false; volatile bool ExtractorTask::s_bCustom = false; -char ExtractorTask::s_errMsg[BUFF_SIZE] = {'\0'}; //////////////////////////////////////////////////////////// // Constructor @@ -203,10 +223,11 @@ void InitializationThread::run() } //Allocate maps - QMap mapChecksum; - QMap mapVersion; - QMap mapCpuType; - QMap mapVersTag; + QQueue queueToolName; + QQueue queueChecksum; + QQueue queueVersInfo; + QQueue queueVersions; + QQueue queueCpuTypes; //Init properties for(int i = 0; true; i++) @@ -217,11 +238,11 @@ void InitializationThread::run() } else if(g_lamexp_tools[i].pcName && g_lamexp_tools[i].pcHash && g_lamexp_tools[i].uiVersion) { - const QString currentTool = QString::fromLatin1(g_lamexp_tools[i].pcName); - mapChecksum.insert(currentTool, QString::fromLatin1(g_lamexp_tools[i].pcHash)); - mapCpuType.insert(currentTool, g_lamexp_tools[i].uiCpuType); - mapVersion.insert(currentTool, g_lamexp_tools[i].uiVersion); - mapVersTag.insert(currentTool, g_lamexp_tools[i].pcVersTag); + queueToolName.enqueue(QString::fromLatin1(g_lamexp_tools[i].pcName)); + queueChecksum.enqueue(QString::fromLatin1(g_lamexp_tools[i].pcHash)); + queueVersInfo.enqueue(QString::fromLatin1(g_lamexp_tools[i].pcVersTag)); + queueCpuTypes.enqueue(g_lamexp_tools[i].uiCpuType); + queueVersions.enqueue(g_lamexp_tools[i].uiVersion); } else { @@ -229,8 +250,6 @@ void InitializationThread::run() } } - QDir toolsDir(":/tools/"); - QList toolsList = toolsDir.entryInfoList(QStringList("*.*"), QDir::Files, QDir::Name); QDir appDir = QDir(QCoreApplication::applicationDirPath()).canonicalPath(); QThreadPool *pool = new QThreadPool(); @@ -246,34 +265,42 @@ void InitializationThread::run() const long long timeExtractStart = lamexp_perfcounter_value(); //Extract all files - while(!toolsList.isEmpty()) + while(!(queueToolName.isEmpty() || queueChecksum.isEmpty() || queueVersInfo.isEmpty() || queueCpuTypes.isEmpty() || queueVersions.isEmpty())) { - try + const QString toolName = queueToolName.dequeue(); + const QString checksum = queueChecksum.dequeue(); + const QString versInfo = queueVersInfo.dequeue(); + const unsigned int cpuType = queueCpuTypes.dequeue(); + const unsigned int version = queueVersions.dequeue(); + + const QByteArray toolHash(checksum.toLatin1()); + if(toolHash.size() != 96) { - QFileInfo currentTool = toolsList.takeFirst(); - QString toolName = currentTool.fileName().toLower(); - QString toolShortName = QString("%1.%2").arg(currentTool.baseName().toLower(), currentTool.suffix().toLower()); - - QByteArray toolHash = mapChecksum.take(toolName).toLatin1(); - unsigned int toolCpuType = mapCpuType.take(toolName); - unsigned int toolVersion = mapVersion.take(toolName); - QString toolVersTag = mapVersTag.take(toolName); - - if(toolHash.size() != 96) - { - throw "The required checksum is missing, take care!"; - } - - if(toolCpuType & cpuSupport) - { - pool->start(new ExtractorTask(appDir, toolName, toolShortName, toolHash, toolVersion, toolVersTag)); - } - } - catch(char *errorMsg) - { - qFatal("At least one of the required tools could not be initialized:\n%s", errorMsg); + qFatal("The checksum for \"%s\" has an invalid size!", toolName.toUtf8().constData()); return; } + + QResource *resource = new QResource(QString(":/tools/%1").arg(toolName)); + if(!(resource->isValid() && resource->data())) + { + LAMEXP_DELETE(resource); + qFatal("The resource for \"%s\" could not be found!", toolName.toUtf8().constData()); + return; + } + + if(cpuType & cpuSupport) + { + pool->start(new ExtractorTask(resource, appDir, toolName, toolHash, version, versInfo)); + continue; + } + + LAMEXP_DELETE(resource); + } + + //Sanity Check + if(!(queueToolName.isEmpty() && queueChecksum.isEmpty() && queueVersInfo.isEmpty() && queueCpuTypes.isEmpty() && queueVersions.isEmpty())) + { + qFatal("Checksum queues *not* empty fater verification completed. Take care!"); } //Wait for extrator threads to finish @@ -295,20 +322,8 @@ void InitializationThread::run() return; } - //Make sure all files were extracted - if(!mapChecksum.isEmpty()) - { - qFatal("At least one required tool could not be found:\n%s", toolsDir.filePath(mapChecksum.keys().first()).toLatin1().constData()); - return; - } - qDebug("All extracted.\n"); - //Clean-up - mapChecksum.clear(); - mapVersion.clear(); - mapCpuType.clear(); - //Using any custom tools? if(ExtractorTask::getCustom()) {