mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
- 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:
parent
d4ba16b900
commit
11b2a3f61c
1 changed files with 25 additions and 22 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue