#include <QtConcurrent>
#include "editlocallymanager.h"
-#include "editlocallyverificationjob.h"
#include "folder.h"
#include "folderman.h"
#include "syncengine.h"
return;
}
- Systray::instance()->createEditFileLocallyLoadingDialog({});
+ const auto relPathSplit = _relPath.split(QLatin1Char('/'));
+ if (relPathSplit.isEmpty()) {
+ showError(tr("Could not find a file for local editing."
+ "Make sure its path is valid and it is synced locally."), _relPath);
+ return;
+ }
+
+ _fileName = relPathSplit.last();
+ Systray::instance()->createEditFileLocallyLoadingDialog(_fileName);
findAfolderAndConstructPaths();
}
void EditLocallyJob::proceedWithSetup()
{
- const auto relPathSplit = _relPath.split(QLatin1Char('/'));
- if (relPathSplit.isEmpty()) {
- showError(tr("Could not find a file for local editing. Make sure its path is valid and it is synced locally."), _relPath);
- return;
- }
-
- _fileName = relPathSplit.last();
_folderForFile = findFolderForFile(_relPath, _accountState->account()->userIdAtHostWithPort());
-
+
if (!_folderForFile) {
showError(tr("Could not find a file for local editing. Make sure it is not excluded via selective sync."), _relPath);
return;
_localFilePath = _folderForFile->path() + _relativePathToRemoteRoot;
- Systray::instance()->destroyEditFileLocallyLoadingDialog();
startEditLocally();
}
return;
}
- Systray::instance()->createEditFileLocallyLoadingDialog(_fileName);
-
if (_folderForFile->isSyncRunning()) {
// in case sync is already running - terminate it and start a new one
_syncTerminatedConnection = connect(_folderForFile, &Folder::syncFinished, this, [this]() {