MCPcopy Create free account
hub / github.com/KDE/kdiff3 / get

Method get

src/DefaultFileAccessJobHandler.cpp:92–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90#endif
91
92bool DefaultFileAccessJobHandler::get(void* pDestBuffer, long maxLength)
93{
94 ProgressProxyExtender pp; // Implicitly used in slotPercent()
95
96 if(maxLength > 0 && !ProgressProxy::wasCancelled())
97 {
98 m_bSuccess = false;
99#if HAS_KFKIO
100 KIO::TransferJob* pJob = KIO::get(mFileAccess->url(), KIO::NoReload);
101 m_transferredBytes = 0;
102 m_pTransferBuffer = (char*)pDestBuffer;
103 m_maxLength = maxLength;
104 mFileAccess->setStatusText(QString());
105
106 chk_connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
107 chk_connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
108 chk_connect(pJob, &KIO::TransferJob::data, this, &DefaultFileAccessJobHandler::slotGetData);
109 chk_connect(pJob, &KIO::TransferJob::percentChanged, &pp, &ProgressProxyExtender::slotPercent);
110
111 ProgressProxy::enterEventLoop(pJob, i18nc("Message for progress dialog %1 = path to file", "Reading file: %1", mFileAccess->prettyAbsPath()));
112#endif
113 return m_bSuccess;
114 }
115 else
116 return true;
117}
118
119#if HAS_KFKIO
120void DefaultFileAccessJobHandler::slotGetData(KJob* pJob, const QByteArray& newData)

Callers 10

loadDataMethod · 0.45
readFileMethod · 0.45
getBufMethod · 0.45
readFileMethod · 0.45
writeFileMethod · 0.45
copyBufFromMethod · 0.45
preprocessMethod · 0.45
DirectoryMergeWindowMethod · 0.45
mainFunction · 0.45
KDiff3PluginHistoryMethod · 0.45

Calls 2

setStatusTextMethod · 0.80
prettyAbsPathMethod · 0.45

Tested by

no test coverage detected