[Pkg-owncloud-commits] [owncloud-client] 157/219: Mac Overlays: handle filenames with slashes properly.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:21 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 8915f94931a0bcd35a395255f474dd67ed10d48e
Author: Klaas Freitag <freitag at owncloud.com>
Date: Thu Sep 25 12:23:17 2014 +0200
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.
---
shell_integration/MacOSX/OwnCloudFinder/RequestManager.m | 9 ++++++++-
src/mirall/protocolwidget.cpp | 11 ++++++++++-
src/mirall/protocolwidget.h | 2 ++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
index 0207b8c..fae7e77 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
@@ -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];
diff --git a/src/mirall/protocolwidget.cpp b/src/mirall/protocolwidget.cpp
index 00d3636..abf25f8 100644
--- a/src/mirall/protocolwidget.cpp
+++ b/src/mirall/protocolwidget.cpp
@@ -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;
diff --git a/src/mirall/protocolwidget.h b/src/mirall/protocolwidget.h
index 765c6b1..244f4e9 100644
--- a/src/mirall/protocolwidget.h
+++ b/src/mirall/protocolwidget.h
@@ -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 );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list