| 1 | /**************************************************************************** |
| 2 | Copyright (C) VCreate Logic Private Limited, Bangalore |
| 3 | Contact: [email protected] |
| 4 | |
| 5 | This file is developed by VCreate Logic Private Limited and used as part of the "luckyBackup" project |
| 6 | It is distributed under the terms of the GNU General Public License |
| 7 | It is free software: you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation, either version 3 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | It is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with the luckyBackup project. If not, see <http://www.gnu.org/licenses/>. |
| 19 | |
| 20 | ****************************************************************************/ |
| 21 | // modified on 22 May 2016 |
| 22 | // by luckyb after Lothar's fixes |
| 23 | |
| 24 | #include "RsyncDirModel_p.h"cxx . . $ `<file>/src/RsyncDirModel_p.h`/ |
| 25 | |
| 26 | #include <QFileIconProvider> |
| 27 | #include <QPixmapCache> |
| 28 | #include <QDesktopServices> |
| 29 | #include <QDir> |
| 30 | #include <QIcon> |
| 31 | #include <QPixmap> |
| 32 | #include <QTextCodec> |
| 33 | |
| 34 | /////////////////////////////////////////////////////////////////////////////// |
| 35 | // RsyncEntry |
| 36 | /////////////////////////////////////////////////////////////////////////////// |
| 37 | |
| 38 | struct RsyncEntryDatacxx . . $ RsyncEntryData# |
| 39 | { |
| 40 | RsyncEntryDatacxx . . $ RsyncEntryData#RsyncEntryData(49f6e7a06ebc5aa8).() : parentcxx . . $ RsyncEntryData#parent.(0), |
| 41 | childrenFetchedcxx . . $ RsyncEntryData#childrenFetched.(false), |
| 42 | fetchingcxx . . $ RsyncEntryData#fetching.(false) { } |
| 43 | |
| 44 | QUrlInfocxx . . $ QUrlInfo# urlInfocxx . . $ RsyncEntryData#urlInfo.; |
| 45 | |
| 46 | RsyncEntrycxx . . $ RsyncEntry#* parentcxx . . $ RsyncEntryData#parent.; |
| 47 | QListcxx . . $ QList#<RsyncEntrycxx . . $ RsyncEntry#*> childrencxx . . $ RsyncEntryData#children.; |
| 48 | bool childrenFetchedcxx . . $ RsyncEntryData#childrenFetched.; |
| 49 | bool fetchingcxx . . $ RsyncEntryData#fetching.; |
| 50 | QStringcxx . . $ QString# pathcxx . . $ RsyncEntryData#path.; |
| 51 | QIconcxx . . $ QIcon# iconcxx . . $ RsyncEntryData#icon.; |
| 52 | |
| 53 | }; |
| 54 | |
| 55 | |
| 56 | |
| 57 | RsyncEntrycxx . . $ RsyncEntry#::RsyncEntrycxx . . $ RsyncEntry#RsyncEntry(ed216b1bc01b0eea).(const QUrlInfocxx . . $ QUrlInfo#& info) |
| 58 | { |
| 59 | dcxx . . $ RsyncEntry#d. = new RsyncEntryDatacxx . . $ RsyncEntryData#RsyncEntryData(49f6e7a06ebc5aa8).; |
| 60 | dcxx . . $ RsyncEntry#d.->urlInfocxx . . $ RsyncEntryData#urlInfo. =cxx . . $ QUrlInfo#`operator=`(7113a6b264a23c52). info; |
| 61 | if(info.isDircxx . . $ QUrlInfo#isDir(50ce9a9e25b4a850).()) |
| 62 | dcxx . . $ RsyncEntry#d.->childrenFetchedcxx . . $ RsyncEntryData#childrenFetched. = false; |
| 63 | else |
| 64 | dcxx . . $ RsyncEntry#d.->childrenFetchedcxx . . $ RsyncEntryData#childrenFetched. = true; |
| 65 | |
| 66 | if(info.isValidcxx . . $ QUrlInfo#isValid(50ce9a9e25b4a850).()) |
| 67 | dcxx . . $ RsyncEntry#d.->iconcxx . . $ RsyncEntryData#icon. =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). FileIconCachecxx . . $ FileIconCache#::instancecxx . . $ FileIconCache#instance(914ec6a0d8b70d33).().iconcxx . . $ FileIconCache#icon(31e76d3f7a936a88).(info); |
| 68 | } |
| 69 | |
| 70 | RsyncEntrycxx . . $ RsyncEntry#::~cxx . . $ RsyncEntry#`~RsyncEntry`(ced63f7c635d850d).RsyncEntrycxx . . $ RsyncEntry#() |
| 71 | { |
| 72 | qDeleteAllcxx . . $ qDeleteAll(77d9f17553126ecb).(dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children.); |
| 73 | delete dcxx . . $ RsyncEntry#d.; |
| 74 | } |
| 75 | |
| 76 | RsyncEntrycxx . . $ RsyncEntry#* RsyncEntrycxx . . $ RsyncEntry#::parentEntrycxx . . $ RsyncEntry#parentEntry(88dfca43b633da6e).() const |
| 77 | { |
| 78 | return dcxx . . $ RsyncEntry#d.->parentcxx . . $ RsyncEntryData#parent.; |
| 79 | } |
| 80 | |
| 81 | QListcxx . . $ QList#<RsyncEntrycxx . . $ RsyncEntry#*> RsyncEntrycxx . . $ RsyncEntry#::childEntriescxx . . $ RsyncEntry#childEntries(b197b3b591ec6d30).() const |
| 82 | { |
| 83 | return dcxx . . $ QList#QList(3d2301cfd89f773a).->childrencxx . . $ RsyncEntryData#children.; |
| 84 | } |
| 85 | |
| 86 | bool RsyncEntrycxx . . $ RsyncEntry#::isChildrenFetchedcxx . . $ RsyncEntry#isChildrenFetched(50ce9a9e25b4a850).() const |
| 87 | { |
| 88 | return dcxx . . $ RsyncEntry#d.->childrenFetchedcxx . . $ RsyncEntryData#childrenFetched.; |
| 89 | } |
| 90 | |
| 91 | bool RsyncEntrycxx . . $ RsyncEntry#::isFetchingcxx . . $ RsyncEntry#isFetching(50ce9a9e25b4a850).() const |
| 92 | { |
| 93 | return dcxx . . $ RsyncEntry#d.->fetchingcxx . . $ RsyncEntryData#fetching.; |
| 94 | } |
| 95 | |
| 96 | QStringcxx . . $ QString# RsyncEntrycxx . . $ RsyncEntry#::pathcxx . . $ RsyncEntry#path(6ef7b6c27b00b43d).() const |
| 97 | { |
| 98 | if(!dcxx . . $ RsyncEntry#d.->pathcxx . . $ RsyncEntryData#path..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 99 | return dcxx . . $ QString#QString(132dd6869045752b).->pathcxx . . $ RsyncEntryData#path.; |
| 100 | |
| 101 | if(dcxx . . $ RsyncEntry#d.->parentcxx . . $ RsyncEntryData#parent.) |
| 102 | dcxx . . $ RsyncEntry#d.->pathcxx . . $ RsyncEntryData#path. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). dcxx . . $ RsyncEntry#d.->parentcxx . . $ RsyncEntryData#parent.->pathcxx . . $ RsyncEntry#path(6ef7b6c27b00b43d).(); |
| 103 | else |
| 104 | dcxx . . $ RsyncEntry#d.->pathcxx . . $ RsyncEntryData#path. =cxx . . $ QString#`operator=`(d02845eef0c33901). "/"; |
| 105 | |
| 106 | if(dcxx . . $ RsyncEntry#d.->urlInfocxx . . $ RsyncEntryData#urlInfo..isDircxx . . $ QUrlInfo#isDir(50ce9a9e25b4a850).()) |
| 107 | dcxx . . $ RsyncEntry#d.->pathcxx . . $ RsyncEntryData#path. +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). dcxx . . $ RsyncEntry#d.->urlInfocxx . . $ RsyncEntryData#urlInfo..namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "/"; |
| 108 | else |
| 109 | dcxx . . $ RsyncEntry#d.->pathcxx . . $ RsyncEntryData#path. +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). dcxx . . $ RsyncEntry#d.->urlInfocxx . . $ RsyncEntryData#urlInfo..namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).(); |
| 110 | |
| 111 | return dcxx . . $ QString#QString(132dd6869045752b).->pathcxx . . $ RsyncEntryData#path.; |
| 112 | } |
| 113 | |
| 114 | QUrlInfocxx . . $ QUrlInfo# RsyncEntrycxx . . $ RsyncEntry#::urlInfocxx . . $ RsyncEntry#urlInfo(3ee9901d2636976f).() const |
| 115 | { |
| 116 | return dcxx . . $ QUrlInfo#QUrlInfo(ed216b1bc01b0eea).->urlInfocxx . . $ RsyncEntryData#urlInfo.; |
| 117 | } |
| 118 | |
| 119 | QIconcxx . . $ QIcon# RsyncEntrycxx . . $ RsyncEntry#::iconcxx . . $ RsyncEntry#icon(952ef71f8967d9eb).() const |
| 120 | { |
| 121 | return dcxx . . $ QIcon#QIcon(71dcdac178620ed6).->iconcxx . . $ RsyncEntryData#icon.; |
| 122 | } |
| 123 | |
| 124 | RsyncEntrycxx . . $ RsyncEntry#* RsyncEntrycxx . . $ RsyncEntry#::addUrlInfocxx . . $ RsyncEntry#addUrlInfo(d75920986d95510d).(const QUrlInfocxx . . $ QUrlInfo#& urlInfo) |
| 125 | { |
| 126 | if(dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..countcxx . . $ QList#count(455f465bc33b4cdf).()) |
| 127 | { |
| 128 | RsyncEntrycxx . . $ RsyncEntry#* firstEntry = dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..atcxx . . $ QList#at(e2681f9bb6b2f357).(0); |
| 129 | if(!firstEntry->urlInfocxx . . $ RsyncEntry#urlInfo(3ee9901d2636976f).().isValidcxx . . $ QUrlInfo#isValid(50ce9a9e25b4a850).()) |
| 130 | { |
| 131 | dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(0); |
| 132 | delete firstEntry; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | RsyncEntrycxx . . $ RsyncEntry#* childEntry = new RsyncEntrycxx . . $ RsyncEntry#RsyncEntry(ed216b1bc01b0eea).(urlInfo); |
| 137 | dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..appendcxx . . $ QList#append(77d9f17553126ecb).( childEntry ); |
| 138 | childEntry->dcxx . . $ RsyncEntry#d.->parentcxx . . $ RsyncEntryData#parent. = this; |
| 139 | return childEntry; |
| 140 | } |
| 141 | |
| 142 | void RsyncEntrycxx . . $ RsyncEntry#::removeUrlInfocxx . . $ RsyncEntry#removeUrlInfo(ed216b1bc01b0eea).(const QUrlInfocxx . . $ QUrlInfo#& urlInfo) |
| 143 | { |
| 144 | for(int i=0; i<dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..countcxx . . $ QList#count(455f465bc33b4cdf).(); i++) |
| 145 | { |
| 146 | RsyncEntrycxx . . $ RsyncEntry#* entry = dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..atcxx . . $ QList#at(e2681f9bb6b2f357).(i); |
| 147 | if(entry->urlInfocxx . . $ RsyncEntry#urlInfo(3ee9901d2636976f).() ==cxx . . $ QUrlInfo#`operator==`(db16b59c5a189d6d). urlInfo) |
| 148 | { |
| 149 | dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(i); |
| 150 | delete entry; |
| 151 | return; |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | void RsyncEntrycxx . . $ RsyncEntry#::setChildrenFetchedcxx . . $ RsyncEntry#setChildrenFetched(b45ddcbc8423892c).(bool val) |
| 157 | { |
| 158 | if(!val && dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..countcxx . . $ QList#count(455f465bc33b4cdf).()) |
| 159 | return; |
| 160 | |
| 161 | dcxx . . $ RsyncEntry#d.->childrenFetchedcxx . . $ RsyncEntryData#childrenFetched. = val; |
| 162 | if(val) |
| 163 | dcxx . . $ RsyncEntry#d.->fetchingcxx . . $ RsyncEntryData#fetching. = false; |
| 164 | } |
| 165 | |
| 166 | void RsyncEntrycxx . . $ RsyncEntry#::clearcxx . . $ RsyncEntry#clear(49f6e7a06ebc5aa8).() |
| 167 | { |
| 168 | dcxx . . $ RsyncEntry#d.->childrencxx . . $ RsyncEntryData#children..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 169 | } |
| 170 | |
| 171 | void RsyncEntrycxx . . $ RsyncEntry#::setFetchingcxx . . $ RsyncEntry#setFetching(b45ddcbc8423892c).(bool val) |
| 172 | { |
| 173 | dcxx . . $ RsyncEntry#d.->fetchingcxx . . $ RsyncEntryData#fetching. = val; |
| 174 | |
| 175 | // Add a dummy URL info, until |
| 176 | // children are fetched. |
| 177 | addUrlInfocxx . . $ RsyncEntry#addUrlInfo(d75920986d95510d).(QUrlInfocxx . . $ QUrlInfo#QUrlInfo(49f6e7a06ebc5aa8).()); |
| 178 | } |
| 179 | |
| 180 | /////////////////////////////////////////////////////////////////////////////// |
| 181 | // RsyncDirListerOperation |
| 182 | /////////////////////////////////////////////////////////////////////////////// |
| 183 | |
| 184 | struct RsyncDirListerOperationDatacxx . . $ RsyncDirListerOperationData# |
| 185 | { |
| 186 | RsyncDirListerOperationDatacxx . . $ RsyncDirListerOperationData#RsyncDirListerOperationData(49f6e7a06ebc5aa8).() |
| 187 | : parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.(0), |
| 188 | executingcxx . . $ RsyncDirListerOperationData#executing.(false), |
| 189 | finishedcxx . . $ RsyncDirListerOperationData#finished.(false), |
| 190 | successcxx . . $ RsyncDirListerOperationData#success.(false), |
| 191 | RsyncCmdIdcxx . . $ RsyncDirListerOperationData#RsyncCmdId.(0) { } |
| 192 | |
| 193 | QProcesscxx . . $ QProcess#* syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess.; |
| 194 | bool ProcReportedErrorcxx . . $ RsyncDirListerOperationData#ProcReportedError.; |
| 195 | bool abortcxx . . $ RsyncDirListerOperationData#abort.; |
| 196 | QStringcxx . . $ QString# errorMessagecxx . . $ RsyncDirListerOperationData#errorMessage.; |
| 197 | RsyncDirListercxx . . $ RsyncDirLister#* parentcxx . . $ RsyncDirListerOperationData#parent.; |
| 198 | RsyncEntrycxx . . $ RsyncEntry#* parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.; |
| 199 | bool executingcxx . . $ RsyncDirListerOperationData#executing.; |
| 200 | bool finishedcxx . . $ RsyncDirListerOperationData#finished.; |
| 201 | bool successcxx . . $ RsyncDirListerOperationData#success.; |
| 202 | int idcxx . . $ RsyncDirListerOperationData#id.; |
| 203 | int RsyncCmdIdcxx . . $ RsyncDirListerOperationData#RsyncCmdId.; |
| 204 | QUrlcxx . . $ QUrl# urlcxx . . $ RsyncDirListerOperationData#url.; |
| 205 | |
| 206 | QListcxx . . $ QList#<QUrlInfocxx . . $ QUrlInfo#> urlInfoListcxx . . $ RsyncDirListerOperationData#urlInfoList.; |
| 207 | }; |
| 208 | |
| 209 | static int UniqueIdcxx . . $ UniqueId(b126dc7c1de90089).() |
| 210 | { |
| 211 | static int id; |
| 212 | return ++id; |
| 213 | } |
| 214 | |
| 215 | RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#RsyncDirListerOperation(7944b65af5c6d4a9).(RsyncDirListercxx . . $ RsyncDirLister#* parent) |
| 216 | : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent) |
| 217 | { |
| 218 | dcxx . . $ RsyncDirListerOperation#d. = new RsyncDirListerOperationDatacxx . . $ RsyncDirListerOperationData#RsyncDirListerOperationData(49f6e7a06ebc5aa8).; |
| 219 | dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent. = parent; |
| 220 | dcxx . . $ RsyncDirListerOperation#d.->idcxx . . $ RsyncDirListerOperationData#id. = UniqueIdcxx . . $ UniqueId(b126dc7c1de90089).(); |
| 221 | dcxx . . $ RsyncDirListerOperation#d.->urlcxx . . $ RsyncDirListerOperationData#url. =cxx . . $ QUrl#`operator=`(590d023fc9cd4b2d). QUrlcxx . . $ QUrl#QUrl(ea1f3831e370f1cb).(dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent.->urlcxx . . $ RsyncDirLister#url(36d9834fe7321282).().pathcxx . . $ QUrl#path(9d7420bec8bfe6c9).()); |
| 222 | dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess. = new QProcesscxx . . $ QProcess#(this); |
| 223 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (finished(int, QProcess::ExitStatus)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(procFinished())); |
| 224 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (error(QProcess::ProcessError)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(procError())); |
| 225 | } |
| 226 | |
| 227 | RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#RsyncDirListerOperation(4ed026e573459eaf).(RsyncDirListercxx . . $ RsyncDirLister#* parent,RsyncEntrycxx . . $ RsyncEntry#* entry) |
| 228 | : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent) |
| 229 | { |
| 230 | dcxx . . $ RsyncDirListerOperation#d. = new RsyncDirListerOperationDatacxx . . $ RsyncDirListerOperationData#RsyncDirListerOperationData(49f6e7a06ebc5aa8).; |
| 231 | dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent. = parent; |
| 232 | dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry. = entry; |
| 233 | dcxx . . $ RsyncDirListerOperation#d.->urlcxx . . $ RsyncDirListerOperationData#url. =cxx . . $ QUrl#`operator=`(590d023fc9cd4b2d). QUrlcxx . . $ QUrl#QUrl(ea1f3831e370f1cb).(dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent.->urlcxx . . $ RsyncDirLister#url(36d9834fe7321282).().pathcxx . . $ QUrl#path(9d7420bec8bfe6c9).()+cxx . . $ operator+(fab9b4f80031f353).dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.->pathcxx . . $ RsyncEntry#path(6ef7b6c27b00b43d).()); |
| 234 | dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.->setFetchingcxx . . $ RsyncEntry#setFetching(b45ddcbc8423892c).(true); |
| 235 | dcxx . . $ RsyncDirListerOperation#d.->idcxx . . $ RsyncDirListerOperationData#id. = UniqueIdcxx . . $ UniqueId(b126dc7c1de90089).(); |
| 236 | dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess. = new QProcesscxx . . $ QProcess#(this); |
| 237 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (finished(int, QProcess::ExitStatus)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(procFinished())); |
| 238 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (error(QProcess::ProcessError)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(procError())); |
| 239 | } |
| 240 | |
| 241 | RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::~cxx . . $ RsyncDirListerOperation#`~RsyncDirListerOperation`(ced63f7c635d850d).RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#() |
| 242 | { |
| 243 | delete dcxx . . $ RsyncDirListerOperation#d.; |
| 244 | } |
| 245 | |
| 246 | void RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::setParentEntrycxx . . $ RsyncDirListerOperation#setParentEntry(e0788863548ea5ab).(RsyncEntrycxx . . $ RsyncEntry#* entry) |
| 247 | { |
| 248 | |
| 249 | dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry. = entry; |
| 250 | dcxx . . $ RsyncDirListerOperation#d.->urlcxx . . $ RsyncDirListerOperationData#url. =cxx . . $ QUrl#`operator=`(590d023fc9cd4b2d). QUrlcxx . . $ QUrl#QUrl(ea1f3831e370f1cb).(dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent.->urlcxx . . $ RsyncDirLister#url(36d9834fe7321282).().pathcxx . . $ QUrl#path(9d7420bec8bfe6c9).()+cxx . . $ operator+(fab9b4f80031f353).dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.->pathcxx . . $ RsyncEntry#path(6ef7b6c27b00b43d).()); |
| 251 | dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.->setFetchingcxx . . $ RsyncEntry#setFetching(b45ddcbc8423892c).(true); |
| 252 | } |
| 253 | |
| 254 | RsyncEntrycxx . . $ RsyncEntry#* RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::parentEntrycxx . . $ RsyncDirListerOperation#parentEntry(88dfca43b633da6e).() const |
| 255 | { |
| 256 | return dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.; |
| 257 | } |
| 258 | |
| 259 | int RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::idcxx . . $ RsyncDirListerOperation#id(455f465bc33b4cdf).() const |
| 260 | { |
| 261 | return dcxx . . $ RsyncDirListerOperation#d.->idcxx . . $ RsyncDirListerOperationData#id.; |
| 262 | } |
| 263 | |
| 264 | bool RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::isExecutingcxx . . $ RsyncDirListerOperation#isExecuting(50ce9a9e25b4a850).() const |
| 265 | { |
| 266 | return dcxx . . $ RsyncDirListerOperation#d.->executingcxx . . $ RsyncDirListerOperationData#executing.; |
| 267 | } |
| 268 | |
| 269 | bool RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::isFinishedcxx . . $ RsyncDirListerOperation#isFinished(50ce9a9e25b4a850).() const |
| 270 | { |
| 271 | return dcxx . . $ RsyncDirListerOperation#d.->finishedcxx . . $ RsyncDirListerOperationData#finished.; |
| 272 | } |
| 273 | |
| 274 | bool RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::isSuccessfullyFinishedcxx . . $ RsyncDirListerOperation#isSuccessfullyFinished(50ce9a9e25b4a850).() const |
| 275 | { |
| 276 | return dcxx . . $ RsyncDirListerOperation#d.->successcxx . . $ RsyncDirListerOperationData#success.; |
| 277 | } |
| 278 | QStringcxx . . $ QString# RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::pathcxx . . $ RsyncDirListerOperation#path(6ef7b6c27b00b43d).() const |
| 279 | { |
| 280 | return dcxx . . $ RsyncDirListerOperation#d.->urlcxx . . $ RsyncDirListerOperationData#url..pathcxx . . $ QUrl#path(9d7420bec8bfe6c9).(); |
| 281 | } |
| 282 | void RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::executecxx . . $ RsyncDirListerOperation#execute(49f6e7a06ebc5aa8).() |
| 283 | { |
| 284 | dcxx . . $ RsyncDirListerOperation#d.->executingcxx . . $ RsyncDirListerOperationData#executing. = true; |
| 285 | QStringListcxx . . $ QStringList# tempArgs=dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent.->argumentscxx . . $ RsyncDirLister#arguments(e1dbd5c4feadc8f5).(); |
| 286 | tempArgs <<cxx . . $ QStringList#`operator<<`(85116071a693d053). pathcxx . . $ RsyncDirListerOperation#path(6ef7b6c27b00b43d).(); |
| 287 | dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess. -> startcxx . . $ QProcess#start(5e315ba9c811784d). (dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent.->commandcxx . . $ RsyncDirLister#command(6ef7b6c27b00b43d).(),tempArgs); // execute rsync command with rsyncArguments |
| 288 | if (!dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess.->waitForStartedcxx . . $ QProcess#waitForStarted(83c267b20bac841a).()) |
| 289 | abortcxx . . $ RsyncDirListerOperation#abort(49f6e7a06ebc5aa8).(); |
| 290 | } |
| 291 | |
| 292 | void RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::abortcxx . . $ RsyncDirListerOperation#abort(49f6e7a06ebc5aa8).() |
| 293 | { |
| 294 | if(dcxx . . $ RsyncDirListerOperation#d.->executingcxx . . $ RsyncDirListerOperationData#executing.) |
| 295 | { |
| 296 | dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess.->killcxx . . $ QProcess#kill(49f6e7a06ebc5aa8).(); |
| 297 | dcxx . . $ RsyncDirListerOperation#d.->executingcxx . . $ RsyncDirListerOperationData#executing. = false; |
| 298 | dcxx . . $ RsyncDirListerOperation#d.->finishedcxx . . $ RsyncDirListerOperationData#finished. = true; |
| 299 | dcxx . . $ RsyncDirListerOperation#d.->successcxx . . $ RsyncDirListerOperationData#success. = false; |
| 300 | dcxx . . $ RsyncDirListerOperation#d.->urlInfoListcxx . . $ RsyncDirListerOperationData#urlInfoList..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 301 | // emit aborted(); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | |
| 306 | void RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::procFinishedcxx . . $ RsyncDirListerOperation#procFinished(49f6e7a06ebc5aa8).() |
| 307 | { |
| 308 | QTextCodeccxx . . $ QTextCodec# *codec = QTextCodeccxx . . $ QTextCodec#::codecForNamecxx . . $ QTextCodec#codecForName(914382192c9ca379).("UTF-8"); |
| 309 | QTextStreamcxx . . $ QTextStream# outputStreamcxx . . $ QTextStream#QTextStream(16e3d097052a73db). (new QStringcxx . . $ QString#(codec->toUnicodecxx . . $ QTextCodec#toUnicode(5b58488ffc88f4c0).(dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess. -> readAllStandardOutputcxx . . $ QProcess#readAllStandardOutput(b3c286cec66e09f4).()))); |
| 310 | QStringcxx . . $ QString# linecxx . . $ QString#QString(ced63f7c635d850d).; |
| 311 | QListcxx . . $ QList#<RsyncEntrycxx . . $ RsyncEntry#*> parentEntriescxx . . $ QList#QList(ced63f7c635d850d).; |
| 312 | do { |
| 313 | line =cxx . . $ QString#`operator=`(4f35bf974e7f8568).outputStream.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 314 | QStringListcxx . . $ QStringList# data= line.splitcxx . . $ QString#split(86dfba059c69ed01).(" "cxx . . $ QString#QString(85c52e162fed56f9).,QStringcxx . . $ QString#::SkipEmptyPartscxx . . $ QString#SkipEmptyParts.); |
| 315 | if (data.isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) |
| 316 | continue; |
| 317 | bool isDir=false; |
| 318 | bool isFile=false; |
| 319 | bool isLink=false; |
| 320 | bool isExec=false; |
| 321 | QStringcxx . . $ QString# d1=datacxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]; |
| 322 | //in data list 0: permisions, 1: size, 2: date, 3: hour, 4: name |
| 323 | if (d1.atcxx . . $ QString#at(13af7ae5a875439e).(0)==cxx . . $ `operator==`(a468b2f18a3afe8).'d'cxx . . $ QChar#QChar(f349c77f591a7878).){ |
| 324 | isExec=true; |
| 325 | isDir=true; |
| 326 | } |
| 327 | else if(d1.atcxx . . $ QString#at(13af7ae5a875439e).(0)==cxx . . $ `operator==`(a468b2f18a3afe8).'l'cxx . . $ QChar#QChar(f349c77f591a7878).) |
| 328 | isLink=true; |
| 329 | else if(d1.atcxx . . $ QString#at(13af7ae5a875439e).(0)==cxx . . $ `operator==`(a468b2f18a3afe8).'-'cxx . . $ QChar#QChar(f349c77f591a7878).) |
| 330 | isFile=true; |
| 331 | else |
| 332 | continue; |
| 333 | d1=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).4]; |
| 334 | for (int i=5;i<data.sizecxx . . $ QList#size(ea6fe5115c70a13f).();i++) |
| 335 | d1+=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c)." "+cxx . . $ operator+(c75c3ae4eb9af1a8).data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i]; |
| 336 | if (d1[cxx . . $ QString#`operator[]`(57436120916eb52c).0]==cxx . . $ `operator==`(a468b2f18a3afe8).'.'cxx . . $ QChar#QChar(f349c77f591a7878).) |
| 337 | continue; |
| 338 | if (dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.){ |
| 339 | dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.->addUrlInfocxx . . $ RsyncEntry#addUrlInfo(d75920986d95510d).(QUrlInfocxx . . $ QUrlInfo#QUrlInfo(61783fdb3df82e7e).(d1,777,"root"cxx . . $ QString#QString(85c52e162fed56f9).,"root"cxx . . $ QString#QString(85c52e162fed56f9).,data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).1].toLongcxx . . $ QString#toLong(9627c40b2a14c302).(), QDateTimecxx . . $ QDateTime#::fromStringcxx . . $ QDateTime#fromString(231687af0a676ea1).(data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).2]+cxx . . $ operator+(3d22f08efddf8107)." "+cxx . . $ operator+(fab9b4f80031f353).data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).3],"yyyy/MM/dd HH:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).), |
| 340 | QDateTimecxx . . $ QDateTime#::fromStringcxx . . $ QDateTime#fromString(231687af0a676ea1).(data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).2]+cxx . . $ operator+(3d22f08efddf8107)." "+cxx . . $ operator+(fab9b4f80031f353).data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).3],"yyyy/MM/dd HH:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).), |
| 341 | isDir,isFile,isLink,false,true,isExec)); |
| 342 | }else{ |
| 343 | parentEntries.appendcxx . . $ QList#append(77d9f17553126ecb).(new RsyncEntrycxx . . $ RsyncEntry#RsyncEntry(ed216b1bc01b0eea).(QUrlInfocxx . . $ QUrlInfo#QUrlInfo(61783fdb3df82e7e).(d1,777,"root"cxx . . $ QString#QString(85c52e162fed56f9).,"root"cxx . . $ QString#QString(85c52e162fed56f9).,data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).1].toLongcxx . . $ QString#toLong(9627c40b2a14c302).(), QDateTimecxx . . $ QDateTime#::fromStringcxx . . $ QDateTime#fromString(231687af0a676ea1).(data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).2]+cxx . . $ operator+(3d22f08efddf8107)." "+cxx . . $ operator+(fab9b4f80031f353).data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).3],"yyyy/MM/dd HH:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).), |
| 344 | QDateTimecxx . . $ QDateTime#::fromStringcxx . . $ QDateTime#fromString(231687af0a676ea1).(data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).2]+cxx . . $ operator+(3d22f08efddf8107)." "+cxx . . $ operator+(fab9b4f80031f353).data[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).3],"yyyy/MM/dd HH:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).), |
| 345 | isDir,isFile,isLink,false,true,isExec))); |
| 346 | |
| 347 | } |
| 348 | |
| 349 | |
| 350 | }while (!line.isNullcxx . . $ QString#isNull(50ce9a9e25b4a850).()); |
| 351 | dcxx . . $ RsyncDirListerOperation#d.->executingcxx . . $ RsyncDirListerOperationData#executing. = false; |
| 352 | dcxx . . $ RsyncDirListerOperation#d.->finishedcxx . . $ RsyncDirListerOperationData#finished. = true; |
| 353 | dcxx . . $ RsyncDirListerOperation#d.->successcxx . . $ RsyncDirListerOperationData#success. = true; |
| 354 | if (dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.) |
| 355 | dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent.->setChildrenFetchedcxx . . $ RsyncDirLister#setChildrenFetched(e0788863548ea5ab).(dcxx . . $ RsyncDirListerOperation#d.->parentEntrycxx . . $ RsyncDirListerOperationData#parentEntry.); |
| 356 | else |
| 357 | dcxx . . $ RsyncDirListerOperation#d.->parentcxx . . $ RsyncDirListerOperationData#parent.->setTopLevelEntriescxx . . $ RsyncDirLister#setTopLevelEntries(5b617d7947364111).(parentEntries); |
| 358 | } |
| 359 | |
| 360 | void RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#::procErrorcxx . . $ RsyncDirListerOperation#procError(49f6e7a06ebc5aa8).() |
| 361 | { |
| 362 | QTextCodeccxx . . $ QTextCodec# *codec = QTextCodeccxx . . $ QTextCodec#::codecForNamecxx . . $ QTextCodec#codecForName(914382192c9ca379).("UTF-8"); |
| 363 | dcxx . . $ RsyncDirListerOperation#d.->errorMessagecxx . . $ RsyncDirListerOperationData#errorMessage. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). codec->toUnicodecxx . . $ QTextCodec#toUnicode(5b58488ffc88f4c0).(dcxx . . $ RsyncDirListerOperation#d.->syncProcesscxx . . $ RsyncDirListerOperationData#syncProcess. -> readAllStandardErrorcxx . . $ QProcess#readAllStandardError(b3c286cec66e09f4).()); |
| 364 | dcxx . . $ RsyncDirListerOperation#d.->executingcxx . . $ RsyncDirListerOperationData#executing. = false; |
| 365 | dcxx . . $ RsyncDirListerOperation#d.->finishedcxx . . $ RsyncDirListerOperationData#finished. = true; |
| 366 | dcxx . . $ RsyncDirListerOperation#d.->successcxx . . $ RsyncDirListerOperationData#success. = false; |
| 367 | } |
| 368 | |
| 369 | /////////////////////////////////////////////////////////////////////////////// |
| 370 | // RsyncDirLister |
| 371 | /////////////////////////////////////////////////////////////////////////////// |
| 372 | |
| 373 | struct RsyncDirListerDatacxx . . $ RsyncDirListerData# |
| 374 | { |
| 375 | RsyncDirListerDatacxx . . $ RsyncDirListerData#RsyncDirListerData(49f6e7a06ebc5aa8).() : |
| 376 | topLevelEntriesFetchedcxx . . $ RsyncDirListerData#topLevelEntriesFetched.(false), |
| 377 | currentParentcxx . . $ RsyncDirListerData#currentParent.(0) { } |
| 378 | |
| 379 | // QProcess *syncProcess; |
| 380 | // bool ProcReportedError; |
| 381 | // bool abort; |
| 382 | QStringcxx . . $ QString# errorMessagecxx . . $ RsyncDirListerData#errorMessage.; |
| 383 | QListcxx . . $ QList#<RsyncEntrycxx . . $ RsyncEntry#*> topLevelEntriescxx . . $ RsyncDirListerData#topLevelEntries.; |
| 384 | bool topLevelEntriesFetchedcxx . . $ RsyncDirListerData#topLevelEntriesFetched.; |
| 385 | QUrlcxx . . $ QUrl# urlcxx . . $ RsyncDirListerData#url.; |
| 386 | |
| 387 | RsyncEntrycxx . . $ RsyncEntry#* currentParentcxx . . $ RsyncDirListerData#currentParent.; |
| 388 | QStringcxx . . $ QString# commandcxx . . $ RsyncDirListerData#command.; //command to be executed. Normally this is "rsync" |
| 389 | QStringListcxx . . $ QStringList# rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments.; // This stringList holds all arguments for the rsync command |
| 390 | QListcxx . . $ QList#<RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#*> operationQueuecxx . . $ RsyncDirListerData#operationQueue.; |
| 391 | |
| 392 | }; |
| 393 | |
| 394 | RsyncDirListercxx . . $ RsyncDirLister#::RsyncDirListercxx . . $ RsyncDirLister#RsyncDirLister(749de1b6ae65bddd).(QObjectcxx . . $ QObject#* parent) |
| 395 | :QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent) |
| 396 | { |
| 397 | dcxx . . $ RsyncDirLister#d. = new RsyncDirListerDatacxx . . $ RsyncDirListerData#RsyncDirListerData(49f6e7a06ebc5aa8).; |
| 398 | dcxx . . $ RsyncDirLister#d.->commandcxx . . $ RsyncDirListerData#command.=cxx . . $ QString#`operator=`(d02845eef0c33901)."rsync"; |
| 399 | dcxx . . $ RsyncDirLister#d.->rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--list-only"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 400 | |
| 401 | } |
| 402 | |
| 403 | RsyncDirListercxx . . $ RsyncDirLister#::~cxx . . $ RsyncDirLister#`~RsyncDirLister`(ced63f7c635d850d).RsyncDirListercxx . . $ RsyncDirLister#() |
| 404 | { |
| 405 | delete dcxx . . $ RsyncDirLister#d.; |
| 406 | } |
| 407 | |
| 408 | void RsyncDirListercxx . . $ RsyncDirLister#::setUrlcxx . . $ RsyncDirLister#setUrl(37355d2f77053a23).(const QUrlcxx . . $ QUrl#& url) |
| 409 | { |
| 410 | dcxx . . $ RsyncDirLister#d.->urlcxx . . $ RsyncDirListerData#url. =cxx . . $ QUrl#`operator=`(ba0721afb6bdccd9). url; |
| 411 | } |
| 412 | void RsyncDirListercxx . . $ RsyncDirLister#::setUrlcxx . . $ RsyncDirLister#setUrl(5c08d79d5867d094).(const QUrlcxx . . $ QUrl#& url,const QStringcxx . . $ QString#& cpath) |
| 413 | { |
| 414 | dcxx . . $ RsyncDirLister#d.->rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 415 | dcxx . . $ RsyncDirLister#d.->urlcxx . . $ RsyncDirListerData#url.=cxx . . $ QUrl#`operator=`(ba0721afb6bdccd9).url; |
| 416 | dcxx . . $ RsyncDirLister#d.->commandcxx . . $ RsyncDirListerData#command.=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).cpath; |
| 417 | |
| 418 | dcxx . . $ RsyncDirLister#d.->rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--list-only"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 419 | } |
| 420 | void RsyncDirListercxx . . $ RsyncDirLister#::setUrlcxx . . $ RsyncDirLister#setUrl(81e429cd986f7dfb).(const QUrlcxx . . $ QUrl#& url,const QStringcxx . . $ QString#& cpath, const QStringListcxx . . $ QStringList#& cargs) |
| 421 | { |
| 422 | dcxx . . $ RsyncDirLister#d.->rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 423 | dcxx . . $ RsyncDirLister#d.->urlcxx . . $ RsyncDirListerData#url.=cxx . . $ QUrl#`operator=`(ba0721afb6bdccd9).url; |
| 424 | dcxx . . $ RsyncDirLister#d.->commandcxx . . $ RsyncDirListerData#command.=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).cpath; |
| 425 | |
| 426 | if (!cargs.isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) |
| 427 | dcxx . . $ RsyncDirLister#d.->rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments.=cxx . . $ QStringList#`operator=`(cb3c3d1614140851).cargs; |
| 428 | dcxx . . $ RsyncDirLister#d.->rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "--list-only"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 429 | |
| 430 | } |
| 431 | |
| 432 | QUrlcxx . . $ QUrl# RsyncDirListercxx . . $ RsyncDirLister#::urlcxx . . $ RsyncDirLister#url(36d9834fe7321282).() const |
| 433 | { |
| 434 | return dcxx . . $ QUrl#QUrl(37355d2f77053a23).->urlcxx . . $ RsyncDirListerData#url.; |
| 435 | } |
| 436 | |
| 437 | QStringcxx . . $ QString# RsyncDirListercxx . . $ RsyncDirLister#::commandcxx . . $ RsyncDirLister#command(6ef7b6c27b00b43d).() const |
| 438 | { |
| 439 | return dcxx . . $ QString#QString(132dd6869045752b).->commandcxx . . $ RsyncDirListerData#command.; |
| 440 | } |
| 441 | |
| 442 | QStringListcxx . . $ QStringList# RsyncDirListercxx . . $ RsyncDirLister#::argumentscxx . . $ RsyncDirLister#arguments(e1dbd5c4feadc8f5).() const |
| 443 | { |
| 444 | return dcxx . . $ RsyncDirLister#d.->rsyncArgumentscxx . . $ RsyncDirListerData#rsyncArguments.; |
| 445 | } |
| 446 | |
| 447 | QListcxx . . $ QList#<RsyncEntrycxx . . $ RsyncEntry#*> RsyncDirListercxx . . $ RsyncDirLister#::topLevelEntriescxx . . $ RsyncDirLister#topLevelEntries(b197b3b591ec6d30).() const |
| 448 | { |
| 449 | return dcxx . . $ QList#QList(3d2301cfd89f773a).->topLevelEntriescxx . . $ RsyncDirListerData#topLevelEntries.; |
| 450 | } |
| 451 | |
| 452 | bool RsyncDirListercxx . . $ RsyncDirLister#::topLevelEntriesFetchedcxx . . $ RsyncDirLister#topLevelEntriesFetched(50ce9a9e25b4a850).() const |
| 453 | { |
| 454 | return dcxx . . $ RsyncDirLister#d.->topLevelEntriesFetchedcxx . . $ RsyncDirListerData#topLevelEntriesFetched.; |
| 455 | } |
| 456 | |
| 457 | QStringcxx . . $ QString# RsyncDirListercxx . . $ RsyncDirLister#::lastErrorcxx . . $ RsyncDirLister#lastError(6ef7b6c27b00b43d).() const |
| 458 | { |
| 459 | return dcxx . . $ QString#QString(132dd6869045752b).->errorMessagecxx . . $ RsyncDirListerData#errorMessage.; |
| 460 | } |
| 461 | |
| 462 | void RsyncDirListercxx . . $ RsyncDirLister#::listcxx . . $ RsyncDirLister#list(49f6e7a06ebc5aa8).() |
| 463 | { |
| 464 | cleanOperationscxx . . $ RsyncDirLister#cleanOperations(49f6e7a06ebc5aa8).(); |
| 465 | // Create a list operation and queue it. |
| 466 | RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#* listOper |
| 467 | = new RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#RsyncDirListerOperation(7944b65af5c6d4a9).(this); |
| 468 | dcxx . . $ RsyncDirLister#d.->operationQueuecxx . . $ RsyncDirListerData#operationQueue..appendcxx . . $ QList#append(77d9f17553126ecb).(listOper); |
| 469 | dcxx . . $ RsyncDirLister#d.->topLevelEntriesFetchedcxx . . $ RsyncDirListerData#topLevelEntriesFetched. = false; |
| 470 | listOper->executecxx . . $ RsyncDirListerOperation#execute(49f6e7a06ebc5aa8).(); |
| 471 | |
| 472 | } |
| 473 | |
| 474 | void RsyncDirListercxx . . $ RsyncDirLister#::listcxx . . $ RsyncDirLister#list(e0788863548ea5ab).(RsyncEntrycxx . . $ RsyncEntry#* entry) |
| 475 | { |
| 476 | // If the entry is already being fetched, |
| 477 | // dont sweat |
| 478 | cleanOperationscxx . . $ RsyncDirLister#cleanOperations(49f6e7a06ebc5aa8).(); |
| 479 | if(entry->isChildrenFetchedcxx . . $ RsyncEntry#isChildrenFetched(50ce9a9e25b4a850).() || entry->isFetchingcxx . . $ RsyncEntry#isFetching(50ce9a9e25b4a850).()) |
| 480 | return; |
| 481 | |
| 482 | // Verify whether entry belongs to us |
| 483 | RsyncEntrycxx . . $ RsyncEntry#* e2 = entry; |
| 484 | while(e2->parentEntrycxx . . $ RsyncEntry#parentEntry(88dfca43b633da6e).()) |
| 485 | e2 = e2->parentEntrycxx . . $ RsyncEntry#parentEntry(88dfca43b633da6e).(); |
| 486 | if(!dcxx . . $ RsyncDirLister#d.->topLevelEntriescxx . . $ RsyncDirListerData#topLevelEntries..containscxx . . $ QList#contains(8877ebe272b9620d).(e2)) |
| 487 | return; |
| 488 | |
| 489 | // Create a list operation and queue it. |
| 490 | RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#* listOper |
| 491 | = new RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#RsyncDirListerOperation(4ed026e573459eaf).(this,entry); |
| 492 | // listOper->setParentEntry(entry); |
| 493 | dcxx . . $ RsyncDirLister#d.->operationQueuecxx . . $ RsyncDirListerData#operationQueue..appendcxx . . $ QList#append(77d9f17553126ecb).(listOper); |
| 494 | listOper->executecxx . . $ RsyncDirListerOperation#execute(49f6e7a06ebc5aa8).(); |
| 495 | } |
| 496 | |
| 497 | void RsyncDirListercxx . . $ RsyncDirLister#::refreshcxx . . $ RsyncDirLister#refresh(49f6e7a06ebc5aa8).() |
| 498 | { |
| 499 | abortcxx . . $ RsyncDirLister#abort(49f6e7a06ebc5aa8).(); |
| 500 | qDeleteAllcxx . . $ qDeleteAll(77d9f17553126ecb).(dcxx . . $ RsyncDirLister#d.->topLevelEntriescxx . . $ RsyncDirListerData#topLevelEntries.); |
| 501 | dcxx . . $ RsyncDirLister#d.->topLevelEntriescxx . . $ RsyncDirListerData#topLevelEntries..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 502 | listcxx . . $ RsyncDirLister#list(49f6e7a06ebc5aa8).(); |
| 503 | } |
| 504 | |
| 505 | void RsyncDirListercxx . . $ RsyncDirLister#::refreshcxx . . $ RsyncDirLister#refresh(e0788863548ea5ab).(RsyncEntrycxx . . $ RsyncEntry#* entry) |
| 506 | { |
| 507 | if(entry->isFetchingcxx . . $ RsyncEntry#isFetching(50ce9a9e25b4a850).()) |
| 508 | return; |
| 509 | |
| 510 | entry->setChildrenFetchedcxx . . $ RsyncEntry#setChildrenFetched(b45ddcbc8423892c).(false); |
| 511 | listcxx . . $ RsyncDirLister#list(e0788863548ea5ab).(entry); |
| 512 | } |
| 513 | |
| 514 | void RsyncDirListercxx . . $ RsyncDirLister#::cleanOperationscxx . . $ RsyncDirLister#cleanOperations(49f6e7a06ebc5aa8).() |
| 515 | { |
| 516 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(RsyncDirListerOperation* oper, d->operationQueue) |
| 517 | { |
| 518 | if(oper->isFinishedcxx . . $ RsyncDirListerOperation#isFinished(50ce9a9e25b4a850).()) |
| 519 | dcxx . . $ RsyncDirLister#d.->operationQueuecxx . . $ RsyncDirListerData#operationQueue..removeOnecxx . . $ QList#removeOne(fe1ba53999e710f3).(oper); |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | void RsyncDirListercxx . . $ RsyncDirLister#::abortcxx . . $ RsyncDirLister#abort(49f6e7a06ebc5aa8).() |
| 524 | { |
| 525 | QListcxx . . $ QList#<RsyncDirListerOperationcxx . . $ RsyncDirListerOperation#*> queue = dcxx . . $ QList#QList(3d2301cfd89f773a).->operationQueuecxx . . $ RsyncDirListerData#operationQueue.; |
| 526 | dcxx . . $ RsyncDirLister#d.->operationQueuecxx . . $ RsyncDirListerData#operationQueue..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 527 | |
| 528 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(RsyncDirListerOperation* oper, queue) |
| 529 | { |
| 530 | if(oper->isExecutingcxx . . $ RsyncDirListerOperation#isExecuting(50ce9a9e25b4a850).()) |
| 531 | oper->abortcxx . . $ RsyncDirListerOperation#abort(49f6e7a06ebc5aa8).(); |
| 532 | } |
| 533 | |
| 534 | qDeleteAllcxx . . $ qDeleteAll(77d9f17553126ecb).(queue); |
| 535 | } |
| 536 | |
| 537 | void RsyncDirListercxx . . $ RsyncDirLister#::setTopLevelEntriescxx . . $ RsyncDirLister#setTopLevelEntries(5b617d7947364111).(const QListcxx . . $ QList#<RsyncEntrycxx . . $ RsyncEntry#*>& entries) |
| 538 | { |
| 539 | dcxx . . $ RsyncDirLister#d.->topLevelEntriescxx . . $ RsyncDirListerData#topLevelEntries. =cxx . . $ QList#`operator=`(296c5e09a09ca26f). entries; |
| 540 | dcxx . . $ RsyncDirLister#d.->topLevelEntriesFetchedcxx . . $ RsyncDirListerData#topLevelEntriesFetched. = true; |
| 541 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! listingDonecxx . . $ RsyncDirLister#listingDone(e0788863548ea5ab).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 542 | } |
| 543 | |
| 544 | void RsyncDirListercxx . . $ RsyncDirLister#::setChildrenFetchedcxx . . $ RsyncDirLister#setChildrenFetched(e0788863548ea5ab).(RsyncEntrycxx . . $ RsyncEntry#* entry) |
| 545 | { |
| 546 | entry->setChildrenFetchedcxx . . $ RsyncEntry#setChildrenFetched(b45ddcbc8423892c).(true); |
| 547 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! listingDonecxx . . $ RsyncDirLister#listingDone(e0788863548ea5ab).(entry); |
| 548 | } |
| 549 | |
| 550 | |
| 551 | /////////////////////////////////////////////////////////////////////////////// |
| 552 | // RsyncDirLister |
| 553 | /////////////////////////////////////////////////////////////////////////////// |
| 554 | |
| 555 | |
| 556 | |
| 557 | struct FileIconCacheDatacxx . . $ FileIconCacheData# |
| 558 | { |
| 559 | QFileIconProvidercxx . . $ QFileIconProvider# iconProvidercxx . . $ FileIconCacheData#iconProvider.; |
| 560 | QStringcxx . . $ QString# tempDircxx . . $ FileIconCacheData#tempDir.; |
| 561 | |
| 562 | QStringcxx . . $ QString# suffixcxx . . $ FileIconCacheData#suffix(fd988a2ab94d906b).(const QStringcxx . . $ QString#& fileName); |
| 563 | QStringcxx . . $ QString# createTempFilecxx . . $ FileIconCacheData#createTempFile(fd988a2ab94d906b).(const QStringcxx . . $ QString#& name); |
| 564 | }; |
| 565 | |
| 566 | FileIconCachecxx . . $ FileIconCache#& FileIconCachecxx . . $ FileIconCache#::instancecxx . . $ FileIconCache#instance(914ec6a0d8b70d33).() |
| 567 | { |
| 568 | static FileIconCachecxx . . $ FileIconCache# theInstancecxx . . $ FileIconCache#FileIconCache(49f6e7a06ebc5aa8).; |
| 569 | return theInstance; |
| 570 | } |
| 571 | |
| 572 | FileIconCachecxx . . $ FileIconCache#::FileIconCachecxx . . $ FileIconCache#FileIconCache(49f6e7a06ebc5aa8).() |
| 573 | { |
| 574 | dcxx . . $ FileIconCache#d. = new FileIconCacheDatacxx . . $ FileIconCacheData#; |
| 575 | |
| 576 | QDircxx . . $ QDir# tempDir = QDircxx . . $ QDir#QDir(3520e46b33348bf6).::tempPathcxx . . $ QDir#tempPath(4365c3963150523e).(); |
| 577 | tempDir.mkdircxx . . $ QDir#mkdir(f3b39adf77d9c36c).("FileIconCache"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 578 | dcxx . . $ FileIconCache#d.->tempDircxx . . $ FileIconCacheData#tempDir. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). tempDir.absoluteFilePathcxx . . $ QDir#absoluteFilePath(5555d9024dcf93fb).("FileIconCache"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 579 | } |
| 580 | |
| 581 | FileIconCachecxx . . $ FileIconCache#::~cxx . . $ FileIconCache#`~FileIconCache`(ced63f7c635d850d).FileIconCachecxx . . $ FileIconCache#() |
| 582 | { |
| 583 | delete dcxx . . $ FileIconCache#d.; |
| 584 | } |
| 585 | |
| 586 | QIconcxx . . $ QIcon# FileIconCachecxx . . $ FileIconCache#::iconcxx . . $ FileIconCache#icon(31e76d3f7a936a88).(const QUrlInfocxx . . $ QUrlInfo#& info) const |
| 587 | { |
| 588 | QIconcxx . . $ QIcon# iconcxx . . $ QIcon#QIcon(ced63f7c635d850d).; |
| 589 | |
| 590 | if(info.isDircxx . . $ QUrlInfo#isDir(50ce9a9e25b4a850).()) |
| 591 | icon =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). dcxx . . $ FileIconCache#d.->iconProvidercxx . . $ FileIconCacheData#iconProvider..iconcxx . . $ QFileIconProvider#icon(fd6485570bad31e7).(QFileIconProvidercxx . . $ QFileIconProvider#::Foldercxx . . $ QFileIconProvider#Folder.); |
| 592 | else |
| 593 | { |
| 594 | QStringcxx . . $ QString# suffix = dcxx . . $ FileIconCache#d.->suffixcxx . . $ FileIconCacheData#suffix(fd988a2ab94d906b).(info.namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).()); |
| 595 | QPixmapcxx . . $ QPixmap# pixmapcxx . . $ QPixmap#QPixmap(49f6e7a06ebc5aa8).; |
| 596 | if(QPixmapCachecxx . . $ QPixmapCache#::findcxx . . $ QPixmapCache#find(7ac16cc81568da16).(suffix, pixmap)) |
| 597 | return QIconcxx . . $ QIcon#QIcon(8887f7d25b86c3f4).(pixmap); |
| 598 | |
| 599 | if(suffix.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 600 | icon =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). dcxx . . $ FileIconCache#d.->iconProvidercxx . . $ FileIconCacheData#iconProvider..iconcxx . . $ QFileIconProvider#icon(fd6485570bad31e7).(QFileIconProvidercxx . . $ QFileIconProvider#::Filecxx . . $ QFileIconProvider#File.); |
| 601 | else |
| 602 | { |
| 603 | // Create an empty file with the same name as info.name() |
| 604 | // in the temporary folder |
| 605 | QStringcxx . . $ QString# file = dcxx . . $ FileIconCache#d.->createTempFilecxx . . $ FileIconCacheData#createTempFile(fd988a2ab94d906b).(info.namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).()); |
| 606 | if(file.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 607 | icon =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). dcxx . . $ FileIconCache#d.->iconProvidercxx . . $ FileIconCacheData#iconProvider..iconcxx . . $ QFileIconProvider#icon(fd6485570bad31e7).(QFileIconProvidercxx . . $ QFileIconProvider#::Filecxx . . $ QFileIconProvider#File.); |
| 608 | else |
| 609 | icon =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). dcxx . . $ FileIconCache#d.->iconProvidercxx . . $ FileIconCacheData#iconProvider..iconcxx . . $ QFileIconProvider#icon(7d10cf7837546d47).(QFileInfocxx . . $ QFileInfo#(file)); |
| 610 | QFilecxx . . $ QFile#::removecxx . . $ QFile#remove(e1defb592416720d).(file); |
| 611 | } |
| 612 | |
| 613 | if(icon.isNullcxx . . $ QIcon#isNull(50ce9a9e25b4a850).()) |
| 614 | icon =cxx . . $ QIcon#`operator=`(bc9f66e25baced4b). dcxx . . $ FileIconCache#d.->iconProvidercxx . . $ FileIconCacheData#iconProvider..iconcxx . . $ QFileIconProvider#icon(fd6485570bad31e7).(QFileIconProvidercxx . . $ QFileIconProvider#::Filecxx . . $ QFileIconProvider#File.); |
| 615 | |
| 616 | QPixmapCachecxx . . $ QPixmapCache#::insertcxx . . $ QPixmapCache#insert(ea4708518c20dff9).(suffix, icon.pixmapcxx . . $ QIcon#pixmap(6ca65e964a77a341).(32,32)); |
| 617 | } |
| 618 | |
| 619 | return iconcxx . . $ QIcon#QIcon(44c9bbc25a297bfe).; |
| 620 | } |
| 621 | |
| 622 | QStringcxx . . $ QString# FileIconCacheDatacxx . . $ FileIconCacheData#::suffixcxx . . $ FileIconCacheData#suffix(fd988a2ab94d906b).(const QStringcxx . . $ QString#& fileName) |
| 623 | { |
| 624 | QStringListcxx . . $ QStringList# comps = fileName.splitcxx . . $ QString#split(c8b44a97dcb6200d).("."cxx . . $ QString#QString(85c52e162fed56f9).); |
| 625 | comps.removeFirstcxx . . $ QList#removeFirst(49f6e7a06ebc5aa8).(); |
| 626 | |
| 627 | QStringcxx . . $ QString# suffix = comps.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).("."cxx . . $ QString#QString(85c52e162fed56f9).); |
| 628 | return suffixcxx . . $ QString#QString(28715ad661ad3cec).; |
| 629 | } |
| 630 | |
| 631 | QStringcxx . . $ QString# FileIconCacheDatacxx . . $ FileIconCacheData#::createTempFilecxx . . $ FileIconCacheData#createTempFile(fd988a2ab94d906b).(const QStringcxx . . $ QString#& name) |
| 632 | { |
| 633 | QStringcxx . . $ QString# completeName = QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1/%2").argcxx . . $ QString#arg(bc823072288cbbb5).(tempDircxx . . $ FileIconCacheData#tempDir.).argcxx . . $ QString#arg(bc823072288cbbb5).(name); |
| 634 | |
| 635 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(completeName); |
| 636 | if(!file.opencxx . . $ QFile#open(dca164408be960c8).(QFilecxx . . $ QFlags#QFlags(93d577a3e9528307).::WriteOnlycxx . . $ QIODevice#WriteOnly.)) |
| 637 | return QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 638 | |
| 639 | file.writecxx . . $ QIODevice#write(4ee2750a0be83987).(completeName.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).()); |
| 640 | file.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); |
| 641 | |
| 642 | return completeNamecxx . . $ QString#QString(28715ad661ad3cec).; |
| 643 | } |
| 644 |