From edcdcb945a68ac0434410e826b1f313221ebdef6 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 2 Sep 2013 17:25:07 +0200 Subject: [PATCH] Show the reason why a file was ignored. --- src/mirall/csyncthread.cpp | 4 +++- src/mirall/itemprogressdialog.cpp | 30 ++++++++++++++++++------------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/mirall/csyncthread.cpp b/src/mirall/csyncthread.cpp index 504ea5d8f5..68011ed5df 100644 --- a/src/mirall/csyncthread.cpp +++ b/src/mirall/csyncthread.cpp @@ -187,7 +187,9 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote ) item._file = QString::fromUtf8( file->path ); item._instruction = file->instruction; item._dir = SyncFileItem::None; - + if(file->error_string) { + item._errorString = QString::fromUtf8(file->error_string); + } SyncFileItem::Direction dir; int re = 0; diff --git a/src/mirall/itemprogressdialog.cpp b/src/mirall/itemprogressdialog.cpp index a08647ec8a..2252c7c714 100644 --- a/src/mirall/itemprogressdialog.cpp +++ b/src/mirall/itemprogressdialog.cpp @@ -116,22 +116,28 @@ void ItemProgressDialog::setSyncResult( const SyncResult& result ) columns << item._file; columns << folder; if( item._instruction == CSYNC_INSTRUCTION_IGNORE) { - if( item._type == SyncFileItem::File ) { - errMsg = tr("File ignored."); - tooltip = tr("The file was ignored because it is listed in the clients ignore list\n" - "or the filename contains characters that are not syncable\nin a cross platform " - "environment."); - } else if( item._type == SyncFileItem::Directory ){ - errMsg = tr("Directory ignored."); - tooltip = tr("The directory was ignored because it is listed in the clients\nignore list " - "or the directory name contains\ncharacters that are not syncable in a cross " - "platform environment."); - } else if( item._type == SyncFileItem::SoftLink ) { + if( item._type == SyncFileItem::SoftLink ) { errMsg = tr("Soft Link ignored."); tooltip = tr("Softlinks break the semantics of synchronization.\nPlease do not " "use them in synced directories."); } else { - errMsg = tr("Ignored."); + QString obj = tr("file"); + if( item._type == SyncFileItem::Directory ) { + obj = tr("directory"); + } + tooltip = tr("The %1 was ignored because it is listed in the clients ignore list\n" + "or the %1 name contains characters that are not syncable\nin a cross platform " + "environment.").arg(obj); + errMsg = tr("Item ignored."); + if( item._errorString == QLatin1String("File listed on ignore list.") ) { + errMsg = tr("%1 on ignore list.").arg(obj); + tooltip = tr("The %1 was skipped because it is listed on the clients list of names\n" + "to ignore.").arg(obj); + } else if( item._errorString == QLatin1String("File contains invalid characters.") ) { + errMsg = tr("Invalid characters."); + tooltip = tr("The %1 name contains one or more invalid characters which break\n" + "syncing in a cross platform environment.").arg(obj); + } } } else if( item._instruction == CSYNC_INSTRUCTION_CONFLICT ) { errMsg = tr("Conflict file.");