- indicate whether the server provides an updated version of a file

- QProcess::waitForReadyRead() must be invoked until it returns false. BTW: this method is invoked inside a non-GUI-thread and hence does not block Dolphin

svn path=/trunk/KDE/kdebase/apps/; revision=1004044
This commit is contained in:
Peter Penz 2009-07-29 07:38:57 +00:00
parent d4ba16b900
commit 11b2a3f61c

View file

@ -102,35 +102,38 @@ bool SubversionPlugin::beginRetrieval(const QString& directory)
Q_ASSERT(directory.endsWith('/'));
QStringList arguments;
arguments << "status" << directory;
arguments << "status" << "--show-updates" << directory;
QProcess process;
process.start("svn", arguments);
if (!process.waitForReadyRead()) {
return false;
}
while (process.waitForReadyRead()) {
char buffer[1024];
while (process.readLine(buffer, sizeof(buffer)) > 0) {
RevisionState state = NormalRevision;
QString filePath(buffer);
char buffer[1024];
while (process.readLine(buffer, sizeof(buffer)) > 0) {
RevisionState state = NormalRevision;
switch (buffer[0]) {
case '?': state = UnversionedRevision; break;
case 'M': state = LocallyModifiedRevision; break;
case 'A': state = AddedRevision; break;
case 'D': state = RemovedRevision; break;
case 'C': state = ConflictingRevision; break;
default:
if (filePath.contains('*')) {
state = UpdateRequiredRevision;
}
break;
}
switch (buffer[0]) {
case '?': state = UnversionedRevision; break;
case 'M': state = LocallyModifiedRevision; break;
case 'A': state = AddedRevision; break;
case 'D': state = RemovedRevision; break;
case 'C': state = ConflictingRevision; break;
default: break;
}
QString filePath(buffer);
int pos = filePath.indexOf('/');
const int length = filePath.length() - pos - 1;
filePath = filePath.mid(pos, length);
if (!filePath.isEmpty()) {
m_revisionInfoHash.insert(filePath, state);
int pos = filePath.indexOf('/');
const int length = filePath.length() - pos - 1;
filePath = filePath.mid(pos, length);
if (!filePath.isEmpty()) {
m_revisionInfoHash.insert(filePath, state);
}
}
}
m_revisionInfoKeys = m_revisionInfoHash.keys();
return true;
}