Debian Codegraph @

src/executenow.cpp

raw symbols SCIP
1 /* ---------------------------------- executenow.cpp ---------------------------------------------------------------------------
2 do everything that deals with commands (rsync & others) execution
3
4 ===============================================================================================================================
5 ===============================================================================================================================
6 This file is part of "luckyBackup" project
7 Copyright, Loukas Avgeriou
8 luckyBackup is distributed under the terms of the GNU General Public License
9 luckyBackup is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 luckyBackup is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with luckyBackup. If not, see <http://www.gnu.org/licenses/>.
21
22
23 project version : Please see "main.cpp" for project version
24
25 developer : luckyb
26 last modified : 22 May 2016
27 ===============================================================================================================================
28 ===============================================================================================================================
29 ********************************** DO NOT FORGET TO CHANGE "commandline.cpp:rsyncIT()" ********************************************************
30 */
31
32 #include <iostream> // cout
33 using namespace std;
34 #include <math.h> // pow
35
36 #include <QProcess>
37 #include <QTextCodec>
38 #include <QTextStream>
39 #include <QTime>
40 #include <QToolBar>
41
42 #include "global.h"cxx . . $ `<file>/src/global.h`/
43 #include "luckybackupwindow.h"cxx . . $ `<file>/src/luckybackupwindow.h`/
44 #include "operationClass.h"cxx . . $ `<file>/src/operationClass.h`/
45
46 QProcesscxx . . $ QProcess# *syncProcesscxx . . $ syncProcess.;
47 QTimecxx . . $ QTime# StartTimecxx . . $ StartTime.(0,0,0,0); //find out elapsed time from these;
48
49 // executeNOW=================================================================================================
50 // executes rsync (& other commands )and displays progress.
51 void luckyBackupWindowcxx . . $ luckyBackupWindow#::executeNOWcxx . . $ luckyBackupWindow#executeNOW(49f6e7a06ebc5aa8). ()
52 {
53 //Variables initialization
54 // do NOT intitialise specific task variables here. Use the executeBeforeTask() function instead
55
56 NOWexecutingcxx . . $ luckyBackupWindow#NOWexecuting. = true; //this is mainly used if the window close button (or alt+F4) is pressed
57 ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed. = false; //becomes true if abort button pressed
58 //change gui to execute mode !!
59 guiModeNormalcxx . . $ luckyBackupWindow#guiModeNormal. = false;
60
61 (uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->documentcxx . . $ QTextEdit#document(f21741221844491e).())->setMaximumBlockCountcxx . . $ QTextDocument#setMaximumBlockCount(d4f767463ce0a6b3).(50000); // set the maximum block count for the output window to avoid freezing
62
63 swapGUIcxx . . $ luckyBackupWindow#swapGUI(7df51288a9ebd664).("execution"cxx . . $ QString#QString(85c52e162fed56f9).);
64 uicxx . . $ luckyBackupWindow#ui..AbortButtoncxx . . $ Ui_luckyBackupWindow#AbortButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
65 uicxx . . $ luckyBackupWindow#ui..DoneButtoncxx . . $ Ui_luckyBackupWindow#DoneButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
66 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput. -> setTextcxx . . $ QTextEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
67
68 outputStringcxx . . $ luckyBackupWindow#outputString. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
69 outputErrorcxx . . $ luckyBackupWindow#outputError. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
70 calculatingcxx . . $ luckyBackupWindow#calculating. = false; //these 3 bools are used to diplay progress of rsync at the info window
71 transferringcxx . . $ luckyBackupWindow#transferring. = false;
72 deletingcxx . . $ luckyBackupWindow#deleting. = false;
73 ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore.=false;
74 ExecuteBeforeExitedErrorcxx . . $ luckyBackupWindow#ExecuteBeforeExitedError. = false;
75 ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError. = false;
76 StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution. = false;
77 ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter.=false;
78 writeToLogcxx . . $ Global/writeToLog.=false;
79 errorsFoundcxx . . $ Global/errorsFound. = 0; //total error founds during profile execution
80 filesTransferedcxx . . $ Global/filesTransfered. = 0; //total bytes transfered during profile execution
81 bytesTransferedcxx . . $ Global/bytesTransfered. = 0; //total bytes transfered during profile execution
82 countcxx . . $ luckyBackupWindow#count. = 0;
83 currentAftercxx . . $ luckyBackupWindow#currentAfter. = 0;
84 currentBeforecxx . . $ luckyBackupWindow#currentBefore. = 0;
85 errorCountcxx . . $ luckyBackupWindow#errorCount. = 0; //errors found during task execution
86 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. = 0;
87 repeatOnFailMaxcxx . . $ luckyBackupWindow#repeatOnFailMax. = 0;
88
89 //initiate tray icon
90 if (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ())
91 {
92 createTrayIconcxx . . $ luckyBackupWindow#createTrayIcon(49f6e7a06ebc5aa8).(); //create the tray icon
93 LBtraycxx . . $ luckyBackupWindow#LBtray. -> showcxx . . $ QSystemTrayIcon#show(49f6e7a06ebc5aa8).(); // show the tray icon
94 }
95 //display a popup baloon
96 trayMessagecxx . . $ luckyBackupWindow#trayMessage. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("execution of profile:","tray message - execution of profile: <PROFILENAME> in progress...") +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
97 profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("in progress...","tray message - execution of profile: <PROFILENAME> in progress...");
98 if (DryRuncxx . . $ Global/DryRun.)
99 trayMessagecxx . . $ luckyBackupWindow#trayMessage..appendcxx . . $ QString#append(6a89d0b7f4d2681c).("\n(" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("simulation mode") +cxx . . $ operator+(3d22f08efddf8107). ")");
100 if ( (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ()) && (QSystemTrayIconcxx . . $ QSystemTrayIcon#::supportsMessagescxx . . $ QSystemTrayIcon#supportsMessages(c9857a73d68e59ba). ()) )
101 {
102 if (KDErunningcxx . . $ Global/KDErunning.)
103 {
104 QProcesscxx . . $ QProcess# *dialogProcess; dialogProcess = new QProcesscxx . . $ QProcess#(this);
105 QStringListcxx . . $ QStringList# dialogArgscxx . . $ QStringList#QStringList(ced63f7c635d850d).; dialogArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--title"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). appNamecxx . . $ Global/appName. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--passivepopup"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). trayMessagecxx . . $ luckyBackupWindow#trayMessage. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "10"cxx . . $ QString#QString(85c52e162fed56f9).;
106 dialogProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). ("kdialog"cxx . . $ QString#QString(85c52e162fed56f9).,dialogArgs);
107 }
108 else
109 LBtraycxx . . $ luckyBackupWindow#LBtray. -> showMessagecxx . . $ QSystemTrayIcon#showMessage(d234e6c04c1013f3). (appNamecxx . . $ Global/appName., trayMessagecxx . . $ luckyBackupWindow#trayMessage., QSystemTrayIconcxx . . $ QSystemTrayIcon#::Informationcxx . . $ QSystemTrayIcon#Information.,3000);
110 }
111 //Initialize shhutdown button
112 uicxx . . $ luckyBackupWindow#ui..pushButton_shutdowncxx . . $ Ui_luckyBackupWindow#pushButton_shutdown. -> setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
113
114 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uicxx . . $ luckyBackupWindow#ui..AbortButtoncxx . . $ Ui_luckyBackupWindow#AbortButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( abortPressed() ) ); //connect abort pushButton SLOT ----------------
115 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uicxx . . $ luckyBackupWindow#ui..DoneButtoncxx . . $ Ui_luckyBackupWindow#DoneButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( donePressed() ) ); //connect done pushButton SLOT ----------------
116
117 /* if (WINrunning) // disable VSS until...
118 {
119 vssTimer= new QTimer(this);
120
121 pipeVssFile = new QFile(tempDirPath+SLASH+"qt_tempvss"+QString::number(qrand() % (999998) + 1));
122 if (pipeVssFile->open(QIODevice::ReadWrite))
123 {
124 pipeVssFile->close();
125 // if (pipeVssFile->open(QIODevice::ReadOnly | QIODevice::Text))
126 // connect(pipeVssFile,SIGNAL(readyRead()),this,SLOT(appendRsyncVssOutput()));
127 }
128 pipeVssErrFile = new QFile(tempDirPath+SLASH+"qt_tempvsserr"+QString::number(qrand() % (999998) + 1));
129 if (pipeVssErrFile->open(QIODevice::ReadWrite)){
130 pipeVssErrFile->close();
131 // if (pipeVssErrFile->open(QIODevice::ReadOnly | QIODevice::Text))
132 // connect(pipeVssErrFile,SIGNAL(readyRead()),this,SLOT(appendRsyncVssOutput()));
133 }
134 if (Operation[currentOperation]->GetOptionsVss())
135 {
136 connect (vssTimer,SIGNAL(timeout()),this,SLOT(appendRsyncVssOutput()));
137 vssTimer->start(vssSleepTime);
138 }
139 }*/
140
141 syncProcesscxx . . $ syncProcess. = new QProcesscxx . . $ QProcess#(this); //create a new qprocess (for rsync) & connect signals
142 connectcxx . . $ QObject#connect(158df1d9a01a3410).(syncProcesscxx . . $ syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(readyReadStandardError()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(appendRsyncOutput()));
143 connectcxx . . $ QObject#connect(158df1d9a01a3410).(syncProcesscxx . . $ syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(readyReadStandardOutput()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(appendRsyncOutput()));
144 connectcxx . . $ QObject#connect(158df1d9a01a3410).(syncProcesscxx . . $ syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (finished(int, QProcess::ExitStatus)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(procFinished()));
145 connectcxx . . $ QObject#connect(158df1d9a01a3410).(syncProcesscxx . . $ syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (error(QProcess::ProcessError)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(procError()));
146
147 if (silentModecxx . . $ Global/silentMode.)
148 minimizeTraycxx . . $ luckyBackupWindow#minimizeTray(49f6e7a06ebc5aa8).();
149
150 //rsync command & arguments initiation
151 commandcxx . . $ luckyBackupWindow#command. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). rsyncCommandPathcxx . . $ Global/rsyncCommandPath.;
152 rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
153 syncABcxx . . $ luckyBackupWindow#syncAB. = true;
154
155 StartTimecxx . . $ StartTime..startcxx . . $ QTime#start(49f6e7a06ebc5aa8).(); //start the timer to measure elapsed time
156
157 currentOperationcxx . . $ Global/currentOperation. = 0;
158
159 //increase currentOperation until first operation to be executed (execute tasks with a "by-pass WARNING option too)
160 while ( (currentOperationcxx . . $ Global/currentOperation. < TotalOperationscxx . . $ Global/TotalOperations.) && (!Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetPerformcxx . . $ operation#GetPerform(50ce9a9e25b4a850).()) )
161 currentOperationcxx . . $ Global/currentOperation.++;
162
163 executeBeforeTaskcxx . . $ luckyBackupWindow#executeBeforeTask(49f6e7a06ebc5aa8).(); //execute pre-task commands if any
164 }
165
166 // swapGUI=====================================================================================================
167 //swaps the gui mode from normal to execute
168 void luckyBackupWindowcxx . . $ luckyBackupWindow#::swapGUIcxx . . $ luckyBackupWindow#swapGUI(7df51288a9ebd664).(QStringcxx . . $ QString# GUImode)
169 {
170 if (GUImode ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "execution") //change gui to execution mode
171 {
172 uicxx . . $ luckyBackupWindow#ui..pushButton_startcxx . . $ Ui_luckyBackupWindow#pushButton_start. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
173 uicxx . . $ luckyBackupWindow#ui..listWidget_operationscxx . . $ Ui_luckyBackupWindow#listWidget_operations. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
174 uicxx . . $ luckyBackupWindow#ui..textBrowser_infocxx . . $ Ui_luckyBackupWindow#textBrowser_info. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
175 uicxx . . $ luckyBackupWindow#ui..label_TaskListcxx . . $ Ui_luckyBackupWindow#label_TaskList. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("commands output","output window label"));
176 uicxx . . $ luckyBackupWindow#ui..frame_operationscxx . . $ Ui_luckyBackupWindow#frame_operations. -> setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("rsync and pre/post task commands output is displayed here","tooltip"));
177
178 uicxx . . $ luckyBackupWindow#ui..pushButton_upcxx . . $ Ui_luckyBackupWindow#pushButton_up. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
179 uicxx . . $ luckyBackupWindow#ui..pushButton_downcxx . . $ Ui_luckyBackupWindow#pushButton_down. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
180 uicxx . . $ luckyBackupWindow#ui..label_includecxx . . $ Ui_luckyBackupWindow#label_include. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
181 uicxx . . $ luckyBackupWindow#ui..menuFilecxx . . $ Ui_luckyBackupWindow#menuFile. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
182 uicxx . . $ luckyBackupWindow#ui..menu_Taskcxx . . $ Ui_luckyBackupWindow#menu_Task. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
183 languageMenucxx . . $ luckyBackupWindow#languageMenu. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
184 settingsMenucxx . . $ luckyBackupWindow#settingsMenu. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
185 helpMenucxx . . $ luckyBackupWindow#helpMenu. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
186 if (!runImmediatelycxx . . $ Global/runImmediately.)
187 IsVisibleProfileToolbarcxx . . $ luckyBackupWindow#IsVisibleProfileToolbar. = profileToolbarcxx . . $ luckyBackupWindow#profileToolbar. -> isVisiblecxx . . $ QWidget#isVisible(50ce9a9e25b4a850).();//hold the visibility state of this toolbar
188 profileToolbarcxx . . $ luckyBackupWindow#profileToolbar. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
189 profileComboToolbarcxx . . $ luckyBackupWindow#profileComboToolbar. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
190 uicxx . . $ luckyBackupWindow#ui..comboBox_profilecxx . . $ Ui_luckyBackupWindow#comboBox_profile. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
191 uicxx . . $ luckyBackupWindow#ui..groupBox_taskcxx . . $ Ui_luckyBackupWindow#groupBox_task. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
192 uicxx . . $ luckyBackupWindow#ui..checkBox_DryRuncxx . . $ Ui_luckyBackupWindow#checkBox_DryRun. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
193 uicxx . . $ luckyBackupWindow#ui..pushButton_exitcxx . . $ Ui_luckyBackupWindow#pushButton_exit. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
194 uicxx . . $ luckyBackupWindow#ui..labelcxx . . $ Ui_luckyBackupWindow#label. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
195
196 uicxx . . $ luckyBackupWindow#ui..AbortButtoncxx . . $ Ui_luckyBackupWindow#AbortButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
197 uicxx . . $ luckyBackupWindow#ui..DoneButtoncxx . . $ Ui_luckyBackupWindow#DoneButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
198 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
199 //ui.pushButton_InfoCollapse -> setChecked(!IsVisibleInfoWindow);
200 shutdownToolbarcxx . . $ luckyBackupWindow#shutdownToolbar.-> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
201 if ( (KDErunningcxx . . $ Global/KDErunning.) || (currentUsercxx . . $ Global/currentUser. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "super user") )
202 shutdownToolbarcxx . . $ luckyBackupWindow#shutdownToolbar.-> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
203 else
204 shutdownToolbarcxx . . $ luckyBackupWindow#shutdownToolbar.-> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
205 uicxx . . $ luckyBackupWindow#ui..nowDoingcxx . . $ Ui_luckyBackupWindow#nowDoing. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (IsVisibleInfoWindowcxx . . $ luckyBackupWindow#IsVisibleInfoWindow.);
206 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
207 if (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ())
208 uicxx . . $ luckyBackupWindow#ui..pushButton_minimizeToTraycxx . . $ Ui_luckyBackupWindow#pushButton_minimizeToTray. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
209 else
210 uicxx . . $ luckyBackupWindow#ui..pushButton_minimizeToTraycxx . . $ Ui_luckyBackupWindow#pushButton_minimizeToTray. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
211 errorsToolbarcxx . . $ luckyBackupWindow#errorsToolbar.-> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
212 uicxx . . $ luckyBackupWindow#ui..pushButton_nextErrorcxx . . $ Ui_luckyBackupWindow#pushButton_nextError. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
213 uicxx . . $ luckyBackupWindow#ui..pushButton_previousErrorcxx . . $ Ui_luckyBackupWindow#pushButton_previousError. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
214 uicxx . . $ luckyBackupWindow#ui..pushButton_nextErrorcxx . . $ Ui_luckyBackupWindow#pushButton_nextError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
215 uicxx . . $ luckyBackupWindow#ui..pushButton_previousErrorcxx . . $ Ui_luckyBackupWindow#pushButton_previousError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
216 uicxx . . $ luckyBackupWindow#ui..checkBox_onlyShowErrorscxx . . $ Ui_luckyBackupWindow#checkBox_onlyShowErrors. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
217 }
218 else //change gui to normal mode !!
219 {
220 uicxx . . $ luckyBackupWindow#ui..AbortButtoncxx . . $ Ui_luckyBackupWindow#AbortButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
221 uicxx . . $ luckyBackupWindow#ui..DoneButtoncxx . . $ Ui_luckyBackupWindow#DoneButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
222 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
223 uicxx . . $ luckyBackupWindow#ui..nowDoingcxx . . $ Ui_luckyBackupWindow#nowDoing. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
224 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
225 uicxx . . $ luckyBackupWindow#ui..pushButton_minimizeToTraycxx . . $ Ui_luckyBackupWindow#pushButton_minimizeToTray.-> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
226 uicxx . . $ luckyBackupWindow#ui..pushButton_nextErrorcxx . . $ Ui_luckyBackupWindow#pushButton_nextError. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
227 uicxx . . $ luckyBackupWindow#ui..pushButton_previousErrorcxx . . $ Ui_luckyBackupWindow#pushButton_previousError. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
228 uicxx . . $ luckyBackupWindow#ui..checkBox_onlyShowErrorscxx . . $ Ui_luckyBackupWindow#checkBox_onlyShowErrors. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
229
230 uicxx . . $ luckyBackupWindow#ui..pushButton_startcxx . . $ Ui_luckyBackupWindow#pushButton_start. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
231 uicxx . . $ luckyBackupWindow#ui..listWidget_operationscxx . . $ Ui_luckyBackupWindow#listWidget_operations. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
232 uicxx . . $ luckyBackupWindow#ui..pushButton_InfoCollapsecxx . . $ Ui_luckyBackupWindow#pushButton_InfoCollapse. -> setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(!IsVisibleInfoWindowcxx . . $ luckyBackupWindow#IsVisibleInfoWindow.);
233 uicxx . . $ luckyBackupWindow#ui..textBrowser_infocxx . . $ Ui_luckyBackupWindow#textBrowser_info. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (IsVisibleInfoWindowcxx . . $ luckyBackupWindow#IsVisibleInfoWindow.);
234 uicxx . . $ luckyBackupWindow#ui..label_TaskListcxx . . $ Ui_luckyBackupWindow#label_TaskList. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Task list","task list label"));
235 uicxx . . $ luckyBackupWindow#ui..frame_operationscxx . . $ Ui_luckyBackupWindow#frame_operations. -> setToolTipcxx . . $ QWidget#setToolTip(3520e46b33348bf6).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("List of all the available tasks","task list tooltip - line1")+cxx . . $ operator+(3d22f08efddf8107)."\n"+cxx . . $ operator+(fab9b4f80031f353).
236 trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Use the 'include checkboxes' to include or not a selected task","task list tooltip - line2"));
237
238 uicxx . . $ luckyBackupWindow#ui..pushButton_upcxx . . $ Ui_luckyBackupWindow#pushButton_up. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
239 uicxx . . $ luckyBackupWindow#ui..pushButton_downcxx . . $ Ui_luckyBackupWindow#pushButton_down. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
240 uicxx . . $ luckyBackupWindow#ui..label_includecxx . . $ Ui_luckyBackupWindow#label_include. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
241 uicxx . . $ luckyBackupWindow#ui..menuFilecxx . . $ Ui_luckyBackupWindow#menuFile. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
242 uicxx . . $ luckyBackupWindow#ui..menu_Taskcxx . . $ Ui_luckyBackupWindow#menu_Task. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
243 languageMenucxx . . $ luckyBackupWindow#languageMenu. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
244 settingsMenucxx . . $ luckyBackupWindow#settingsMenu. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
245 helpMenucxx . . $ luckyBackupWindow#helpMenu. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
246 profileToolbarcxx . . $ luckyBackupWindow#profileToolbar. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (IsVisibleProfileToolbarcxx . . $ luckyBackupWindow#IsVisibleProfileToolbar.);
247 profileComboToolbarcxx . . $ luckyBackupWindow#profileComboToolbar. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
248 shutdownToolbarcxx . . $ luckyBackupWindow#shutdownToolbar. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
249 errorsToolbarcxx . . $ luckyBackupWindow#errorsToolbar. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
250 uicxx . . $ luckyBackupWindow#ui..comboBox_profilecxx . . $ Ui_luckyBackupWindow#comboBox_profile. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
251 uicxx . . $ luckyBackupWindow#ui..groupBox_taskcxx . . $ Ui_luckyBackupWindow#groupBox_task. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
252 uicxx . . $ luckyBackupWindow#ui..checkBox_DryRuncxx . . $ Ui_luckyBackupWindow#checkBox_DryRun. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
253 uicxx . . $ luckyBackupWindow#ui..pushButton_exitcxx . . $ Ui_luckyBackupWindow#pushButton_exit. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false); // set this to true to make the exit button visible at normal mode
254 uicxx . . $ luckyBackupWindow#ui..labelcxx . . $ Ui_luckyBackupWindow#label. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
255 }
256 }
257
258 // done button pressed=====================================================================================================
259 void luckyBackupWindowcxx . . $ luckyBackupWindow#::donePressedcxx . . $ luckyBackupWindow#donePressed(49f6e7a06ebc5aa8).()
260 {
261 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput. -> setTextcxx . . $ QTextEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
262 guiModeNormalcxx . . $ luckyBackupWindow#guiModeNormal. = true;
263 swapGUIcxx . . $ luckyBackupWindow#swapGUI(7df51288a9ebd664).("normal"cxx . . $ QString#QString(85c52e162fed56f9).);
264
265 if (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ()) // this prevents a segfault when system tray is NOT available
266 LBtraycxx . . $ luckyBackupWindow#LBtray. -> hidecxx . . $ QSystemTrayIcon#hide(49f6e7a06ebc5aa8).(); // hide the tray icon
267
268 refreshListcxx . . $ luckyBackupWindow#refreshList(49f6e7a06ebc5aa8).(); //refresh the listWidget_operations
269
270 InfoDatacxx . . $ luckyBackupWindow#InfoData. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). QDateTimecxx . . $ QDateTime#::currentDateTimecxx . . $ QDateTime#currentDateTime(bf5129c8228c71c0).().toStringcxx . . $ QDateTime#toString(7b7e68bded046f2f).(Qtcxx . . $ Qt/::DefaultLocaleLongDatecxx . . $ Qt/DefaultLocaleLongDate.) +cxx . . $ operator+(3d22f08efddf8107). "<br>" +cxx . . $ operator+(fab9b4f80031f353).
271 trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Execution of profile","full phrase: 'Execution of profile <PROFILENAME> finished'") +cxx . . $ operator+(3d22f08efddf8107).
272 " <b>" +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "</b> " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("finished","full phrase: 'Execution of profile <PROFILENAME> finished'")+cxx . . $ operator+(3d22f08efddf8107)." !!<br>";
273 if (DryRuncxx . . $ Global/DryRun.)
274 InfoDatacxx . . $ luckyBackupWindow#InfoData..appendcxx . . $ QString#append(6a89d0b7f4d2681c).("(" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("simulation mode") +cxx . . $ operator+(3d22f08efddf8107).")");
275 else
276 {
277 if (!savedProfilecxx . . $ luckyBackupWindow#savedProfile.)
278 InfoDatacxx . . $ luckyBackupWindow#InfoData..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Could not update last execution time of tasks") +cxx . . $ operator+(3d22f08efddf8107). "<br>" +cxx . . $ operator+(fab9b4f80031f353). profilecxx . . $ Global/profile..errorStringcxx . . $ QIODevice#errorString(6ef7b6c27b00b43d).());
279 else
280 InfoDatacxx . . $ luckyBackupWindow#InfoData..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Last execution time of tasks updated"));
281 }
282 uicxx . . $ luckyBackupWindow#ui..textBrowser_infocxx . . $ Ui_luckyBackupWindow#textBrowser_info. -> setTextcxx . . $ QTextEdit#setText(3520e46b33348bf6).(InfoDatacxx . . $ luckyBackupWindow#InfoData.);
283 }
284 // abort button pressed=====================================================================================================
285 void luckyBackupWindowcxx . . $ luckyBackupWindow#::abortPressedcxx . . $ luckyBackupWindow#abortPressed(49f6e7a06ebc5aa8).()
286 {
287 //if (syncProcess->state() == QProcess::NotRunning) //if syncProcess is not Running (done pressed)
288
289 // the next condition is used because for some wierd reason the abort button is presses multiple times
290 // if you launch LB, run a profile twice and abort both of them. The second run you abort, will emitt 2 abort clicked() signals !!!
291 if (ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.)
292 return;
293
294 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("<br><br><font color=red>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Aborting: Please wait for all processes to be killed") +cxx . . $ operator+(3d22f08efddf8107). "...</font>");
295 ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore. = false;
296 ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter. = false;
297 ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed. = true;
298
299 syncProcesscxx . . $ syncProcess. -> killcxx . . $ QProcess#kill(49f6e7a06ebc5aa8).(); //kill rsyncProcess
300 syncProcesscxx . . $ syncProcess. -> waitForFinishedcxx . . $ QProcess#waitForFinished(83c267b20bac841a).();
301
302 setNowDoingcxx . . $ luckyBackupWindow#setNowDoing(49f6e7a06ebc5aa8). (); //update Nowdoing textBrowser
303
304 }
305
306 // createTrayIcon =============================================================================================================================
307 // create the tray icon
308 // This is only called when system tray is available
309 void luckyBackupWindowcxx . . $ luckyBackupWindow#::createTrayIconcxx . . $ luckyBackupWindow#createTrayIcon(49f6e7a06ebc5aa8).()
310 {
311 //actions----------------------------------
312 LBtrayMenucxx . . $ luckyBackupWindow#LBtrayMenu. = new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(this);
313 actionAbortcxx . . $ luckyBackupWindow#actionAbort. = new QActioncxx . . $ QAction#QAction(ef44fe276c987e61).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/luckyPrefix/abort.png"cxx . . $ QString#QString(85c52e162fed56f9).), trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("&Abort"), this);
314 minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray. = new QActioncxx . . $ QAction#QAction(ef44fe276c987e61).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/luckyPrefix/window_minimize.png"cxx . . $ QString#QString(85c52e162fed56f9).), trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("&Minimize to tray","tray menu action"), this);
315 restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray. = new QActioncxx . . $ QAction#QAction(ef44fe276c987e61).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/luckyPrefix/window_restore.png"cxx . . $ QString#QString(85c52e162fed56f9).), trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("&Restore","tray menu action"), this);
316
317 connectcxx . . $ QObject#connect(158df1d9a01a3410).( actionAbortcxx . . $ luckyBackupWindow#actionAbort., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(abortPressed())); //tray icon action ABORT
318 connectcxx . . $ QObject#connect(158df1d9a01a3410).( minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(minimizeTray())); //tray icon action minimize to Tray
319 connectcxx . . $ QObject#connect(158df1d9a01a3410).( restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(restoreTray())); //tray icon action restore from tray
320
321 //context menu----------------------------
322 LBtrayMenucxx . . $ luckyBackupWindow#LBtrayMenu. -> addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray.);
323 LBtrayMenucxx . . $ luckyBackupWindow#LBtrayMenu. -> addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray.);
324 LBtrayMenucxx . . $ luckyBackupWindow#LBtrayMenu. -> addSeparatorcxx . . $ QMenu#addSeparator(a590eff9f1ec9a95).();
325 LBtrayMenucxx . . $ luckyBackupWindow#LBtrayMenu. -> addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(actionAbortcxx . . $ luckyBackupWindow#actionAbort.);
326
327 //tray icon--------------------------------
328 LBtraycxx . . $ luckyBackupWindow#LBtray. = new QSystemTrayIconcxx . . $ QSystemTrayIcon#(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/luckyPrefix/luckybackup_96.png"cxx . . $ QString#QString(85c52e162fed56f9).),this);
329 LBtraycxx . . $ luckyBackupWindow#LBtray. -> setContextMenucxx . . $ QSystemTrayIcon#setContextMenu(cb52c12b49e9b51b).(LBtrayMenucxx . . $ luckyBackupWindow#LBtrayMenu.);
330 if (isMinimizedToTraycxx . . $ luckyBackupWindow#isMinimizedToTray. == true)
331 {
332 minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
333 restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(true);
334 }
335 else
336 {
337 minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(true);
338 restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
339 }
340
341 //connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
342 connectcxx . . $ QObject#connect(158df1d9a01a3410).(LBtraycxx . . $ luckyBackupWindow#LBtray., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(activated(QSystemTrayIcon::ActivationReason)),
343 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(LBtrayActivated(QSystemTrayIcon::ActivationReason)));
344 }
345
346 // minimizeTray =============================================================================================================================
347 // minimizes the gui to the tray
348 void luckyBackupWindowcxx . . $ luckyBackupWindow#::minimizeTraycxx . . $ luckyBackupWindow#minimizeTray(49f6e7a06ebc5aa8).()
349 {
350 if (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ())
351 {
352 minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
353 restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(true);
354 }
355 isMinimizedToTraycxx . . $ luckyBackupWindow#isMinimizedToTray. = true;
356 this -> hidecxx . . $ QWidget#hide(49f6e7a06ebc5aa8).();
357 }
358 // restoreTray =============================================================================================================================
359 // restores the gui from the tray
360 void luckyBackupWindowcxx . . $ luckyBackupWindow#::restoreTraycxx . . $ luckyBackupWindow#restoreTray(49f6e7a06ebc5aa8).()
361 {
362 if (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ())
363 {
364 minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(true);
365 restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
366 }
367 isMinimizedToTraycxx . . $ luckyBackupWindow#isMinimizedToTray. = false;
368 this -> showNormalcxx . . $ QWidget#showNormal(49f6e7a06ebc5aa8).();
369 }
370 // LBtrayActivated============================================================================================================
371 // LB tray icon activated SLOT
372 void luckyBackupWindowcxx . . $ luckyBackupWindow#::LBtrayActivatedcxx . . $ luckyBackupWindow#LBtrayActivated(dc7279b31293a212).(QSystemTrayIconcxx . . $ QSystemTrayIcon#::ActivationReasoncxx . . $ QSystemTrayIcon#ActivationReason# reason)
373 {
374 switch (reason)
375 {
376 case QSystemTrayIconcxx . . $ QSystemTrayIcon#::Contextcxx . . $ QSystemTrayIcon#Context.:
377 break;
378 case QSystemTrayIconcxx . . $ QSystemTrayIcon#::Triggercxx . . $ QSystemTrayIcon#Trigger.:
379 if (isMinimizedToTraycxx . . $ luckyBackupWindow#isMinimizedToTray. == true)
380 restoreTraycxx . . $ luckyBackupWindow#restoreTray(49f6e7a06ebc5aa8).();
381 else
382 minimizeTraycxx . . $ luckyBackupWindow#minimizeTray(49f6e7a06ebc5aa8).();
383 break;
384 default:
385 ;
386 }
387
388 if (isMinimizedToTraycxx . . $ luckyBackupWindow#isMinimizedToTray. == true)
389 {
390 minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
391 restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(true);
392 }
393 else
394 {
395 minimizeToTraycxx . . $ luckyBackupWindow#minimizeToTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(true);
396 restoreFromTraycxx . . $ luckyBackupWindow#restoreFromTray. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
397 }
398 }
399 //executes pre-task commands ===============================================================================================
400 void luckyBackupWindowcxx . . $ luckyBackupWindow#::executeBeforeTaskcxx . . $ luckyBackupWindow#executeBeforeTask(49f6e7a06ebc5aa8).()
401 {
402 if (ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) //better safe than sorry ;)
403 return;
404
405 repeatOnFailMaxcxx . . $ luckyBackupWindow#repeatOnFailMax. = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRepeatOnFailcxx . . $ operation#GetRepeatOnFail(455f465bc33b4cdf).(); // This holds the number of re-runs to try if the task fails for a reason
406
407 // logfile & older snapshots actions if real run is performed
408 if ( (!DryRuncxx . . $ Global/DryRun.) && (currentBeforecxx . . $ luckyBackupWindow#currentBefore. == 0) && (repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. == 0) )
409 {
410 int maxSnaps = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetKeepSnapshotscxx . . $ operation#GetKeepSnapshots(455f465bc33b4cdf).(); // this is the number of snapshots to keep
411 if (maxSnaps < 1)
412 maxSnaps = 1;
413 int currentSnaps = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListSizecxx . . $ operation#GetSnapshotsListSize(455f465bc33b4cdf).(); // this is the current number of snapshots
414 if (currentSnaps < 1)
415 currentSnaps = 1;
416
417 // first remove the older logfiles and snapshots if max keep snapshots is reached
418
419 bool RemoteDestUsed = (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteDestinationcxx . . $ operation#GetRemoteDestination(50ce9a9e25b4a850).()) && (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotecxx . . $ operation#GetRemote(50ce9a9e25b4a850).());
420
421 // SNAPSHOTS REMOVAL - This is outside the (currentSnaps >= maxSnaps) condition, because it will eventually cause the snapshots directory to get created so that the profile will be backed up without problems later on
422 // First calculate the folder where snapshots go (tempDestination)
423 QStringListcxx . . $ QStringList# tempArguments = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetArgscxx . . $ operation#GetArgs(e1dbd5c4feadc8f5).();
424 QStringcxx . . $ QString# tempSource = tempArgumentscxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).tempArguments.sizecxx . . $ QList#size(ea6fe5115c70a13f).()-2];
425 QStringcxx . . $ QString# tempDestination = tempArgumentscxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).tempArguments.sizecxx . . $ QList#size(ea6fe5115c70a13f).()-1];
426 QStringcxx . . $ QString# tempDestinationOrig = tempArgumentscxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).tempArguments.sizecxx . . $ QList#size(ea6fe5115c70a13f).()-1];
427 QStringcxx . . $ QString# tempDestinationOrig2cxx . . $ QString#QString(ced63f7c635d850d).;
428 QStringcxx . . $ QString# sourceLast = tempSourcecxx . . $ QString#QString(132dd6869045752b).;
429 if (!tempSource.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(SLASHcxx . . $ Global/SLASH.)) // this means task is of type "backup dir by name"
430 {
431 sourceLast =cxx . . $ QString#`operator=`(4f35bf974e7f8568). calculateLastPathcxx . . $ Global/calculateLastPath(f7f320d754b8fd09).(sourceLastcxx . . $ QString#QString(132dd6869045752b).); // This is the lowest dir of the source
432
433 tempSource.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(SLASHcxx . . $ Global/SLASH.);
434 if (WINrunningcxx . . $ Global/WINrunning. && RemoteDestUsed)
435 tempDestination.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(sourceLast +cxx . . $ operator+(fab9b4f80031f353). XnixSLASHcxx . . $ Global/XnixSLASH.);
436 else
437 tempDestination.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(sourceLast +cxx . . $ operator+(fab9b4f80031f353). SLASHcxx . . $ Global/SLASH.);
438 }
439 tempDestinationOrig2=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).tempDestination;
440 if (RemoteDestUsed && WINrunningcxx . . $ Global/WINrunning.)
441 tempDestination.appendcxx . . $ QString#append(6a89d0b7f4d2681c). (snapDefaultDircxx . . $ Global/snapDefaultDir..replacecxx . . $ QString#replace(192e628656427d1c).(SLASHcxx . . $ Global/SLASH.,XnixSLASHcxx . . $ Global/XnixSLASH.));
442 else
443 tempDestination.appendcxx . . $ QString#append(6a89d0b7f4d2681c). (snapDefaultDircxx . . $ Global/snapDefaultDir.);
444
445 QStringListcxx . . $ QStringList# remoteArgscxx . . $ QStringList#QStringList(ced63f7c635d850d).; remoteArgs.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
446 //all remote arguments exactly as used at normal backup
447 if (RemoteDestUsed)
448 {
449 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("--protect-args"cxx . . $ QString#QString(85c52e162fed56f9).);
450 //if ( Operation[currentOperation] -> GetRemotePassword() != "")
451 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.]-> GetRemoteModulecxx . . $ operation#GetRemoteModule(50ce9a9e25b4a850).() && Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotePasswordcxx . . $ operation#GetRemotePassword(6ef7b6c27b00b43d).() !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "")
452 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("--password-file=" +cxx . . $ operator+(c75c3ae4eb9af1a8). ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotePasswordcxx . . $ operation#GetRemotePassword(6ef7b6c27b00b43d).()) );
453 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHcxx . . $ operation#GetRemoteSSH(50ce9a9e25b4a850).())
454 {
455 QStringcxx . . $ QString# sshOptions=(Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHOptionscxx . . $ operation#GetRemoteSSHOptions(6ef7b6c27b00b43d).()).replacecxx . . $ QString#replace(192e628656427d1c).("\""cxx . . $ QString#QString(85c52e162fed56f9).,"\\\""cxx . . $ QString#QString(85c52e162fed56f9).)+cxx . . $ operator+(3d22f08efddf8107)." -o \"StrictHostKeyChecking no\" -o \"PasswordAuthentication no\" ";
456 if (WINrunningcxx . . $ Global/WINrunning.)
457 {
458 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPasswordcxx . . $ operation#GetRemoteSSHPassword(6ef7b6c27b00b43d).() !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "")
459 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).() != 0)
460 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e \""+cxx . . $ operator+(c75c3ae4eb9af1a8).Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSshCommandcxx . . $ operation#GetSshCommand(6ef7b6c27b00b43d).()+cxx . . $ operator+(3d22f08efddf8107)."\" "+cxx . . $ operator+(fab9b4f80031f353).sshOptions+cxx . . $ operator+(3d22f08efddf8107)." -i \"" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPasswordcxx . . $ operation#GetRemoteSSHPassword(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107)."\" -p " +cxx . . $ operator+(fab9b4f80031f353).
461 countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).()) );
462 else
463 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e \""+cxx . . $ operator+(c75c3ae4eb9af1a8).Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSshCommandcxx . . $ operation#GetSshCommand(6ef7b6c27b00b43d).()+cxx . . $ operator+(3d22f08efddf8107)."\" "+cxx . . $ operator+(fab9b4f80031f353).sshOptions+cxx . . $ operator+(3d22f08efddf8107)." -i \"" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPasswordcxx . . $ operation#GetRemoteSSHPassword(6ef7b6c27b00b43d).()+cxx . . $ operator+(3d22f08efddf8107)."\"");
464 else
465 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).() != 0)
466 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e \""+cxx . . $ operator+(c75c3ae4eb9af1a8).Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSshCommandcxx . . $ operation#GetSshCommand(6ef7b6c27b00b43d).()+cxx . . $ operator+(3d22f08efddf8107)."\" "+cxx . . $ operator+(fab9b4f80031f353).sshOptions+cxx . . $ operator+(3d22f08efddf8107)." -p " +cxx . . $ operator+(fab9b4f80031f353). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).()) );
467 else
468 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e \""+cxx . . $ operator+(c75c3ae4eb9af1a8).Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSshCommandcxx . . $ operation#GetSshCommand(6ef7b6c27b00b43d).()+cxx . . $ operator+(3d22f08efddf8107)."\" "+cxx . . $ operator+(fab9b4f80031f353).sshOptions+cxx . . $ operator+(3d22f08efddf8107)."");
469 }
470 else
471 {
472 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPasswordcxx . . $ operation#GetRemoteSSHPassword(6ef7b6c27b00b43d).() !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "")
473 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).() != 0)
474 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e "+cxx . . $ operator+(c75c3ae4eb9af1a8).sshCommandPathcxx . . $ Global/sshCommandPath.+cxx . . $ operator+(3d22f08efddf8107)." -i " +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPasswordcxx . . $ operation#GetRemoteSSHPassword(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107)." -p " +cxx . . $ operator+(fab9b4f80031f353).
475 countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).()) );
476 else
477 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e "+cxx . . $ operator+(c75c3ae4eb9af1a8).sshCommandPathcxx . . $ Global/sshCommandPath.+cxx . . $ operator+(3d22f08efddf8107)." -i " +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPasswordcxx . . $ operation#GetRemoteSSHPassword(6ef7b6c27b00b43d).());
478 else
479 if ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).() != 0)
480 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e "+cxx . . $ operator+(c75c3ae4eb9af1a8).sshCommandPathcxx . . $ Global/sshCommandPath.+cxx . . $ operator+(3d22f08efddf8107)." -p " +cxx . . $ operator+(fab9b4f80031f353). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteSSHPortcxx . . $ operation#GetRemoteSSHPort(455f465bc33b4cdf).()) );
481 else
482 remoteArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("-e "+cxx . . $ operator+(c75c3ae4eb9af1a8).sshCommandPathcxx . . $ Global/sshCommandPath.);
483 }
484 }
485 }
486
487
488 if (currentSnaps >= maxSnaps)
489 {
490 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "\n<font color=magenta>" +cxx . . $ operator+(c75c3ae4eb9af1a8).
491 trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Removing old snapshots and logfiles of task","info message displayed during ...data removal\nFull phrase: Removing old snapshots and logfiles of task: <TASKNAME>") +cxx . . $ operator+(3d22f08efddf8107).
492 ": <b>" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107).
493 "</b></font><br>=====================================<br>";
494 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
495
496 // **************Remove actual backup data ***************************************************
497
498 // increase the remove limit to include the source.size() if "backup dir by name" is used
499 if (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetTypeDirNamecxx . . $ operation#GetTypeDirName(50ce9a9e25b4a850).())
500 removeCharLimitcxx . . $ Global/removeCharLimit. = 4 + sourceLast.sizecxx . . $ QString#size(455f465bc33b4cdf).()+1;
501 else
502 removeCharLimitcxx . . $ Global/removeCharLimit. = 4;
503
504 //we will delete the snapshots directory by using an rsync command with an empty source:
505 QProcesscxx . . $ QProcess# *rmProcess;
506 rmProcess = new QProcesscxx . . $ QProcess#(this);
507 QStringListcxx . . $ QStringList# rmArgscxx . . $ QStringList#QStringList(ced63f7c635d850d).;
508 rmArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--progress"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "-r"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--delete-after"cxx . . $ QString#QString(85c52e162fed56f9).;
509 int snapToKeep = currentSnaps-maxSnaps + 1;
510 while ( snapToKeep < currentSnaps )
511 {
512 if (WINrunningcxx . . $ Global/WINrunning. && RemoteDestUsed)
513 rmArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("--filter=protect " +cxx . . $ operator+(c75c3ae4eb9af1a8). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(snapToKeep) +cxx . . $ operator+(fab9b4f80031f353). XnixSLASHcxx . . $ Global/XnixSLASH.);
514 else
515 rmArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("--filter=protect " +cxx . . $ operator+(c75c3ae4eb9af1a8). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(snapToKeep) +cxx . . $ operator+(fab9b4f80031f353). SLASHcxx . . $ Global/SLASH.);
516 snapToKeep++;
517 }
518 // protect the backup profile dir too
519 if (WINrunningcxx . . $ Global/WINrunning. && RemoteDestUsed)
520 rmArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("--filter=protect " +cxx . . $ operator+(c75c3ae4eb9af1a8). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). ".profile" +cxx . . $ operator+(fab9b4f80031f353). XnixSLASHcxx . . $ Global/XnixSLASH.);
521 else
522 rmArgs.appendcxx . . $ QList#append(77d9f17553126ecb).("--filter=protect " +cxx . . $ operator+(c75c3ae4eb9af1a8). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). ".profile" +cxx . . $ operator+(fab9b4f80031f353). SLASHcxx . . $ Global/SLASH.);
523
524 //also add all remote arguments exactly as used at normal backup
525 if (RemoteDestUsed)
526 //rmArgs.append(remoteArgs); // use operator << instead of append to maintain compatiiblity with debian 5
527 rmArgs <<cxx . . $ QStringList#`operator<<`(cb3c3d1614140851). remoteArgs;
528
529 rmArgs.appendcxx . . $ QList#append(77d9f17553126ecb).(snapEmptyDircxx . . $ Global/snapEmptyDir.);
530 rmArgs.appendcxx . . $ QList#append(77d9f17553126ecb).(tempDestination);
531
532 if (WINrunningcxx . . $ Global/WINrunning.)
533 {
534
535 //bool createWinRsyncCommand(tempDirPath,QFile command1,QFile command2,bool vss,QString rsyncArgs,QString source,QString dest);
536 QStringcxx . . $ QString# command2=createWinRsyncCommandcxx . . $ Global/createWinRsyncCommand(f72b83e3d8c9da9d).(tempDirPathcxx . . $ QString#QString(132dd6869045752b).,false,rmArgs);
537 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n"+cxx . . $ operator+(c75c3ae4eb9af1a8).command2);
538 if (command2==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."")
539 coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\nfailed to create bat file in rmProccess";
540 else
541 rmProcess -> startcxx . . $ QProcess#start(8f4bc4a0c00c3d3f). (command2);
542 }
543 else
544 rmProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). (commandcxx . . $ luckyBackupWindow#command.,rmArgs);
545 rmProcess -> waitForFinishedcxx . . $ QProcess#waitForFinished(83c267b20bac841a).();
546
547 if ((rmProcess -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()) == 0)
548 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Removed all older snapshots data"));// +" " + tempDestination + Operation[currentOperation] -> GetSnapshotsListItem(0) + SLASH);
549 else
550 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("failed to remove all older snapshots data"));// +" " + tempDestination + Operation[currentOperation] -> GetSnapshotsListItem(0) + SLASH);
551
552 //******************************************************
553
554 countcxx . . $ luckyBackupWindow#count. = 0;
555 while ( countcxx . . $ luckyBackupWindow#count. < (currentSnaps -maxSnaps + 1 ) )
556 {
557 //remove the changes file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
558 snapchangesfilenamecxx . . $ Global/snapchangesfilename. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). snapChangesDircxx . . $ Global/snapChangesDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353).
559 (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(0)) +cxx . . $ operator+(3d22f08efddf8107). ".changes.log";
560 snapfilecxx . . $ Global/snapfile..setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(snapchangesfilenamecxx . . $ Global/snapchangesfilename.);
561 if (snapfilecxx . . $ Global/snapfile..existscxx . . $ QFile#exists(50ce9a9e25b4a850).())
562 {
563 if (snapfilecxx . . $ Global/snapfile..removecxx . . $ QFile#remove(c9857a73d68e59ba).()) // this is the old snapshot changes file
564 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Removing") +cxx . . $ operator+(3d22f08efddf8107)." " +cxx . . $ operator+(fab9b4f80031f353). snapchangesfilenamecxx . . $ Global/snapchangesfilename.);
565 else
566 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("failed to remove") +cxx . . $ operator+(3d22f08efddf8107)." " +cxx . . $ operator+(fab9b4f80031f353). snapchangesfilenamecxx . . $ Global/snapchangesfilename.);
567 }
568
569 //remove the oldest logfile ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
570 logfilenamecxx . . $ Global/logfilename. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). logDircxx . . $ Global/logDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353).
571 (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(0)) +cxx . . $ operator+(3d22f08efddf8107). ".log";
572 logfilecxx . . $ Global/logfile..setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(logfilenamecxx . . $ Global/logfilename.); // this is the old logfile
573 if (logfilecxx . . $ Global/logfile..existscxx . . $ QFile#exists(50ce9a9e25b4a850).())
574 {
575 if (logfilecxx . . $ Global/logfile..removecxx . . $ QFile#remove(c9857a73d68e59ba).())
576 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Removing") +cxx . . $ operator+(3d22f08efddf8107)." " +cxx . . $ operator+(fab9b4f80031f353). logfilenamecxx . . $ Global/logfilename.);
577 else
578 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("failed to remove") +cxx . . $ operator+(3d22f08efddf8107)." " +cxx . . $ operator+(fab9b4f80031f353). logfilenamecxx . . $ Global/logfilename.);
579 }
580
581 //remove the oldest snapshot (0) from the list
582 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> RemoveSnapshotsListItemcxx . . $ operation#RemoveSnapshotsListItem(d4f767463ce0a6b3). (0);
583 countcxx . . $ luckyBackupWindow#count.++;
584 }
585 }
586 else // this is just to create the .snapDefaultDir if it does not to exist so as to copy profile data later...
587 {
588 //we will create the snapshots default directory by using an rsync command with an empty source without --delete option
589 QProcesscxx . . $ QProcess# *mkdirProcess;
590 mkdirProcess = new QProcesscxx . . $ QProcess#(this);
591 QStringListcxx . . $ QStringList# mkdirArgscxx . . $ QStringList#QStringList(ced63f7c635d850d).; mkdirArgs.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
592 //no needed any more
593 //if ( (WINrunning) && (RemoteDestUsed) )
594 // mkdirArgs << "--mkdir";
595 //else
596 mkdirArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--progress"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "-r"cxx . . $ QString#QString(85c52e162fed56f9).;
597
598 //add all remote arguments exactly as used at normal backup
599 if (RemoteDestUsed)
600 //mkdirArgs.append(remoteArgs); // use operator << instead of append to maintain compatiiblity with debian 5
601 mkdirArgs <<cxx . . $ QStringList#`operator<<`(cb3c3d1614140851). remoteArgs;
602
603 mkdirArgs.appendcxx . . $ QList#append(77d9f17553126ecb).(snapEmptyDircxx . . $ Global/snapEmptyDir.);
604
605 //rsync throws error if directory is not yet created, ..so create it first
606
607 // Add the destination folder
608 mkdirArgs.appendcxx . . $ QList#append(77d9f17553126ecb).(tempDestinationOrig); // this is actually an empty argument
609 if (WINrunningcxx . . $ Global/WINrunning.)
610 {
611 //bool createWinRsyncCommand(tempDirPath,QFile command1,QFile command2,bool vss,QString rsyncArgs,QString source,QString dest);
612 QStringcxx . . $ QString# command2=createWinRsyncCommandcxx . . $ Global/createWinRsyncCommand(f72b83e3d8c9da9d).(tempDirPathcxx . . $ QString#QString(132dd6869045752b).,false,mkdirArgs);
613 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n"+cxx . . $ operator+(c75c3ae4eb9af1a8).command2);
614 if (command2==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."")
615 coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\nfailed to create bat file in mkdirProccess";
616 else
617 mkdirProcess -> startcxx . . $ QProcess#start(8f4bc4a0c00c3d3f). (command2);
618 }
619 else
620 mkdirProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). (commandcxx . . $ luckyBackupWindow#command.,mkdirArgs);
621
622 mkdirProcess -> waitForFinishedcxx . . $ QProcess#waitForFinished(83c267b20bac841a).();
623 if ((mkdirProcess -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()) == 0)
624 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n!!"cxx . . $ QString#QString(85c52e162fed56f9).);
625 else
626 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n!"cxx . . $ QString#QString(85c52e162fed56f9).);
627 mkdirArgs.removeLastcxx . . $ QList#removeLast(49f6e7a06ebc5aa8).(); //remove the tempDestinationOrig argument
628
629 // Add the destination folder [ + sourceLast +SLASH ]
630 mkdirArgs.appendcxx . . $ QList#append(77d9f17553126ecb).(tempDestinationOrig2); // this is actually an empty argument
631 if (WINrunningcxx . . $ Global/WINrunning.)
632 {
633 //bool createWinRsyncCommand(tempDirPath,QFile command1,QFile command2,bool vss,QString rsyncArgs,QString source,QString dest);
634 QStringcxx . . $ QString# command2=createWinRsyncCommandcxx . . $ Global/createWinRsyncCommand(f72b83e3d8c9da9d).(tempDirPathcxx . . $ QString#QString(132dd6869045752b).,false,mkdirArgs);
635 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n"+cxx . . $ operator+(c75c3ae4eb9af1a8).command2);
636 if (command2==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."")
637 coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\nfailed to create bat file in mkdirProccess";
638 else
639 mkdirProcess -> startcxx . . $ QProcess#start(8f4bc4a0c00c3d3f). (command2);
640 }
641 else
642 mkdirProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). (commandcxx . . $ luckyBackupWindow#command.,mkdirArgs);
643
644 mkdirProcess -> waitForFinishedcxx . . $ QProcess#waitForFinished(83c267b20bac841a).();
645 if ((mkdirProcess -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()) == 0)
646 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n!!"cxx . . $ QString#QString(85c52e162fed56f9).);
647 else
648 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n!"cxx . . $ QString#QString(85c52e162fed56f9).);
649
650 // Add the destination folder [ + sourceLast +SLASH ] + snapDefaultDir
651 mkdirArgs.removeLastcxx . . $ QList#removeLast(49f6e7a06ebc5aa8).(); //remove the tempDestinationOrig2 argument
652 mkdirArgs.appendcxx . . $ QList#append(77d9f17553126ecb).(tempDestination);
653 if (WINrunningcxx . . $ Global/WINrunning.)
654 {
655 //bool createWinRsyncCommand(tempDirPath,QFile command1,QFile command2,bool vss,QString rsyncArgs,QString source,QString dest);
656 QStringcxx . . $ QString# command2=createWinRsyncCommandcxx . . $ Global/createWinRsyncCommand(f72b83e3d8c9da9d).(tempDirPathcxx . . $ QString#QString(132dd6869045752b).,false,mkdirArgs);
657 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n"+cxx . . $ operator+(c75c3ae4eb9af1a8).command2);
658 if (command2==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."")
659 coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\nfailed to create bat file in mkdirProccess";
660 else
661 mkdirProcess -> startcxx . . $ QProcess#start(8f4bc4a0c00c3d3f). (command2);
662 }
663 else
664 mkdirProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). (commandcxx . . $ luckyBackupWindow#command.,mkdirArgs);
665
666 mkdirProcess -> waitForFinishedcxx . . $ QProcess#waitForFinished(83c267b20bac841a).();
667 if ((mkdirProcess -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()) == 0)
668 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n!!"cxx . . $ QString#QString(85c52e162fed56f9).);
669 else
670 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n!"cxx . . $ QString#QString(85c52e162fed56f9).);
671 }
672
673 //set the current date and time as the operation's last execution date-time
674 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> SetLastExecutionTimecxx . . $ operation#SetLastExecutionTime(738e092a5192a79). (QDateTimecxx . . $ QDateTime#::currentDateTimecxx . . $ QDateTime#currentDateTime(bf5129c8228c71c0).());
675
676 // add a new snapshot with the last execution date-time
677 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] ->
678 AddSnapshotsListItemcxx . . $ operation#AddSnapshotsListItem(7df51288a9ebd664). ((Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetLastExecutionTimecxx . . $ operation#GetLastExecutionTime(4e062b5c490497ac).()).toStringcxx . . $ QDateTime#toString(5555d9024dcf93fb).("yyyyMMddhhmmss"cxx . . $ QString#QString(85c52e162fed56f9).));
679 currentSnaps = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListSizecxx . . $ operation#GetSnapshotsListSize(455f465bc33b4cdf).(); // update the current number of snapshots
680
681 // set a new changes file. This has a tag of the previous snapshot will include changes made to this snapshot
682 snapchangesfilenamecxx . . $ Global/snapchangesfilename. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). snapChangesDircxx . . $ Global/snapChangesDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353).
683 (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(currentSnaps - 1)) +cxx . . $ operator+(3d22f08efddf8107). ".changes.log";
684 snapfilecxx . . $ Global/snapfile..setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(snapchangesfilenamecxx . . $ Global/snapchangesfilename.);
685
686 // set a new logfile
687 logfilenamecxx . . $ Global/logfilename. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). logDircxx . . $ Global/logDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353).
688 ( Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(currentSnaps - 1) ) +cxx . . $ operator+(3d22f08efddf8107). ".log";
689 logfilecxx . . $ Global/logfile..setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(logfilenamecxx . . $ Global/logfilename.); // this is the logfile
690 if (logfilecxx . . $ Global/logfile..opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::WriteOnlycxx . . $ QIODevice#WriteOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) //create a new log file
691 writeToLogcxx . . $ Global/writeToLog. = true; //& if it's ok set this to true
692 else
693 writeToLogcxx . . $ Global/writeToLog. = false;
694 }
695
696 errorCountcxx . . $ luckyBackupWindow#errorCount. = 0; // task starts, so set this to 0 no matter dry or real run
697
698 // execute commands before task -----------------------------------------------------------------------------------------------------
699 // if there are no (more) pre-task commands to be executed ||
700 // the previous pre-task command exited with an error(all repeatOnFail runs) and the stop checkbox is checked
701 if ( (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteBeforeListSizecxx . . $ operation#GetExecuteBeforeListSize(455f465bc33b4cdf).() == currentBeforecxx . . $ luckyBackupWindow#currentBefore.) || (StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution.) )
702 {
703 currentBeforecxx . . $ luckyBackupWindow#currentBefore. = 0;
704 ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore.=false;
705 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. = 0;
706
707 executeRsynccxx . . $ luckyBackupWindow#executeRsync(49f6e7a06ebc5aa8).();
708 }
709 else
710 {
711 ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore.=true;
712 ExecuteBeforeExitedErrorcxx . . $ luckyBackupWindow#ExecuteBeforeExitedError. = false;
713 StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution. = false;
714 ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError. = false; // This might change as soon as syncprocess will start ()
715 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("pre-starting"cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).,currentBeforecxx . . $ luckyBackupWindow#currentBefore.);
716
717 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
718
719 syncProcesscxx . . $ syncProcess. -> startcxx . . $ QProcess#start(8f4bc4a0c00c3d3f). (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteBeforeListItemcxx . . $ operation#GetExecuteBeforeListItem(3f3c3d0e9c0eb37f).(currentBeforecxx . . $ luckyBackupWindow#currentBefore.));
720 syncProcesscxx . . $ syncProcess. -> waitForStartedcxx . . $ QProcess#waitForStarted(83c267b20bac841a).(5000);
721
722 // The reason for the below jump is that when a process reports an error it does not emit finished() signals neither std output/errors
723 if (ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError.)
724 procFinishedcxx . . $ luckyBackupWindow#procFinished(49f6e7a06ebc5aa8).();
725 }
726 }
727
728 //executes post-task commands ===============================================================================================
729 void luckyBackupWindowcxx . . $ luckyBackupWindow#::executeAfterTaskcxx . . $ luckyBackupWindow#executeAfterTask(49f6e7a06ebc5aa8).()
730 {
731 if (ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) //better safe than sorry :)
732 return;
733
734 // execute commands after task -----------------------------------------------------------------------------------------------------
735 //if there are no (more) post-task commands to be executed or we are here because a pre/post-task command exited with an error or destination could not be created
736 if ( (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteAfterListSizecxx . . $ operation#GetExecuteAfterListSize(455f465bc33b4cdf).() == currentAftercxx . . $ luckyBackupWindow#currentAfter.)|| (DestCreateFailcxx . . $ luckyBackupWindow#DestCreateFail.) || (StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution.) )
737 {
738 if (!DryRuncxx . . $ Global/DryRun.)
739 {
740 logfilecxx . . $ Global/logfile..closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); //close the logfile first (will create a new one for the next task)
741 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> SetLastExecutionErrorscxx . . $ operation#SetLastExecutionErrors(d4f767463ce0a6b3). (errorCountcxx . . $ luckyBackupWindow#errorCount.); // update the last execution errors
742 }
743
744 currentAftercxx . . $ luckyBackupWindow#currentAfter. = 0;
745 ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter.=false;
746
747 errorCountcxx . . $ luckyBackupWindow#errorCount. = 0; // reset the current task error count
748
749 currentOperationcxx . . $ Global/currentOperation.++;
750 //increase currentOperation until next operation to be executed or end of operations
751 while ( (currentOperationcxx . . $ Global/currentOperation. < TotalOperationscxx . . $ Global/TotalOperations.) && (!Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetPerformcxx . . $ operation#GetPerform(50ce9a9e25b4a850).()) )
752 currentOperationcxx . . $ Global/currentOperation.++;
753 if (currentOperationcxx . . $ Global/currentOperation. < TotalOperationscxx . . $ Global/TotalOperations.)
754 {
755 ExecuteBeforeExitedErrorcxx . . $ luckyBackupWindow#ExecuteBeforeExitedError. = false;
756 StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution. = false;
757 executeBeforeTaskcxx . . $ luckyBackupWindow#executeBeforeTask(49f6e7a06ebc5aa8).();
758 }
759 else
760 setNowDoingcxx . . $ luckyBackupWindow#setNowDoing(49f6e7a06ebc5aa8).();
761 }
762 else
763 {
764 ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter.=true;
765 ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError. = false; // This might change as soon as syncprocess will start ()
766 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("post-starting"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., currentAftercxx . . $ luckyBackupWindow#currentAfter.);
767 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
768
769 syncProcesscxx . . $ syncProcess. -> startcxx . . $ QProcess#start(8f4bc4a0c00c3d3f). (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteAfterListItemcxx . . $ operation#GetExecuteAfterListItem(3f3c3d0e9c0eb37f).(currentAftercxx . . $ luckyBackupWindow#currentAfter.));
770 syncProcesscxx . . $ syncProcess. -> waitForStartedcxx . . $ QProcess#waitForStarted(83c267b20bac841a).(5000);
771
772 // The reason for the below jump is that when a process reports an error it does not emit finished() signals neither std output/errors
773 if (ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError.)
774 procFinishedcxx . . $ luckyBackupWindow#procFinished(49f6e7a06ebc5aa8).();
775 }
776 }
777
778 //executes rsync ===============================================================================================
779 void luckyBackupWindowcxx . . $ luckyBackupWindow#::executeRsynccxx . . $ luckyBackupWindow#executeRsync(49f6e7a06ebc5aa8).()
780 {
781 if (ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) //better safe than sorry :)
782 return;
783
784 if (StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution.) // if a pre-task command exited with an error do not do anything
785 {
786 procFinishedcxx . . $ luckyBackupWindow#procFinished(49f6e7a06ebc5aa8).();
787 return;
788 }
789
790 synccxx . . $ luckyBackupWindow#sync. = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetTypeSynccxx . . $ operation#GetTypeSync(50ce9a9e25b4a850).(); //set sync variable according to checkstate of radiobutton operation type
791 rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments. =cxx . . $ QStringList#`operator=`(335bb966c1744308). AppendArgumentscxx . . $ Global/AppendArguments(20f639a182fdbea2).(Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.]); //set rsync arguments
792
793 bool RemoteDestUsed = (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteDestinationcxx . . $ operation#GetRemoteDestination(50ce9a9e25b4a850).()) && (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotecxx . . $ operation#GetRemote(50ce9a9e25b4a850).()); // Is remote dest used ?
794
795 if (DryRuncxx . . $ Global/DryRun.)
796 rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..insertcxx . . $ QList#insert(20dcc09d4a3213bb).(rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..sizecxx . . $ QList#size(ea6fe5115c70a13f).()-2,"--dry-run"cxx . . $ QString#QString(85c52e162fed56f9).);
797
798 dirAcxx . . $ luckyBackupWindow#dirA. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..sizecxx . . $ QList#size(ea6fe5115c70a13f).()-2];
799 dirBcxx . . $ luckyBackupWindow#dirB. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..sizecxx . . $ QList#size(ea6fe5115c70a13f).()-1];
800
801 if (synccxx . . $ luckyBackupWindow#sync.) //execute rsync for syncing 2 dirs
802 {
803 if (syncABcxx . . $ luckyBackupWindow#syncAB.) //execute rsync A -> B
804 syncABcxx . . $ luckyBackupWindow#syncAB. = false;
805
806 else //execute rsync B -> A
807 {
808 rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..removeLastcxx . . $ QList#removeLast(49f6e7a06ebc5aa8).();
809 rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..removeLastcxx . . $ QList#removeLast(49f6e7a06ebc5aa8).();
810 rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..appendcxx . . $ QList#append(77d9f17553126ecb).(dirBcxx . . $ luckyBackupWindow#dirB.); // set SyncDirA & SyncDirB as Arguments
811 rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..appendcxx . . $ QList#append(77d9f17553126ecb).(dirAcxx . . $ luckyBackupWindow#dirA.);
812 syncABcxx . . $ luckyBackupWindow#syncAB. = true;
813 }
814 }
815
816 //display a couple of lines to inticate start of task
817 if ((synccxx . . $ luckyBackupWindow#sync.) && (!syncABcxx . . $ luckyBackupWindow#syncAB.))
818 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-starting-syncAB"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., 0);
819
820 if ((synccxx . . $ luckyBackupWindow#sync.) && (syncABcxx . . $ luckyBackupWindow#syncAB.))
821 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-starting-syncBA"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., 0);
822
823 DestCreateFailcxx . . $ luckyBackupWindow#DestCreateFail. = false; // This will become true if destination does not exist and cannot be created
824
825 if (!synccxx . . $ luckyBackupWindow#sync.)
826 {
827 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-starting-backup"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., 0);
828
829 // Create the destination if it does not exist
830 QDircxx . . $ QDir# destCreatecxx . . $ QDir#QDir(3520e46b33348bf6). (dirBcxx . . $ luckyBackupWindow#dirB.);
831 if ( (!destCreate.existscxx . . $ QDir#exists(50ce9a9e25b4a850).()) && (!RemoteDestUsed) ) // local use ONLY
832 {
833 if (destCreate.mkpathcxx . . $ QDir#mkpath(f3b39adf77d9c36c).(dirBcxx . . $ luckyBackupWindow#dirB.))
834 outputInsertcxx . . $ luckyBackupWindow#outputInsert..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-standard"cxx . . $ QString#QString(85c52e162fed56f9)., "<br>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Successfully created destination directory"), 0));
835 else
836 {
837 outputInsertcxx . . $ luckyBackupWindow#outputInsert..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-error"cxx . . $ QString#QString(85c52e162fed56f9)., "<br>" +cxx . . $ operator+(c75c3ae4eb9af1a8).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Failed to create destination directory"), 0));
838 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
839 DestCreateFailcxx . . $ luckyBackupWindow#DestCreateFail. = true;
840 errorsFoundcxx . . $ Global/errorsFound.++;
841 errorCountcxx . . $ luckyBackupWindow#errorCount.++;
842 procFinishedcxx . . $ luckyBackupWindow#procFinished(49f6e7a06ebc5aa8).(); // Do not proceed any further
843 return;
844 }
845 }
846 }
847
848 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
849 //set the progressbar to 0
850 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setRangecxx . . $ QProgressBar#setRange(3e454b8ccf442868).(0,100);
851 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setValuecxx . . $ QProgressBar#setValue(d4f767463ce0a6b3). (0);
852
853 ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError. = false; // This might change as soon as syncprocess will start ()
854
855 if (WINrunningcxx . . $ Global/WINrunning.)
856 {
857 //bool createWinRsyncCommand(tempDirPath,QFile command1,QFile command2,bool vss,QString rsyncArgs,QString source,QString dest);
858 QStringcxx . . $ QString# command2=createWinRsyncCommandcxx . . $ Global/createWinRsyncCommand(f72b83e3d8c9da9d).(tempDirPathcxx . . $ QString#QString(132dd6869045752b).,Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.]->GetOptionsVsscxx . . $ operation#GetOptionsVss(50ce9a9e25b4a850).(),rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments.);
859 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("\n"+cxx . . $ operator+(c75c3ae4eb9af1a8).command2);
860 if (command2==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."")
861 coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\nfailed to create bat file for vss";
862 else
863 syncProcesscxx . . $ syncProcess. -> startcxx . . $ QProcess#start(8f4bc4a0c00c3d3f). (command2);
864 }
865 else
866 syncProcesscxx . . $ syncProcess. -> startcxx . . $ QProcess#start(5e315ba9c811784d). (commandcxx . . $ luckyBackupWindow#command.,rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments.); // execute rsync command with rsyncArguments
867
868 // The reason for the below jump is that when a process reports an error it does not emit finished() signals neither std output/errors
869 if (ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError.)
870 procFinishedcxx . . $ luckyBackupWindow#procFinished(49f6e7a06ebc5aa8).();
871 }
872
873 //when rsyncProcess emits finished signal execute another RsyncProcess if any left====================================================================
874 void luckyBackupWindowcxx . . $ luckyBackupWindow#::procFinishedcxx . . $ luckyBackupWindow#procFinished(49f6e7a06ebc5aa8).()
875 {
876 if (ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) //this is to prevent segmentation fault when abort button pressed
877 return;
878
879 /* Disable VSS until
880 if (doVss==1) //reads all log file in vss before finished
881 {
882 doVss=2;
883 return;
884 }*/
885
886 bool RemoteDestUsed = (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemoteDestinationcxx . . $ operation#GetRemoteDestination(50ce9a9e25b4a850).()) && (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotecxx . . $ operation#GetRemote(50ce9a9e25b4a850).()); // Is remote dest used ?
887 if (ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore.) // if the pre-task execution command (process) finished
888 {
889 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("pre-finished"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., currentBeforecxx . . $ luckyBackupWindow#currentBefore.);
890 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
891
892 // set this for a successful run of a command. They might change if there was an error
893 ExecuteBeforeExitedErrorcxx . . $ luckyBackupWindow#ExecuteBeforeExitedError. = false;
894 StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution. = false;
895
896 // if the pre-task command exited with an error
897 if ((syncProcesscxx . . $ syncProcess. -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).() != 0) || (ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError.))
898 {
899 ExecuteBeforeExitedErrorcxx . . $ luckyBackupWindow#ExecuteBeforeExitedError. = true;
900
901 if (repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. == repeatOnFailMaxcxx . . $ luckyBackupWindow#repeatOnFailMax.) // if the last run of the command just ended
902 {
903 if (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteBeforeListItemStatecxx . . $ operation#GetExecuteBeforeListItemState(4a668f6de69bf818).(currentBeforecxx . . $ luckyBackupWindow#currentBefore.) == true)
904 StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution. = true;
905 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. = 0; // reset the runs counter for a specific command
906 currentBeforecxx . . $ luckyBackupWindow#currentBefore.++; //go to the next pre-task execution command
907 }
908 else
909 {
910 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("repeat-on-fail"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., currentBeforecxx . . $ luckyBackupWindow#currentBefore.);
911 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
912 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry.++; // re-run this command, do not proceed to the next one
913 }
914 }
915 else // if the process was successful, go to the next one
916 {
917 currentBeforecxx . . $ luckyBackupWindow#currentBefore.++; //go to the next pre-task execution command
918 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. = 0; // it should already be 0, but ...you never know
919 }
920
921 executeBeforeTaskcxx . . $ luckyBackupWindow#executeBeforeTask(49f6e7a06ebc5aa8).(); //and executeBeforeTask again
922
923 return;
924 }
925
926 if (ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter.) // if the post-task execution command (process) finished
927 {
928 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("post-finished"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., currentAftercxx . . $ luckyBackupWindow#currentAfter.);
929 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
930
931 // set this for a successful run of a command. They might change if there was an error
932 StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution. = false;
933
934 // if the post-task command exited with an error
935 if ((syncProcesscxx . . $ syncProcess. -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).() != 0) || (ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError.))
936 {
937 if (repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. == repeatOnFailMaxcxx . . $ luckyBackupWindow#repeatOnFailMax.) // if the last run of the command just ended
938 {
939 if (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteAfterListItemStatecxx . . $ operation#GetExecuteAfterListItemState(4a668f6de69bf818).(currentAftercxx . . $ luckyBackupWindow#currentAfter.) == true)
940 StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution. = true;
941 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. = 0; //rest the counter for a specific command
942 currentAftercxx . . $ luckyBackupWindow#currentAfter.++; //go to the next pre-task execution command
943 }
944 else
945 {
946 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("repeat-on-fail"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., currentAftercxx . . $ luckyBackupWindow#currentAfter.);
947 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
948 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry.++; // re-run this command, do not proceed to the next one
949 }
950 }
951 else // if the process was successful, go to the next one
952 currentAftercxx . . $ luckyBackupWindow#currentAfter.++; //go to the next post-task execution command
953
954 executeAfterTaskcxx . . $ luckyBackupWindow#executeAfterTask(49f6e7a06ebc5aa8).(); //and executeAfterTask again
955 return;
956 }
957
958 //display a couple of lines to indicate end of task
959 if (StopTaskExecutioncxx . . $ luckyBackupWindow#StopTaskExecution.)
960 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("pre-task-exited-with-error"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., 0);
961 else
962 {
963 if (!DryRuncxx . . $ Global/DryRun.)
964 {
965 // strip unused lines from the snapshot changes file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
966 QStringcxx . . $ QString# filesAdded = ""cxx . . $ QString#QString(85c52e162fed56f9)., snapLine = ""cxx . . $ QString#QString(85c52e162fed56f9).;
967 if (snapfilecxx . . $ Global/snapfile..opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.))
968 {
969 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("."cxx . . $ QString#QString(85c52e162fed56f9).);
970 QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&snapfilecxx . . $ Global/snapfile.);
971 while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).())
972 {
973 snapLine =cxx . . $ QString#`operator=`(4f35bf974e7f8568). in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).();
974 if (snapLine.containscxx . . $ QString#contains(8cce4688c16f48f3).("+++++++"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.))
975 {
976 snapLine =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). snapLine.rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(snapLine.sizecxx . . $ QString#size(455f465bc33b4cdf).()-snapLine.lastIndexOfcxx . . $ QString#lastIndexOf(a1e52806cd31c200).("[LB]"cxx . . $ QString#QString(85c52e162fed56f9).)-removeCharLimitcxx . . $ Global/removeCharLimit.) +cxx . . $ operator+(3d22f08efddf8107). "\n";
977 filesAdded.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(snapLine);
978 }
979 }
980 snapfilecxx . . $ Global/snapfile..closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).();
981 filesAdded.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("[LB]"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); // just to make sure cause sometimes there are [LB]'s left
982 }
983 if (snapfilecxx . . $ Global/snapfile..opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::WriteOnlycxx . . $ QIODevice#WriteOnly.))
984 {
985 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("."cxx . . $ QString#QString(85c52e162fed56f9).);
986 QTextStreamcxx . . $ QTextStream# outcxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&snapfilecxx . . $ Global/snapfile.);
987 out <<cxx . . $ QTextStream#`operator<<`(f61e69e0d177108f). filesAdded;
988 snapfilecxx . . $ Global/snapfile..closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).();
989 }
990 }
991
992 if ((!synccxx . . $ luckyBackupWindow#sync.) || ((synccxx . . $ luckyBackupWindow#sync.) && (syncABcxx . . $ luckyBackupWindow#syncAB.)) )
993 {
994 // Backup profile + logs + snaps to destination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
995
996 QStringcxx . . $ QString# exportProfileDir = ""cxx . . $ QString#QString(85c52e162fed56f9).; QStringcxx . . $ QString# sourceLast=Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSourcecxx . . $ operation#GetSource(6ef7b6c27b00b43d).();
997 //calculate the last folder of source
998 if (!sourceLast.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(SLASHcxx . . $ Global/SLASH.)) // this means task is of type "backup dir by name"
999 sourceLast =cxx . . $ QString#`operator=`(4f35bf974e7f8568). calculateLastPathcxx . . $ Global/calculateLastPath(f7f320d754b8fd09).(sourceLastcxx . . $ QString#QString(132dd6869045752b).); // This is the lowest dir of the source
1000 else
1001 sourceLast =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
1002
1003 if (!rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) //rsyncArguments is calculated at executeRsync()
1004 {
1005 if (WINrunningcxx . . $ Global/WINrunning. && RemoteDestUsed)
1006 exportProfileDir =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..lastcxx . . $ QList#last(19b2b6f17af048b).() +cxx . . $ operator+(fab9b4f80031f353). sourceLast +cxx . . $ operator+(fab9b4f80031f353). XnixSLASHcxx . . $ Global/XnixSLASH. +cxx . . $ operator+(fab9b4f80031f353). snapDefaultDircxx . . $ Global/snapDefaultDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). ".profile" +cxx . . $ operator+(fab9b4f80031f353). XnixSLASHcxx . . $ Global/XnixSLASH.;
1007 else
1008 exportProfileDir =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..lastcxx . . $ QList#last(19b2b6f17af048b).() +cxx . . $ operator+(fab9b4f80031f353). sourceLast +cxx . . $ operator+(fab9b4f80031f353). SLASHcxx . . $ Global/SLASH. +cxx . . $ operator+(fab9b4f80031f353). snapDefaultDircxx . . $ Global/snapDefaultDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). ".profile" +cxx . . $ operator+(fab9b4f80031f353). SLASHcxx . . $ Global/SLASH.;
1009 }
1010
1011 //QMessageBox::information(this, "LB",exportProfileDir); //TESTING
1012
1013 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
1014
1015 // If this is a backup task && not a dryrun, backup profile data to destination
1016 if ( (!synccxx . . $ luckyBackupWindow#sync.) && (!DryRuncxx . . $ Global/DryRun.) && (!rsyncArgumentscxx . . $ luckyBackupWindow#rsyncArguments..isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) )
1017 {
1018 // Create the export path if it does not exist
1019 // local use
1020 QDircxx . . $ QDir# exportPathCreatecxx . . $ QDir#QDir(3520e46b33348bf6). (exportProfileDir);
1021 if ( (!exportPathCreate.existscxx . . $ QDir#exists(50ce9a9e25b4a850).()) && (!RemoteDestUsed) )
1022 exportPathCreate.mkpathcxx . . $ QDir#mkpath(f3b39adf77d9c36c).(exportProfileDir);
1023
1024 if (exportFullProfilecxx . . $ Global/exportFullProfile(80825a4bb658cac2).(exportProfileDircxx . . $ QString#QString(132dd6869045752b).,"ExportOnlyTask"cxx . . $ QString#QString(85c52e162fed56f9).))
1025 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("backup-profile"cxx . . $ QString#QString(85c52e162fed56f9)., " -> Ok"cxx . . $ QString#QString(85c52e162fed56f9)., currentAftercxx . . $ luckyBackupWindow#currentAfter.);
1026 else
1027 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("backup-profile"cxx . . $ QString#QString(85c52e162fed56f9)., " -> Fail"cxx . . $ QString#QString(85c52e162fed56f9)., currentAftercxx . . $ luckyBackupWindow#currentAfter.);
1028
1029 }
1030
1031 outputInsertcxx . . $ luckyBackupWindow#outputInsert..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-finished"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., 0));
1032 }
1033 else
1034 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-finished-sync1"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., 0);
1035 }
1036
1037 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
1038
1039 /* If there is an error repeat the rsync command. Errors:
1040 5 - Error starting client-server protocol
1041 12 - Error in rsync protocol data stream
1042 23 - Partial transfer due to error -> I took this out
1043 30 - Timeout in data send/receive
1044 35 - Timeout waiting for daemon connection
1045 255 - unexplained error */
1046 if ((repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. < repeatOnFailMaxcxx . . $ luckyBackupWindow#repeatOnFailMax.) &&
1047 ( (syncProcesscxx . . $ syncProcess. -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()==30) || (syncProcesscxx . . $ syncProcess. -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()==35) || (syncProcesscxx . . $ syncProcess. -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()==255) ||
1048 (syncProcesscxx . . $ syncProcess. -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()==12) || (syncProcesscxx . . $ syncProcess. -> exitCodecxx . . $ QProcess#exitCode(455f465bc33b4cdf).()==5) || (ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError.) ))
1049 {
1050 outputInsertcxx . . $ luckyBackupWindow#outputInsert. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("repeat-on-fail"cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9)., 0);
1051 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputInsertcxx . . $ luckyBackupWindow#outputInsert.);
1052 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry.++;
1053 executeRsynccxx . . $ luckyBackupWindow#executeRsync(49f6e7a06ebc5aa8).();
1054 return;
1055 }
1056 else
1057 repeatOnFailTrycxx . . $ luckyBackupWindow#repeatOnFailTry. = 0; // reset the runs counter
1058
1059 if ( (synccxx . . $ luckyBackupWindow#sync.) && (!syncABcxx . . $ luckyBackupWindow#syncAB.) ) //sync A->B is finished. Do the opposite now before proceeding to next included operation or post-task commands
1060 executeRsynccxx . . $ luckyBackupWindow#executeRsync(49f6e7a06ebc5aa8).();
1061 else
1062 executeAfterTaskcxx . . $ luckyBackupWindow#executeAfterTask(49f6e7a06ebc5aa8).(); //execute post-task commands (if any)
1063 }
1064
1065 // A process reported an error (eg failed to start or crashed etc)
1066 void luckyBackupWindowcxx . . $ luckyBackupWindow#::procErrorcxx . . $ luckyBackupWindow#procError(49f6e7a06ebc5aa8).()
1067 {
1068 ProcReportedErrorcxx . . $ luckyBackupWindow#ProcReportedError. = true;
1069 QProcesscxx . . $ QProcess#::ProcessErrorcxx . . $ QProcess#ProcessError# commandError = syncProcesscxx . . $ syncProcess. -> errorcxx . . $ QProcess#error(e2b31e94b850a4d7).();
1070 QStringcxx . . $ QString# errorText = trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Unknown error");
1071 switch (commandError)
1072 {
1073 case QProcesscxx . . $ QProcess#::FailedToStartcxx . . $ QProcess#FailedToStart.: errorText =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Failed to start","this refers to a process");
1074 break;
1075 case QProcesscxx . . $ QProcess#::Crashedcxx . . $ QProcess#Crashed. : errorText =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Crashed","this refers to a process");
1076 break;
1077 case QProcesscxx . . $ QProcess#::Timedoutcxx . . $ QProcess#Timedout. : errorText =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Timed out","this refers to a process");
1078 break;
1079 case QProcesscxx . . $ QProcess#::WriteErrorcxx . . $ QProcess#WriteError. : errorText =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Write error","this refers to a process");
1080 break;
1081 case QProcesscxx . . $ QProcess#::ReadErrorcxx . . $ QProcess#ReadError. : errorText =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Read error","this refers to a process");
1082 break;
1083 case QProcesscxx . . $ QProcess#::UnknownErrorcxx . . $ QProcess#UnknownError. : errorText =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Unknown error","this refers to a process");
1084 break;
1085 }
1086
1087 errorsFoundcxx . . $ Global/errorsFound.++;
1088 errorCountcxx . . $ luckyBackupWindow#errorCount.++;
1089 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("process-reported-error"cxx . . $ QString#QString(85c52e162fed56f9)., errorTextcxx . . $ QString#QString(132dd6869045752b)., 0));
1090 setNowDoingcxx . . $ luckyBackupWindow#setNowDoing(49f6e7a06ebc5aa8).();
1091 }
1092 //update dialog with new data (text - progressbar) - also update logfile =======================================================================
1093 void luckyBackupWindowcxx . . $ luckyBackupWindow#::appendRsyncOutputcxx . . $ luckyBackupWindow#appendRsyncOutput(49f6e7a06ebc5aa8).()
1094 {
1095 if (ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) //better safe than sorry :)
1096 return;
1097
1098 setNowDoingcxx . . $ luckyBackupWindow#setNowDoing(49f6e7a06ebc5aa8). (); //update Nowdoing textBrowser
1099
1100 //update textBrowser ------------------------------------------------------------------------------------------------------
1101 QTextCodeccxx . . $ QTextCodec# *codec = QTextCodeccxx . . $ QTextCodec#::codecForNamecxx . . $ QTextCodec#codecForName(914382192c9ca379).("UTF-8");
1102 outputStringcxx . . $ luckyBackupWindow#outputString. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). codec->toUnicodecxx . . $ QTextCodec#toUnicode(5b58488ffc88f4c0).(syncProcesscxx . . $ syncProcess. -> readAllStandardOutputcxx . . $ QProcess#readAllStandardOutput(b3c286cec66e09f4).());
1103 outputErrorcxx . . $ luckyBackupWindow#outputError. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). codec->toUnicodecxx . . $ QTextCodec#toUnicode(5b58488ffc88f4c0).(syncProcesscxx . . $ syncProcess. -> readAllStandardErrorcxx . . $ QProcess#readAllStandardError(b3c286cec66e09f4).());
1104
1105 //if (!showOnlyErrors)
1106 if (!uicxx . . $ luckyBackupWindow#ui..checkBox_onlyShowErrorscxx . . $ Ui_luckyBackupWindow#checkBox_onlyShowErrors. -> isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
1107 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputStringcxx . . $ luckyBackupWindow#outputString.);
1108
1109
1110 logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-standard"cxx . . $ QString#QString(85c52e162fed56f9)., outputStringcxx . . $ QString#QString(132dd6869045752b)., 0);
1111
1112 if (outputErrorcxx . . $ luckyBackupWindow#outputError. !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636)."")
1113 {
1114 errorsFoundcxx . . $ Global/errorsFound.++;
1115 errorCountcxx . . $ luckyBackupWindow#errorCount.++;
1116 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-error"cxx . . $ QString#QString(85c52e162fed56f9)., outputErrorcxx . . $ QString#QString(132dd6869045752b)., 0));
1117 }
1118
1119 //update progressbar--------------------------------------------------------------------------------------------------------
1120 bool ok;
1121 if ( (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("to-check"cxx . . $ QString#QString(85c52e162fed56f9).)) || (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("to-chk"cxx . . $ QString#QString(85c52e162fed56f9).)) ) //we will calculate how many files have been proccessed so far
1122 {
1123 //DoneToTotal_Ref & DoneToTotal_String hold a e.g. "17/84"
1124 QStringRefcxx . . $ QStringRef# DoneToTotal_Refcxx . . $ QStringRef#QStringRef(49f6e7a06ebc5aa8).;
1125 if (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("to-check"cxx . . $ QString#QString(85c52e162fed56f9).)) // if rsync uses "to-check="
1126 DoneToTotal_Ref =cxx . . $ QStringRef#`operator=`(8d821538be7bbf96). outputStringcxx . . $ luckyBackupWindow#outputString..midRefcxx . . $ QString#midRef(d3067bdbc520bd67).(outputStringcxx . . $ luckyBackupWindow#outputString..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("check="cxx . . $ QString#QString(85c52e162fed56f9).)+6,outputStringcxx . . $ luckyBackupWindow#outputString..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(")"cxx . . $ QString#QString(85c52e162fed56f9).)-outputStringcxx . . $ luckyBackupWindow#outputString..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("check="cxx . . $ QString#QString(85c52e162fed56f9).)-6);
1127 else // if rsync uses "to-chk="
1128 DoneToTotal_Ref =cxx . . $ QStringRef#`operator=`(8d821538be7bbf96). outputStringcxx . . $ luckyBackupWindow#outputString..midRefcxx . . $ QString#midRef(d3067bdbc520bd67).(outputStringcxx . . $ luckyBackupWindow#outputString..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("o-chk="cxx . . $ QString#QString(85c52e162fed56f9).)+6,outputStringcxx . . $ luckyBackupWindow#outputString..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(")"cxx . . $ QString#QString(85c52e162fed56f9).)-outputStringcxx . . $ luckyBackupWindow#outputString..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("o-chk="cxx . . $ QString#QString(85c52e162fed56f9).)-6);
1129 QStringcxx . . $ QString# DoneToTotal_String = DoneToTotal_Ref.toStringcxx . . $ QStringRef#toString(6ef7b6c27b00b43d).();
1130
1131 //Total no files
1132 QStringRefcxx . . $ QStringRef# ref_temp = DoneToTotal_String.rightRefcxx . . $ QString#rightRef(b195c912a3976876).(DoneToTotal_String.sizecxx . . $ QString#size(455f465bc33b4cdf).() - DoneToTotal_String.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(SLASHcxx . . $ Global/SLASH.) -1);
1133 QStringcxx . . $ QString# string_temp = ref_temp.toStringcxx . . $ QStringRef#toString(6ef7b6c27b00b43d).();
1134 progress_totalcxx . . $ luckyBackupWindow#progress_total. = string_temp.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(&ok,10);
1135 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setRangecxx . . $ QProgressBar#setRange(3e454b8ccf442868).(0,progress_totalcxx . . $ luckyBackupWindow#progress_total.); //set the range of the progressbar to the no of files to consider
1136
1137 //No of files processed so far
1138 ref_temp =cxx . . $ QStringRef#`operator=`(8d821538be7bbf96). DoneToTotal_String.leftRefcxx . . $ QString#leftRef(b195c912a3976876).(DoneToTotal_String.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(SLASHcxx . . $ Global/SLASH.));
1139 string_temp =cxx . . $ QString#`operator=`(4f35bf974e7f8568). ref_temp.toStringcxx . . $ QStringRef#toString(6ef7b6c27b00b43d).();
1140 progress_donecxx . . $ luckyBackupWindow#progress_done. = string_temp.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(&ok,10);
1141 progress_donecxx . . $ luckyBackupWindow#progress_done. = progress_totalcxx . . $ luckyBackupWindow#progress_total. - progress_donecxx . . $ luckyBackupWindow#progress_done.;
1142 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setValuecxx . . $ QProgressBar#setValue(d4f767463ce0a6b3). (progress_donecxx . . $ luckyBackupWindow#progress_done.); //set the current progressbar value
1143 }
1144 if (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("speedup is"cxx . . $ QString#QString(85c52e162fed56f9).)) //the process has finished, so if we're back fill it to 100%
1145 {
1146 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setRangecxx . . $ QProgressBar#setRange(3e454b8ccf442868).(0,100);
1147 uicxx . . $ luckyBackupWindow#ui..OperationProgresscxx . . $ Ui_luckyBackupWindow#OperationProgress. -> setValuecxx . . $ QProgressBar#setValue(d4f767463ce0a6b3). (100);
1148 }
1149 if (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("building file list"cxx . . $ QString#QString(85c52e162fed56f9).))
1150 {
1151 calculatingcxx . . $ luckyBackupWindow#calculating. = true;
1152 transferringcxx . . $ luckyBackupWindow#transferring. = false;
1153 deletingcxx . . $ luckyBackupWindow#deleting. = false;
1154 }
1155 if (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("files to consider"cxx . . $ QString#QString(85c52e162fed56f9).))
1156 {
1157 calculatingcxx . . $ luckyBackupWindow#calculating. = false;
1158 transferringcxx . . $ luckyBackupWindow#transferring. = true;
1159 deletingcxx . . $ luckyBackupWindow#deleting. = false;
1160 }
1161 if (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("deleting"cxx . . $ QString#QString(85c52e162fed56f9).))
1162 {
1163 calculatingcxx . . $ luckyBackupWindow#calculating. = false;
1164 transferringcxx . . $ luckyBackupWindow#transferring. = false;
1165 deletingcxx . . $ luckyBackupWindow#deleting. = true;
1166 }
1167
1168 // Extraxt some data from the "stats" lines at the end of rsync
1169 if ( (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("Number of files transferred"cxx . . $ QString#QString(85c52e162fed56f9).)) || (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("Total bytes sent:"cxx . . $ QString#QString(85c52e162fed56f9).)) || (outputStringcxx . . $ luckyBackupWindow#outputString..containscxx . . $ QString#contains(8cce4688c16f48f3).("Number of regular files"cxx . . $ QString#QString(85c52e162fed56f9).)) )
1170 {
1171 // split the outputString to lines
1172 QStringcxx . . $ QString# FilesTransferedString=""cxx . . $ QString#QString(85c52e162fed56f9).,BytesTransferedString=""cxx . . $ QString#QString(85c52e162fed56f9).;
1173 QStringListcxx . . $ QStringList# lines = outputStringcxx . . $ luckyBackupWindow#outputString..splitcxx . . $ QString#split(86dfba059c69ed01).( "\n"cxx . . $ QString#QString(85c52e162fed56f9)., QStringcxx . . $ QString#::SkipEmptyPartscxx . . $ QString#SkipEmptyParts. );
1174 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!( QString line, lines )
1175 {
1176 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Number of files transferred:"cxx . . $ QString#QString(85c52e162fed56f9).))
1177 FilesTransferedString =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("Number of files transferred: "cxx . . $ QString#QString(85c52e162fed56f9).); // old rsync report;
1178 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Number of regular files transferred:"cxx . . $ QString#QString(85c52e162fed56f9).))
1179 FilesTransferedString =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("Number of regular files transferred: "cxx . . $ QString#QString(85c52e162fed56f9).); // newer rsync report
1180 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Total transferred file size:"cxx . . $ QString#QString(85c52e162fed56f9).))
1181 BytesTransferedString =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("Total transferred file size: "cxx . . $ QString#QString(85c52e162fed56f9).); // newer rsync report
1182 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Total bytes sent:"cxx . . $ QString#QString(85c52e162fed56f9).))
1183 BytesTransferedString =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("Total bytes sent: "cxx . . $ QString#QString(85c52e162fed56f9).); // old rsync report
1184 }
1185
1186 filesTransferedcxx . . $ Global/filesTransfered. = filesTransferedcxx . . $ Global/filesTransfered. + FilesTransferedString.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(&ok, 10);
1187
1188 BytesTransferedString =cxx . . $ QString#`operator=`(4f35bf974e7f8568). convertBytescxx . . $ luckyBackupWindow#convertBytes(afa4754008a97e3f).(BytesTransferedStringcxx . . $ QString#QString(132dd6869045752b).,false);
1189 bytesTransferedcxx . . $ Global/bytesTransfered. = bytesTransferedcxx . . $ Global/bytesTransfered. + BytesTransferedString.toULongLongcxx . . $ QString#toULongLong(fab7f4fb36759c3a).(&ok, 10);
1190 }
1191 }
1192
1193 /* disable vss until...
1194 void luckyBackupWindow::appendRsyncVssOutput()
1195 {
1196 appendRsyncVssOutput(vssReadSize);
1197 }
1198
1199 //Read size lines, if size=-1 read all file
1200 void luckyBackupWindow::appendRsyncVssOutput(int size)
1201 {
1202 if (ABORTpressed) //better safe than sorry :)
1203 return;
1204 if (doVss==0)
1205 return;
1206 setNowDoing (); //update Nowdoing textBrowser
1207
1208
1209
1210 QString s,se;
1211 if (pipeVssFile->open(QIODevice::ReadOnly | QIODevice::Text))
1212 {
1213 int i=size;
1214 QTextStream stream(pipeVssFile);
1215 stream.setCodec("UTF-8");
1216 stream.seek(vssPos);
1217 outputString="";
1218 s=stream.readLine();
1219 while(!s.isNull()&&i!=0){
1220 outputString=outputString+s+"\n";
1221 s=stream.readLine();
1222 //if (!showOnlyErrors)
1223 i--;
1224 };
1225 vssPos=stream.pos();
1226 pipeVssFile->close();
1227 if (outputString !="")
1228 {
1229 if (!ui.checkBox_onlyShowErrors -> isChecked())
1230 ui.rsyncOutput->append(outputString);
1231 logFileUpdate("rsync-standard", outputString, 0);
1232 //update progressbar--------------------------------------------------------------------------------------------------------
1233 bool ok;
1234 if (outputString.contains("to-check")) //we will calculate how many files have been proccessed so far
1235 {
1236 //DoneToTotal_Ref & DoneToTotal_String hold a e.g. "17/84"
1237 QStringRef DoneToTotal_Ref = outputString.midRef(outputString.indexOf("check=")+6,outputString.indexOf(")")-outputString.indexOf("check=")-6);
1238 QString DoneToTotal_String = DoneToTotal_Ref.toString();
1239
1240 //Total no files
1241 QStringRef ref_temp = DoneToTotal_String.rightRef(DoneToTotal_String.size() - DoneToTotal_String.indexOf(SLASH) -1);
1242 QString string_temp = ref_temp.toString();
1243 progress_total = string_temp.toInt(&ok,10);
1244 ui.OperationProgress -> setRange(0,progress_total); //set the range of the progressbar to the no of files to consider
1245
1246 //No of files processed so far
1247 ref_temp = DoneToTotal_String.leftRef(DoneToTotal_String.indexOf(SLASH));
1248 string_temp = ref_temp.toString();
1249 progress_done = string_temp.toInt(&ok,10);
1250 progress_done = progress_total - progress_done;
1251 ui.OperationProgress -> setValue (progress_done); //set the current progressbar value
1252 }
1253 if (outputString.contains("speedup is")) //the process has finished, so if we're back fill it to 100%
1254 {
1255 ui.OperationProgress -> setRange(0,100);
1256 ui.OperationProgress -> setValue (100);
1257 }
1258 if (outputString.contains("building file list"))
1259 {
1260 calculating = true;
1261 transferring = false;
1262 deleting = false;
1263 }
1264 if (outputString.contains("files to consider"))
1265 {
1266 calculating = false;
1267 transferring = true;
1268 deleting = false;
1269 }
1270 if (outputString.contains("deleting"))
1271 {
1272 calculating = false;
1273 transferring = false;
1274 deleting = true;
1275 }
1276 }
1277 }
1278 if (pipeVssErrFile->open(QIODevice::ReadOnly | QIODevice::Text))
1279 {
1280 int i=size;
1281 QTextStream stream(pipeVssErrFile);
1282 stream.setCodec("UTF-8");
1283 stream.seek(vssErrPos);
1284 outputError="";
1285 se=stream.readLine();
1286 while(!se.isNull()&&i!=0){
1287 outputError=outputError+se+"\n";
1288 se=stream.readLine();
1289 i--;
1290 }
1291
1292 vssErrPos=stream.pos();
1293 pipeVssErrFile->close();
1294 if (outputError !="")
1295 {
1296 errorsFound++;
1297 errorCount++;
1298 ui.rsyncOutput->append(logFileUpdate("rsync-error", outputError, 0));
1299 }
1300 }
1301 if (doVss == 2 && se.isNull() && s.isNull())
1302 {
1303 vssTimer->stop();
1304 doVss = 0;
1305 pipeVssFile->remove();
1306 pipeVssErrFile->remove();
1307 procFinished();
1308
1309 }
1310 }
1311 */
1312 //updates Now Doing textBrowser ===============================================================================================================
1313 void luckyBackupWindowcxx . . $ luckyBackupWindow#::setNowDoingcxx . . $ luckyBackupWindow#setNowDoing(49f6e7a06ebc5aa8).()
1314 {
1315 //calculate elapsed time since all operations start
1316 QTimecxx . . $ QTime# DifTimecxx . . $ QTime#QTime(748afa4755bc9595).(0,0,0,0);
1317 int elapsedMsec = StartTimecxx . . $ StartTime..elapsedcxx . . $ QTime#elapsed(455f465bc33b4cdf).();
1318 DifTime =cxx . . $ QTime#`operator=`(370b645f04941e62). DifTime.addMSecscxx . . $ QTime#addMSecs(902e6118dfa1a226).(elapsedMsec);
1319
1320 if ( (currentOperationcxx . . $ Global/currentOperation. < TotalOperationscxx . . $ Global/TotalOperations.) && (!ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) )
1321 {
1322 if (ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore.)
1323 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "<p align=\"center\">"+cxx . . $ operator+(c75c3ae4eb9af1a8).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Elapsed time")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=red>" +cxx . . $ operator+(fab9b4f80031f353). DifTime.toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("hh:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107).
1324 "</font></b><br>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("pre-task execution of command")+cxx . . $ operator+(3d22f08efddf8107)." : <b>" +cxx . . $ operator+(fab9b4f80031f353).
1325 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteBeforeListItemcxx . . $ operation#GetExecuteBeforeListItem(3f3c3d0e9c0eb37f).(currentBeforecxx . . $ luckyBackupWindow#currentBefore.) +cxx . . $ operator+(3d22f08efddf8107). "</b>";
1326
1327 if (ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter.)
1328 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "<p align=\"center\">"+cxx . . $ operator+(c75c3ae4eb9af1a8).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Elapsed time")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=red>" +cxx . . $ operator+(fab9b4f80031f353). DifTime.toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("hh:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107).
1329 "</font></b><br>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("post-task execution of command")+cxx . . $ operator+(3d22f08efddf8107)." : <b>" +cxx . . $ operator+(fab9b4f80031f353).
1330 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetExecuteAfterListItemcxx . . $ operation#GetExecuteAfterListItem(3f3c3d0e9c0eb37f).(currentAftercxx . . $ luckyBackupWindow#currentAfter.) +cxx . . $ operator+(3d22f08efddf8107). "</b>";
1331
1332 if ( (synccxx . . $ luckyBackupWindow#sync.) && (!ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter.) && (!ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore.) ) //if a sync operation is executed
1333 {
1334 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "<p align=\"center\">"+cxx . . $ operator+(c75c3ae4eb9af1a8).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Elapsed time")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=red>" +cxx . . $ operator+(fab9b4f80031f353). DifTime.toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("hh:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107).
1335 "</font></b><br>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Now performing task")+cxx . . $ operator+(3d22f08efddf8107)." : <b>" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107).
1336 "</b>";
1337
1338 if (DryRuncxx . . $ Global/DryRun.)
1339 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(" <b><font color=magenta>(" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("simulation mode") +cxx . . $ operator+(3d22f08efddf8107). ")</font>");
1340
1341 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(d02845eef0c33901).("</p>");
1342 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Directory")+cxx . . $ operator+(3d22f08efddf8107)." A : <b><font color=blue>" +cxx . . $ operator+(fab9b4f80031f353). dirAcxx . . $ luckyBackupWindow#dirA. +cxx . . $ operator+(3d22f08efddf8107).
1343 "</font></b><br>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Directory")+cxx . . $ operator+(3d22f08efddf8107)." B : <b><font color=blue>" +cxx . . $ operator+(fab9b4f80031f353). dirBcxx . . $ luckyBackupWindow#dirB. +cxx . . $ operator+(3d22f08efddf8107). "</font></b><br>");
1344
1345 if (calculatingcxx . . $ luckyBackupWindow#calculating.)
1346 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("calculating","info message displayed during ...calculations")+cxx . . $ operator+(3d22f08efddf8107).": " +cxx . . $ operator+(fab9b4f80031f353). outputStringcxx . . $ luckyBackupWindow#outputString.);
1347 if (transferringcxx . . $ luckyBackupWindow#transferring.)
1348 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("transferring files","info message displayed during ...file transfers")+cxx . . $ operator+(3d22f08efddf8107).": " +cxx . . $ operator+(fab9b4f80031f353). outputStringcxx . . $ luckyBackupWindow#outputString.);
1349 if (deletingcxx . . $ luckyBackupWindow#deleting.)
1350 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("deleting files","info message displayed during ...file deletions")+cxx . . $ operator+(3d22f08efddf8107).": " +cxx . . $ operator+(fab9b4f80031f353). outputStringcxx . . $ luckyBackupWindow#outputString.);
1351 }
1352
1353 if ( (!synccxx . . $ luckyBackupWindow#sync.) && (!ExecuteAftercxx . . $ luckyBackupWindow#ExecuteAfter.) && (!ExecuteBeforecxx . . $ luckyBackupWindow#ExecuteBefore.) ) //if a backup operation is executed
1354 {
1355 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "<p align=\"center\">"+cxx . . $ operator+(c75c3ae4eb9af1a8).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Elapsed time")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=red>" +cxx . . $ operator+(fab9b4f80031f353). DifTime.toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("hh:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107).
1356 "</font></b><br>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Now performing task")+cxx . . $ operator+(3d22f08efddf8107)." : <b>" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107).
1357 "</b>";
1358
1359 if (DryRuncxx . . $ Global/DryRun.)
1360 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(" <b><font color=magenta>(" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("simulation mode") +cxx . . $ operator+(3d22f08efddf8107). ")</font>");
1361
1362 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(d02845eef0c33901).("</p>");
1363 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Source")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=blue>" +cxx . . $ operator+(fab9b4f80031f353). dirAcxx . . $ luckyBackupWindow#dirA. +cxx . . $ operator+(3d22f08efddf8107).
1364 "</font></b><br>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Destination")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=blue>" +cxx . . $ operator+(fab9b4f80031f353). dirBcxx . . $ luckyBackupWindow#dirB. +cxx . . $ operator+(3d22f08efddf8107). "</font></b><br>");
1365
1366 if (calculatingcxx . . $ luckyBackupWindow#calculating.)
1367 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("calculating")+cxx . . $ operator+(3d22f08efddf8107).": " +cxx . . $ operator+(fab9b4f80031f353). outputStringcxx . . $ luckyBackupWindow#outputString.);
1368 if (transferringcxx . . $ luckyBackupWindow#transferring.)
1369 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("transferring files")+cxx . . $ operator+(3d22f08efddf8107).": " +cxx . . $ operator+(fab9b4f80031f353). outputStringcxx . . $ luckyBackupWindow#outputString.);
1370 if (deletingcxx . . $ luckyBackupWindow#deleting.)
1371 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("deleting files")+cxx . . $ operator+(3d22f08efddf8107).": " +cxx . . $ operator+(fab9b4f80031f353). outputStringcxx . . $ luckyBackupWindow#outputString.);
1372 }
1373 }
1374
1375 if ( (currentOperationcxx . . $ Global/currentOperation. == TotalOperationscxx . . $ Global/TotalOperations.) && (!ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.)) //if all operations finished normally - not aborted
1376 {
1377 NOWexecutingcxx . . $ luckyBackupWindow#NOWexecuting. = false; //this is mainly used if the window close button (or alt+F4) is pressed
1378
1379 if (filesTransferedcxx . . $ Global/filesTransfered. == 0)
1380 bytesTransferedcxx . . $ Global/bytesTransfered. = 0;
1381
1382 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "<p align=\"center\">"+cxx . . $ operator+(c75c3ae4eb9af1a8).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Elapsed time")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=red>" +cxx . . $ operator+(fab9b4f80031f353). DifTime.toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("hh:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107).
1383 "</font></b><br>" +cxx . . $ operator+(fab9b4f80031f353).
1384 trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Total files transferred") +cxx . . $ operator+(3d22f08efddf8107). " : <b>" +cxx . . $ operator+(fab9b4f80031f353). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).(filesTransferedcxx . . $ Global/filesTransfered.) +cxx . . $ operator+(3d22f08efddf8107). "</b> (" +cxx . . $ operator+(fab9b4f80031f353). convertBytescxx . . $ luckyBackupWindow#convertBytes(afa4754008a97e3f).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f5a84b9651713264).(bytesTransferedcxx . . $ Global/bytesTransfered.),true) +cxx . . $ operator+(3d22f08efddf8107).")<br>"
1385 "========================================="
1386 "<b><br><font color=blue>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("All tasks completed")+cxx . . $ operator+(3d22f08efddf8107)." </font></b>";
1387 trayMessagecxx . . $ luckyBackupWindow#trayMessage. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("All tasks completed");
1388 if (DryRuncxx . . $ Global/DryRun.)
1389 {
1390 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(" <b><font color=magenta>(" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("simulation mode") +cxx . . $ operator+(3d22f08efddf8107). ")</b></font>");
1391 trayMessagecxx . . $ luckyBackupWindow#trayMessage..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(" (" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("simulation mode") +cxx . . $ operator+(3d22f08efddf8107). ")");
1392 }
1393 if (errorsFoundcxx . . $ Global/errorsFound. == 0)
1394 {
1395 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).("<br><font color=green>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("No errors found") +cxx . . $ operator+(3d22f08efddf8107). "</font><br>");
1396 trayMessagecxx . . $ luckyBackupWindow#trayMessage..appendcxx . . $ QString#append(6a89d0b7f4d2681c).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("No errors found"));
1397 }
1398 else
1399 {
1400 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).("<br><font color=green>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("errors found") +cxx . . $ operator+(3d22f08efddf8107). ": " +cxx . . $ operator+(fab9b4f80031f353). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).(errorsFoundcxx . . $ Global/errorsFound.) +cxx . . $ operator+(3d22f08efddf8107)."</font><br>");
1401 trayMessagecxx . . $ luckyBackupWindow#trayMessage..appendcxx . . $ QString#append(6a89d0b7f4d2681c).("\n" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("errors found"));
1402
1403 // initialize jump to next error button
1404 firstScrollcxx . . $ luckyBackupWindow#firstScroll.=true;
1405 errorCountcxx . . $ luckyBackupWindow#errorCount. = 0;
1406 uicxx . . $ luckyBackupWindow#ui..pushButton_nextErrorcxx . . $ Ui_luckyBackupWindow#pushButton_nextError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
1407 }
1408 if (!DryRuncxx . . $ Global/DryRun.)
1409 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("logfile(s) have been created under directory: ")+cxx . . $ operator+(fab9b4f80031f353). logDircxx . . $ Global/logDir. +cxx . . $ operator+(3d22f08efddf8107)."<br>");
1410 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(d02845eef0c33901).("=========================================</p>");
1411 uicxx . . $ luckyBackupWindow#ui..AbortButtoncxx . . $ Ui_luckyBackupWindow#AbortButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
1412 uicxx . . $ luckyBackupWindow#ui..DoneButtoncxx . . $ Ui_luckyBackupWindow#DoneButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
1413 uicxx . . $ luckyBackupWindow#ui..pushButton_minimizeToTraycxx . . $ Ui_luckyBackupWindow#pushButton_minimizeToTray. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
1414
1415 //update tray baloon
1416 if ( (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ()) && (QSystemTrayIconcxx . . $ QSystemTrayIcon#::supportsMessagescxx . . $ QSystemTrayIcon#supportsMessages(c9857a73d68e59ba). ()) )
1417 {
1418 if (KDErunningcxx . . $ Global/KDErunning.)
1419 {
1420 QProcesscxx . . $ QProcess# *dialogProcess; dialogProcess = new QProcesscxx . . $ QProcess#(this);
1421 QStringListcxx . . $ QStringList# dialogArgscxx . . $ QStringList#QStringList(ced63f7c635d850d).;
1422 dialogArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--title"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). appNamecxx . . $ Global/appName. +cxx . . $ operator+(3d22f08efddf8107). " - " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("execution of profile:") +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("finished") <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--passivepopup"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). trayMessagecxx . . $ luckyBackupWindow#trayMessage. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "10"cxx . . $ QString#QString(85c52e162fed56f9).;
1423 dialogProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). ("kdialog"cxx . . $ QString#QString(85c52e162fed56f9).,dialogArgs);
1424 }
1425 else
1426 LBtraycxx . . $ luckyBackupWindow#LBtray. -> showMessagecxx . . $ QSystemTrayIcon#showMessage(d234e6c04c1013f3). (appNamecxx . . $ Global/appName. +cxx . . $ operator+(3d22f08efddf8107). " - " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("execution of profile:") +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("finished") , trayMessagecxx . . $ luckyBackupWindow#trayMessage.,
1427 QSystemTrayIconcxx . . $ QSystemTrayIcon#::Informationcxx . . $ QSystemTrayIcon#Information.,3000);
1428 actionAbortcxx . . $ luckyBackupWindow#actionAbort. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
1429 }
1430
1431 finishUpcxx . . $ luckyBackupWindow#finishUp(49f6e7a06ebc5aa8).();
1432
1433 // bring the system down if the relevant button is pressed
1434 if (uicxx . . $ luckyBackupWindow#ui..pushButton_shutdowncxx . . $ Ui_luckyBackupWindow#pushButton_shutdown. -> isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
1435 shutDownSystemcxx . . $ luckyBackupWindow#shutDownSystem(49f6e7a06ebc5aa8).();
1436
1437 if ( (silentModecxx . . $ Global/silentMode.) && (isMinimizedToTraycxx . . $ luckyBackupWindow#isMinimizedToTray. == true) ) // if --silent is given as argument and the gui is not shown exit the app
1438 {
1439 //delay the app exit for 3 seconds
1440 QTimecxx . . $ QTime# StartSleepcxx . . $ QTime#QTime(748afa4755bc9595).(0,0,0,0);
1441 StartSleep.startcxx . . $ QTime#start(49f6e7a06ebc5aa8).();
1442 int elapsedSleepMsec = 0;
1443
1444 while (elapsedSleepMsec < 3000)
1445 elapsedSleepMsec = StartSleep.elapsedcxx . . $ QTime#elapsed(455f465bc33b4cdf).();
1446
1447 exitcxx . . $ exit(44ed87f96534fad7).(0); //quit
1448 }
1449 }
1450
1451 if (ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) //if operations were terminated by user
1452 {
1453 NOWexecutingcxx . . $ luckyBackupWindow#NOWexecuting. = false; //this is mainly used if the window close button (or alt+F4) is pressed
1454 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "<p align=\"center\">"+cxx . . $ operator+(c75c3ae4eb9af1a8).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Elapsed time")+cxx . . $ operator+(3d22f08efddf8107)." : <b><font color=red>" +cxx . . $ operator+(fab9b4f80031f353). DifTime.toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("hh:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107).
1455 "</font></b><br>========================================="
1456 "<br><b><font color=blue>"+cxx . . $ operator+(fab9b4f80031f353).trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Execution of tasks were terminated violently by user")+cxx . . $ operator+(3d22f08efddf8107)."</font></b><br>";
1457 trayMessagecxx . . $ luckyBackupWindow#trayMessage. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("Execution of tasks were terminated violently by user");
1458
1459 if (!DryRuncxx . . $ Global/DryRun.)
1460 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("logfile(s) have been created under directory: ")+cxx . . $ operator+(fab9b4f80031f353). logDircxx . . $ Global/logDir. +cxx . . $ operator+(3d22f08efddf8107)."<br>");
1461 nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText..appendcxx . . $ QString#append(d02845eef0c33901).("=========================================</p>");
1462 uicxx . . $ luckyBackupWindow#ui..AbortButtoncxx . . $ Ui_luckyBackupWindow#AbortButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
1463 uicxx . . $ luckyBackupWindow#ui..DoneButtoncxx . . $ Ui_luckyBackupWindow#DoneButton. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
1464 uicxx . . $ luckyBackupWindow#ui..pushButton_minimizeToTraycxx . . $ Ui_luckyBackupWindow#pushButton_minimizeToTray. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
1465 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("<br><font color=red><b>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("ABORTED") +cxx . . $ operator+(3d22f08efddf8107). " !!</b></font>");
1466
1467 //update tray baloon
1468 if ( (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ()) && (QSystemTrayIconcxx . . $ QSystemTrayIcon#::supportsMessagescxx . . $ QSystemTrayIcon#supportsMessages(c9857a73d68e59ba). ()) )
1469 {
1470 if (KDErunningcxx . . $ Global/KDErunning.)
1471 {
1472 QProcesscxx . . $ QProcess# *dialogProcess; dialogProcess = new QProcesscxx . . $ QProcess#(this);
1473 QStringListcxx . . $ QStringList# dialogArgscxx . . $ QStringList#QStringList(ced63f7c635d850d).;
1474 dialogArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--title"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). appNamecxx . . $ Global/appName. +cxx . . $ operator+(3d22f08efddf8107). " - " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("execution of profile:") +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("finished") <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--passivepopup"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). trayMessagecxx . . $ luckyBackupWindow#trayMessage. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "10"cxx . . $ QString#QString(85c52e162fed56f9).;
1475 dialogProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). ("kdialog"cxx . . $ QString#QString(85c52e162fed56f9).,dialogArgs);
1476 }
1477 else
1478 LBtraycxx . . $ luckyBackupWindow#LBtray. -> showMessagecxx . . $ QSystemTrayIcon#showMessage(d234e6c04c1013f3). (appNamecxx . . $ Global/appName. +cxx . . $ operator+(3d22f08efddf8107). " - " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("execution of profile:") +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("finished") , trayMessagecxx . . $ luckyBackupWindow#trayMessage.,
1479 QSystemTrayIconcxx . . $ QSystemTrayIcon#::Informationcxx . . $ QSystemTrayIcon#Information.,3000);
1480 actionAbortcxx . . $ luckyBackupWindow#actionAbort. -> setVisiblecxx . . $ QAction#setVisible(b45ddcbc8423892c).(false);
1481 }
1482
1483 if (errorsFoundcxx . . $ Global/errorsFound. > 0)// initialize jump to next error button
1484 {
1485 firstScrollcxx . . $ luckyBackupWindow#firstScroll.=true;
1486 uicxx . . $ luckyBackupWindow#ui..pushButton_nextErrorcxx . . $ Ui_luckyBackupWindow#pushButton_nextError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
1487 }
1488
1489 finishUpcxx . . $ luckyBackupWindow#finishUp(49f6e7a06ebc5aa8).();
1490 if (!DryRuncxx . . $ Global/DryRun.)
1491 {
1492 // strip unused lines from the snapshot changes file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
1493 QStringcxx . . $ QString# filesAdded = ""cxx . . $ QString#QString(85c52e162fed56f9)., snapLine = ""cxx . . $ QString#QString(85c52e162fed56f9).;
1494 if (snapfilecxx . . $ Global/snapfile..opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.))
1495 {
1496 QTextStreamcxx . . $ QTextStream# incxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&snapfilecxx . . $ Global/snapfile.);
1497 while (!in.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).())
1498 {
1499 snapLine =cxx . . $ QString#`operator=`(4f35bf974e7f8568). in.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).();
1500 if (snapLine.containscxx . . $ QString#contains(8cce4688c16f48f3).("+++++++"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.))
1501 {
1502 snapLine =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). snapLine.rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(snapLine.sizecxx . . $ QString#size(455f465bc33b4cdf).()-snapLine.lastIndexOfcxx . . $ QString#lastIndexOf(a1e52806cd31c200).("[LB]"cxx . . $ QString#QString(85c52e162fed56f9).)-removeCharLimitcxx . . $ Global/removeCharLimit.) +cxx . . $ operator+(3d22f08efddf8107). "\n";
1503 filesAdded.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(snapLine);
1504 }
1505 }
1506 snapfilecxx . . $ Global/snapfile..closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).();
1507 filesAdded.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("[LB]"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); // just to make sure cause sometimes there are [LB]'s left
1508 }
1509 if (snapfilecxx . . $ Global/snapfile..opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::WriteOnlycxx . . $ QIODevice#WriteOnly.))
1510 {
1511 QTextStreamcxx . . $ QTextStream# outcxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&snapfilecxx . . $ Global/snapfile.);
1512 out <<cxx . . $ QTextStream#`operator<<`(f61e69e0d177108f). filesAdded;
1513 snapfilecxx . . $ Global/snapfile..closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).();
1514 }
1515 }
1516
1517 if ( (silentModecxx . . $ Global/silentMode.) && (isMinimizedToTraycxx . . $ luckyBackupWindow#isMinimizedToTray. == true) ) // if --silent is given as argument and the gui is not shown, exit the app
1518 exitcxx . . $ exit(44ed87f96534fad7).(0); //quit
1519 }
1520 uicxx . . $ luckyBackupWindow#ui..nowDoingcxx . . $ Ui_luckyBackupWindow#nowDoing. -> setTextcxx . . $ QTextEdit#setText(3520e46b33348bf6). (nowDoingTextcxx . . $ luckyBackupWindow#nowDoingText.);
1521 }
1522
1523 // function finishUp=====================================================================================================
1524 // finish up some stuff when all tasks finish either normally or aborted
1525 void luckyBackupWindowcxx . . $ luckyBackupWindow#::finishUpcxx . . $ luckyBackupWindow#finishUp(49f6e7a06ebc5aa8).()
1526 {
1527 if (!DryRuncxx . . $ Global/DryRun.)
1528 {
1529 //save the profile to update last execution times & no of errors
1530 if (!saveProfilecxx . . $ Global/saveProfile(7dc6c9a0b6a7270f).(currentProfilecxx . . $ QString#QString(132dd6869045752b).))
1531 {
1532 savedProfilecxx . . $ luckyBackupWindow#savedProfile. = false;
1533 uicxx . . $ luckyBackupWindow#ui..actionSavecxx . . $ Ui_luckyBackupWindow#actionSave. -> setEnabledcxx . . $ QAction#setEnabled(b45ddcbc8423892c).(true);
1534 }
1535 else
1536 {
1537 savedProfilecxx . . $ luckyBackupWindow#savedProfile. = true; //change profile status to "saved"
1538 uicxx . . $ luckyBackupWindow#ui..actionSavecxx . . $ Ui_luckyBackupWindow#actionSave. -> setEnabledcxx . . $ QAction#setEnabled(b45ddcbc8423892c).(false);
1539 }
1540
1541 logfilecxx . . $ Global/logfile..closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); // close the logfile
1542
1543 // send an email
1544 if ( (!ABORTpressedcxx . . $ luckyBackupWindow#ABORTpressed.) && (!emailNevercxx . . $ Global/emailNever.) )
1545 {
1546 bool send = true;
1547 if ( ((emailErrorcxx . . $ Global/emailError.) && (errorsFoundcxx . . $ Global/errorsFound. == 0)) // do not send if the condition "error" is checked and there are no errors
1548 ||
1549 ((emailSchedulecxx . . $ Global/emailSchedule.) && (!silentModecxx . . $ Global/silentMode.)) ) // do not send if the condition "scheduled" is checked and profile is not run in silent mode
1550
1551 send = false;
1552
1553 // ***** console mode and "schedule" is covered in commandline.cpp ******
1554
1555 if (send)
1556 {
1557 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("<font color=green>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font>"cxx . . $ QString#QString(85c52e162fed56f9).);
1558 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).( "trying to send an email"));
1559 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).( " . . ."cxx . . $ QString#QString(85c52e162fed56f9).);
1560 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(sendEmailNowcxx . . $ Global/sendEmailNow(f4d483874300e612).(false));
1561 }
1562 }
1563 }
1564
1565 shutdownToolbarcxx . . $ luckyBackupWindow#shutdownToolbar.-> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
1566
1567 // TESTING-TESTING-TESTING-TESTING-TESTING-TESTING
1568 //QMessageBox::information(this, "LB","QtextDocument title= **" + ui.rsyncOutput->documentTitle() +"**");
1569 }
1570
1571 // function shutDownSystem=====================================================================================================
1572 // shutdown the system if the relevant button is pressed, when all tasks are finished
1573 void luckyBackupWindowcxx . . $ luckyBackupWindow#::shutDownSystemcxx . . $ luckyBackupWindow#shutDownSystem(49f6e7a06ebc5aa8).()
1574 {
1575 QProcesscxx . . $ QProcess# *shutdownProcess;
1576 shutdownProcess = new QProcesscxx . . $ QProcess#(this);
1577 QStringcxx . . $ QString# shutdownCommand=""cxx . . $ QString#QString(85c52e162fed56f9).; QStringListcxx . . $ QStringList# shutdownArgscxx . . $ QStringList#QStringList(ced63f7c635d850d).; shutdownArgs.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
1578
1579 if (KDErunningcxx . . $ Global/KDErunning.)
1580 {
1581 shutdownCommand =cxx . . $ QString#`operator=`(d02845eef0c33901). "/usr/bin/qdbus";
1582 shutdownArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "org.kde.ksmserver"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "/KSMServer"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "org.kde.KSMServerInterface.logout"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "1"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "2"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "2"cxx . . $ QString#QString(85c52e162fed56f9).;
1583 }
1584 else if (currentUsercxx . . $ Global/currentUser. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "super user")
1585 {
1586 shutdownCommand =cxx . . $ QString#`operator=`(d02845eef0c33901). "/sbin/shutdown";
1587 shutdownArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "-h"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "1"cxx . . $ QString#QString(85c52e162fed56f9).;
1588 if ( (QSystemTrayIconcxx . . $ QSystemTrayIcon#::isSystemTrayAvailablecxx . . $ QSystemTrayIcon#isSystemTrayAvailable(c9857a73d68e59ba). ()) && (QSystemTrayIconcxx . . $ QSystemTrayIcon#::supportsMessagescxx . . $ QSystemTrayIcon#supportsMessages(c9857a73d68e59ba). ()) )
1589 LBtraycxx . . $ luckyBackupWindow#LBtray. -> showMessagecxx . . $ QSystemTrayIcon#showMessage(d234e6c04c1013f3). (appNamecxx . . $ Global/appName. +cxx . . $ operator+(3d22f08efddf8107). " - " +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("WARNING"), trcxx . . $ luckyBackupWindow#tr(75d9f1c324b4579d).("The system will shutdown in 1 minute"), QSystemTrayIconcxx . . $ QSystemTrayIcon#::Informationcxx . . $ QSystemTrayIcon#Information.,3000);
1590 }
1591
1592 shutdownProcess -> startcxx . . $ QProcess#start(5e315ba9c811784d). (shutdownCommand,shutdownArgs);
1593
1594 //delay the app exit for 3 seconds
1595 QTimecxx . . $ QTime# StartSleepcxx . . $ QTime#QTime(748afa4755bc9595).(0,0,0,0);
1596 StartSleep.startcxx . . $ QTime#start(49f6e7a06ebc5aa8).();
1597 int elapsedSleepMsec = 0;
1598 while (elapsedSleepMsec < 3000)
1599 elapsedSleepMsec = StartSleep.elapsedcxx . . $ QTime#elapsed(455f465bc33b4cdf).();
1600 exitcxx . . $ exit(44ed87f96534fad7).(0); //quit
1601 }
1602
1603 // previous error button pressed=====================================================================================================
1604 void luckyBackupWindowcxx . . $ luckyBackupWindow#::previousErrorJumpcxx . . $ luckyBackupWindow#previousErrorJump(49f6e7a06ebc5aa8).()
1605 {
1606 errorCountcxx . . $ luckyBackupWindow#errorCount.--; //decrease the current error by one
1607
1608 if (errorCountcxx . . $ luckyBackupWindow#errorCount. == 0 ) // if the current error is the first within the logfile disable the previous button
1609 uicxx . . $ luckyBackupWindow#ui..pushButton_previousErrorcxx . . $ Ui_luckyBackupWindow#pushButton_previousError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
1610
1611 if (errorCountcxx . . $ luckyBackupWindow#errorCount. < errorsFoundcxx . . $ Global/errorsFound.-1) //if the current error is less than the last one within the logfile enable the next button
1612 uicxx . . $ luckyBackupWindow#ui..pushButton_nextErrorcxx . . $ Ui_luckyBackupWindow#pushButton_nextError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
1613
1614 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput. -> scrollToAnchorcxx . . $ QTextEdit#scrollToAnchor(3520e46b33348bf6).("error" +cxx . . $ operator+(c75c3ae4eb9af1a8). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).(errorCountcxx . . $ luckyBackupWindow#errorCount.+1));
1615 }
1616
1617 // next error button pressed=====================================================================================================
1618 void luckyBackupWindowcxx . . $ luckyBackupWindow#::nextErrorJumpcxx . . $ luckyBackupWindow#nextErrorJump(49f6e7a06ebc5aa8).()
1619 {
1620 if (!firstScrollcxx . . $ luckyBackupWindow#firstScroll.)
1621 errorCountcxx . . $ luckyBackupWindow#errorCount.++; // increase the current error by one
1622 firstScrollcxx . . $ luckyBackupWindow#firstScroll. = false;
1623
1624 if (errorCountcxx . . $ luckyBackupWindow#errorCount. == errorsFoundcxx . . $ Global/errorsFound.-1) // If the current error is the last within the logfile disable the next button
1625 uicxx . . $ luckyBackupWindow#ui..pushButton_nextErrorcxx . . $ Ui_luckyBackupWindow#pushButton_nextError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
1626
1627 if (errorCountcxx . . $ luckyBackupWindow#errorCount. > 0) // if the current error is greater than the first one within the logfile enable the previous button
1628 uicxx . . $ luckyBackupWindow#ui..pushButton_previousErrorcxx . . $ Ui_luckyBackupWindow#pushButton_previousError. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
1629
1630 uicxx . . $ luckyBackupWindow#ui..rsyncOutputcxx . . $ Ui_luckyBackupWindow#rsyncOutput. -> scrollToAnchorcxx . . $ QTextEdit#scrollToAnchor(3520e46b33348bf6).("error" +cxx . . $ operator+(c75c3ae4eb9af1a8). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).(errorCountcxx . . $ luckyBackupWindow#errorCount.+1));
1631 }
1632
1633 // convertBytes (QString,bool)
1634 // Converts a string of the form 67M to bytes and vice versa (eg 1024 -> 1KB)
1635 // if bool=false then conversion string->bytes. If bool=true then conversion bytes->string
1636 // =====================================================================================================
1637 QStringcxx . . $ QString# luckyBackupWindowcxx . . $ luckyBackupWindow#::convertBytescxx . . $ luckyBackupWindow#convertBytes(afa4754008a97e3f). (QStringcxx . . $ QString# byteLine,bool toWhat)
1638 {
1639 QStringcxx . . $ QString# returnThis = ""cxx . . $ QString#QString(85c52e162fed56f9).;
1640 bool ok;
1641
1642 if (toWhat) // convert bytes to string
1643 {
1644 QStringcxx . . $ QString# multi = " bytes"cxx . . $ QString#QString(85c52e162fed56f9).;
1645 double bytesFLOAT = byteLine.toDoublecxx . . $ QString#toDouble(1bd8e57dd4a29c14).(&ok);
1646
1647 if (bytesFLOAT >= 1024)
1648 {
1649 bytesFLOAT = bytesFLOAT / 1024;
1650 multi =cxx . . $ QString#`operator=`(d02845eef0c33901). "KB";
1651 }
1652 if (bytesFLOAT >= 1024)
1653 {
1654 bytesFLOAT = bytesFLOAT / 1024;
1655 multi =cxx . . $ QString#`operator=`(d02845eef0c33901). "MB";
1656 }
1657 if (bytesFLOAT >= 1024)
1658 {
1659 bytesFLOAT = bytesFLOAT / 1024;
1660 multi =cxx . . $ QString#`operator=`(d02845eef0c33901). "GB";
1661 }
1662 if (bytesFLOAT >= 1024)
1663 {
1664 bytesFLOAT = bytesFLOAT / 1024;
1665 multi =cxx . . $ QString#`operator=`(d02845eef0c33901). "TB";
1666 }
1667 returnThis =cxx . . $ QString#`operator=`(4f35bf974e7f8568). (QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(bytesFLOAT));
1668 if ( (returnThis.containscxx . . $ QString#contains(8cce4688c16f48f3).("."cxx . . $ QString#QString(85c52e162fed56f9).)) && ((returnThis.lastIndexOfcxx . . $ QString#lastIndexOf(a1e52806cd31c200).("."cxx . . $ QString#QString(85c52e162fed56f9).) + 3) < returnThis.sizecxx . . $ QString#size(455f465bc33b4cdf).()) )
1669 returnThis.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(returnThis.sizecxx . . $ QString#size(455f465bc33b4cdf).() - returnThis.lastIndexOfcxx . . $ QString#lastIndexOf(a1e52806cd31c200).("."cxx . . $ QString#QString(85c52e162fed56f9).) - 3); // leave only 3 decimal points
1670 returnThis =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). returnThis +cxx . . $ operator+(fab9b4f80031f353). multi;
1671 }
1672 else // convert string to bytes
1673 {
1674 unsigned long long int multiply = 1;
1675
1676 if (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("K"cxx . . $ QString#QString(85c52e162fed56f9).))
1677 multiply = 1024;
1678 if (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("M"cxx . . $ QString#QString(85c52e162fed56f9).))
1679 multiply = powcxx . . $ pow(9454dda30a4b8335).(1024,2);
1680 if (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("G"cxx . . $ QString#QString(85c52e162fed56f9).))
1681 multiply = powcxx . . $ pow(9454dda30a4b8335).(1024,3);
1682 if (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("T"cxx . . $ QString#QString(85c52e162fed56f9).))
1683 multiply = powcxx . . $ pow(9454dda30a4b8335).(1024,4);
1684
1685 if ( (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("K"cxx . . $ QString#QString(85c52e162fed56f9).)) || (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("M"cxx . . $ QString#QString(85c52e162fed56f9).)) ||
1686 (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("G"cxx . . $ QString#QString(85c52e162fed56f9).)) || (byteLine.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("T"cxx . . $ QString#QString(85c52e162fed56f9).)) )
1687 byteLine.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1);
1688
1689 unsigned long long int returnThisNo = byteLine.toDoublecxx . . $ QString#toDouble(1bd8e57dd4a29c14).(&ok) * multiply;
1690 returnThis =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f5a84b9651713264).( returnThisNo);
1691 }
1692
1693 return returnThiscxx . . $ QString#QString(28715ad661ad3cec).;
1694
1695 }
1696 // end of executenow.cpp ---------------------------------------------------------------------------
1697