mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Mac Overlays: handle filenames with slashes properly.
There are filenames with slashes on MacOSX, they can be created in Finder. Internally they are converted to colons.
This commit is contained in:
parent
31bf844452
commit
8915f94931
@ -139,7 +139,14 @@ static RequestManager* sharedInstance = nil;
|
||||
|
||||
if( [chunks count] > 0 && tag == READ_TAG ) {
|
||||
if( [[chunks objectAtIndex:0] isEqualToString:@"STATUS"] ) {
|
||||
[contentman setResultForPath:[chunks objectAtIndex:2] result:[chunks objectAtIndex:1]];
|
||||
NSString *path = [chunks objectAtIndex:2];
|
||||
if( [chunks count] > 3 ) {
|
||||
for( int i = 2; i < [chunks count]-1; i++ ) {
|
||||
path = [NSString stringWithFormat:@"%@:%@",
|
||||
path, [chunks objectAtIndex:i+1] ];
|
||||
}
|
||||
}
|
||||
[contentman setResultForPath:path result:[chunks objectAtIndex:1]];
|
||||
} else if( [[chunks objectAtIndex:0] isEqualToString:@"UPDATE_VIEW"] ) {
|
||||
NSString *path = [chunks objectAtIndex:1];
|
||||
[contentman reFetchFileNameCacheForPath:path];
|
||||
|
||||
@ -183,6 +183,15 @@ void ProtocolWidget::slotOpenFile( QTreeWidgetItem *item, int )
|
||||
}
|
||||
}
|
||||
|
||||
QString ProtocolWidget::fixupFilename( const QString& name )
|
||||
{
|
||||
if( Utility::isMac() ) {
|
||||
QString n(name);
|
||||
return n.replace(QChar(':'), QChar('/'));
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
QTreeWidgetItem* ProtocolWidget::createCompletedTreewidgetItem(const QString& folder, const SyncFileItem& item)
|
||||
{
|
||||
QStringList columns;
|
||||
@ -193,7 +202,7 @@ QTreeWidgetItem* ProtocolWidget::createCompletedTreewidgetItem(const QString& fo
|
||||
QString message;
|
||||
|
||||
columns << timeStr;
|
||||
columns << item._file;
|
||||
columns << fixupFilename(item._file);
|
||||
columns << folder;
|
||||
if (Progress::isWarningKind(item._status)) {
|
||||
message= item._errorString;
|
||||
|
||||
@ -56,6 +56,8 @@ private:
|
||||
void setSyncResultStatus(const SyncResult& result );
|
||||
void cleanIgnoreItems( const QString& folder );
|
||||
void computeResyncButtonEnabled();
|
||||
QString fixupFilename( const QString& name );
|
||||
|
||||
|
||||
QTreeWidgetItem* createCompletedTreewidgetItem(const QString &folder, const SyncFileItem &item );
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user