Changeset View
Changeset View
Standalone View
Standalone View
src/file/extractorprocess.cpp
Show All 38 Lines | 38 | { | |||
---|---|---|---|---|---|
39 | if (exitStatus == QProcess::CrashExit) { | 39 | if (exitStatus == QProcess::CrashExit) { | ||
40 | Q_EMIT failed(); | 40 | Q_EMIT failed(); | ||
41 | } | 41 | } | ||
42 | }); | 42 | }); | ||
43 | 43 | | |||
44 | m_extractorProcess.setProgram(m_extractorPath); | 44 | m_extractorProcess.setProgram(m_extractorPath); | ||
45 | m_extractorProcess.setProcessChannelMode(QProcess::ForwardedErrorChannel); | 45 | m_extractorProcess.setProcessChannelMode(QProcess::ForwardedErrorChannel); | ||
46 | m_extractorProcess.start(); | 46 | m_extractorProcess.start(); | ||
47 | } | 47 | } | ||
apol: Maybe this should be called in ::index then? This way we only block where it breaks.
| |||||
48 | 48 | | |||
49 | ExtractorProcess::~ExtractorProcess() | 49 | ExtractorProcess::~ExtractorProcess() | ||
50 | { | 50 | { | ||
51 | m_extractorProcess.close(); | 51 | m_extractorProcess.close(); | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | void ExtractorProcess::start() | 54 | void ExtractorProcess::start() | ||
55 | { | 55 | { | ||
56 | m_extractorProcess.start(QIODevice::Unbuffered | QIODevice::ReadWrite); | 56 | m_extractorProcess.start(QIODevice::Unbuffered | QIODevice::ReadWrite); | ||
57 | m_extractorProcess.waitForStarted(); | 57 | m_extractorProcess.waitForStarted(); | ||
58 | m_extractorProcess.setReadChannel(QProcess::StandardOutput); | 58 | m_extractorProcess.setReadChannel(QProcess::StandardOutput); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | void ExtractorProcess::index(const QVector<quint64>& fileIds) | 61 | void ExtractorProcess::index(const QVector<quint64>& fileIds) | ||
62 | { | 62 | { | ||
63 | Q_ASSERT(m_extractorProcess.state() == QProcess::Running); | | |||
64 | Q_ASSERT(!fileIds.isEmpty()); | 63 | Q_ASSERT(!fileIds.isEmpty()); | ||
bruns: This assert is just nonsense ... | |||||
65 | 64 | | |||
66 | QDataStream batch(&m_extractorProcess); | 65 | QDataStream batch(&m_extractorProcess); | ||
67 | batch << fileIds; | 66 | batch << fileIds; | ||
68 | } | 67 | } | ||
69 | 68 | | |||
70 | void ExtractorProcess::slotIndexingFile() | 69 | void ExtractorProcess::slotIndexingFile() | ||
71 | { | 70 | { | ||
72 | while (m_extractorProcess.canReadLine()) { | 71 | while (m_extractorProcess.canReadLine()) { | ||
Show All 26 Lines |
Maybe this should be called in ::index then? This way we only block where it breaks.